For someone who doesn't like being associated with something almost working, Matt Parker produces a lot of almost-working things and shows them to the world.
@@idontwantahandlethough no my phone just, legit has the dumbest autocorrect, it regularly turns "is" to "I'd" and also capitalizes even conjunctions among other things
We're all worried about intelligent machines taking over, but here's Matt teaching trees how to do multiplication when they already outnumber us by trillions.
Hi, I'm from the year 2024, and unfortunately machines already outnumber all humans, and trees, except TREE(3)+... I'm sure this joke will have aged well by the end of next month. I thank you.
Which makes me wonder, what are the constraints on size of the presents given the size of the tree? I imagine you’d want a variety of sized presents to distribute the baubles evenly…
@@maf654321the presents have to be a very specific size based on the size of your "unit" height. (In this case I think 8 is the shortest present so that one represents one unit). The unit height is constrained by the tree height (and bauble droopiness), such that the tree is a minimum of 58 units tall PLUS the droop of the top bauble (so the top bauble sits at 58 units but is attached a bit higher). So if your tree is 5 ft exactly (60"), and the droop is 2 inches, then your max unit height is 58 inches ÷ 58units = 1 inch. So your presents will be multiples of an inch up to 29 inches
@@maf654321 The height just has to match the numbers in the input table (whatever 2-9 corresponds to) times some arbitrary unit of length. If you can come up with another table that works, you can use those measurements.
For some reason, the reveal of the display of the cogputer had me nearly falling off my chair with laughter. It's so ridiculously tiny, absolutely perfect!
Wonderfully on-brand, yes :) According to his comment in other thread, Matt was thinking of the fact that _Arithmetica Logarithmica,_ the first great table for log₁₀, was published in 1624.
most original joke you've ever written. and holy moly, how specific this joke is, like there is no way to write this exact same joke about literally anything
As an elementary STEM teacher, I think I need to make one of these for my students to use. The fact that the answer window is so tiny is actually awesome for multiple students to use it for the same problem.
The way that 20th century mechanical computers did multiplication was really simple and clever. They used the formula for a line Y=MX. Inside the machine is a flat grid, you have a sliding input along the bottom for x that has a perpendicular track going straight up riding along and a rotating track that's centered around the origin, it has its slope set by a vertical sliding input at x = 1. Those two tracks constrain a pin that would always be at the intersection point of the two input tracks, and there'd be a third horizontal track that would be pushed up or down to read out the y value, and that's your answer. You had to know in advance what range of values you had to work with, but you could multiply any of the inputs or outputs by a constant using a gear ratio to force it into the right range.
Mechanical computing is such a fascinating area! I have a small collection of mechanical calculators, including a fully automatic four function one that I'm restoring. The amount of engineering effort and ingenuity that wen't into those things is amazing, but so it the sheer variety of methods of operation. For example, some machines do subtraction via a reverse of the addition mechanism, but some do it via 9's-complement which means they can add and subtract with the same mechanism! There's also a relevant example to this video which is the MADAS Millionaire, which uses a special kind of lookup table to do "single-operation" multiplication. That's not the mention the hook-and-crook slide adders, the ingenious ways of doing various operations on the comptometer (once the biggest educator in the UK), and even "Consul, the Educated Monkey"! And all that is just 'digital' calculators, not to mention all the analogue calculating mechanisms around (which made their way into all sorts of places, like WW2 bombing computers, and automatic gearboxes).
The alternate table is what I was taught as the "times table" in primary school. What is relevant is that the first computer I ever used, the IBM1620 (early 1960's computer, used in 1968) employed decimal, not binary arithmetic, and did its multiplication using a times table - in 100 2-digit decimal memory locations 200 to 399, I recall.
The derivation of the math function he used seems very similar to a notion I've heard about in computer science called "Perfect Hashing" because really, what I'm seeing is that what he wants is very similar. Both are given a set (all pairs of base-10 digits) to find a function that spreads them into distinct buckets with no collisions.
I assume Percy would want to have several 1 digit multipliers and combine them to have a multiple digit multiplier. Which would also be why the entries for 0 would be important to include.
I did multiplication with logic gates (2 8bit numbers) when I learned how full / half binary adders worked. I designed my own calculator (terribly inneficient) to do the 4 basic calculation
My first thought is the lookup table could be folded up into a n-dimensional array where n is the number of primes you include. A dimension for 2, 3, 5, 7, 11, etc.
yes! ive been looking for this everywhere for a year since i heard that "Z_(p-1) with addition is isomorphic to Z_p - {0} with multiplication" in my group theory class for some values of p. that made me think that there had to be a method to multiply integers through addition that could be efficient for computers? and i found (almost) exactly this and built some "paperputers" like yours. thank you for the video!
Oh man... this is why I love this channel. You've got a megaminx, a mirror cube and a fluctuation cube on your shelf. Just as I do, right behind me, among a billion others. Makes me feel a little less stupid as I try to keep up with your explanations. Thanks for all your work. Cripes my megaminx is dusty... can't have that.
I hate to be that guy but…. Babbage built part of his difference engine and it was used to calculate log tables and tide times, but never completed it, but it would be described as a mechanical calculator. His analytical engine was something he designed but never built and it was the first design of a programmable computer, inspired by Jaquard and his looms. The analytical engine would be more akin to what we call a computer today, whereas his difference engine (and your nifty machine) would be a calculator not a computer, and I personally prefer the term “cogulator” as opposed to “cogputer”
He completed two difference engines. Only one of them (the one the government actually wanted) was incomplete. Also, a "computer" is not necessarily a general-purpose computer. In fact, no such mechanical computer has _ever_ been built. Rather, the term "mechanical computer" refers to calculating devices like this (mostly adding machines).
It's an important distinction, because the first calculator is from 1642, designed by Pascal, Percy comes 200 years later, so Matt did get the history of computer science largely wrong. OK, I am late to the party.
not sure if anyone had the same thought, but at 12:00, the second grid perfectly overlaps the left grid if you rotate it 180 degrees. instead of only fitting the first row of the second grid into empty spaces, you could do it with all the rows
My goodness, the lengths you go to do math in the most entertaining and abnormal method possible is an inspiration to us all. Love the tree! Love the cogputer!
This method should be taught in schools everywhere, with the two tables provided on pieces of cloth that must be flattened out, repeatedly, to read, but with the option given that it's acceptable to memorize the results, should you find that, umm, a little bit faster.
Why not using integer logarithms? As the biggest result is 9*9 = 81, we can work modulo the next prime, which is 83. 83 has 2 as a primitive root, so you just need to tabulate all values of 2^x mod 83. So, for 5*9 you find that 2^27 = 5, and 2^62 = 9, you add 27+62 = 7 (mod 83) and 2^7 = 45 -> your solution.
the idea is that Percy's method (and its adaptation by Matt) is supposed to compute products with a very rudimentary mechanical computer, so it has to exploit number theorerical properties of integers which can easily be encoded and manipulated by such a machine. modular exponentiation surely doesn't fit the bill, though indeed it is more simple and elegant in a purely mathematically setting
@@jan_kulawa The computer would still only be doing addition and table lookups, just like with Percy's method. You only need exponentiation to create the table.
The difference engine! I have actually seen the actual build of it in real life at the Science Museum in London. It is decently large but it probably works quite well.
One "easy" improvement to help with the alignment problem would be to have a second large cog uncoupled from the output cog with every subsidiary cog fully toothed to that gear so that they are always in sync.
Matt, you were so close to getting each number to appear at its own index (like you discuss at 15:10)! You could replace each value x in your first lookup table with 42 - x. That way 1 would map to 0. You would also replace each index z in the second lookup table with 84 - z. This works because x + y = z if and only if (42 - x) + (42 - y) = 84 - z. As a bonus, your second lookup table would only have to go up to 82 instead of 84. And, your outer wheels would only need a total of 166 instead of your current 254 (though Percy still wins in this regard; their design would only need 141 total teeth on the outer wheels). With this change: 0-9 COGPUTER 0 cog: 41 teeth 1 cog: 0 teeth 2 cog: 1 teeth 3 cog: 15 teeth 4 cog: 2 teeth 5 cog: 34 teeth 6 cog: 16 teeth 7 cog: 24 teeth 8 cog: 3 teeth 9 cog: 30 teeth LABELS ON MIDDLE COG: CE=01, 02, 04, 08, 16, 32, 64, --, --, --, --, --, --, --, --, 03, 06, 12, 24, 48, --, --, --, --, 07, 14, 28, 56, --, --, 09, 18, 36, 72, 05, 10, 20, 40, --, 21, 42, 00, 00, 00, 00, 27, 54, --, 49, 15, 30, --, --, --, 63, --, 00, 00, 35, --, 81, --, --, --, 45, 00, --, --, 25, --, --, 00, --, --, --, 00, --, --, --, --, --, --, 00 (This scheme has CE and 1 in the same place, which you may have understandably chosen to avoid, but it also seems appropriate to have the multiplicative identity also be the "clear" value)
For the tree you should have just made 1 a card with ~0 thickness, so you can multiply by 1 by adding the card to the stack without changing the height.
I love this channel! Not only is the content informative, it's delivered with comedy, and the comments are always gold. P.S. i first came here to mention laughing hard enough over the Self on the shelf, that my coworkers checked in on me.
Before logarithms people did a similar trick to simplify multiplication to addition by using a lookup table for squaring numbers. Used since the Babylonians. a*b = ((a +b)^2 - a^2 - b^2)/2
When multiplying similar numbers (especially when they differ by an even number) I like to use ab = ((a+b)/2)² - ((a-b)/2)². Eg, 77 x 81 = 79² - 2² = (80² - 80 - 79) - 4 = 6237.
18:00 The way the cog has 15 teeth that engage reminds me of production mechanical calculators where entering a digit with a button would have a similar effect -- either as you enter it (like yours), as with the famous Curta, or setting up the mechanism so that when the crack it turned it issues a linear gear with the right number of teeth. The printer or readout often uses a similar mechanism, too.
I did multiplication at school using log tables, so it's all relatively familiar stuff. Matt's Christmas Tree is a variant of the slide rule, but with fixed cursors (baubles)
I'm tempted to call this the Parker 'Puter but I think I'll have to settle for the Parker Cogputer, since with his now advanced levels "terrible python code", Matt's bound to create his own computer one of these days, operating system and all!
By far my favourite multiplication shortcut is the "finger method". 1. Give each finger on both hands a number from 6 to 10, starting from the thumb and counting outwards. 2. With your hands face down, place the finger with the number being multiplied on your left hand on top of the finger with the number you wish to multiply it with on your right hand. This separates your fingers into those "in the loop" ( the two overlapping fingers and everything in between ) and those "out of the loop" ( the rest ). 3. Multiply the number of "in the loop" fingers by 10 to get the tens digit. 4. Multiply the number of "out of the loop" fingers on your left hand with the number of "out of the loop" fingers on your right hand. Add this to the result from step 3 to get the units digit. 5. That's your answer. The only drawback to this method is that it requires you to memorise your first five times tables, but everyone should already have those memorised from school! Also please let me know if anyone knows exactly why this works.
tricking a tree into doing multiplication defines a whole new paradigm of computing. we should have Parker machines instead of Turing machines in our theoretical computer science curriculum
I was studying the attention mechanisim in machine learning and was struggling to find the equivalence between Additive Attention, and Dot Product attention. Your simple formula which reminds us that: A*B = f(g(A) + g(B)) finally led to the aha! moment, Thanks.
I found a sudoku puzzle book in an op shop for cheap and I bought it, but something about it intrigued me, and surely it has some interesting mathematics. See, the book is organized into "easy", "medium" and "difficult" puzzles and they do tend to be harder as you go along. Newspapers also often have both an easy and hard sudoku puzzle, if they provide it. And I was wondering how the hell they do that. I thought it was just "the easy ones have more numbers", and whilst that is often the case with the easiest puzzles, it isn't always with the harder ones (in my book, anyway). Some of the "medium" puzzles have as few as 27 clue numbers, and the "difficult" puzzles have as many as 32. So, how the hell do they make them "harder"? I'm sure the maths of sudoku must be well understood, if we can make them so easily, but I couldn't find it online.
17:47 I think you said toward the end that the 9 cog has 15 dents but it's 12 as stated in the description :D Great stuff nonetheless had a lot of fun trying to recreate your table to put back the triangle of number together (01 02 04 up to 81) ( 05 10 20 up to 45) (07 14 up to 63) (even the 00 works) and seee those flying 25 35 and 49 (and three 00) and I wonder if you could try to minimise the space of those geometric shapes (while fitting the flying unit around) to find other minimal triangles
Fascinating! Matt, that is awesome! A while back I started writing a Reed-Solomon coding RAID driver... sadly I never finished it though: I got distracted with real work. In it addition and subtraction are just XOR but multiplication and division are 2 log table lookups, addition or subtraction of those respectively, then an inverse log table lookup.
I'm a sucker for mechanical computer designs. Some cranks, detents, and spring-ball plungers would make that cogputer actually quite usable. Basically, instead of everything being free-spinning, a detent would hold each input wheel in an unengaged position, and detents (one detent for each tooth/position) would hold the center wheel in position. When turning an input wheel, you could click the center wheel through the requisite number of positions and you wouldn't have to worry about the subtalties of engagement and disengagement. Adding cranks to the input and reset wheels will help you track when you do a full turn and simply make it more usable.
I know and have worked with Mark! Smart dude! Wrote a brilliant book on functional programming with Perl, that I still reread occasionally for interesting tricks.
Surprised not to see any mention of the "difference of two squares" method for multiplying. Basic idea is: (a+b)^2 = a^2 + b^2 + 2ab ---> (eqn 1) (a-b)^2 = a^2 + b^2 - 2ab ---> (eqn 2) (eqn 1) - (eqn 2) => 4ab = (a+b)^2 - (a-b)^2 So define f(x) = floor(x^2 / 4) Then a*b = f(a+b) - f(a-b) (it can be shown that the remainder after dividing by 4 always cancels out when calculating the difference, hence we can discard it completely) This is how they used to do fast multiplication on computers in the 80s. Replace the pre-generated table of squares-divided-by-4 with a big book of tables, and you could do it by hand, as long as you don't mind doing subtraction!
It would be incredible if you could make a video on the statistical claims of past chess grandmaster Kramnik accusing current chess grandmaster and second best player in the world Hikaru Nakamura of cheating, like you did in the Dream probability stuff. Many people have made blog posts about Kramnik’s poor methods but there’s a lot of confusion everywhere and a nice, simple explanation of the statistics involved would be incredible!!!
Merry Christmas Matt, thanks hugely for your part in getting me back into Maths this year after shunning it in my youth! Ive had such fun messing about with my own silly equations and tricks, long may your channel continue!
You might improve this by adding a "click" in place in the correct alignment of the output (can be achieved with a spring-loaded rounded rod resting on the main cog, for example). Wonderful, merry Christmas :)
To improve the cogputer: You could lift the cogs up to disengage them (with a system that clicks them into off and on positions). So that you can reset and use the cogputer eseaier. Perhaps there could be markings on all the interactor wheels (including the main cog) to show where the neutral positions are. A mechanical magnifier so the output can be bigger (The main cog will be further back from the first improvement giving some space for this) Otherwise, I absolutely love the Cogputer I fully expect these never to be implemented but I had to get my ideas out there
Following Percy Ludgate’s method , I made tables for 1 digit multiplication up to base 12. With the rule that 1 must have an index of zero, the lengths of the second tables, which I’m calling the first 12 “Irish Numbers” are: 3,7,15,23,37,41, 59,81,101,121,171,195 I guess technically the zeroth Irish Number could be 1, but that would just be two one long tables telling you that zero times zero is, in fact, zero, and it would sort of break our rule about one having index zero
When you mentioned the Christmas card on the podcast, I assumed it was the standard type of logarithm. Pleasantly surprised and entertained to discover there was a little more to it!
I have an old book of maths tables. At the back is a table of "quarter-squares" which allows multiplication through the identity ab = [(a+b)^2]/4 - [(a-b)^2]/4
You could bring a regular old digital pocket calculator that has all the functions you need but that would be boring. If instead I had this cogputer I'd have been the hero of math class.
I've tried making other lookup tables by hand with this technique, but when I did multiplication of 0-19, it wasn't as nice. That is, if there isn't any other better 'packing' then the last result (19×19for me) ending up on index #140. Stipl better then a regular look up table that would have 20^2 outcomes, ~half of that if you abandon symmetry. A much easier task was figuring out multiplication of numbers 11-19, since no numbers are co-prime and therefore, the patterns don't differ when you switch the code for any two numbers in the first table. With the first number at index #0, it's highest index is #130. So, still not very effective when you could just make a much easier cogputer with 81 outcomes.
For someone who doesn't like being associated with something almost working, Matt Parker produces a lot of almost-working things and shows them to the world.
Sharing stuff that worked only once during development is my Forte lmao
His motto is "give it a go"
Parkerputer
@@bowfuz wait, do you type Will Forte's name enough that your phone automatically capitalizes it...?
@@idontwantahandlethough no my phone just, legit has the dumbest autocorrect, it regularly turns "is" to "I'd" and also capitalizes even conjunctions among other things
I didn't expect my belief in the commutativity of multiplication to be threatened by the thought of having to balance a box on a flamingo
😂
I'll take "Sentences First Said Today" for $500, Trebeck.
Thanks, that gave me a very good laugh 😂😂
Wow. Amazing, thank you xD
@@ironnwizzard r/BrandNewSentence is free ;-)
Noah sent his animals to "go forth and multiply", but a pair of snakes told him "we can't multiply, we're adders" - so he builds them a log table.
I wish I could do more than like this comment lol, this is great
In binary,
snakes and eggs.
Not base 1010
It's really great that log has that double meaning too.
Aah the double meaning!
sorry can anyone explain
We're all worried about intelligent machines taking over, but here's Matt teaching trees how to do multiplication when they already outnumber us by trillions.
Hi, I'm from the year 2024, and unfortunately machines already outnumber all humans, and trees, except TREE(3)+...
I'm sure this joke will have aged well by the end of next month. I thank you.
The Ents wouldn't have died off so soon if only they had arithmetic.
Don't worry. I double-checked the first calculation, and 9 * 5 is 45. (Fixed typo) and that one guy really did a proof on this \/
You're a hero for doing that. 😊
I don't believe either you or Matt and I request that you provide a detailed proof of your hypothesis.
Did you check it with a tree though
@@CiaraOSullivan1990 I have discovered a truly remarkable proof which this youtube comment is too small to contain.
the first calculation was 9*5 though, can you check that too please?
I’m surprised you missed the obvious branding for the tree: it’s a Yule Log™️
I came here to exclaim this! 😅
Well, he did say it is a "log table" at 21:27
I was so about to say, "Not just a log table, a Yule log table!" XD So glad I'm not the only one lol
Merry Multiplication-Mas
(✖️-Mas) 😜
He has another computer in the fireplace, but we couldn't tell because it's a discreet log.
Now we gotta have a Python-running Christmas tree that can generate multiplication algorithms automatically with any given set of presents
Which makes me wonder, what are the constraints on size of the presents given the size of the tree? I imagine you’d want a variety of sized presents to distribute the baubles evenly…
@@maf654321the presents have to be a very specific size based on the size of your "unit" height. (In this case I think 8 is the shortest present so that one represents one unit).
The unit height is constrained by the tree height (and bauble droopiness), such that the tree is a minimum of 58 units tall PLUS the droop of the top bauble (so the top bauble sits at 58 units but is attached a bit higher).
So if your tree is 5 ft exactly (60"), and the droop is 2 inches, then your max unit height is 58 inches ÷ 58units = 1 inch.
So your presents will be multiples of an inch up to 29 inches
@@maf654321 The height just has to match the numbers in the input table (whatever 2-9 corresponds to) times some arbitrary unit of length. If you can come up with another table that works, you can use those measurements.
what is the meaning of this? mommy?
Could that tree multiply 3 variables by using rotation in the plane as wall as height???
“This could be improved dramatically.” A quote for the ages. 18:34
it's a shame we won't have the sequel, "Somebody improved my cogputer by 40,832,277,770%"
He's begging for fans to send him better ones there
HERE WE GO
Likewise 21:49, "Do not eat my face!"
The first mechanical calculator was built in 1642 by Wilhelm Schickard.
For some reason, the reveal of the display of the cogputer had me nearly falling off my chair with laughter. It's so ridiculously tiny, absolutely perfect!
One might say it's comically small
Comically large dials vs comically small display
Alan Turing has been really quiet since the parker machine dropped
Matt: needs a computer to work out 9*5
Also Matt: 2024 is the 400th anniversary of 1614
Yes, this tracks
Wonderfully on-brand, yes :) According to his comment in other thread, Matt was thinking of the fact that _Arithmetica Logarithmica,_ the first great table for log₁₀, was published in 1624.
Parkerversary
it's the fact that he didn't realise this in the writing, recording, or editing stages 😂
Adding new meaning to "What tree has the best logs?"
The one with square roots, obviously.
What I'm worried about, is Matt's increasingly parallelogram-shaped bookcase.
He must be disappointed that it isn't becoming a rhombus.
If it's Ikea, it's a design choice to change shape slowly.
making a log table using a tree is pure genius
Ahem, log tree.
@@CaraesNaur It is puns like that which make me wish I could subscribe to Patreon to NOT support Matt
Mom can we have a computer?
No, we have a computer at home
Computer at home:
most original joke you've ever written. and holy moly, how specific this joke is, like there is no way to write this exact same joke about literally anything
Frankly, I would have loved to get something like this as a child
As an elementary STEM teacher, I think I need to make one of these for my students to use. The fact that the answer window is so tiny is actually awesome for multiple students to use it for the same problem.
You could embed a small magnet in each input cog and on the background to hold it in its neutral position while other cogs are turned.
Oooh, use magnets, I like this idea a lot!! 😁
Alternatively, use a weak coil spring. Same idea just a lot cheaper and works on non-ferro materials (like plastic).
All it would really take is for the dials to be asymmetric, so that gravity keeps them in the disengaged position.
The way that 20th century mechanical computers did multiplication was really simple and clever. They used the formula for a line Y=MX. Inside the machine is a flat grid, you have a sliding input along the bottom for x that has a perpendicular track going straight up riding along and a rotating track that's centered around the origin, it has its slope set by a vertical sliding input at x = 1. Those two tracks constrain a pin that would always be at the intersection point of the two input tracks, and there'd be a third horizontal track that would be pushed up or down to read out the y value, and that's your answer. You had to know in advance what range of values you had to work with, but you could multiply any of the inputs or outputs by a constant using a gear ratio to force it into the right range.
ooh that sounds like the mechanical equivalent of a nomogram! neat
Finally, we have it. PC2
And PC stands for Parker Computer
Mechanical computing is such a fascinating area! I have a small collection of mechanical calculators, including a fully automatic four function one that I'm restoring. The amount of engineering effort and ingenuity that wen't into those things is amazing, but so it the sheer variety of methods of operation. For example, some machines do subtraction via a reverse of the addition mechanism, but some do it via 9's-complement which means they can add and subtract with the same mechanism! There's also a relevant example to this video which is the MADAS Millionaire, which uses a special kind of lookup table to do "single-operation" multiplication.
That's not the mention the hook-and-crook slide adders, the ingenious ways of doing various operations on the comptometer (once the biggest educator in the UK), and even "Consul, the Educated Monkey"!
And all that is just 'digital' calculators, not to mention all the analogue calculating mechanisms around (which made their way into all sorts of places, like WW2 bombing computers, and automatic gearboxes).
The alternate table is what I was taught as the "times table" in primary school. What is relevant is that the first computer I ever used, the IBM1620 (early 1960's computer, used in 1968) employed decimal, not binary arithmetic, and did its multiplication using a times table - in 100 2-digit decimal memory locations 200 to 399, I recall.
The derivation of the math function he used seems very similar to a notion I've heard about in computer science called "Perfect Hashing" because really, what I'm seeing is that what he wants is very similar. Both are given a set (all pairs of base-10 digits) to find a function that spreads them into distinct buckets with no collisions.
8:17 It makes good sense for the multiplicative identity 1 to translate into the additive identity 0. Saves them duplicating entries.
This video deserves reCOGnition...
reCOGNITION!
Is it just me or is Percy's method more work than just having a multiplication table with the answers on it and directly looking them up?
It is for a human, but not for a machine made of cogs and rods etc.
but that's no fun!
I assume Percy would want to have several 1 digit multipliers and combine them to have a multiple digit multiplier. Which would also be why the entries for 0 would be important to include.
Maybe he wanted a working proof of concept before scaling it to the point where multiplication tables were unwieldy.
This is your brain when you learn math without learning anything about computation
The reveal of the cog-puter's microscopic display had me in stitches. 😂
You need to make a Hitchhiker's Guide edition of the xmas card where if you multiply 6 by 9 it reads 42.
That Christmas tree card seems like something that could be used in an Exit "escape room in a box" puzzle!
I did multiplication with logic gates (2 8bit numbers) when I learned how full / half binary adders worked. I designed my own calculator (terribly inneficient) to do the 4 basic calculation
My first thought is the lookup table could be folded up into a n-dimensional array where n is the number of primes you include. A dimension for 2, 3, 5, 7, 11, etc.
That's pretty much it, but it's then compressed to 1D as compact as possible
yes! ive been looking for this everywhere for a year since i heard that "Z_(p-1) with addition is isomorphic to Z_p - {0} with multiplication" in my group theory class for some values of p. that made me think that there had to be a method to multiply integers through addition that could be efficient for computers? and i found (almost) exactly this and built some "paperputers" like yours. thank you for the video!
Oh man... this is why I love this channel. You've got a megaminx, a mirror cube and a fluctuation cube on your shelf. Just as I do, right behind me, among a billion others. Makes me feel a little less stupid as I try to keep up with your explanations. Thanks for all your work.
Cripes my megaminx is dusty... can't have that.
6:13 - If logs came around in 1614, then wouldn't 2024 be the 410th anniversary, not the 400th?
Good point! My brain confused it with the 1624 publishing of Arithmetica Logarithmica, the first great log table book. I’ll add it to the corrections.
@@standupmathsi just assumed you thought it was 2014. 2024 doesn't sound real :)
It's a Parker Quatercentenary.
Wait, what about calendar corrections which happened in Europe right around that time.
@@jpaugh64 - The adoption of the Gregorian calendar yielded an adjustment of about 10~11 days in the 17th Century, not 10 years.
I hate to be that guy but…. Babbage built part of his difference engine and it was used to calculate log tables and tide times, but never completed it, but it would be described as a mechanical calculator. His analytical engine was something he designed but never built and it was the first design of a programmable computer, inspired by Jaquard and his looms. The analytical engine would be more akin to what we call a computer today, whereas his difference engine (and your nifty machine) would be a calculator not a computer, and I personally prefer the term “cogulator” as opposed to “cogputer”
He completed two difference engines. Only one of them (the one the government actually wanted) was incomplete. Also, a "computer" is not necessarily a general-purpose computer. In fact, no such mechanical computer has _ever_ been built. Rather, the term "mechanical computer" refers to calculating devices like this (mostly adding machines).
It's an important distinction, because the first calculator is from 1642, designed by Pascal, Percy comes 200 years later, so Matt did get the history of computer science largely wrong. OK, I am late to the party.
not sure if anyone had the same thought, but at 12:00, the second grid perfectly overlaps the left grid if you rotate it 180 degrees. instead of only fitting the first row of the second grid into empty spaces, you could do it with all the rows
Yes! That was my thought too!
Move aside Parker Square, here comes the Parker Cog!
My goodness, the lengths you go to do math in the most entertaining and abnormal method possible is an inspiration to us all. Love the tree! Love the cogputer!
"Now THAT's a log table" needs to be a t-shirt
This method should be taught in schools everywhere, with the two tables provided on pieces of cloth that must be flattened out, repeatedly, to read, but with the option given that it's acceptable to memorize the results, should you find that, umm, a little bit faster.
Why not using integer logarithms? As the biggest result is 9*9 = 81, we can work modulo the next prime, which is 83. 83 has 2 as a primitive root, so you just need to tabulate all values of 2^x mod 83. So, for 5*9 you find that 2^27 = 5, and 2^62 = 9, you add 27+62 = 7 (mod 83) and 2^7 = 45 -> your solution.
the idea is that Percy's method (and its adaptation by Matt) is supposed to compute products with a very rudimentary mechanical computer, so it has to exploit number theorerical properties of integers which can easily be encoded and manipulated by such a machine. modular exponentiation surely doesn't fit the bill, though indeed it is more simple and elegant in a purely mathematically setting
Would it work to use 79 instead of 83, and replace 9x with 78x mod 79? I think you could get the largest gear a bit smaller that way.
@@jan_kulawa The computer would still only be doing addition and table lookups, just like with Percy's method. You only need exponentiation to create the table.
The difference engine! I have actually seen the actual build of it in real life at the Science Museum in London. It is decently large but it probably works quite well.
Although when we say Babbage designed a "Turing complete" computer, we mean his "Analytical engine", which was never built.
One "easy" improvement to help with the alignment problem would be to have a second large cog uncoupled from the output cog with every subsidiary cog fully toothed to that gear so that they are always in sync.
Matt, you were so close to getting each number to appear at its own index (like you discuss at 15:10)! You could replace each value x in your first lookup table with 42 - x. That way 1 would map to 0. You would also replace each index z in the second lookup table with 84 - z. This works because x + y = z if and only if (42 - x) + (42 - y) = 84 - z. As a bonus, your second lookup table would only have to go up to 82 instead of 84. And, your outer wheels would only need a total of 166 instead of your current 254 (though Percy still wins in this regard; their design would only need 141 total teeth on the outer wheels).
With this change:
0-9 COGPUTER
0 cog: 41 teeth
1 cog: 0 teeth
2 cog: 1 teeth
3 cog: 15 teeth
4 cog: 2 teeth
5 cog: 34 teeth
6 cog: 16 teeth
7 cog: 24 teeth
8 cog: 3 teeth
9 cog: 30 teeth
LABELS ON MIDDLE COG:
CE=01, 02, 04, 08, 16, 32, 64, --, --, --, --, --, --, --, --, 03, 06, 12, 24, 48, --, --, --, --, 07, 14, 28, 56, --, --, 09, 18, 36, 72, 05, 10, 20, 40, --, 21, 42, 00, 00, 00, 00, 27, 54, --, 49, 15, 30, --, --, --, 63, --, 00, 00, 35, --, 81, --, --, --, 45, 00, --, --, 25, --, --, 00, --, --, --, 00, --, --, --, --, --, --, 00
(This scheme has CE and 1 in the same place, which you may have understandably chosen to avoid, but it also seems appropriate to have the multiplicative identity also be the "clear" value)
For the tree you should have just made 1 a card with ~0 thickness, so you can multiply by 1 by adding the card to the stack without changing the height.
That doesn't work, as the hight isn't the number itself. (in his version)
Matt's voice going ever more high pitched with excitement as the presents align with the correct results is fantastic.
I love this channel!
Not only is the content informative, it's delivered with comedy, and the comments are always gold.
P.S. i first came here to mention laughing hard enough over the Self on the shelf, that my coworkers checked in on me.
Before logarithms people did a similar trick to simplify multiplication to addition by using a lookup table for squaring numbers. Used since the Babylonians. a*b = ((a +b)^2 - a^2 - b^2)/2
When multiplying similar numbers (especially when they differ by an even number) I like to use ab = ((a+b)/2)² - ((a-b)/2)².
Eg, 77 x 81 = 79² - 2² = (80² - 80 - 79) - 4 = 6237.
@@zygoloid Yeah, I found the cosine-squared approach a bit odd, when a table of (a/2)² works more simply..
18:00 The way the cog has 15 teeth that engage reminds me of production mechanical calculators where entering a digit with a button would have a similar effect -- either as you enter it (like yours), as with the famous Curta, or setting up the mechanism so that when the crack it turned it issues a linear gear with the right number of teeth. The printer or readout often uses a similar mechanism, too.
Stuff like this makes me even more interested in computation algorithms.
I did multiplication at school using log tables, so it's all relatively familiar stuff.
Matt's Christmas Tree is a variant of the slide rule, but with fixed cursors (baubles)
It would not be a Matt Parker video without terrible python code
I'm tempted to call this the Parker 'Puter but I think I'll have to settle for the Parker Cogputer, since with his now advanced levels "terrible python code", Matt's bound to create his own computer one of these days, operating system and all!
By far my favourite multiplication shortcut is the "finger method".
1. Give each finger on both hands a number from 6 to 10, starting from the thumb and counting outwards.
2. With your hands face down, place the finger with the number being multiplied on your left hand on top of the finger with the number you wish to multiply it with on your right hand. This separates your fingers into those "in the loop" ( the two overlapping fingers and everything in between ) and those "out of the loop" ( the rest ).
3. Multiply the number of "in the loop" fingers by 10 to get the tens digit.
4. Multiply the number of "out of the loop" fingers on your left hand with the number of "out of the loop" fingers on your right hand. Add this to the result from step 3 to get the units digit.
5. That's your answer.
The only drawback to this method is that it requires you to memorise your first five times tables, but everyone should already have those memorised from school!
Also please let me know if anyone knows exactly why this works.
No way! I love Mark's blog! I've been following him for a year or so now. Wild to see him featured in a video.
tricking a tree into doing multiplication defines a whole new paradigm of computing. we should have Parker machines instead of Turing machines in our theoretical computer science curriculum
Who needs calculators, when we have Christmas trees?
I was studying the attention mechanisim in machine learning and was struggling to find the equivalence between Additive Attention, and Dot Product attention. Your simple formula which reminds us that: A*B = f(g(A) + g(B)) finally led to the aha! moment, Thanks.
I found a sudoku puzzle book in an op shop for cheap and I bought it, but something about it intrigued me, and surely it has some interesting mathematics.
See, the book is organized into "easy", "medium" and "difficult" puzzles and they do tend to be harder as you go along. Newspapers also often have both an easy and hard sudoku puzzle, if they provide it.
And I was wondering how the hell they do that. I thought it was just "the easy ones have more numbers", and whilst that is often the case with the easiest puzzles, it isn't always with the harder ones (in my book, anyway). Some of the "medium" puzzles have as few as 27 clue numbers, and the "difficult" puzzles have as many as 32. So, how the hell do they make them "harder"?
I'm sure the maths of sudoku must be well understood, if we can make them so easily, but I couldn't find it online.
This would go nicely with a rotary phone style dial!
17:47 I think you said toward the end that the 9 cog has 15 dents but it's 12 as stated in the description :D
Great stuff nonetheless had a lot of fun trying to recreate your table to put back the triangle of number together (01 02 04 up to 81) ( 05 10 20 up to 45) (07 14 up to 63) (even the 00 works) and seee those flying 25 35 and 49 (and three 00) and I wonder if you could try to minimise the space of those geometric shapes (while fitting the flying unit around) to find other minimal triangles
The Christmas tree is worth it for the log table joke
An extremely elaborate way to show that addition is commutative and infer that multiplication is too.
So many lookup tables just to avoid a couple of additions! I prefer the name Cogulator to describe the device.
Fascinating! Matt, that is awesome!
A while back I started writing a Reed-Solomon coding RAID driver... sadly I never finished it though: I got distracted with real work. In it addition and subtraction are just XOR but multiplication and division are 2 log table lookups, addition or subtraction of those respectively, then an inverse log table lookup.
The professions of comedian and mathematician are inherently mutually exclusive, with one notable exception, Matt Parker.
This is brilliant, I love how much effort goes into his gags
I'm a sucker for mechanical computer designs. Some cranks, detents, and spring-ball plungers would make that cogputer actually quite usable. Basically, instead of everything being free-spinning, a detent would hold each input wheel in an unengaged position, and detents (one detent for each tooth/position) would hold the center wheel in position. When turning an input wheel, you could click the center wheel through the requisite number of positions and you wouldn't have to worry about the subtalties of engagement and disengagement. Adding cranks to the input and reset wheels will help you track when you do a full turn and simply make it more usable.
Are you going to cover the Kramnik vs Hikaru Chess cheating accusations? It has a lot of stats and probabilities with elo involved.
I know and have worked with Mark! Smart dude! Wrote a brilliant book on functional programming with Perl, that I still reread occasionally for interesting tricks.
You could add detents to the cogs to make them need purpose to start turning and to have them lock in to position where they wont interfere.
Surprised not to see any mention of the "difference of two squares" method for multiplying. Basic idea is:
(a+b)^2 = a^2 + b^2 + 2ab ---> (eqn 1)
(a-b)^2 = a^2 + b^2 - 2ab ---> (eqn 2)
(eqn 1) - (eqn 2) => 4ab = (a+b)^2 - (a-b)^2
So define f(x) = floor(x^2 / 4)
Then a*b = f(a+b) - f(a-b)
(it can be shown that the remainder after dividing by 4 always cancels out when calculating the difference, hence we can discard it completely)
This is how they used to do fast multiplication on computers in the 80s. Replace the pre-generated table of squares-divided-by-4 with a big book of tables, and you could do it by hand, as long as you don't mind doing subtraction!
It would be incredible if you could make a video on the statistical claims of past chess grandmaster Kramnik accusing current chess grandmaster and second best player in the world Hikaru Nakamura of cheating, like you did in the Dream probability stuff. Many people have made blog posts about Kramnik’s poor methods but there’s a lot of confusion everywhere and a nice, simple explanation of the statistics involved would be incredible!!!
I love how proud Matt is of his cogputer
"This could be improved dramatically" the title of everything Matt attempts (but he attempts while most would not)
A Yule Log table to be more appropriate.
Merry Christmas Matt, thanks hugely for your part in getting me back into Maths this year after shunning it in my youth! Ive had such fun messing about with my own silly equations and tricks, long may your channel continue!
You might improve this by adding a "click" in place in the correct alignment of the output (can be achieved with a spring-loaded rounded rod resting on the main cog, for example). Wonderful, merry Christmas :)
this went straight over my head, think I'll have to watch it again.
That display though!
Every day, Matt is closer to becoming an Adeptus Mechanicus tech-priest... look, he's using cogitators now!
I applaud the dedication and amount of effort just for the pun at 21:30
Matt, if you title your next book Terrible Python Code, you’ve probably already written it.
The multiplicating
christmas tree is amazing
The Christmas tree made me crack up like a Christmas cracker
To improve the cogputer:
You could lift the cogs up to disengage them (with a system that clicks them into off and on positions). So that you can reset and use the cogputer eseaier.
Perhaps there could be markings on all the interactor wheels (including the main cog) to show where the neutral positions are.
A mechanical magnifier so the output can be bigger (The main cog will be further back from the first improvement giving some space for this)
Otherwise, I absolutely love the Cogputer
I fully expect these never to be implemented but I had to get my ideas out there
Mat: "... this tree can do multiplication. Now THAT is a Log table!"
Me screaming out loud (completely alone!): "ITS A YULE LOG!"
The christmas tree idea was sooooo good!!
Following Percy Ludgate’s method , I made tables for 1 digit multiplication up to base 12. With the rule that 1 must have an index of zero, the lengths of the second tables, which I’m calling the first 12 “Irish Numbers” are:
3,7,15,23,37,41,
59,81,101,121,171,195
I guess technically the zeroth Irish Number could be 1, but that would just be two one long tables telling you that zero times zero is, in fact, zero, and it would sort of break our rule about one having index zero
You know what really grinds my gears? Multiplication!
I feel like the cog-puter would be great in a steampunk/gearpunk setting
Aslo, that christmas card is so wonderfully nerdy
When you mentioned the Christmas card on the podcast, I assumed it was the standard type of logarithm. Pleasantly surprised and entertained to discover there was a little more to it!
I feel like a little dome magnifying glass stuck over the answer would really improve the UI
That's pretty neat.
You know, that table can be arbitrarily large.
I have an old book of maths tables. At the back is a table of "quarter-squares" which allows multiplication through the identity ab = [(a+b)^2]/4 - [(a-b)^2]/4
It's like a significantly worse version of a mechanical calculator.
Send it to Chris Staecker to review!
You could bring a regular old digital pocket calculator that has all the functions you need but that would be boring. If instead I had this cogputer I'd have been the hero of math class.
you sir, are mathematics. an universal treasure. never change. also, looking forwards to pi day!
I've tried making other lookup tables by hand with this technique, but when I did multiplication of 0-19, it wasn't as nice. That is, if there isn't any other better 'packing' then the last result (19×19for me) ending up on index #140. Stipl better then a regular look up table that would have 20^2 outcomes, ~half of that if you abandon symmetry.
A much easier task was figuring out multiplication of numbers 11-19, since no numbers are co-prime and therefore, the patterns don't differ when you switch the code for any two numbers in the first table. With the first number at index #0, it's highest index is #130. So, still not very effective when you could just make a much easier cogputer with 81 outcomes.
The tree is missing all the prime numbers. So that's cool too.
Wish I could go to pi day 2024, but travel simply costs too much.
Best of luck to everyone attending