Sharing Kelsey Houston-Edwards’s Cryptography video with kids

I’m falling way behind on Kelsey Houston-Edwards’s video series, sadly. Her “How to Break Crytography” video is so freaking amazing that it needed to be first in line in my effort to catch up!

So, this morning I watched the video with the boys. We stopped the video a few times to either work through some of the math, or simply to just have me explain it a bit. Overall, though, I think this video is not just accessible to kids, but is something that they will find absolutely fascinating.

Here’s what my kids took away from it:

Next we went upstairs to write some Mathematica code to step through the process that Houston-Edwards described in her video. In this video we (slightly clumsily) step through the code and check a few small examples:

When I turned the camera off after the last video my younger son asked a really interesting question -> Why don’t we just use Mathematica’s “FactorInteger[]” function?

We talked about that for a bit in this video and then tried to use Shor’s algorithm to find the factors of a number that was the product of two 4 digit primes.

So, we had the camera off for a little over a minute after the last video, but the good news is that Mathematica did, indeed, finish the calculation. It was a nice (and somewhat accidental) example of how quickly this algorithm runs into trouble.

The cool thing, though, is that it did work ðŸ™‚

Definitely a fun project, though it does require a bit more computer power than most of our other projects. I’m happy to be catching up a little on Kelsey Houston-Edwards’s video series – it really is one of the best math-related things on the internet!

Sharing Grant Sanderson’s Calculus Ideas video with kids

Yesterday I saw an incredible new video from Grant Sanderson:

As is the case with all of his videos, this one totally blew me away. I also thought that it has some fantastic ideas to share with kids. So, this morning we tried it out!

I started by asking the boys about the area of a circle – how do you find the area?

We have studied the idea before. Here’s the previous idea (that we got from a Steven Strogatz tweet):

and here are the projects inspired by Strogatz’s tweet:

Steven Strogatz’s circle-area exercise

Steven Strogatz’s circle-area project part 2

Fortunately, the boys were able to remember that idea and explain it pretty well:

After this short discussion I had the boys watch the new “Essence of Calculus” video. I actually left the room so that I wouldn’t interfere. The video below shows the ideas that they found interesting. One thing – luckily! – was the idea of making lots of slices and getting a better and better approximation to a shape. We were able to connect that idea to our prior way of finding the area of a circle, which was nice ðŸ™‚

Next we talked about the new (to them) way of finding the area of a circle that Sanderson explains in his video. What made me really happy here is that my younger son was able to understand and explain most of the ideas. It think that a 5th grader being able to grasp these ideas really shows the tremendous quality of Sanderson’s explanation in his video. I also think that it shows that many important ideas from advanced math are both accessible and interesting(!) to kids

Finally, I showed the boys some 3d prints that I made overnight.

These prints were pretty easy to make and I hoped that they would make some of the approximation ideas seem more real. In the middle of the video I remembered that I’d actually tried this idea before (ha!):

3d printing and calculus concepts for kids

After remembering the old project, I ran and got the old shapes, too:

I’m really excited for the rest of this new calculus series. Some of the more advanced ideas might not be so great for kids, but I hope to share one or two more with the boys just to show them a few ideas that they’ve probably never seen before. Plus – I’ve got no doubt at all that this whole series is going to be amazing!

Sierpinski Numbers

I was trying (unsuccessfully) to track down a reference on the chaos game for Edmund Harriss and ran across an unsolved problem in math that I’d never heard of before -> the Sierpinski Numbers.

Turns out that Sierpinski proved in 1960 that there are infinitely many odd positive integers $k$ for which the number:

$k * 2^n + 1$

is not prime for any positive integer $n$.

It turns out that the smallest known Sierpinski number is 78,557, though there are 4 smaller numbers for which no primes have been found, yet. Those numbers are 21181, 22699, 24737, 55459, and 67607.

There’s lots of info on the Sierpinski numbers on Wikipedia:

Wikipedia’s page on the Sierpinski numbers

Tonight I wanted to explain a bit about the Sierpinski numbers to the boys as a way to review modular arithmetic. I also thought it would be interesting to see how they thought you could attack a problem like this one – especially in the 1960s!

