Category Uncategorized

The most interesting piece of math I learned in 2017 -> the COVFEFE problem

This question from a math exam in India was flying around math twitter last week:

Screen Shot 2017-12-11 at 5.05.10 AM.png

I mistakenly thought the question was just sort of a fun joke and not all that interesting, but then I saw a series of tweets beginning with:

and ending with:

That last tweet was definitely a “wait . . . what??” moment for me.

Thinking about ABRACADABRA right off the bat was too hard, so I simplified the problem drastically too see what was going on. Suppose you are flipping a fair coin, what is the expected number of flips until you see the sequence H H? What about H T? These two problems are also, I think, great ways to introduce ideas about stopping time problems to kids. (the answers are 5 flips and 4 flips respectively).

Playing around with the easier problems showed me why the ABRACADABRA problem could have a longer stopping time than I would have guessed, but I couldn’t solve the problem exactly. Then I found this paper (written as part of an undergraduate research program at the University of Chicago!) which gave a wonderful explanation of the ABRACADABRA problem and (almost incredibly) a way to think about the problem that allows you to solve it in your head!

Screen Shot 2017-12-11 at 5.18.38 AM

Martingale’s and the ABRACADABRA problem by Di Ai

After going through that paper I was happy to have learned some new ideas about stopping time problems and more or less moved on. But then one more nice surprise came from the COVFEFE problem when Nassim Taleb shared his Markov chain solution:

I’d never played with Markov chains in Mathematica (or, basically anywhere really) so I thought it would be fun to use what I learned from Taleb’s code to explore the ABRACADABRA problem. Working through that code gave me a much better understanding of Long’s “which states lead to which states” comment above. It took me a bit of time to realize, for example, that the state ABRA can move to the state AB, for example.

Again, copying Taleb’s code, here’s the transition matrix:

Transition States

and the graph of the states plus the stopping time which matches 26^11 + 26^4 + 26:

Time to Stop.jpg

It was fun to learn that the original COVFEFE problem was part of a class of problems that are much more subtle than they might seem at first glance. Learning about the connections to martingales and learning how to implement Markov chains in Mathematica was a really nice surprise, too.


Revisiting non-transitive dice

We’ve done a few projects on non-transitive dice in the past:

Sharing Tim Gower’s non-transitive dice talk with kids

Non-Transitive Grime Dice

Today we’ve got some snow to shovel, so I was looking for a fairly light project this morning so we could get out the door to shovel. I grabbed our Grime dice off of the shelf and asked the kids to talk about them:

I asked the boys to pick two pairs of dice and test them to see which color would win. They worked independently and here’s how they explained what they found:

Finally, for a bit of a challenge, I had them work together to put the dice in a circular arrangement so that every color beat the one coming after it and lost to the one before it. This arrangement illustrates the seemingly odd non-transtive nature of these dice:

Although short, this was a fun exercise. These “Grime” dice are really fun for kids to play with!

Revisiting card shuffling after seeing a talk by Persi Diaconis

Last week I took the boys to a talk given by Persi Diaconis at MIT:

Despite most of the talk going over their heads, the boys were really excited after the talk and had lots of different “shuffling” ideas that they wanted to explore.

Since this was going to be a long project, I divided it into two pieces – studying “pick up 52” with my younger son last night and studying shaking the cards in a box with both kids this morning.

The idea of using Shannon Entropy to study how random the shuffles are is something that we explored in these two prior projects:

Chard Shuffling and Shannon Entropy

Chard Shuffling and Shannon Entropy part 2

The original idea for those projects came from on an old Stackexchange post (well, the first comment) here:

See the first comment on this Stackexchange post

So, I kicked off the project last night with my younger son. Here are his thoughts about the Diaconis talk and about his “pick up 52” idea

We did 4 trials without re-sorting the cards in between. Here are some quick thoughts about how the deck was getting mixed up between the 2nd and 3rd throws:

After we finished I had my son do a few minutes of riffle shuffling to completely mix up the deck (starting from where the deck was after the 4th pick up 52). While he was doing that I entered the numbers from our throws into a spreadsheet.

The surprise was that even after the first throw the cards were really mixed up. I was even more surprised by this because he basically threw the deck in the air rather than what (to me anyway) is the normal way of throwing cards for pick up 52.

This morning we continued the project with my older son’s idea of putting the cards in a box and shaking the box. Here the introduction to that idea:

Here are some thoughts from my older son after the first mixing. He didn’t think they were all that mixed up. We did a total of 3 more mixings – the 3rd and 4th were off camera.

Finally, we wrapped up by reviewing the numbers for mixing the cards up in the box. The first mixing had more entropy than we thought, and after the 2nd mixing the cards appear to be pretty close to as mixed up as you can get (equivalent to about 10 riffle shuffles, I think).

This was a really fun project. The math you need to describe what’s going on here is much to advanced for kids (and worthy of a math lecture at MIT!), but kids can still have a lot of fun exploring some of the ideas. The seemingly simple idea of how can you measure how mixed up a shuffle is is a pretty interest idea all by itself.

