Square roots on the Curta. 12 Days of Curtsmas 9

Поділитися
Вставка
  • Опубліковано 18 гру 2023
  • 12 Days of Curtsmas Chapter 9: Roots and other diversions.
    Curta tables were downloaded here: www.curtamania.com/curta/code/...
    This is a Curta Type I, built in 1952. Stay tuned for episodes every other day, December 3 - 25. Thanks as always to the person who gave me the Curta.
    End song inspired by "Hotter than a Molotov" by The Coup. • The Coup: Hotter Than ...
    Jingle bells sound from www.freesoundslibrary.com, CC-BY-4.0

КОМЕНТАРІ • 67

  • @retrogiftsuk4812
    @retrogiftsuk4812 6 місяців тому +32

    I love the fact the Curta is half calculator, half fidget toy.

  • @biquinary
    @biquinary 6 місяців тому +4

    I love that the Hello Kitty Calculator is a recurring character on this channel

  • @evanbarnes9984
    @evanbarnes9984 6 місяців тому +19

    If you have to start your square root calculation by looking at a table, I think you can probably skip the rest of the steps and just have a direct square root lookup table. It's cool that this works though!

    • @MattMcIrvin
      @MattMcIrvin 6 місяців тому +1

      Basically they made the table smaller by having you use the Curta to do a linear interpolation. Of course you could use any calculating machine that can add and multiply to do this.

  • @MattMcIrvin
    @MattMcIrvin 6 місяців тому +14

    Doing this stuff by hand makes you appreciate how important load and store operations, which just move data between registers or in and out of main memory, are in computer CPUs. On any kind of simple calculator, you're doing those, and every time you can save yourself a manual transfer, you gain speed and avoid a potential error.
    It reminds me of a thing about slide rules: I was just watching Professor Herning's videos on slide rules and it took me a while to really get the motivation behind log-log scales, which take up a lot of space on the really fancy high-end ones. I knew they're primarily used for taking arbitrary powers. But you can actually do those on a much simpler slide rule too, by using the linear L scale in conjunction with the usual logarithmic ones-- the L scale can give you the common logarithm of whatever's on the C or D scale (your sort of default slide-rule scales), or you can go the other way, and then you can use the usual relations you learn in school to take powers.
    The trouble is, those usual relations tell you to multiply the logarithm by your power, and then take the exponential (the opposite of the logarithm). But you can't multiply right on the linear scale, you have to manually reset the slide to transfer the number to a place where you can multiply it. Then you have to transfer the result back. That slows you down and introduces error.
    What the log-log scales get you is that you can do it without transferring numbers so much, because the logarithm ends up right on the scale where you CAN do the multiplication. It seems like a lot of the scales on a fancy slide rule (apart from really specialized ones) aren't for new and different calculations, they're just for those kinds of optimizations. They save you a transfer, or they make it easier to get your result without worrying about it running off the end of the scale.

  • @UltraMaXAtAXX
    @UltraMaXAtAXX 6 місяців тому +3

    "...do I want to try another example? I do not."
    Oh boy, I wish I could end a lecture like that.

  • @derekkuhl
    @derekkuhl 6 місяців тому +3

    While the Curta is awesome, the philosophical rambling at the end is where the true joy lies. Genius as usual!

  • @LeoStaley
    @LeoStaley 6 місяців тому +9

    That's like saying, hey, this pen can do multiplication, all you need is to carry this handy multiplication table around.

    • @ChrisStaecker
      @ChrisStaecker  6 місяців тому +6

      To be fair, there are Curta square root algorithms that don't require any tables- based on other different arithmetical tricks to compute roots using only additions and multiplications. They're more complicated than using the tables.

    • @Salsmachev
      @Salsmachev 6 місяців тому +1

      @@ChrisStaecker Yeah my instinct would be to use the Babylonian method.

  • @hughobyrne2588
    @hughobyrne2588 6 місяців тому +3

    7:02 "... simply by adding and multiplying" - if you go to the fundamentals of Peano's axioms, and work up from there, it really boils down to "... simply by counting to the next number".

    • @ChrisStaecker
      @ChrisStaecker  6 місяців тому +3

      Yes- I suppose you could do it all using only the counter, keeping the input dials at 0.

    • @hughobyrne2588
      @hughobyrne2588 6 місяців тому

      @@ChrisStaecker Whoa. I hadn't even taken the thought to that degree. Here is a man, people, who takes his math... hardCORE.

  • @AlRoderick
    @AlRoderick 6 місяців тому +4

    Modern computers also can't do much beside add, but the one thing they can do besides addition is store massive lookup tables in its memory and do that looking up instantly. When you ask a modern computer to do a square root, the compiler or the assembler or some step in the software development process generates the massive list of instructions to add and multiply and store intermediate values that it can flash through in a few microseconds. Unless you're developing the quake engine and you design a function that can cheat by taking advantage of how floating point numbers are stored and forcing them into an integer to do it in like four processor instructions.

    • @jordanrodrigues1279
      @jordanrodrigues1279 6 місяців тому

      Memory access is usually slower than doing more arithmetic. The workhorse operations are addition and multiplication with occasional assists from division and choice (if then value1 else value2). There are CPU instructions for more difficult functions but they're intended for backwards compatibility and generally can't take full advantage of the arithmetic hardware.
      Graphics processors do have hardware for lookup tables. More precisely they have texture fetch and you can use that to implement lookup tables if you really want to. Even with that help, lookup tables rarely beat instructions for anything you can more or less write in closed form.
      Textures are used for functions that are captured from nature, painted by hand, or the output of a particularly expensive simulation. They're a bad fit when you need the inverse cosh of something and will compose that operation with others.

    • @AlRoderick
      @AlRoderick 6 місяців тому

      @@jordanrodrigues1279 yeah my point there wasn't that the computer is going to look up what the cosine of the input is from a table, more that it has a table that contains what multi-layer addition problem it needs to solve to calculate the cosine.

  • @dlt4videos
    @dlt4videos 6 місяців тому +5

    Dr Staecker, thanks for doing the hard work the long way... If I had curta, I certainly would have tried it, as well. But yeah it's a bit pointless if you have to look it up in the table you would just look for the square root or the cube root in the table game over ! or at the very least reach over for a slide rule. Again thank you for doing it this way as I surely would have tried it just for the heck of it now I can almost say that I did by virtually watching you do it.

    • @Salsmachev
      @Salsmachev 6 місяців тому

      Yeah, I've been trying to design my own (very silly) math tool and the thing I keep coming back to is "If I need a lookup table to do this, then I might as well just look up the answer".

    • @MattMcIrvin
      @MattMcIrvin 6 місяців тому

      There was a Friden motorized mechanical calculator that could actually do automatic square roots. But it used a completely different algorithm from this one that was more like long division in character. I suppose you could do that manually on a Curta but it would be slower than this way. The advantage for a machine is that it involves no estimation or table lookup.

    • @MattMcIrvin
      @MattMcIrvin 6 місяців тому

      (Apparently there was a time when that "long division" method of extracting square roots, which seems to work by the binomial theorem and is pretty unintuitive, was routinely taught in schools as a pencil-and-paper arithmetic method. But I never learned it.)

  • @friiq0
    @friiq0 6 місяців тому +2

    You could also use the Babylonian Method to take the square root without a lookup table. Suppose you want to take the square root of x. Make a guess of what the square root might be. Divide x by the guess, then add the guess, and then divide by 2. What you’ll get is your new guess! Just repeat this process and you’ll get closer and closer to the answer! If you want a certain number of digits of accuracy, just keep going until those digits stop changing. It is a bit of a pain because you do have to keep track of your new guess and manually transfer it as you go. A pen and paper is still advised. But hey, it works in a pinch if you don’t have that lookup table!

    • @MattMcIrvin
      @MattMcIrvin 6 місяців тому

      That's the only method of extracting square roots I was ever able to remember.
      There's a method similar to long division that lets you extract the digits of the result one by one. People of a certain age were apparently taught it in school but I wasn't. But that's the one that the Friden SRW mechanical calculator used for its square root mechanism.

  • @bluegrassengineer
    @bluegrassengineer 6 місяців тому +5

    Using that algorithm, 2.1147 is the value you should get, not 2.117. The Curta is right. Again!

  • @pierQRzt180
    @pierQRzt180 6 місяців тому +2

    "there are tricks but I do not want to get in to that"
    I hope there will be a future video on those!

    • @ChrisStaecker
      @ChrisStaecker  6 місяців тому +4

      Here is the basic idea: say I want to multiply the number in the answer digits by 942. Call the number in the answer digits X.
      The answer already reads X, so really I need to add X another 941 MORE times. Equivalently I need to add 941 into the answer X times. So I input 941 and now crank X times (shifting digits as usual). This is slightly tricky because as soon as I start cranking, the answer display will change and I won't be able to see X anymore. I can get around this by memorizing X, which I usually want to avoid. The tricky trick is to crank out the digits from most- to least-significant. So look at the top-most digit of X and crank that many times. This messes up that top digit of X, plus any digit to the left- but not the digits to the right. Then move right to the next digit, and crank that many times.
      If you do it all right, you should see X on the counter when you're done, and the product X*942 on the answer register.
      To me this is confusing and easy to mess up- if you don't memorize X, then it's hard to know when you get to the end whether you did it right or not.
      It's similar to the usual division procedure for the Comptometer, which has no counter at all. This also I find hard to do correctly, though people who used these machines all day could do it no problem I'm sure.

    • @pierQRzt180
      @pierQRzt180 6 місяців тому

      @@ChrisStaecker thank you for the answer! Still it could be a video idea to show those tricks (especially on multiple devices) even if they are error prone.

  • @timetraveller6643
    @timetraveller6643 6 місяців тому +1

    Bring it to the next restaurant trip with your friends. At the end of the meal, pull out tge Curta and calculate the tip.

  • @garrysekelli6776
    @garrysekelli6776 6 місяців тому +2

    6:45 the inventions of men thrust onto the machine. Lol.

    • @ChrisStaecker
      @ChrisStaecker  6 місяців тому +5

      This is my version of Kronecker's famous line: "God made the natural numbers, everything else was made by men." God created the Curta to add and multiply- whatever else you do with it is your own business.

    • @garrysekelli6776
      @garrysekelli6776 6 місяців тому +1

      @@ChrisStaecker I found the quote very poetic. Reminded me of deus ex machina or some other sort of stoic type contrivances of bygone times.

  • @KosmosHorology
    @KosmosHorology 6 місяців тому +3

    “Gotta respect the journey” 😂😂😂

  • @someonespadre
    @someonespadre 6 місяців тому +1

    I extract square roots on my Monroe by subtracting successive odd numbers, similar to division.
    I do trig using tables.

    • @charlesbenca5357
      @charlesbenca5357 6 місяців тому

      I also do that by hand sometimes to impress my friends. I think it would be amazing on the curta

  • @evergo
    @evergo 6 місяців тому +7

    Hits blunt - Ok but what if we did this, but like, with electrons?

  • @12...
    @12... 6 місяців тому

    u could save the backtransfer step by adding N^2 and R^2 manually on the input sliders, like you're using an abacus

  • @MattMcIrvin
    @MattMcIrvin 6 місяців тому +1

    ...Oh yeah yeah yeah, I get the logic now. It is a linear interpolation of a square-root table. It's obscured a bit by being expressed in terms of the square roots, but without directly giving the square roots.
    1/(2*sqrt(x)) is the derivative of sqrt(x). That's 1/(2R) in the table. R^2 is the input value to the function.
    So if you just had a table of square roots, the linear interpolation from some value R would be R + (N^2 - R^2) * 1/(2R). Which is (N^2 + R^2) * 1/(2R). So expressing the table this way actually makes it the quickest to calculate. It's pretty clever.
    ...edit: well, I guess not so much an interpolation as an extrapolation, since the R^2 values given are for the centers of the piecewise linear bits, not the endpoints. But it's a piecewise linear thing.
    I looked up Jaap's scan of that pamphlet, and it goes on to give a way to refine this to a 9-digit approximation essentially by repeating the procedure. I guess this is just going one more step in Newton's method or something like it. The pamphlet describes it as simple but it seems to actually involve doing a division on the Curta essentially to get the refined derivative.

  • @maxmn5821
    @maxmn5821 6 місяців тому

    Nice „cute trick…written other way around“

  • @johnsrabe
    @johnsrabe 6 місяців тому

    1:20 “O easy for Leonardo.” - (Dylan Thomas, “A Child’s Christmas in Wales.”)

  • @vinesthemonkey
    @vinesthemonkey 5 місяців тому

    I think there are better approximation techniques for e^x then applying the Taylor series directly

  • @getjaketospace
    @getjaketospace 6 місяців тому

    Curta

  • @tal_the_great
    @tal_the_great 6 місяців тому

    This looks like a cool thing! I think I'll buy one... oh, $1200? Maybe not that cool.

  • @vinesthemonkey
    @vinesthemonkey 5 місяців тому

    I think the square root and cube root are one step of Newton's Method (first order approximation)

  • @StephenRansom47
    @StephenRansom47 6 місяців тому

    0:59 That Gentleman … 😂
    That’s Literally Me 🤣
    we all know one.
    … or is that the square root of one 🤔
    PS - you really should take this act on the road. You could do Rally Calculations between gigs to build on your Current Jokes.

  • @ColtonRMagby
    @ColtonRMagby 6 місяців тому

    I'm surprised you didn't show how to calculate the volume of a sphere yet.

  • @ComputerRouter
    @ComputerRouter 6 місяців тому

    I might be missing something here.... For the square roots, if it requires a table for R^2 and 1/2R, why not just have a table of the actual roots...

  • @kaisalmon1646
    @kaisalmon1646 6 місяців тому +1

    If you have a table with all those R values... why not just have a list of answers?
    Or is this a method for more accurately interpolating between those recalculated answers?
    I just feel like if I'm allowed a lookup table, why not just use a lookup table?

    • @ChrisStaecker
      @ChrisStaecker  6 місяців тому +5

      This is a sensible objection. Using this table and doing the procedure I did will guarantee an answer accurate to 5 significant figures. A full lookup table of all square roots accurate to 5 figures would be much much larger than this table that I was using.

    • @MattMcIrvin
      @MattMcIrvin 6 місяців тому +1

      @@ChrisStaecker The thing that impressed me about it is that unlike the square root algorithm I can actually remember in my head (basically Newton's method), it only involves ONE iteration from your close guess to an answer accurate enough that it will cover most people's purposes. I expected you'd have to do a thing more than one time. I suppose you could iterate it again to get closer but the Curta only has one or two more digits of precision anyway.
      I guess what this really is is a linear interpolation from a square-root table, since the formula is just an add and a multiply. Only instead of just giving you a square-root table and telling you how to linearly interpolate, they have a table that already did some of the initial steps for you so you just have to do an add and a multiply.

  • @johnsrabe
    @johnsrabe 6 місяців тому +1

    If you have to carry around a book to work a machine, then you are not doing it “on the machine.” But serious question: can a slide rule do roots and signs, etc., without ephemera?

    • @ChrisStaecker
      @ChrisStaecker  6 місяців тому +3

      Yes but it's a bit unsatisfying- the slide rule has markings on it that you use to look up your answer, so with most functions like this you're going to end up with an answer in between markings and you'll have to estimate.
      But for a function of a single input (like square root of x, or sin or cos of x, etc) you can just make a scale directly that lines up the inputs with the outputs. Like square root will have markings on either side where the 1 lines up with 1, 4 lines up with 2, 9 lines up with 3, etc. Think like a very simple Celcius - Fahrenheit chart where you can visually look up the conversion.
      A fancy slide rule will include some kind of square root scale, and some will have different kids of trigonometric scales- but if you're just finding a square root in this way, you're not really using the scales like a slide rule. You're just using it like a single-variable lookup table (and estimating values in between).

    • @johnsrabe
      @johnsrabe 6 місяців тому +1

      @@ChrisStaecker is there anything in the field where a slide rule is invaluable for calculating roots and sines etc? Like an engineering project? Or, if you’re building a bridge, is the slop too great? I’m thinking the Curta would be very good for a traveling oriental rug salesman, like my cousin, for keeping track of daily sales figures and calculating discounts and markups.

    • @MattMcIrvin
      @MattMcIrvin 6 місяців тому +1

      Nearly all slide rules have scales that can directly get you square roots, many have one for cube roots. And there are scales that help you take other kinds of powers and roots, and I just posted a long comment about that because this video reminded me of an issue with it.
      Most of them, even fairly basic ones, have scales for trig functions though using them for all possible inputs can involve some extra tricks. You don't have to look anything up in a table.
      What the slide rule doesn't tell you is the order of magnitude of the answer, but then the Curta doesn't either.

    • @amartini51
      @amartini51 6 місяців тому +2

      The trade-off for a slide rule is that, although it’s fast, its precision is limited. The answer usually only has 3 or 4 significant digits. But that’s enough for a lot of engineering calculations.

    • @andrewkarminski2860
      @andrewkarminski2860 6 місяців тому +2

      I remember at school we used to call it a “guessing stick”

  • @charlesbenca5357
    @charlesbenca5357 6 місяців тому

    Hey i know a way of computing square roots by hand, to an arbitrary number of decimal precision in the answer, and i think it would work wonders on the curta. It's repeated substraction just like long division. I expected that you would show it but it looks lile you're not aware of the existance of that algorithm, nor everyone who went to the assle of making precomputed tables like you"ve shown. Im sad :( if you're interested, i could probably invest time to find were i've seen it first or write a document/make a video explaining it.

    • @ChrisStaecker
      @ChrisStaecker  6 місяців тому

      Yes there are many ways to do it, some not requiring any tables. You can see some at Wikipedia here: en.wikipedia.org/wiki/Methods_of_computing_square_roots. What I'm showing is basically one step of what they call "Bakhshali's Method". I'm guessing you're familiar with what they call "digit-by-digit calculation"? That method works great and is the basic approach typically used on the abacus, so certainly you can do it on a Curta or anything else.
      The method I'm showing has the obvious drawback of requiring the table, and also isn't easy to iterate- you get 5 digits of accuracy, and that's it. But it's easier and faster to do than the other methods.

  • @redoktopus3047
    @redoktopus3047 6 місяців тому +3

    taylor series aren't nearly as cool as the method of finite differences.

  • @farpointgamingdirect
    @farpointgamingdirect 6 місяців тому +1

    So: if the Curta enthusiast is a female, would her enthusiasm be considered "woman-splaining"? Asking for a friend 😅. Another fascinating video about the Curta!

  • @duncanbojangles
    @duncanbojangles 6 місяців тому

    Jenny I've got your number
    I need to make you mine
    Jenny don't change your number