Solution

Rounding a Ratio

Show the problem again

Two real numbers x and y are chosen independently and uniformly at random from the interval (0, 1). What is the probability that the integer nearest to x/y is even? (Zero counts as even.) Give an exact closed form, or a decimal rounded to 4 places.

Worked solution

The answer is (5 − π)/4 ≈ 0.4646. The nearest integer is 0 when x/y < 1/2, the triangle x < y/2, of area 1/4. For c ≥ 1, the region x/y > c is the triangle with vertices (0,0), (1,0), (1, 1/c), of area 1/(2c). So the nearest integer is 2n (n ≥ 1), meaning 2n − 1/2 < x/y < 2n + 1/2, with probability 1/(2(2n − 1/2)) − 1/(2(2n + 1/2)) = 1/(4n − 1) − 1/(4n + 1). Summing over n gives 1/3 − 1/5 + 1/7 − 1/9 + ... = 1 − π/4 by Leibniz's series. The total is 1/4 + 1 − π/4 = (5 − π)/4.

Source: Putnam 1993, Problem B3. Statement written for AxiomIQ.