An attempt to share some Katherine Johnson’s math ideas from Hidden Figures with my son

For the last few months I’ve been daydreaming about ways to share some of the math from the movie Hidden Figures with kids. As part of that prep work I found one of Katherine Johnson’s technical papers on NASA’s website:

NASA’s Technical Note D-233 by T. H. Skopinski and Katherine G. Johnson

As you’d expect, there’s a lot of trig, calculus and spherical geometry. I like finding ways to share the work that mathematicians do with kids, but this work is pretty technical and I wasn’t getting any great ideas.

Then my son had a homework problem from his Precalculus book that made me think it was time to stop daydreaming and just try something. Here is that problem, which is a completely standard law of cosines problem:

The problem reminded me of one of the equations for an ellipse used in the Technical Note. One surprising thing is that the equation of an ellipse in polar coordinates is that is is a rational function in \cos{\theta}.

So, I drew an ellipse and showed my son that equation.

One of the neat things about the Technical Note is that the solution to some of the complicated trig equations were found by an iteration method. The specific ideas for solving those equations are too advanced for kids, so I decided to show my son a different (and really simple) iteration method that converges to a well known number:

After that introduction to iteration methods, I decided to jump to a second and slightly more complicated example -> solving x = 3*x*(1 – x).

The ideas in the iteration method we use here can be explored purely geometrically:

Next we went upstairs to the computer to see some of the ideas we just talked about. The first idea was the polar coordinate equation for an ellipse:

Now we played with the second dynamical system -> solving x = 3*x(1-x).

By the way, the ideas here are incredibly fun to explore (especially seeing when this method converges and when it doesn’t), but the details of this method wasn’t really the idea here. I just wanted to show him what an iterative method looks like.

Finally, I showed him the actual paper and pointed out some of the parts we explored. Sorry that this film didn’t come out as well as I’d hoped, but you can view the paper from the first link in this post:

This was a fun project – even if it wasn’t planned really well. Showing some of the math behind Hidden Figures I hope helps motivate some of the topics that my son is studying right now. It will be fun to return to a second Hidden Figures project when he is studying calculus.

A quick hexaflexagon project thanks to Jim Propp

My younger son had been interested in hexaflexagons lately. He saw them Martin Gardner’s “The Collossal Book of Mathematics” first and then I bought him a few books thanks to a suggestion from Annie Perkins:

Then, by lucky coincidence, Jim Propp made this fun video:

After watching that video with my son this morning, he took Propp’s suggestion and cut the corners off of one of his hexaflexagons. Here’s what he had to say:

Even tonight I’m not sure what he was getting at when he was talking about the hexagons moving when the shape was flexed. I might revisit that with him another time, but it was fun to hear him talking about what was going on with this new shape.

I’m happy that he’s been having fun with these shapes. Just when I thought there wasn’t any more he could do with them, Propp’s video opened up a

Revisiting John Conway’s “amusical” Collatz conjecture

A few years ago we did a project based on a version of the Collatz conjecture that I read in John Conway’s article “On Unsettleable Arithmetical Problems” in the 2014 edition of The Best Writing on Mathematics. That project is here:

The Collatz Conjecture and John Conway’s “amusical” variation

Today we revisited that project. I’ve been wanting to share more ideas that I’ve learned from mathematicians lately. The particular ideas in this project are really just addition and multiplications, and so are accessible to are wide audience.

I started by reminding the boys about the Collatz conjecture. They (mostly) remembered the ideas and we worked through one example:

Next we moved on to variation of the Collatz conjecture that Conway discusses in his article about unsolved math problems. This version of the Collatz conjecture is slightly more complicated, but only slightly. I think that working through a few examples of this version of the Collatz conjecture is a great math exercise for kids.

Now we had some fun turning the “amusical” version of the Collatz Conjecture into music. Mathematica gave us an easy way to do this, but all you need is a simple way to convert numbers to notes (and a way to convert large numbers to reasonable notes -> I used both mod 12 and mod 24):

Finally, just for fun, I had the kids pick their favorite 20 note song. We then converted the songs from numbers to notes and had the boys play them. My younger son picked a sequence starting with 12. Here’s the song:

Here is his version of the song on the piano:

My older son started his sequence with the number 42. Here is score for the song of 42:

And here is the performance of 42 on the viola:

Both kids are quite unimpressed with the music! Still, this was a really fun project and a great way for kids to get a bit of arithmetic review and also experience some really interesting and unsolved math.

Sharing a new result about the Cantor set with kids

Earlier in the week I saw a tweet announcing a new (and really cool!) result about the Cantor set:

The new result is that any number in the intein the weekrval [0,1] can be written as the product x^2 * y where x and y are members of the Cantor set.

After reading the paper, I thought that it would be really fun to try to share some of the ideas with kids. The two ideas I wanted to highlight in the project today were (i) the geometric ideas in the construction of the Cantor set, and (ii) the interpretation of the Cantor set in base 3.

I started with a question about base 3 -> how do you write 1/2 in base 3?

Now we looked at constructing the Cantor set by removing intervals. The boys had lots of interesting ideas about what was going on

