Two real numbers x and y are chosen at random in the interval (0, 1) with respect to the uniform distribution. What is the probability that the closest integer to x/y is even? Express your answer in terms of pi.

If one were to draw the area where x/y is even, it’s pretty clear from the get-go that we will have something like the following:

I looked at the problem from the viewpoint of lines (x/y = 1/2, x/y = 3/2, …). This results in the following series from summing the area of the triangles (don’t forget to divide by 2):

Luckily, the series at the end is basically from the arctan series expansion. Thus the answer is .