So, here’s how we got started – a bit of Sierpinski review and then an introduction to the theorem mentioned above. It isn’t the easiest thing for kids to understand, so I wanted to be extra sure they understood all of the parts:

Next we talked a bit about modular arithmetic and why it wasn’t too hard to see, for example, that lots of the number we were looking at were divisible by 3. The math work here is a great introductory modular arithmetic exercise for kids.

Next we went to Mathematica to explore the modular arithmetic a bit more. Once we had the idea with 3, it was a little easier to see why there were repeating patterns with the remainders mod 5. The fun part was that the boys were able to see that one out of every 4 numbers would be divisible by 5.

Finally, we looked at the problem a slightly different way and tried to see if it was easy or hard to see if 3 (or 5 or 7 or 9) was a Sierpinski number. Would we ever see primes?

This project was really fun – it is always neat to stumble on an unsolved problem that is accessible to kids. Also, I’d really love to know how Sierpinski’s proof went – sort of amazing that it took 8 years after the proof that there were infinitely many numbers with this property to find the first one!

A nice problem about primes for kids from James Tanton

Saw a really cool tweet from James Tanton today:

Tonight I sat down with the boys to make sure they understood the problem. They noticed that half the numbers would have no powers of two – good start! After that observation they started down the path to solving the problem really quickly. In fact, my younger son thought that we might have a geometric series.

Since we covered a few ideas pretty quickly in the last video, so I stared this part of the project by asking them to give me a more detailed explanation for how they got the 1/2, 1/4, 1/8, . . . pattern in the last video. It turned out to be a little harder for them to give precise arguments, but they did manage to hit the main points which was nice.

At the end of this video my older son was able to write down the series that we needed to add up to solve the problem.

Now that we had the series, we had to figure out how to add it up. My guess was that they’d never seen a series like this, but my older son had a really cool idea almost immediately – rewrite the series!

The boys were able to sum the series in this new form – so yay!

At the end of of the last video my younger son said that he was surprised that the “expected value” wasn’t zero since zero was the most likely value. In this part of the video we talked a bit more about what “expected value” meant.

Once we had that I asked what I meant to be a quick question -> is the expected number of 3’s higher or lower. It turned out to be a longer conversation than I expected, though, because my older son was actually able to write down the answer!

Definitely a fun problem. I think it is fun for kids to see how to add up a series like the one in this project. I also think it is fun for kids to explore some of the basic ideas about primes that pop up in this problem.

As an aside, one other place where I’ve seen the series that came up here is in this post from Patrick Honner:

Proof Without Words: Two Dimensional Geometric Series

His “proof without words” for the sum is this picture – can you see how it works?

A challenge to everyone in and around math

I saw Steven Strogatz share a quote from Rota earlier in the week:

\\

This passage both struck me and annoyed me – not totally sure why:

It is certainly not the case that everything that is interesting to mathematicians is going to be interesting to either the general public or to kids learning math. Nonetheless, there are many ideas beyond the (maybe overshared) “usual pap of Klein bottles, chaos, and colored pictures” that are indeed worth sharing.

So my challenge for everyone in math is to write one post – just one post – sharing an idea that shows something that might be interesting to both mathematicians and to students learning math. For every post that gets shared with me, I’ll write another one ðŸ™‚

Here’s my first idea. I saw it originally from Ann-Marie Ison and then more recently from Burkard Polster aka “the Mathologer”.Â  The idea shows some fascinating geometry hiding in modular arithmetic.

Our two projects with this type of modular arithmetic are below:

Using Ann-Marie Ison’s incredible math art with kids

Extending our project with Ann-Marie Ison’s art

I think the best way to play with the modular arithmetic patterns is via this Desmos activity written by Martin Holtham:

Also, a good way to dive a little deeper into what’s going on in these pictures is this video from Polster:

I used this modular arithmetic idea in lectures at two math camps last year and both times the kids were just blown away. The connection between geometry and arithmetic here is so fun and so surprising that it is hard to imagine anyone seeing it for the first time not being blow away!

So, no gimmicks, no super abstract math, but something that I think would be both enjoyable for students learning math and something that mathematicians will not throw back on the shelf in disgust.

What are some other ideas ðŸ™‚

A terrific prime number question from Matt Enlow

A great question from Matt Enlow inspired a super fun conversation with the boys last night:

