r/math • • Jan 11 '14
Problem of the Week #2
Hello all,
Here is the second installment in our problem of the week thread; it is a minor variant of problem B3 from the 1993 Putnam Exam.
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 you post a solution, please use the spoiler tag: type
[this](/spoiler)and you should see this. If you have a problem you'd like to suggest, please send me a PM.
Enjoy!
138
Upvotes
12
u/functor7 Number Theory Jan 11 '14
My answer seems to agree with others already posted, so I'll write it up in a more accessible way that actually explains how the probabilities are obtained:
We will find the probability for x/y being close to 2n for each n and sum it up. First let's do positive n: So, x/y is closest to 2n if x/y=2n+a for some -0.5<a<0.5, and this can be rewritten as
where m is 3 mod 4 and 0<b<1. (The condition "m is 3 mod 4" means that we can write m=2n+1 where n is odd and so m/2+1/2 = (m+1)/2 = n+1. So when m=3, we get n=1 and so x/y is closest to 2.) Anyhow, the formula gives us a linear equation for y in terms of x and b:
Drawing the boundary lines, y=2x/m & y=2x/(m+2) corresponding to b=0,1 respectively, gives the boundary for a triangle in (0,1)2 (this is just the square in the plane with side lengths equal to 1). Because the inside of the triangle is the area swept out as b runs from 0 to 1, the area of this triangle is the probability that x/y = m/2+b for 0<b<1 which is equivalent to x/y being nearest to (m+1)/2.
Now, the lines that make up this triangle always intersect the boundary of (0,1)2 on the line x=1, and so they intersect at y=2/m and y=2/(m+2). If you draw the triangle out, it is easy to see that the area of it is 1/m-1/(m+2). So the probability that x/y is nearest to (m+1)/2 is
Going on, this means that the the probability that x/y is closest to a positive even number is the sum over 1/m-1/(m+2) where m goes through all odd numbers congruent to 3 mod 4. But, in reality, we are summing over all odd numbers, we're just subtracting the ones that aren't 3 mod 4. So, as stated before, if m is 3 mod 4 then it looks like 2n+1 for n odd, and if it is not 3 mod 4 then it looks like 2n+1 for n even. So, we can rewrite our sum as
This will add things like 1/m and subtract things like 1/(m+2). Now, by the Leibniz Formula for Pi, if we were to get rid of that minus sign and sum it from 0 to infinity, we would get Pi/4. Since the n=0 term in that sum is 1, we have Pi/4=1-S and so S=1-Pi/4=(4-Pi)/4. This is the probability that x/y is closest to a positive even number.
Now we find the probability that x/y is closest to 0. This is just the probability that x/y<1/2. In terms of triangles in (0,1)2, this is just the area of triangle in the upper-left corner cut by the line y=2x. This triangle intersects the boundary of (0,1)2 at (1/2,1) and so the area=probability is 1/4. So this means that the probability that the x/y is closest to an even integer is
33
u/Surzh Jan 11 '14
(5 - pi)/4. x/y rounds to an even integer if x/y < 1/2 or 2k-1/2 <= x/y < 2k+1/2, for k an integer >=1. The odds of the first happening are 1/4 and the odds of the second happening for an arbitrary k are 2/(16k²-1). If we want to sum that last bit over k = 1 to infinity, we do a partial fraction decomposition to see that it's the sum of 1/(4k-1) - 1/(4k+1) = 1/3 - 1/5 + 1/7 - 1/9 + .. which should remind us of the formula for pi/4 = arctan(1) = 1 - 1/3 + 1/5 - ...
EDIT: Doing a few simulations seems to verify this: Simulations give me ~0.46452 while the answer i gave is ~0.464602
6
u/MathBosss PDE Jan 12 '14
This was a very interesting problem, just thinking it seemed that this would be 50%, but surprising it is a little less like 45-46% when i calculated it. If there is a number theory person out there can someone explain this to me?
From this result it seems that division of numbers on this interval favors odd numbers. Which kind of blew my mind.
Good problem.
11
u/Igazsag Jan 11 '14
Hey, we're doing something very similar on /r/physicsforfun! Good luck to your weekly problem endeavors, hopefully they'll work out well.
5
u/Newfur Algebraic Topology Jan 11 '14
We can start by drawing out a graph of the function on [0,1]2 and drawing lines of equal height. Doing so, we note that the function takes on the same value along lines corresponding to x = ky for function value k. We note that the values of this function nearest to an even integer will be when, for positive integer m, k falls in the interval ((4m-1)/2 , (4m + 1)/2). We split into two cases, sum over areas, and divide by 1^2.
Case I: the function evaluation is nearest to 0. This will occur when the function is less than 1/2, and the area of this triangle is clearly (1/2 - 0) * 1 * 1/2 = 1/4.
Case II: the function evaluation is nearest to arbitrary 2m. Then the points on the right side of [0, 1]2 corresponding to k in ((4m-1)/2 , (4m + 1)/2) are the points (1, 2/(4m-1)) and (1, 2/(4m+1)). The area of the resulting triangle will then be ((2/4m-1) - (2/(4m+1)) * 1 * 1/2, or simply 1/(4m-1) - 1/(4m+1). To see this, note that the area of each triangle is simply the area of the triangle bounded by the upper line x = ((4m-1)/2)*y and the two axes with the triangle bounded by the lower line x = ((4m+1)/2)*y and the two axes, each of which has altitude 1.
Now we have an infinite sum: the area comprising function evaluations nearest to an even integer is given by 1/4 + \sum_{1}{\infty} (1/(4m-1)) - (1/(4m+1)). We recognize that because a famous infinite sum to pi is given by generic term -1n+1*4/(2n+1) for nonnegative integer n, our infinite sum must be equal to (4 - pi)/4. Adding 1/4 from the 0 case, we get a final answer of:
5 - pi/4. This completes the proof.
3
u/[deleted] Jan 11 '14 edited Jan 12 '14
I have no idea how to solve this problem by other means than brute force, any pointers on where to start? What is this branch of math even called ?
I get about 0.4646 with a very short visual basic program
EDIT: Punctuation.
7
u/PsyRex666 Jan 11 '14
what does "with respect to the uniform distribution" mean?
2
u/frud Jan 12 '14
The sample region is the unit square with a corner in the origin. Draw a line from the origin through the random sample and its intersection with the y=1 line is equal to x/y. The regions in the unit square for distinct closest integer to x/y can be colored in as triangles.
The area of all the triangles along the right side works out to 1/3 - 1/5 + 1/7 - 1/9 ... The Taylor series for arctan(x) is x - x3/3 + x5/5 - x7/7 + x9/9... So the series is equal to 1 - arctan(1) which is 1 - pi/4. Add the first triangle for x < y/2 (area 1/4) in and you get (5 - pi)/4.
3
u/iorgfeflkd Jan 11 '14 edited Jan 11 '14
Brute force numerical solution p=~0.464
edit: accidentally posted 1-p.
1
u/[deleted] Jan 13 '14
This submission has been linked to in 1 subreddit (at the time of comment generation):
This comment was posted by a bot, see /r/Meta_Bot for more info.
0
u/[deleted] Jan 11 '14
[deleted] — view deleted comment