top of page
  • Writer's pictureJackson Curtis

I got on FiveThirtyEight!

Ever since my undergrad, I (and whichever friends I can rope in to helping me) have been reading and occasionally attempting fivethirtyeight.com's weekly riddles, which are typically brain teasers around probability, math, or logic. The week after the brain teaser is posted, the answer is posted with one winner (a random selection from all the correct answers) and some helpful explanations submitted by the community. For the first time, I submitted an explanation that was worthy of a shoutout! To celebrate, I figured I'd feature the problem and how it's an excellent demonstration of ways you can get tripped up when switching between continuous and discrete probability.


The riddle is:


Help, there’s a cricket on my floor! I want to trap it with a cup so that I can safely move it outside. But every time I get close, it hops exactly 1 foot in a random direction.
I take note of its starting position and come closer. Boom — it hops in a random direction. I get close again. Boom — it takes another hop in a random direction, independent of the direction of the first hop.
What is the most probable distance between the cricket’s current position after two random jumps and its starting position? (Note: This puzzle is not asking for the expected distance, but rather the most probable distance. In other words, if you consider the probability distribution over all possible distances, where is the peak of this distribution?)

As is common with these puzzles, it's almost always easier to solve the problem through approximate simulation, and then work your way through the math to find an exact solution. We can simulate the probability density function and visualize it in a few lines of code:

tibble(a = runif(10000)*2*pi, x= cos(a), y=sin(a),
       b=runif(10000)*2*pi, x2=cos(b), y2=sin(b),
       end_x=x+x2, end_y=y+y2,
       dist = sqrt(end_x^2+end_y^2)) %>% 
  ggplot(aes(x=dist))+geom_histogram(bins=1000)

Which produces the following:



This is where I got a little hung up. It appeared the right answer was two, and two was much more probable than other choices. Logically, I could not wrap my brain around this. If I was the cricket and I had just made my first jump, then I knew there was only one spot that would take me to a distance of two feet (continuing the exact same direction I already jumped) and there was only one spot that would take me back to a distance of zero (making a complete 180 and jumping exactly backwards). Since the jumps were independent and no jump was any more likely than any other, two couldn't possibly be more probable than zero, RIGHT?


I got frustrated because I was fully convinced that my simulated answer was correct and my logic was correct, so I sent the problem to my ex-roommate and smartest-person-I-know Bryan who graciously filled up about four whiteboards calculating the exact analytic pdf for me, but the key a-ha moment for me was when he shared this:

It's not exactly the Mona Lisa, but the caption on the image was "there's more arc closer to 2 than to 0." That comment was the spark I needed to remember everything I learned in my probability classes. Specifically, when working with continuous distributions, the probability of any specific point is zero. Therefore, it's not really meaningful to talk about how 2 and 0 should be equally likely -- they both have probability zero! Instead, when we consider continuous probability, we need to think about the probabilities of being within some delta of our points of interest. From there, it's pretty easy to see why two is the most probable distance. Consider a cricket after his first jump takes him to the point (1, 0) (the specific point he jumps to is irrelevant). Then, we can visualize his next jump and we can highlight the portion of the graph that will take him within one inch of the origin and the places that will take him 23 inches or more from the origin:

While there's only one jump the cricket can make to get a distance of zero feet, and only one jump to get to zero feet, the number of possibilities to get close to two feet is huge, while the number of possibilities to get close to zero feet is tiny, and that will stay true regardless of how narrowly or widely you want to define "close." Probability density functions can be thought of as the limit of when we define "close" to be smaller and smaller around the value, and so in that sense, there are infinitely (the pdf is infinite at two) many more points "close" to two than there are "close" to zero!



0 comments

Recent Posts

See All

Comments


Post: Blog2_Post
bottom of page