Next we looked at the incredible property that you can make any number in the interval [0,2] by adding two numbers in the Cantor set. This ideas here were a little harder for my younger son to understand than I was expecting, so I ended up breaking the discussion into two parts.

I think the ideas here are fun for kids to think through – how do I pick a number from one set and a second number (possibly from a different set) to add up to a specific number.

Here’s part 1:

and part 2:

Finally, we took a peek at the result from the paper -> how does multiplication work? This was also a fun discussion. The ideas necessary to see why you can find three numbers from the Cantor set that multiply to any number in [0,1] are obviously way out of reach for kids. However, seeing why the multiplication problem is difficult is within reach.

It is always a real treat to find math that is interesting to mathematicians to share with kids. I think talking through some of the ideas related to this new result about the Cantor set makes for an amazing math project for kids!

An instructive counting / probability question from Alexander Bogomolny

I saw this question from Alexander Bogomolny today through a tweet from Nassim Taleb:

It reminded me a bit of a fun question I saw from Christopher Long a few years ago:

A great introductory probability and stats problem I saw from Christopher Long

The first solution that came to mind for the dice question involved generating functions. Here’s the code I wrote in Mathematica:

Mathematica Code

The general idea was to look at powers of the polynomial x + x^2 + x^3 + x^4 + x^5 + x^6 and keep track of the coefficients for powers greater than x^{12}. The one tiny bit of difficulty is that you also have to strip off the powers of x greater than x^{12} after each stage (since you only want to count the first roll giving you a sum greater than 12). Here’s that polynomial cubed, for example:

Coefficient Example

The coefficients for x^{13} through x^{18} tell us the number of different ways to get a 13 through an 18 with three rolls.

The results of counting the polynomial coefficients are given below (columns give the number of ways to roll 13 through 18, and the rows are the dice rolls 3 through 13):

Counts at each stage

These counts don’t have the right weights, though, since 21 ways of getting a 13 on the 3rd roll have a much higher chance of happening than the 1 way of getting an 18 on the 13th roll. In fact each row has a weight 6x greater than the row immediately below it. Weighting the rows properly we get the following counts:

Total Counts.jpg

Now we just have to add up the columns and divide by 6^{13} to get the probabilities of ending on 13 through 18 (and do a weighted sum to get the expected final number) -> the probability of ending on a 13 is about 27.9% and the expected value of the final number is roughly 14.69:


This is a nice problem to show how generating functions can help you find exact answers to problems that seem to require simulations. It was fun to think through this one.

Playing with 3d printed versions of shapes theorized by Hermann Schwarz

Saw a neat tweet earlier today about 3d printing, math, and engineering:

I recognized some of the shapes in the article as ones that we’d played with before:

The grey shape displayed in the article is a “made thicker for 3d printing” version of the surface \cos(x) + \cos(y) + \cos(z) = 0. I thought it would be fun to print that shape today and use it for a little project with the kids tonight. Here’s the Mathematica code and what the print looks like in the Preform software:

8 hours later the print finished and I asked the boys to describe that shape plus the gyroid. It is always fascinating to hear what kids see in unusual shapes. My younger son went first:

Here’s what my older son had to say (and he’s starting to study trig, so we could go a tiny bit deeper into the math behind the shape I printed today):

Next we watched the video about the shapes made by Rice University:

After watching the video I asked the boys to talk about some of the things they learned:

Of course, mostly they didn’t want to talk about the shapes – they wanted to stand on them! So much for an 8 hour print and 45 min of trying to clean out the supports . . .

Here’s how the standing went:

Definitely a fun project and a fun way to show kids a current application of both theoretical math and 3d printing!

A fun math surprise with a 72 degree angle.

We’ve been talking a lot about 72 degree angles recently. Yesterday’s project was about a question our friend Paula Beardell Krieg asked:

Paula Beardell Krieg’s 72 degree question

In that project we learned that a right triangle with angles 72 and 18 (pictured below)

72 degree picture

Is nearly the same as a right triangle with sides of 1, 3, and \sqrt{10}

one three root 10 picture

Today I wanted to show the boys a neat surprise that I stumbled on almost by accident. The continued fraction expansion for the cosine of the two large (~72 degree angles) are remarkable similar and lead to the “discovery” of a 3rd nearly identical triangle.

We got started by reviewing a bit about 72 degree angles:

Now we did a quick review of continued fractions and the “split, flip, and rat” method that my high school teacher, Mr. Waterman, taught me. Then we looked at the continued fraction for 1 / \sqrt{10}:

Now we looked at the reverse process -> given a continued fraction, how do we figure out what number it represents? Solving this problem for the infinite continued fraction we have here is a challenging problem for kids. One nice thing here was that my kids knew that they could do it if the continued fraction had finite length – that made it easier to show them how to deal with the infinitely long part.

Finally, we went to the computer to see the fun surprise:

Here’s that 3rd triangle:

3rd Triangle

I love the surprise that the continued fractions for the cosine of the (roughly) 72 degree angles that we were looking at are so similar. It is always really fun to be able to share neat math connections like this with kids.