Before diving in to the project, I’d really recommend thinking about the question – even just for a few seconds – just to see what your intuition tells you.

We started the project by looking at the tweet and trying to make sure that the boys understood the question. The question itself was harder for them to understand than I expected. One reason was that they weren’t used to thinking about ages in terms of days.

Next we went to Mathematica and wrote a little program using the “PrimePi” function which tells you the number of primes less than or equal to a number.

We played around a little bit. Their initial instinct was to zoom in on a specific number like 30 years old. There were some fun surprises since the number of primes between two numbers bounces around a bit. They also had some really interesting ideas about prime numbers.

Eventually they decided to check a range of ages.

At the end of the last video we decided to check a range of ages, and we did that with a “For” loop. Once we did that we found a couple of really fun surprises ðŸ™‚

Running the program over night, the largest age that I found was 179,676 years old! I doubt that’s the highest number, though, and I love that the boys thought that there might be infinitely many solutions to this problem.

Thanks to Matt Enlow for posing this problem!

Christopher Long’s fun generalization of an Expii problem

Twitter is really great place to see fun math. Before showing the fun generalization, though, just to avoid spoilers I want to show the original problem. Here’s the direct link:

https://www.expii.com/solve/69/5

and here’s the problem itself:

So, I’ll pause here to not ruin the problem for anyone who wants to work on it.

pause

pause

pause

pause

pause

pause

pause

pause

pause

pause

Ok . . . here’s the really cool set of tweets I saw from Christopher Long this morning:

which continued as follows:

To see how delightful Long’s general solution is, maybe walking through my chicken scratch solution which happened to be still sitting on my desk will be helpful:

Here’s a sketch of my approach.

In order to maximize your chance of winning a bet like the one in the problem (one that you expect to lose) you should bet as much as you can at each step (subject to a maximum of the amount you need to win) at each stage.

So,

(i) at step 1 the probability of getting the tree to grow to 40 feet is 1/5 and probability of losing is 4/5.

(ii) Assuming you win, you now have a 1/5 probability of getting the tree to grow to 80 feet and a 4/5 probability of losing.

(iii) Assuming you win, you now have a 1/5 probability of getting the tree to grow to 100 feet and a 4/5 probability of having it shrink to 60 feet.

(iv) If you win on stage (iii) you win (1 out of 125 times). If you lose, you now have a 1/5 probability of having the tree now grow to 100 feet and a 4/5 probability of having the tree shrink to 20 feet.

So, after the 4th branch in my picture you’ve either won (probability 1/125 + 4/625), returned to 20 feet (probability 16/625) or lost (the only other case).

Thus, your probability of winning the game from the start, $x$, satisfies the equation:

$x = 1/125 + 4/625 + (16/625)*x$

We can solve this pretty easily to see that $x = 3/203$.

The really fun – and honestly, amazing – thing about Long’s solution is that he notices that the pattern in the branches of the binary tree corresponds exactly to the pattern in the digits of the binary expansion of 1/5. For clarity, the 1/5 here comes from the growth multiple – 20 feet growing to 100 feet – and not from the probability which, by coincidence, also has a 1/5 in it.

Anyway, Long’s solution also allows you to immediately see how to solve any problem like the Expii one, and, for extra fun, problems where the growth multiple is irrational:

The answer is in Long’s timeline, but it is a good challenge to see if you can work out the answer just from the tweets I’ve included here. Since he skips a bit of algebra in his tweets, working through his tweets is also an important way to make sure that you really understand his work.

I think the sequence of tweets from Long are a great thing to show kids who are learning math – especially kids learning probability and stats. Those tweets really show how a mathematician thinks about a problem.

Studying shuffling and Shannon entropy part 2

We did a fun project about Shannon Entropy and Shuffling yesterday:

Chard Shuffling and Shannon Entropy

That project was based largely on an old Stackexchange post (well, comment) here:

See the first comment on this Stackexchange post

Today I wanted to extend that project a little bit and thought it would be fun to look at a different kind of shuffle to see if there was a difference in entropy.

Here’s the shuffle for today as well as what the boys think will happen with this shuffle:

Next we took some time off camera to enter the card numbers in our spreadsheet. Here’s what we found for the new entropy after one of these new shuffles:

