Simon created this coin flip simulation in the form of a game that runs until you get 10 heads in a row. In the video, he explains what the chance that you get 10 heads in a row is, and how he calculated the average number of flips it should take. We also actually play the game and get very lucky the first time and very unlucky the second time. Simon talks about the code he wrote in the second part of the video.

Simon also built another coin flip game in Processing: Coin Flip simulation that doubles the number of coins in the pot as long as you get consecutive heads and clears the pot once you throw tails. At one point, Simon got 12 heads in a row, which means that he had 2^12 coins in the pot (4096). What is the chance of getting that? (It’s actually 1 in 8192). How cool is that?

More images of the game: