I would guess they used this scheme because it saves storage in the firmware. If there were 4 different independent cyphers, they would need 360 bytes of ROM to store them. With just a single base cypher, they only need 90 bytes of ROM space to store the cyphers plus a few bytes of extra code to handle the skip value.
I am sure this is true. I built a spell checker for typewriters. All the manufacturers that used it were obsessed with saving space. Especially if it allowed smaller/fewer ROMs. It was a really big deal when my Italian dictionary took 68K bytes instead of 64k. But what can I do when the inflected list had 1 1/4 million words of average length 14. (Thanks to pronomial suffixes.) Yes this is less than one bit per word🤩.
As a developer, since this is a kid toy, I would not bother making 4 sigmas : - As they did, you store the string of character (sigma one) in memory and all you have to do is find the index of your letter in this string (called i), - Then you can easily find the corresponding indexed letter "j" with j = (i + cypher_number)%len(cypher) and you look the character at this position 'j' in the string to get the cypher. This costs less memory, it's easier to write and implement. Nowadays memory is cheap, back then it was a bit more expensive and to be affordable for a kid toy, it should have been taken in consideration.
You are one of my most interesting people's on UA-cam. I follow all the main channels However the content you create is more valuable than an entire week of that.
Chaining alphabets is part of the process for solving headline puzzles. I usually don't look at cipher chains unless I'm solving one of those. That was a pretty cool observation.
Always happy to get a banana update. Absolute delight to watch. The passion you have for your field (and tangentially related things to it) is infectious. edit: You've actually got me interested in making a silly web app to let people build their own cyphers. It looks like it would be fairly simple enough to develop.
Yay, you're back! Love this type of follow-up videos, what a lovely way to engage with viewers. Lots of awesome people with high attention to detail. Also wondering how many videos needed to decipher the changing pattern of grey-yellow squares on the wall
My guess is that they have a table of 90 symbols to print, each corresponding to one of 90 values produced by the keys. Then the codes could just be adding a register to the key value and subtracting 90 if necessary before getting the symbol. Even without codes, the key layout isn't necessarily very orderly in terms of the signals it has to send in order to produce the character printed on the key, and they might not have used a second table.
If they had 91 symbols instead of 90, cypher 2 and 3 would each only form a single chain. And with 90 symbols shouldn't sigma^45 automatically be self-decrypting?
@@1224chrisng I think the difference is that it's not shifting in alphabetical order - it's shifting along an arbitrary sequence instead. But other than that it works the same way.
From a lazy developer point of view, I think it is more likely they are using four base strings where they shuffled portions uniformly and then used the exact same character replacement based on index order. The decryption cipher would be the exact same with just reversing the source and destination strings. One algo, four strings, and 8 input changes.
In re: Speak and Spell's self-inverse code: I was primed to imagine this as a single 26-letter code, but then applied 13 times (i.e. σ^13). I guess this is true for any even n-cycles: that σ^(n/2) can be converted to 2 chains. Or maybe even more generally, for x and y where x is divisible by y, σ^(x/y) can be recoded as chains of length y.
Playing the long game, hanging on to the typewriter until the opportune time. Well played! Very few umms and ahhs--almost like you're a professional speaker. :)
I started learning some abstract algebra, recently, and a lot of this is looking very familiar! I'll just drop a neat fact without proof: If they included one more cipher, if they were careful about it, they could have made it possible to create every single transposition cipher by just combining the two in different orders! In fact, one of the dumbest possible ciphers that would work is just swapping "b" and "c", and leaving all the other letters alone.
Makes me wonder if there is some way to take the machine apart and add the functionality? Then you could have one that has all 90 elements generated by cipher 1 :)
@@singingbanana It's an eye-opener. I have an ulterior motive for asking: what would you do with it if you owned a copy and wished to pass it along where it would be appreciated? I bought the 1967 hardcover edition and now I'm considering it's disposition as I age.
So the question is: it the export of the Barbie Typewiter (non σ⁰-variant) controlled by the USA Export Administration Regulations because of its encrypting capabilities? It would be even cooler if the BT appears on the US Munitions List :)
Given the programmer(s) seems to have done things simply they may not have truly randomized the symbol groups and you might be able to reverse engineer a simple algorithm they used by looking at the ASCII/ANSI numbers related to the symbols. I didn't see anything obvious at first glance but it was only a quick glance. Also, I didn't look at it in hex or binary which sometimes shows what you wouldn't easily see in normal decimal notation when it comes to ASCII. If you found the algorithm that should mean that you will be able to reverse the scrambling back into the original ASCII order -- with a bit of luck I suspect.
The way I noticed the cyclic pattern and the "repeated recyphering" was by seeing repeated patterns in the cypher chart you showed in your last video (at ua-cam.com/video/7Gwhx-uG5h8/v-deo.html). I first noticed the 5,6,7,8,9 triangle where it seemed like there was a chain of those numbers where one number was always followed below by a the same number: 6 was always above 7, 7 always above 8, 8 above 9. Once I noticed that I tried to apply it to other letters. I found that in all the columns lowercase 'w' was in, it was always followed by a semicolon and was preceded by a 'z'. After that I just spent a minute following one character after another until I went around the whole graph and typed up that mess of characters in my comment. I said in my last comment that the typewriter was just taking the character and outputting the character N spaces to the right of it (where N is the cypher number). That's how I, as a programmer, would implement that kind of cypher. I didn't think of it at the time as applying Cypher 1 N times. I think the commutativity of the cyphers was an unintended side effect caused by the fact that they're just using addition to get the coded character: it doesn't matter if you did 2 then 4, or 5 then 1, or 2 then 3 then 1, all of them add up to 6 so you'd get the character 6 units to the right of where you started.
hey good sir, I had this question about the tic-tac-toe or noughts and crosses and the internet algorithm provided me your video which was 9 years ago... but I had a different question though.... my question was that how many different ways can you completely fill the spaces while rotations reflections and the likes being not allowed but following the game rule... you know you have to stop if X or O wins and there can't be 2 winners(X and O) can you take a look at it please... just for nostalgic sake.....
So you're telling me that if you have letters with a superscript number... If it's a variable then it's exponentiation. If it's a function (e.g. cos) then it's exponentiation after application. But if it's an operator then it's repeated application! Isn't notation abuse fun? :D
You can think of them as matrices as well. It's all mathematically the same, just different notation. Feed from the right is actually just a convention, and some mathematicians do feed from the left.
They are permutations, which you can either think of as functions-so στx is like f(g(x))-or as matrix multiplication-so στx is like **A** times **B** times vector **x**. Both ideas can work, and both are conventionally put the newer steps on the left and older steps on the right.
You can also look at them like functions, and the composition like function composition, same idea. It's just a common convention across disciplines to think of an argument of some sort to go in on the right and go through a chain of operators from right to left.
@@singingbanana The original cipher was probably just generated as a permutation. Many math libraries in programming languages provide a permutation implementation. In Golang, math/rand provides a function `Perm(n int) []int` that simply returns a random ordering of `{0, 1, ..., n-1}`. A permutation can be generated in `O(n)` time and the resulting permutation (an array) can be used to easily scramble indexed values such as string characters. For example, if we defined `const alphabet = "ABC...Z"` and `p` was generated via `rand.Perm(26)`, `alphabet[p[0]]` would map A to some new value (potentially itself). We could then repeat this to get the second cipher's mapping of A via `alphabet[p[p[0]]]`.
- To be honest, I'm a bit surprised they actually bothered to make the cipher like that for a literal toy, I would have thought they'd just make something like rot13 since it's a lot simpler and more suited for children. 🤨 - It's amusing that a toy-manufacturer had to consider such things as cryptography and idempotence. 😂 I suspect someone at Mattel was a mathematician; I'm reminded of how a bunch of writers for _Simpsons_ were highly educated and snuck maths into it. (Do you not use your outro catchphrase anymore? 😕)
"It seems unlikely that buttons bashed together would produce one big cycle" According to this popular youtuber the probability of this about 1/3. ua-cam.com/video/iSNsgj1OCLA/v-deo.html Maybe im applying it wrong? Although its very unlikely for buttons to have ended up in such neat categories one after another, after all.
Kinda baffles me that you are avoiding algebra terms so much. I never understood why (non-maths) people are usually more comfortable with concepts like "inifinity" and "real numbers" than with algebra terms like "finite groups".
I would love for you to do a video on how to "visualize" large numbers. For example, on Wikipedia it gives a timeline of the ultimate fate of the universe. But the numbers are like a google raised to the google or even 10 raised to the 100th raised to the 1000th power. So how to you calculate power to powers and how to visualize such absurdly large timelines, or conversely small timelines if going back.
[megafavnumbers] Hi Jim, I'm guessing you haven't had time to follow up on the contrubutors to the megafavnumbers project two years ago but I have. You may have notices\d then that many participants started UA-cam channels specifically to participate in the project. But you probably don''t know that several have continued to post new content. For an example check out Pete K "MegaFavNumbers 80741592369217430856 One in a Trillion". I think this is a pretty cool unintended result to the project.
Suddenly this makes me want to see an actual Barbie Enigma machine. Like with the plugboard and rotors and everything but hot pink with flowers etc.
If only Hitler had been more in touch with his feminine side.
Then after many years the paint flakes away to reveal swastikas underneath
What a fun niche to be in! I loved hearing the math and science behind my favorites in my collection
I would guess they used this scheme because it saves storage in the firmware. If there were 4 different independent cyphers, they would need 360 bytes of ROM to store them. With just a single base cypher, they only need 90 bytes of ROM space to store the cyphers plus a few bytes of extra code to handle the skip value.
I am sure this is true. I built a spell checker for typewriters. All the manufacturers that used it were obsessed with saving space. Especially if it allowed smaller/fewer ROMs. It was a really big deal when my Italian dictionary took 68K bytes instead of 64k. But what can I do when the inflected list had 1 1/4 million words of average length 14. (Thanks to pronomial suffixes.) Yes this is less than one bit per word🤩.
As a developer, since this is a kid toy, I would not bother making 4 sigmas :
- As they did, you store the string of character (sigma one) in memory and all you have to do is find the index of your letter in this string (called i),
- Then you can easily find the corresponding indexed letter "j" with j = (i + cypher_number)%len(cypher) and you look the character at this position 'j' in the string to get the cypher.
This costs less memory, it's easier to write and implement. Nowadays memory is cheap, back then it was a bit more expensive and to be affordable for a kid toy, it should have been taken in consideration.
Great comment. That makes sense.
I've been watching you for years, and though I rarely understand what you're talking about, your joy and excitement are contagious! 😋😊
You are one of my most interesting people's on UA-cam.
I follow all the main channels
However the content you create is more valuable than an entire week of that.
Ha. I am not sure about that, but it's nice of you to say.
Chaining alphabets is part of the process for solving headline puzzles. I usually don't look at cipher chains unless I'm solving one of those. That was a pretty cool observation.
Always happy to get a banana update. Absolute delight to watch. The passion you have for your field (and tangentially related things to it) is infectious. edit: You've actually got me interested in making a silly web app to let people build their own cyphers. It looks like it would be fairly simple enough to develop.
Nice!
17:25 On the other hand, you could say that your typewriter model performs a sigma^0 cipher, which is the FASTEST to decode!
I will now.
Yes, that is what I expected to see earlier @12:16
σ⁹⁰ = σ⁰ (= 1)
Yay, you're back! Love this type of follow-up videos, what a lovely way to engage with viewers. Lots of awesome people with high attention to detail.
Also wondering how many videos needed to decipher the changing pattern of grey-yellow squares on the wall
My guess is that they have a table of 90 symbols to print, each corresponding to one of 90 values produced by the keys. Then the codes could just be adding a register to the key value and subtracting 90 if necessary before getting the symbol. Even without codes, the key layout isn't necessarily very orderly in terms of the signals it has to send in order to produce the character printed on the key, and they might not have used a second table.
If they had 91 symbols instead of 90, cypher 2 and 3 would each only form a single chain.
And with 90 symbols shouldn't sigma^45 automatically be self-decrypting?
You're right, sigma^45 is self-inverse.
And cypher 4 makes only 2 chains since 90 and 4 have a common divisor 2, not 4.
I guess it's the equivalent of Rot13, which also makes the system equivalent to the Caesar cypher
@@1224chrisng I think the difference is that it's not shifting in alphabetical order - it's shifting along an arbitrary sequence instead. But other than that it works the same way.
From a lazy developer point of view, I think it is more likely they are using four base strings where they shuffled portions uniformly and then used the exact same character replacement based on index order. The decryption cipher would be the exact same with just reversing the source and destination strings. One algo, four strings, and 8 input changes.
Thanks for another lovely video, James!
Cannot explain the hard work writing script to make this vid :-) i spent much times finish my mandelbrot set vid that have only 2 min, good job bro
In re: Speak and Spell's self-inverse code: I was primed to imagine this as a single 26-letter code, but then applied 13 times (i.e. σ^13). I guess this is true for any even n-cycles: that σ^(n/2) can be converted to 2 chains. Or maybe even more generally, for x and y where x is divisible by y, σ^(x/y) can be recoded as chains of length y.
That's right. If you have sigma^n = 1 and n even, then sigma^(n/2) will be self inverse.
The conversion from two-row notation to cyclic notation reminded me of the 100 prisoners problem.
Playing the long game, hanging on to the typewriter until the opportune time. Well played! Very few umms and ahhs--almost like you're a professional speaker. :)
I brought your course and I enjoyed it!
Thank you!
I started learning some abstract algebra, recently, and a lot of this is looking very familiar! I'll just drop a neat fact without proof:
If they included one more cipher, if they were careful about it, they could have made it possible to create every single transposition cipher by just combining the two in different orders!
In fact, one of the dumbest possible ciphers that would work is just swapping "b" and "c", and leaving all the other letters alone.
Oh yeah, good point, they could have.
Your background keeps changing between videos, and now I'm nerd-sniped to figure out if there's a pattern there
What a fun video!
"Thank you to everyone who enjoyed it"
You're welcome, it was my pleasure to enjoy it
Makes me wonder if there is some way to take the machine apart and add the functionality? Then you could have one that has all 90 elements generated by cipher 1 :)
I wonder if the ciphers were done like that to work within the memory constraints of the machine?
I wonder if there is a pattern to the gray squares that change each video.
I was wondering the same thing, haha. Maybe it is a secret message :o
Jim, did you ever hear of David Kahn's _The Codebreakers?_
I have read it. It's very good.
@@singingbanana It's an eye-opener. I have an ulterior motive for asking: what would you do with it if you owned a copy and wished to pass it along where it would be appreciated? I bought the 1967 hardcover edition and now I'm considering it's disposition as I age.
So the question is: it the export of the Barbie Typewiter (non σ⁰-variant) controlled by the USA Export Administration Regulations because of its encrypting capabilities? It would be even cooler if the BT appears on the US Munitions List :)
Do primitive roots modulo N crop up somewhere here?
Given the programmer(s) seems to have done things simply they may not have truly randomized the symbol groups and you might be able to reverse engineer a simple algorithm they used by looking at the ASCII/ANSI numbers related to the symbols. I didn't see anything obvious at first glance but it was only a quick glance. Also, I didn't look at it in hex or binary which sometimes shows what you wouldn't easily see in normal decimal notation when it comes to ASCII. If you found the algorithm that should mean that you will be able to reverse the scrambling back into the original ASCII order -- with a bit of luck I suspect.
Could be!
the self decrypting button is easily done with a single XOR at binary level.
That's true. I didn't think of that. That's probably what the speak and spell was doing. The effect is the same, it makes pairs of letters.
Awesome vid
The way I noticed the cyclic pattern and the "repeated recyphering" was by seeing repeated patterns in the cypher chart you showed in your last video (at ua-cam.com/video/7Gwhx-uG5h8/v-deo.html). I first noticed the 5,6,7,8,9 triangle where it seemed like there was a chain of those numbers where one number was always followed below by a the same number: 6 was always above 7, 7 always above 8, 8 above 9. Once I noticed that I tried to apply it to other letters. I found that in all the columns lowercase 'w' was in, it was always followed by a semicolon and was preceded by a 'z'. After that I just spent a minute following one character after another until I went around the whole graph and typed up that mess of characters in my comment.
I said in my last comment that the typewriter was just taking the character and outputting the character N spaces to the right of it (where N is the cypher number). That's how I, as a programmer, would implement that kind of cypher. I didn't think of it at the time as applying Cypher 1 N times. I think the commutativity of the cyphers was an unintended side effect caused by the fact that they're just using addition to get the coded character: it doesn't matter if you did 2 then 4, or 5 then 1, or 2 then 3 then 1, all of them add up to 6 so you'd get the character 6 units to the right of where you started.
Makes sense that σ⁹⁰=1 because it would be like σ⁰ since it is one encryption step less than σ=σ¹
That works.
rot13 cipher is self inverse
hey good sir, I had this question about the tic-tac-toe or noughts and crosses and the internet algorithm provided me your video which was 9 years ago... but I had a different question though.... my question was that how many different ways can you completely fill the spaces while rotations reflections and the likes being not allowed but following the game rule... you know you have to stop if X or O wins and there can't be 2 winners(X and O) can you take a look at it please... just for nostalgic sake.....
Hi, wikipedia has all the details en.wikipedia.org/wiki/Tic-tac-toe
@@singingbanana thanks man now I just need to figure out how those 138 positions are obtained in this futile game
Now we can hack all stuff written in the Barbie cipher \o/
So you're telling me that if you have letters with a superscript number... If it's a variable then it's exponentiation. If it's a function (e.g. cos) then it's exponentiation after application. But if it's an operator then it's repeated application! Isn't notation abuse fun? :D
The Abelian!
The sigmas in this notation are permutation matrices, right? That's why you feed it from the right and why A*B isn't B*A.
You can think of them as matrices as well. It's all mathematically the same, just different notation. Feed from the right is actually just a convention, and some mathematicians do feed from the left.
They are permutations, which you can either think of as functions-so στx is like f(g(x))-or as matrix multiplication-so στx is like **A** times **B** times vector **x**. Both ideas can work, and both are conventionally put the newer steps on the left and older steps on the right.
You can also look at them like functions, and the composition like function composition, same idea. It's just a common convention across disciplines to think of an argument of some sort to go in on the right and go through a chain of operators from right to left.
@@singingbanana The original cipher was probably just generated as a permutation. Many math libraries in programming languages provide a permutation implementation. In Golang, math/rand provides a function `Perm(n int) []int` that simply returns a random ordering of `{0, 1, ..., n-1}`. A permutation can be generated in `O(n)` time and the resulting permutation (an array) can be used to easily scramble indexed values such as string characters. For example, if we defined `const alphabet = "ABC...Z"` and `p` was generated via `rand.Perm(26)`, `alphabet[p[0]]` would map A to some new value (potentially itself). We could then repeat this to get the second cipher's mapping of A via `alphabet[p[p[0]]]`.
My favourite mathematician. Hilbert who?!
ROT13^2 is good enough for me
A classic.
🤣🤣👍👍🖐️🖐️
- To be honest, I'm a bit surprised they actually bothered to make the cipher like that for a literal toy, I would have thought they'd just make something like rot13 since it's a lot simpler and more suited for children. 🤨 - It's amusing that a toy-manufacturer had to consider such things as cryptography and idempotence. 😂 I suspect someone at Mattel was a mathematician; I'm reminded of how a bunch of writers for _Simpsons_ were highly educated and snuck maths into it.
(Do you not use your outro catchphrase anymore? 😕)
"For sale: Rare σ⁰ variant Barbie cipher machine"
Ha! It is.
Engagement.
"It seems unlikely that buttons bashed together would produce one big cycle" According to this popular youtuber the probability of this about 1/3. ua-cam.com/video/iSNsgj1OCLA/v-deo.html Maybe im applying it wrong? Although its very unlikely for buttons to have ended up in such neat categories one after another, after all.
You didn't end with "and if you have been, thanks for watching"! :O Is everything alright? Should we send someone to check up on you? ;)
Added value for me? Will I have to pay VAT? LOL!
Kinda baffles me that you are avoiding algebra terms so much. I never understood why (non-maths) people are usually more comfortable with concepts like "inifinity" and "real numbers" than with algebra terms like "finite groups".
Yeah, I absolutely hate fun, I think I will unsubscribe from your channel, even though I think math is a real bore.
I would love for you to do a video on how to "visualize" large numbers. For example, on Wikipedia it gives a timeline of the ultimate fate of the universe. But the numbers are like a google raised to the google or even 10 raised to the 100th raised to the 1000th power.
So how to you calculate power to powers and how to visualize such absurdly large timelines, or conversely small timelines if going back.
That would be a good video. I'll keep it in mind.
[megafavnumbers] Hi Jim, I'm guessing you haven't had time to follow up on the contrubutors to the megafavnumbers project two years ago but I have. You may have notices\d then that many participants started UA-cam channels specifically to participate in the project. But you probably don''t know that several have continued to post new content. For an example check out Pete K "MegaFavNumbers 80741592369217430856 One in a Trillion". I think this is a pretty cool unintended result to the project.
This is great to hear, and it was definitely something we hoped would happen.