Finally, we took even more time off camera to do 4 more shuffles and write down the order of all the cards. After that we did 5 successive shuffles and wrote down the numbers after the 10th shuffle.

The kids didn’t think the cards were as mixed as they were in yesterday’s project, and here’s what the entropy calculation said:

I really enjoyed these two projects. It was especially fun to see how kids could get their arms around the idea of entropy even though the math itself is pretty advanced.

Card Shuffling and Shannon Entropy

My kids have recently become really interested in card games. Yesterday I was chatting with my younger son about shuffling and how you might be able to tell if the cards were well-shuffled. He thought that there was no way to tell.

Following that conversation I thought I’d talk to the boys about entropy and card shuffling. The link below popped up basically immediately on a google search, and the first comment basically wrote the project for me . . . .

See the first comment on this Stackexchange post

In the first part of the video below I introduced the problem and had the boys talk about what they thought about shuffling. They had some interesting ideas and noticed that some simple ways of measuring the disorder wouldn’t actually be very good. That discussion showed me that the general idea of entropy was actually accessible to kids.

The tricky thing about the entropy calculation is that it involves the logarithm function, so I used the second half of the video to do a quick and dirty introduction to logs.

Next I showed them how the Shannon Entropy calculation would work for a deck of cards. Here’s the simplified explanation of the procedure (and the comment on the Stackexchange thread linked above has R code that implements this procedure):

(1) Number the cards
(2) After each shuffle – look at the difference in the numbers of adjacent cards. If that difference is negative, add 52 to make it positive.
(3) Count how many of the differences are 1, 2, 3, and so on.
(4) Divide the count in each bucket by 52 to turn the counts into probabilities.
(5) Add up the probability times the log of the probability for each bucket that had a non-zero count.
(6) Take the number in (5) and multiply by -1 -> that’s the Shannon Entropy.

Here’s my explanation of this process as well as the first shuffle:

Next we looked carefully at the first shuffle – the boys thought it was more random that the unshuffled deck, but still had a lot of structure. When we went through the entropy calculation we found the entropy had moved from 0 to about 1.65.

Next we did 4 more shuffles off camera and recorded the results. Then I had my son do 5 successive shuffles (of the already shuffled deck) to produce a deck that had been shuffled 10 times. In this video we calculated the Shannon Entropy of the deck for all of those shuffles and looked at the results.

Finally we went to the comment on the Stackexchange question. Here we looked at the graphs included in that comment and also compared our results to the computer-generated ones. One surprise that our entropy grew very fast compared to the computer shuffling. Both entropy calculations ended up around the same number, though (which was pretty cool!).

This was a really fun project and one that I think many kids would find fascinating. Obviously the including of logs presents a bit of a challenge. Since I wasn’t planning on doing a super deep dive into the entropy calculation, I effectively just skipped over the logarithms. The main idea that I wanted to communicate to the boys was that there actually is a way to measure disorder, and the process isn’t actually that complicated. I really enjoyed this one!

A neat expected value problem from Expii

[sorry for the quick write up – I got asked to help out with my son’s archery class today, so I just decided to publish this one as it was when I get asked to help . . . ]

I saw a neat expected value problem from Expii yesterday. In case you’ve not see their site, here’s the link to their main site:

Expii’s front page

and here’s a direct link to the problem:

A neat expected value problem from Expii

The problem goes like this:

“You are planting some trees as environmental action for Earth Day. At each of 200 spots around a circle, you place a seed. Each seed will sprout into a small tree with probability 1/2. Sadly, some of these small trees will die. In particular, a small tree dies if it has another small tree as its neighbor, because they will be fighting for sunlight.

What is the expected value of the number of trees that are still alive at the end of the year?”

I thought this would be a great problem to discuss with the boys. We just got back from a vacation in San Diego and my younger son was still on west coast time, though, so I just talked through this one with my older son.

First I introduced the problem and we double checked that he understood it:

Next we discussed some simple cases to see if we could get our arms around the problem:

Now we moved on to the general case. My son understood some of the main ideas about the problem, but made a small mistake at the end that led to a very small expected value.

Finally, we wrapped up by looking at the error at the end of the last video and trying to calculate the expected value slightly more carefully: