x and y are chosen at random (with uniform density) from the interval (0, 1). What is the probability that the closest integer to x/y is even?
The closest integer to x/y is 0 if x < 2y. It is 2n (for n > 0) if 2x/(4n+1) < y < 2x/(4n-1). [We can ignore y/x = 2/(2m+1) since it has probability zero.]
Hence the required probability p = 1/4 + (1/3 - 1/5) + (1/7 - 1/9) + ... . But π/4 = 1 - 1/3 + 1/5 - 1/7 + ... , so p = 5/4 - π/4.
[It makes things easier to draw a picture of the unit square with the lines y = 2x, y = 2/3 x, y = 2/5x etc.]
© John Scholes
12 Dec 1998