I wanted to call this post “Throwing Darts at the Real Numbers,” but apparently someone else already came up with that title to talk about something else. This is a follow-up to the last post that talked about why it’s not possible to define a uniform distribution on an unbounded set (like or ).

Even though it’s not possible to uniformly sample from the real numbers, is there something else that we can choose uniformly that will induce a certain distribution on the real numbers? There is!

What if we were standing some fixed distance (say, unit) away from the real numbers and threw darts at it? If we throw darts at the real numbers, we can describe our throw by the angle that the dart’s path makes with the real number line.

The red line describes the path of the dart towards the real number line, and the angle describes the angle that the dart’s path makes with the line.

Suppose if you were to draw a perpendicular line through where you were standing to the number line, that it passed through the value (slide over the stick figure a bit to the right).

Now, we can define a nice distribution on by picking angles uniformly from the probability density function (PDF) . This PDF has the equation when and when or . This means that, for example, picking an angle between and is just as likely as picking an angle between and .

Let’s say you are standing 1 unit away from the real number line and in line with 0 and compute the probability that the dart you throw hits somewhere between 1 and 2.

To compute this probability, we need to find the angle between where you’re standing and each of those points on the number line. Here are the pictures to have in your head.

Now, we want to find the upper and lower bounds of that create these the triangles with top side lengths between 1 and 2. We’re measuring these angles in radians, but it doesn’t really matter as long as we divide by the appropriate scaling factor.

In the first triangle, , and in the second triangle, .

Now we can compute the probability of hitting this region as . There’s a in the denominator since from all the way parallel to the number line facing to the left and all the way parallel to the number line facing to the right makes up radians.

This means that if you pick angles uniformly between and , there is roughly a 10.24% chance that the number you hit will be in between 1 and 2.

Isn’t that kind of cool? I think so. I’m not sure if this is a standard distribution, so if anyone has any insight into that, let me know!