singingbanana
https://youtube.com/channel/UCMpizQXRt817D0qpBQZ2TlA
Mathematician, juggler and comedy nerd - but not necessarily in that order.
Please keep sending your messages. I do read them all, even if I don't always have time to reply :(
- JimTV & FilmPodsync generator (support us at https://github.com/mxpv/podsync)en-usFri, 16 Aug 2024 00:00:30 +0000Sun, 26 Mar 2006 22:32:01 +0000https://yt3.ggpht.com/ytc/AIdro_m7cUM-pyMSbPJqBYl9M8P0BW4uHhNpQATlvGKGt7ELcg=s800-c-k-c0x00ffffff-no-rjsingingbanana
https://youtube.com/channel/UCMpizQXRt817D0qpBQZ2TlA
singingbananasingingbananano3mrmSkK_fF4Follow-up: Birthday Magic Square
https://youtube.com/watch?v=3mrmSkK_fF4
This is my follow-up video to my birthday magic squares video
https://youtu.be/hNn0j4Kay8g
---
Yeah, I know the audio is messed up. It's not the mic, it's because I recorded via OBS, and that messed up the audio. Sometimes it's difficult to get all the tech working. I tried.
If the audio is really hurting your ears, I process the audio a bit and made an unlisted version of this video with different audio https://youtu.be/ah4WplJqaDA
At 2:20 I point at a group of four and say it adds to 43. That was a mistake.
At 27:40 I said April but typed in 03. Whoops.
---
Here is my excel spreadsheet for creating birthday magic squares
https://singingbanana.com/birthdaymagicsquarescreator.xlsx
Here is the page by Christian Lawson-Perfect
https://somethingorotherwhatever.com/birthday-magic-square/
And I forgot to say that Christian is occasionally available to make things like this for commission.
Wikipedia: https://en.wikipedia.org/wiki/Magic_square
Euler's method: https://en.wikipedia.org/wiki/Magic_square#Method_of_superposition
pandiagonal squares: https://en.wikipedia.org/wiki/Pandiagonal_magic_square
And here are the videos for Further Maths Wales:
https://www.youtube.com/playlist?list=PL0ThtFmyYmsslQn1M1KHmHwYBKBsEZG5eMon, 05 Dec 2022 15:58:14 +0000singingbananaFollow-up: Birthday Magic Square56:56no1hNn0j4Kay8gHow to make a Birthday Magic Square
https://youtube.com/watch?v=hNn0j4Kay8g
A birthday magic square is a special type of magic square that uses someone's birth date in the top row. Then every row, column, and main diagonal add up to the special birthday number - and a whole lot of other magic properties as well!
-----
Notes:
Some people have realised it isn't always possible to make a birthday magic square that avoid negative values or repeats.
In fact, if your total is less than 34, then you will either have repeats or negative values.
Since a total less than 34 is unavoidable for some birth dates, I advise you don't worry about it.
But if you embrace negative values, I think you can always avoid (additional) repeats.Sun, 20 Nov 2022 14:05:03 +0000singingbananaHow to make a Birthday Magic Square7:35no2-vvhwLTuK6MFollow-up: Barbie electronic typewriter
https://youtube.com/watch?v=-vvhwLTuK6M
Here is a copy of the description from the Barbie video:
----
I first found this story on the crypto museum website, which has great information about the Barbie typewriter (and other cipher machines) https://www.cryptomuseum.com/crypto/mehano/barbie/
-------
Thanks to Sarah Everett from Just My Typewriter, check out her channel here: https://www.youtube.com/c/JustMyTypewriter
And Sarah's own Barbie video here: https://youtu.be/axgzXdN-3lo
-------
Here's the link for my cryptography course: https://singingbanana.com/codescourse
And in case you have any problems with that link, here is the long link https://www.udemy.com/course/the-mathematics-of-cryptography-with-dr-james-grime/learn/lecture/28599464?referralCode=A9E03BB265345A92B6C4
Make sure you use my link because it includes my referral code.
------
UPDATES FROM THE COMMENTS
The most important update comes from a comment by Rosie Fay, who spotted that cipher 1 is just a cycle on 90 symbols.
What does that mean? We often write codes in two-row notation like this
Plaintext: ABCDE
Ciphertext: DAEBC
But we can write that as two chains: A becomes D becomes B becomes A, and C becomes E becomes C.
Or more compactly we write (ADB)(CE).
Barbie cipher 1, is just one long chain, using 90 symbols, like this:
mjvgxdlbcorneaithsfpuqkyzw;¢+%:,W.MZBFCA (right angle bracket) RSETHONILDUGYPQKJV (left angle bracket) X1234056789-¨§£€='_)(*#@?/^!&"
YouTube doesn't allow the angled brackets in the description so I wrote them out, but that is meant to be one chain of 90 symbols.
Rosie Fay then also spotted that cipher 2 is cipher 1 applied twice (we call that the second power).
Cipher 3 is cipher 1 applied three times (third power).
And cipher 4 is cipher 1 applied four times (fourth power).
So there are some fun things we can discover from this.
1. We can apply the ciphers in any order, and order does not matter (they are commutative).
For example, cipher 2 followed by cipher 4 is the same as cipher 4 followed by cipher 2. In fact they are both equal to cipher 1 applied six times.
2. If you applied cipher 1 90 times, you would get back to the original message.
3. The decryption cipher for cipher 1 is cipher 1 to the 89th power.
The decryption cipher for cipher 2 is cipher 1 to the 88th power.
The decryption cipher for cipher 3 is cipher 1 to the 87th power.
The decryption cipher for cipher 4 is cipher 1 to the 86th power.
And you could think of these as eight different ciphers. But they work in pairs to code and decode.Mon, 01 Aug 2022 15:36:05 +0000singingbananaFollow-up: Barbie electronic typewriter20:20no37Gwhx-uG5h8The Barbie electronic typewriter - with Just My Typewriter
https://youtube.com/watch?v=7Gwhx-uG5h8
I first found this story on the crypto museum website, which has great information about the Barbie typewriter (and other cipher machines) https://www.cryptomuseum.com/crypto/mehano/barbie/
-------
Thanks to Sarah Everett from Just My Typewriter, check out her channel here: https://www.youtube.com/c/JustMyTypewriter
And Sarah's own Barbie video here: https://youtu.be/axgzXdN-3lo
-------
Here's the link for my cryptography course: https://singingbanana.com/codescourse
And in case you have any problems with that link, here is the long link https://www.udemy.com/course/the-mathematics-of-cryptography-with-dr-james-grime/learn/lecture/28599464?referralCode=A9E03BB265345A92B6C4
Make sure you use my link because it includes my referral code.
------
UPDATES FROM THE COMMENTS
The most important update comes from a comment by Rosie Fay, who spotted that cipher 1 is just a cycle on 90 symbols.
What does that mean? We often write codes in two-row notation like this
Plaintext: ABCDE
Ciphertext: DAEBC
But we can write that as two chains: A becomes D becomes B becomes A, and C becomes E becomes C.
Or more compactly we write (ADB)(CE).
Barbie cipher 1, is just one long chain, using 90 symbols, like this:
mjvgxdlbcorneaithsfpuqkyzw;¢+%:,W.MZBFCA (right angle bracket) RSETHONILDUGYPQKJV (left angle bracket) X1234056789-¨§£€='_)(*#@?/^!&"
YouTube doesn't allow the angled brackets in the description so I wrote them out, but that is meant to be one chain of 90 symbols.
Rosie Fay then also spotted that cipher 2 is cipher 1 applied twice (we call that the second power).
Cipher 3 is cipher 1 applied three times (third power).
And cipher 4 is cipher 1 applied four times (fourth power).
So there are some fun things we can discover from this.
1. We can apply the ciphers in any order, and order does not matter (they are commutative).
For example, cipher 2 followed by cipher 4 is the same as cipher 4 followed by cipher 2. In fact they are both equal to cipher 1 applied six times.
2. If you applied cipher 1 90 times, you would get back to the original message.
3. The decryption cipher for cipher 1 is cipher 1 to the 89th power.
The decryption cipher for cipher 2 is cipher 1 to the 88th power.
The decryption cipher for cipher 3 is cipher 1 to the 87th power.
The decryption cipher for cipher 4 is cipher 1 to the 86th power.
And you could think of these as eight different ciphers. But they work in pairs to code and decode.Tue, 21 Jun 2022 14:40:10 +0000singingbananaThe Barbie electronic typewriter - with Just My Typewriter10:25no4ApsmQwAhPwYFollow-Up: Finite Difference Method
https://youtube.com/watch?v=ApsmQwAhPwY
Original Video here: https://youtu.be/scQ51q_1nhw
Videos mentioned:
James Tanton https://youtu.be/_5vU48kf7NY
Mathologer https://youtu.be/4AuV93LOPcE
More on Gilbreath's conjecture here: https://primes.utm.edu/glossary/page.php?sort=GilbreathsConjecture
Here is finite differences on wikipedia
https://en.wikipedia.org/wiki/Finite_difference#Newton's_series
I didn't mention:
Max Peeters gave the following interesting comment:
"John Conway and Richard Guy explain how this method can be further extended in their book 'The Book of Numbers'. They share 2 of them, the first works for simple exponential functions as well (such as 4^n - 3^n), and the second works for sequences where each term is a sum of previous terms (like Fibonnaci's sequence).
For anyone interested: wolfram has info on both of them, they're called "Jackson's Difference Fan" and "Quotient-Difference Table"."
https://mathworld.wolfram.com/JacksonsDifferenceFan.html
https://mathworld.wolfram.com/Quotient-DifferenceTable.htmlMon, 13 Jun 2022 13:17:49 +0000singingbananaFollow-Up: Finite Difference Method16:44no5scQ51q_1nhwThe Finite Difference Method
https://youtube.com/watch?v=scQ51q_1nhw
Find a polynomial with the finite difference method. Take successive differences of a sequence to find the polynomial that made it.
Let me try to anticipate some questions:
1. What if we have a sequence that doesn't start at x = 0?
There's a general form of Newton's Forward Difference Formula for a sequence that starts at x = a, with 1 unit steps. Here it is on wikipedia
https://en.wikipedia.org/wiki/Finite_difference#Newton's_series
2. What if the steps are not unit steps?
There is an even more general form of Newton's Forward Difference Formula for a sequence that starts at x = a and has equally spaced steps of size h. You can see it on wikipedia at the end of the Newton series section here https://en.wikipedia.org/wiki/Finite_difference#Newton's_series
3. The finite difference method leads to a whole branch of maths called finite difference calculus.
In finite difference calculus, the difference operator (that I called D(x)) is analogous to differentiation.
Then, Newton's Difference Formula is analogous to Taylor series, and there is a whole bunch of other formulas that are analogous to calculus. But it's all for polynomials rather than any analytic function.
4. I want more YouTube videos about the finite difference method please!
James Tanton did a great one here, very approachable description of the idea https://youtu.be/_5vU48kf7NY
And Mathologer has gone into more of the details, especially the connection to calculus, here https://youtu.be/4AuV93LOPcE
5. Are a few constants enough to know we have a polynomial?
Unfortunately, you might have something that looks like a row a constants, but it is not guarantee that the procedure has finished. The formula you end up with will fit the data you currently have.
So, if it is a mystery formula, then what you have is a good guess.
For example, we could start with a sequence for x^2: 0, 1, 4, 9, 16, ...
And the finite difference method will find the formula f(x) = x^2.
But if we want to be naughty, we could add any random number to the end of that sequence:
0, 1, 4, 9, 16, 73, ....
And now we get the formula: f(x) = x + x(x-1) + (48/120)(x)(x-1)(x-2)(x-3)(x-4) = (48x)/5 - 19x^2 + 14x^3 - 4x^4 + (2x^5)/5.
This agrees with x^2 for the first few values, and then gives the value 73.
6. Max Peeters gave the following interesting comment:
"John Conway and Richard Guy explain how this method can be further extended in their book 'The Book of Numbers'. They share 2 of them, the first works for simple exponential functions as well (such as 4^n - 3^n), and the second works for sequences where each term is a sum of previous terms (like Fibonnaci's sequence).
For anyone interested: wolfram has info on both of them, they're called "Jackson's Difference Fan" and "Quotient-Difference Table"."
https://mathworld.wolfram.com/JacksonsDifferenceFan.html
https://mathworld.wolfram.com/Quotient-DifferenceTable.html
7. I think I buried one of the most interesting things about this method, that this is how the Charles Babbage Difference Engine worked. See wikipedia for all its history, and a description of how it worked by differences (basically what I said in the video) https://en.wikipedia.org/wiki/Difference_engine#Charles_Babbage's_difference_engines
8. I like the handwritten notes style, and I like that they are imperfect. But the formula at 3:49 looks a bit blobby. It says f(x) = (D^(2)(0)/2)x^2 + (D(0) - D^(2)(0)/2)x + D^(0)(0). And that can then be rearranged to say f(x) = D^(2)(0) (x(x-1)/2) + D(0)(x) + D^(0)(0).
9. Oh and if you want to check your answer for hexagonal numbers, here it is:
https://en.wikipedia.org/wiki/Hexagonal_numberTue, 07 Jun 2022 11:22:39 +0000singingbananaThe Finite Difference Method8:34no6OaTnZXaFTBcFollow-up: British Flag Theorem
https://youtube.com/watch?v=OaTnZXaFTBc
UPDATE: I've had a think about those integer solutions rectangles. Here is one way to construct the rectangle.
Take two pythagorean triples: (u, v, w) and (x, y, z);
Then we can make four pythagorean triples that fit together, namely (ux, vx, wx), (vx, vy, vz), (uy, vy, wy), (uy, ux, uz).
It turns out that's how I made my example, with (u, v, w) = (12, 35, 37) and (x, y, z) = (3, 4, 5).
I don't know if there are other ways to do it.
Richard Holmes wonders whether this is the only way to construct the rectangles, but found a counterexample: (25, 60, 65), (25, 312, 313), (91, 312, 325), (60, 91, 109)
These are four genuinely different pythag triples. I don't know how to make other examples like this.
Oh, and as supermarc45 pointed out in the comments, you could solve it using 8 copies of one pythagorean triple. I knew that, of course, but that would be boring.
--
Here is the original video https://youtu.be/scZMQEHEt1w
And here is the description from that video, copied over to this one:
1. Is there a 3d version of this?
There is. First of all, the point can be above/below a rectangle, and if we connect the four corners to the point (now in 3d space), it is still true.
But also, I've just checked for a cuboid and it's still true. If AB is a space diagonal (for example, from the bottom left corner of the cuboid to the top right corner of the opposite face), and CD the other space diagonal (for example, bottom right to top left of opposite face), then a^2 + b^2 = c^2 + d^2. You can prove that by splitting the height, width, and depth into u, v, w, x, y, z and doing 3d pythagoras on that. The two sides are equal to u^2 + v^2 + w^2 + x^2 + y^2 + z^2.
2. Can this be done for a parallelograms?
There is a version for parallelograms, although a^2 + b^2 does not equal c^2 + d^2. Instead, the two sides differ by a value that is independent of the choice of point. (I will leave that as a challenge for you, I might do the answer in a follow-up video).
2a. ironpencil observes that if we place two copies of the rectangle, side-by-side, then the diagonals a, b, c, d form a quadrilateral with orthogonal diagonals. In that case a and b are opposite sides, c and d are opposite sides and a^2 + b^2 = c^2 + d^2.
The diagonals would have length (w+x) and (y+z), and the area of the quadrilateral will be (w+x)(y+z)/2.
3. Can we make w, x, y, z and diagonals a, b, c, d all integers?
You can! If (w, z, a) are all integers, it is called a pythagorean triple. We need to find four pythagorean triples, (w, z, a), (x, y, b), (w, y, c) and (x, z, d) so they can fit together to make a rectangle. That's how I made my example, with pythagorean triples (280, 210, 350), (72, 96, 120), (280, 96, 296) and (72, 210, 222), making a 352 by 306 rectangle.
UPDATE: I've had a think about those integer solutions rectangles. Here is one way to construct the rectangle.
Take two pythagorean triples: (u, v, w) and (x, y, z);
Then we can make four pythagorean triples that fit together, namely (ux, vx, wx), (vx, vy, vz), (uy, vy, wy), (uy, ux, uz).
It turns out that's how I made my example, with (u, v, w) = (12, 35, 37) and (x, y, z) = (3, 4, 5).
I don't know if there are other ways to do it.
Oh, and as supermarc45 pointed out in the comments, you could solve it using 8 copies of one pythagorean triple. I knew that, of course, but that would be boring.
4. What other flag theorems could we have?
Here is the Dutch National Flag Problem: https://en.wikipedia.org/wiki/Dutch_national_flag_problem
And someone suggested pythagoras is the Trinidad and Tobago flag theorem https://en.wikipedia.org/wiki/Flag_of_Trinidad_and_Tobago
5. How can pythagoras be a special case of the British Flag Theorem, when you use pythag to prove the British Flag Theorem?
We could prove the British Flag Theorem the same way we prove pythag, without using pythag itself. There are a few hundred ways to do that, take your pick. In other words, Pythag and BFT are equivalent theorems.
6. Is there some sort of British celebration going on?
There is. The Queen has been queen for 70 years. For the record, I'm not bothered about that, but there will be lots of flags about and I'm using that as an excuse to talk about maths.Wed, 01 Jun 2022 14:57:32 +0000singingbananaFollow-up: British Flag Theorem13:56no7scZMQEHEt1wThe British Flag Theorem
https://youtube.com/watch?v=scZMQEHEt1w
The British Flag Theorem connects any point to the corners of a rectangle to calculate distances.
It turns out I don't know how to salute. The Royal Navy salute that way if that makes you feel better.
I would appreciate it if you kept the comments light. Reading lots of hot takes isn't much fun for me.
UPDATE: Follow-up video here: https://youtu.be/OaTnZXaFTBc
Some good questions, and answers, from the comments:
1. Is there a 3d version of this?
There is. First of all, the point can be above/below a rectangle, and if we connect the four corners to the point (now in 3d space), it is still true.
But also, I've just checked for a cuboid and it's still true. If AB is a space diagonal (for example, from the bottom left corner of the cuboid to the top right corner of the opposite face), and CD the other space diagonal (for example, bottom right to top left of opposite face), then a^2 + b^2 = c^2 + d^2. You can prove that by splitting the height, width, and depth into u, v, w, x, y, z and doing 3d pythagoras on that. The two sides are equal to u^2 + v^2 + w^2 + x^2 + y^2 + z^2.
2. Can this be done for a parallelograms?
There is a version for parallelograms, although a^2 + b^2 does not equal c^2 + d^2. Instead, the two sides differ by a value that is independent of the choice of point. (I will leave that as a challenge for you, I might do the answer in a follow-up video).
UPDATE: I did https://youtu.be/OaTnZXaFTBc
2a. ironpencil observes that if we place two copies of the rectangle, side-by-side, then the diagonals a, b, c, d form a quadrilateral with orthogonal diagonals. In that case a and b are opposite sides, c and d are opposite sides and a^2 + b^2 = c^2 + d^2.
The diagonals would have length (w+x) and (y+z), and the area of the quadrilateral will be (w+x)(y+z)/2.
3. Can we make w, x, y, z and diagonals a, b, c, d all integers?
You can! If (w, z, a) are all integers, it is called a pythagorean triple. We need to find four pythagorean triples, (w, z, a), (x, y, b), (w, y, c) and (x, z, d) so they can fit together to make a rectangle. That's how I made my example, with pythagorean triples (280, 210, 350), (72, 96, 120), (280, 96, 296) and (72, 210, 222), making a 352 by 306 rectangle.
UPDATE: I've had a think about those integer solutions rectangles. Here is one way to construct the rectangle.
Take two pythagorean triples: (u, v, w) and (x, y, z);
Then we can make four pythagorean triples that fit together, namely (ux, vx, wx), (vx, vy, vz), (uy, vy, wy), (uy, ux, uz).
It turns out that's how I made my example, with (u, v, w) = (12, 35, 37) and (x, y, z) = (3, 4, 5).
I don't know if there are other ways to do it.
Richard Holmes wonders whether this is the only way to construct the rectangles, but found a counterexample: (25, 60, 65), (25, 312, 313), (91, 312, 325), (60, 91, 109)
These are four genuinely different pythag triples. I don't know how to make other examples like this.
Oh, and as supermarc45 pointed out in the comments, you could solve it using 8 copies of one pythagorean triple. I knew that, of course, but that would be boring.
4. What other flag theorems could we have?
Here is the Dutch National Flag Problem: https://en.wikipedia.org/wiki/Dutch_national_flag_problem
And someone suggested pythagoras is the Trinidad and Tobago flag theorem https://en.wikipedia.org/wiki/Flag_of_Trinidad_and_Tobago
5. How can pythagoras be a special case of the British Flag Theorem, when you use pythag to prove the British Flag Theorem?
We could prove the British Flag Theorem the same way we prove pythag, without using pythag itself. There are a few hundred ways to do that, take your pick. In other words, Pythag and BFT are equivalent theorems.
6. Is there some sort of British celebration going on?
There is. The Queen has been queen for 70 years. For the record, I'm not bothered about that, but there will be lots of flags about and I'm using that as an excuse to talk about maths.Tue, 24 May 2022 14:00:50 +0000singingbananaThe British Flag Theorem2:42no8FR_71HyBytEMastermind with Steve Mould
https://youtube.com/watch?v=FR_71HyBytE
Thanks Steve! https://www.youtube.com/c/SteveMould
Play online: https://codebreaker.eoin.co/
Thanks Eoin.
Word Mastermind: https://stressfle.nikolaus.uk/
Thanks Alex.
I recommend these apps for Android:
Mastermind (but called Bulls and Cows) shorturl.at/uvxNU
Bulls and Cows shorturl.at/ekF12
----------------
Let's go through some Mastermind algorithms. Here are two human methods:
Randomly Consistent: Picking any remaining valid combination at random. (Swaszek 1999).
FIRST GUESS = ANY, MAX = 10, AVG = 4.638.
Here is an example of 10 consistent guesses: https://www.cut-the-knot.org/ctk/Rafler.shtml
Randomly Consistent can be improved with FIRST GUESS = 1123, then MAX = 9 and AVG = 4.58.
Simple: This algorithm just goes through the combinations in numerical order from 1111 to 6666, and picking the next consistent combination. (Shapiro 1983).
FIRST GUESS: 1111, MAX = 9, AVG = 5.765
This method can be improved with a FIRST GUESS = 5466, then MAX = 7, AVG = 4.646.
----------------
Here is the Least Worst Case Scenario method:
Least Worst Case Scenario (simple): Consider the table of responses at each step, and choose a combination (from the remaining combinations) with the least worse case scenario. (Norvig 1984).
FIRST GUESS = 1122, MAX = 6, AVG = 4.478
Least Worst Case Scenario (full): Consider the table of responses at each step, and choose the combination (from all combinations) with the least worse case scenario. (Donald Knuth 1977).
FIRST GUESS = 1122, MAX = 5, AVG = 4.476.
***CORRECTION: I said 4.478 not 4.476 in the video. I mixed up the two Worst Case Scenario methods***
In Knuth's paper, he gives an example of a game that needs an inconsistent move to guarantee a solve in 5 steps.
https://www.cs.uni.edu/~wallingf/teaching/cs3530/resources/knuth-mastermind.pdf
Using Least Worst Algorithm the most difficult codes are 1221, 2354, 3311, 4524, 5656, 6643.
----------------
Here are some other methods:
Expected Case: Consider the table of responses, and choose the combination with the smallest average scenario. (Irving 1979).
FIRST GUESS 1123, MAX = 6, AVG = 4.395.
Entropy: Using the table of responses, maximise entropy. (Neuwirth, 1982).
FIRST GUESS 1234, MAX = 6, AVG = 4.415.
Entropy is an idea from Information Theory and is quite technical. 3b1b goes into it in detail in his wordle video here: https://youtu.be/v68zYyaEmEA
Most Parts: Using the table of responses, pick the choice with the most non-zero parts. (Kooi 2005).
FIRST GUESS = 1123, MAX = 6, AVG = 4.374.
The idea here is to divide the remaining possibilities into as many buckets as possible. This increases the probability of a lucky guess.
Interestingly, this method performs well in the 4-digit, 6 colour mastermind, but not as well with other numbers of digits and colours.
----------------
And here is the Optimal method:
Optimal: Deep search to create a look-up table that gives the lowest average. (Koyoma and Lai 1993).
FIRST GUESS = 1123, MAX = 6, AVG = 4.340.
Interesting fact, there is only one combination that takes 6 steps, (namely 4421).
Adjusted Optimal: Deep search to find the lowest average, with a max of 5. (Koyoma and Lai 1993).
FIRST GUESS = 1123, MAX = 5, AVG = 4.341.
This is something that got edited out of the video for time. With a few adjustments, the optimal max is reduced to 5, with a tiny increase to the average.
----------------
Here is another humanly possible method, which I think is fun, but is very different:
Static Mastermind: A set of 6 fixed combinations, that can completely determine any secret combination on the seventh step.
GUESSES = 1212, 2263, 3344, 4554, 5316, 6156.
Here is the article: https://www.cut-the-knot.org/ctk/Mastermind.shtml
(My list is different to the article, because I tried to make it more memorable).
----------------
Bulls and Cows: The original game. Using pen and paper, a 4-digit number is chosen without repeats.
Random: FIRST GUESS = ANY, MAX = 8, AVG = 5.445
Least Worst Case: FIRST GUESS = 1234, MAX = 7, AVG = 5.380
Optimal: FIRST GUESS = 1234, MAX = 7, AVG = 5.213
----------------
Generalisations: What about mastermind using n positions, and k colours?
We have partial information about maximums and averages. There is a good summary here https://people.cs.clemson.edu/~goddard/papers/mastermindRevisited.pdf
----------------
Further information:
I found good information and references here: https://mathworld.wolfram.com/Mastermind.html
And here: http://www.serkangur.freeservers.com/
And wikipedia, obviously: https://en.wikipedia.org/wiki/Bulls_and_Cows
https://en.wikipedia.org/wiki/Mastermind_(board_game)
I then got the book by Serkan Gur and I thought it was excellent: https://www.amazon.com/dp/B01M17PMIQ
Serkan kindly helped me out with some of the details. Thank you Serkan.Sun, 20 Mar 2022 08:00:42 +0000singingbananaMastermind with Steve Mould20:27no951fD3FEoskIIntroducing MathsCity Leeds
https://youtube.com/watch?v=51fD3FEoskI
Introducing MathsCity Leeds, the UK's first hands-on maths discovery centre. Step inside a giant bubble, explore our laser ring of fire, and solve our hands-on puzzle challenges.
MathsCity Leeds can be found in the Trinity shopping centre, on the first floor, between Boots and Customer Services.
Find out more and book tickets online at https://www.mathscity.co.ukFri, 01 Oct 2021 15:30:21 +0000singingbananaIntroducing MathsCity Leeds1:43no10kVs9nFhcX_8A MegaFavNumbers Thank You!
https://youtube.com/watch?v=kVs9nFhcX_8
See the full #MegaFavNumbers playlist here https://www.youtube.com/playlist?list=PLar4u0v66vIodqt3KSZPsYyuULD5meoAoTue, 08 Sep 2020 15:37:43 +0000singingbananaA MegaFavNumbers Thank You!1:49no11R2eQVqdUQLIMegaFavNumbers - The Even Amicable Numbers Conjecture
https://youtube.com/watch?v=R2eQVqdUQLI
This video is part of the MegaFavNumbers project. Maths YouTubers have come together to make videos about their favourite numbers bigger than one million, which we are calling #MegaFavNumbers.
We want *you*, the viewers, to join in! Make your own video about your favourite mega-number. You can think of a cool big number, or think of a cool topic first and hang a mega-number on it.
Upload your videos to YouTube with the hashtag #MegaFavNumbers and with MegaFavNumbers in the title, and your video will be added to the megafavnumbers playlist.
Submit your videos anytime before Wednesday 2nd September to be added to the MegaFavNumbers playlist!
MegaFavNumbers Playlist: https://www.youtube.com/playlist?list=PLar4u0v66vIodqt3KSZPsYyuULD5meoAo
Amicable Numbers on Wikipedia:
https://en.wikipedia.org/wiki/Amicable_numbers
Here is a list of amicable numbers:
http://www.vaxasoftware.com/doc_eduen/mat/numamigos_eng.pdf
A list of sums of amicable numbers
https://oeis.org/A180164
Remember, a test for divisibility by 9 is to add all the digits of the number together, and to do the same with the result, until you get a single digit. If the end result is 9 then the original number was a multiple of 9.
Here is a list of even amicable numbers whose sum is not divisible by 9 https://oeis.org/A291550
And here are those complicated mathematical conditions
https://www.ams.org/journals/mcom/1969-23-107/S0025-5718-1969-0248074-6/S0025-5718-1969-0248074-6.pdfWed, 19 Aug 2020 14:00:06 +0000singingbananaMegaFavNumbers - The Even Amicable Numbers Conjecture5:54no12y_LKxvjuiSgI'm making videos on MathsWorldUK and this is me telling you about it
https://youtube.com/watch?v=y_LKxvjuiSg
See the videos at https://www.youtube.com/user/MathsWorldUK
At the moment, we've made 12 and they will be released over the next few weeks.
Here's more about MathsWorldUK http://mathsworlduk.com/Fri, 12 Jun 2020 13:12:34 +0000singingbananaI'm making videos on MathsWorldUK and this is me telling you about it1:44no13rwtDBhD6Mq0Bayes Billiards with Tom Crawford
https://youtube.com/watch?v=rwtDBhD6Mq0
Bayes' Theorem allows us to assign a probability to an unknown fact.
Thomas Bayes himself described an experiment with a billiard table, which is brilliantly explained by Hannah Fry and Matt Parker here https://www.youtube.com/watch?v=7GgLSnQ48os
Brian Cox and David Spiegelhalter did a 1-dimensional version similar to our experiment here https://www.youtube.com/watch?v=-e8wOcaascM
After we filmed this video, 3blue1brown released his own Bayesian video https://www.youtube.com/watch?v=HZGCoVF3YvM
For more of Tom Crawford see his channel https://www.youtube.com/tomrocksmaths
Our experiment failed pretty badly really. For some behind-the-scenes information, this was our third attempt at the experiment, the first two were a little slow. The previous attempts were a lot more accurate. Oh well.
Why did we fail? Maybe because the balls were colliding they were not independent. Maybe Tom wasn't random enough. In which case, our assumption that each position is equally likely could be updated.
For more information on this experiment see https://www.nature.com/articles/nbt0904-1177
The main point, I believe, is that for limited data, the Bayesian approach (using the average estimate) is more accurate.
Viewer, Penny Lane, has run a simulation of this experiment, which did show that Bayesian was slightly more accurate than Frequentist (so this real-life attempt was probably a toss up for who did best):
"Here's the output of my script:
simulated 14 balls 10000000 times
the Bayesian approach won over the Frequentist one 50.44934% of the times
6.65762% of the simulations were ties, so 42.89304% were Frequentist wins
the mean deviation from the real value for the Bayesian approach was: 0.0800043179873167
the mean deviation from the real value for the Frequentist approach was: 0.08422584547321381"
See the comment here http://youtube.com/watch?v=rwtDBhD6Mq0&lc=UgzUC4MfbeHpIPQsBSR4AaABAg
And code here https://pastebin.com/yyCjtnEu
Another comment I liked talked about what would happen if all the balls had been to the right. In that case the frequentist approach would put the position on the extreme left, p=0. While the Bayesian approach would put the position at p = 1/16 = 0.0625, so a little way from the extreme. And that sounds sensible.
People who read the description are the best people. If you have read this, I probably need cheering up after the failure of this experiment, so tell me a joke in the comments. Thanks.Fri, 24 Jan 2020 12:08:04 +0000singingbananaBayes Billiards with Tom Crawford15:00no14b52sCDFlRuoHelp us make a maths discovery centre in the UK
https://youtube.com/watch?v=b52sCDFlRuo
I'm talking to Dr Katie Chicot CEO of Maths World UK ( http://mathsworlduk.com/ ) - an organisation dedicated to creating a maths discovery centre in the UK.
Although maths discovery centres exist in other countries we have nothing like it in the UK, that is what Maths World UK want to change.
We ask for your ideas for what you would like to see in a maths discovery centre and show off a few puzzles and pretty mathematical objects.
At the moment Maths World UK has funding to creating a travelling exhibition that will be visiting science centres. Maths World UK are currently looking for funding to create a permanent home.
I really want to see a maths discovery centre in UK, but at the moment we have no permanent home. So if you know any friendly millionaires, let them know. (That's not a joke, that's what we need).Fri, 26 Apr 2019 12:22:21 +0000singingbananaHelp us make a maths discovery centre in the UK8:27no15_PyPOXXPIJQA Pythagorean Theorem for Pentagons + Einstein's Proof
https://youtube.com/watch?v=_PyPOXXPIJQ
Pythagoras's Theorem is the most famous theorem in mathematics, commonly stated as "the square on the hypotenuse of a right-angled triangle is equal to the sum of the squares on the other two sides."
However, Pythagoras's Theorem is not just for squares. In fact it works for any shape.
The proof relies on the fact that scaling a shape by c will scale the area by c^2. Then, if Pythagoras's Theorem is true then the area of the shape on the hypotenuse will be equal to the total areas of the similar shapes on the other two sides.
More succinctly, if Pythagoras's Theorem is true then the areas will be equal.
But we can prove Pythagoras's Theorem itself by running that argument in reverse - if the shapes have equal area then Pythagoras's Theorem is true.
This is an argument an 11 year old Albert Einstein used to prove Pythagoras's Theorem for himself.
There are a couple of things I wished I said clearer in the Einstein proof:
The Einstein proof divides the triangle so we have three right-angled triangles (but I think that was clear from the picture)
Secondly, the three triangles are scaled versions of a triangle with a hypotenuse of length 1 and area X, which then have areas scaled by a^2, b^2 and c^2. (I just said "some triangle").
This topic has been done before by a couple of the big maths YouTube channels, which I didn't know at the time (or forgot).
Numberphile did it in 2014 https://www.youtube.com/watch?v=ItiFO5y36kw
And Mathologer did it in 2018 https://www.youtube.com/watch?v=p-0SOWbzUYI
A little historical note, Pythagoras's Theorem appears twice in Euclid's Elements, the famous squares version appears in Book 1.47, and in Book 6.31 it is there again, this time for any shape.Tue, 02 Apr 2019 14:07:22 +0000singingbananaA Pythagorean Theorem for Pentagons + Einstein's Proof6:53no16MTf_WcKUg2YFermat's Last Theorem for rational and irrational exponents
https://youtube.com/watch?v=MTf_WcKUg2Y
Fermat's Last Theorem states the equation x^n + y^n = z^n has no integer solutions for positive integer exponents greater than 2. However, Fermat's Last Theorem says nothing about exponents that are not positive integers.
Note: x, y and z are meant to be positive integers, which I should have said in the video. Whoops.
This video introduces some results for rational and irrational exponents.
For rational exponents, k/m, k must be equal to 1 or 2.
If we allow complex roots, then we have strange solutions with x=y=z and m divisible by 6.
For irrational exponents no general results exist but we know there are infinitely many integer solutions, in this video I give a couple of examples.
Many of the examples in this video, as well as the proof for rational exponents, were taken from this paper by Frank Morgan (2010) https://www.maa.org/sites/default/files/pdf/cmj_ftp/CMJ/May%202010/3%20Articles/1%20Morgan/Morgan9_5_09.pdf
Here is another description of the same proof, with a bit more detail https://www.math.leidenuniv.nl/~hwl/PUBLICATIONS/1992d/art.pdf
Another proof for rational exponents is here, as well as the result with complex roots, by Bennett, Glass, Székely (2004)
https://digitalcommons.lmu.edu/cgi/viewcontent.cgi?referer=&httpsredir=1&article=1103&context=math_fac
The result for rationals seems to have been first proven by R. Oblath. Quelques proprietes arithmetiques des radicaux (Hungarian). In Comptes Rendus du Premier Congres des Mathematiciens Hongrois, 27 Aout–2 Septembre 1950, pages 445–450. Akad´emiai Kiado,
Budapest, 1952.Wed, 27 Feb 2019 12:35:21 +0000singingbananaFermat's Last Theorem for rational and irrational exponents7:18no17AsYfbmp0To0The Elo Rating System for Chess and Beyond
https://youtube.com/watch?v=AsYfbmp0To0
The Elo Rating system is a method to rate players in chess and other competitive games. A new player starts with a rating of 1000. This rating will go up if they win games, and go down if they lose games. Over time a player's rating becomes a true reflection of their ability - relative to the population.
My video was mostly based on A Comprehensive Guide to Chess Ratings by Prof Mark E Glickman http://www.glicko.net/research/acjpaper.pdf
Below are some of the things I wanted to talk about, but cut so the video wasn't too long!
Some explanations of the Elo rating system say it is based on the normal distribution, which is not quite true. Elo's original idea did model each player's ability as a normal distribution. The difference between the two players strengths would then also be a normal distribution. However, the formula for a normal distribution is a bit messy so today it is preferred to model each player using an extreme value distribution. The difference between the two players strengths is then a logistic distribution. This has the property that if a player has a rating 400 points more than another player they are 10 times more likely to win, this makes the formula nicer to use. Practically, the difference between a logistic distribution and the normal distribution is small.
Logistic distribution on Wikipedia https://en.wikipedia.org/wiki/Logistic_distribution?wprov=sfla1
We replace e with base 10, s=400, mu=R_A - R_B and x=0 in the cdf.
For the update formula I say that your rating can increase or decrease by a maximum of 32 points, and I said there was no special reason for that. This value is called the K-factor, and the higher the K-factor the more weight you give to the players tournament performance (and so less weight to their pre-tournament performance). For high level chess tournaments they use a K-factor of 16 as it is believed their pre-tournament rating is about right, so their rating will not fluctuate as much. Some tournaments use different K-factors.
In the original Elo system, draws are not included, instead they are considered to be equivalent to half a win and half a loss. The paper by Mark Glickman above contains a formula that includes draws. Similarly the paper contains a formula that includes the advantage to white.
Another criticism of Elo is the reliability of the rating. The rating of an infrequent player is a less reliable measure of that player's strength, so to address this problem Mark Glickman devised Glicko and Glicko2. See descriptions of these methods at http://www.glicko.net/glicko.html
On the plus side, the Elo system was leagues ahead of what it replaced, known as the Harkness system. I originally intended to explain the Harkness system as well, so here are the paragraphs I cut:
"In the Harkness system an average was taken of everyone's rating, then at the end of the tournament if the percentage of games you won was 50% then your new rating was the average rating.
If you did better or worse than 50% then 10 points was added or subtracted to the average rating for every percentage point above or below 50.
This system was not the best and could produce some strange results. For example, it was possible for a player to lose every game and still gain points."
This video was suggested by Outray Chess. The maths is a bit harder, but I liked the idea so I made a in-front-of-a-wall video.Fri, 15 Feb 2019 21:36:29 +0000singingbananaThe Elo Rating System for Chess and Beyond7:09no18ZwJlOJuhbOwThe Infinite Game of Chess (with Outray Chess)
https://youtube.com/watch?v=ZwJlOJuhbOw
An infinite game of chess with the Thue-Morse sequence.
To avoid an infinite game of chess there was a rule that declared that a game would end if any sequence of moves were repeated three times in a row.
However Dutch mathematician Max Euwe showed that the Thue-Morse sequence can define an infinite game since it contains no finite sequence that is repeated three times in a row.
The Thue-Morse sequence is made from building blocks of 0110 and 1001, so we know it cannot contain short repetitions like 000, 111, 010101 or 101010.
Double digits in the Thue-Morse sequence always appear in the odd positions (starting from position zero), which is not possible if a sequence of odd length is repeated. So the Thue-Morse sequence does not contain any finite sequence of odd length repeated three times in a row.
If we remove every second digit of the Thue-Morse sequence we will still have the Thue-Morse sequence. If you apply this to any finite sequence of even length that is repeated three times in a row, you will get a sequence half the length that also repeats three times in a row. Repeat this process until you reach a sequence of odd length repeated three times or a short sequence repeated three times. Since we know this shorter repeated sequence is not contained in the Thue-Morse sequence it implies the original repeated sequence is not contained in the Thue-Morse sequence.
The argument above is enough to show that the Thue-Morse sequence does not contain a finite sequence of any length repeated three times in a row.
You can read a little more detail here https://homepages-fb.thm.de/boergens/english/problems/problem059englloe.htm
Thanks to Outray Chess for making this video.
Outray Chess https://www.youtube.com/channel/UCVfSsCg38hOzrezIFvMz9oA/featured
Host: Rune Friborg
Camera: Mathis Eskjær
Editing: Mathis Eskjær and Rune Friborg
Finally, here is our video about Hugh Alexander, as promised https://youtu.be/im75EwDXEzgFri, 08 Feb 2019 13:46:54 +0000singingbananaThe Infinite Game of Chess (with Outray Chess)8:47no19cMxbSsRntv4Alan Turing's lost radio broadcast rerecorded
https://youtube.com/watch?v=cMxbSsRntv4
On the 15th of May 1951 the BBC broadcasted a short lecture on the radio by the mathematician Alan Turing.
His lecture was titled “Can Digital Computers Think?” and was part of a series of lectures which featured other leading figures in computing at the time.
Unfortunately, these recording no longer exist, along with all other recordings of Alan Turing. The following is a rerecording of Alan Turing’s lost broadcast from his original script.
See Turing's script at the Turing Digital Archive from King's College, Cambridge: http://www.turingarchive.org/browse.php/B/5
For more information on the radio series see: http://oro.open.ac.uk/5609/1/01299654.pdf
Photo: Alan Turing (right) at the console of Mark II computer, c. 1951, at the University of Manchester.Sun, 24 Dec 2017 21:34:17 +0000singingbananaAlan Turing's lost radio broadcast rerecorded15:33no20