nearest integer function

• Jul 9th 2009, 08:10 PM
Random Variable
nearest integer function
Let x be a random real number from the interval (0, 1].

Let nint(x) be the nearest integer function of x.

What is the probability that nint(1/x) is even?

Nearest integer function - Wikipedia, the free encyclopedia

Moderator edit: Approved Challenge question.
• Jul 9th 2009, 09:58 PM
AlephZero
I will be the first fool to state that I think it should be 1/2, which I suppose is wrong, otherwise I don't see why you'd pose the question. So I'm curious.

However, I've seen "nearest integer" defined in different ways. By your definition, does nint(1/2)=0 or 1?
• Jul 9th 2009, 10:59 PM
Moo
As he gave the wikipedia link, I guess we should take 0.

But the probability of getting n/2 is 0, so it's not really important actually.
• Jul 10th 2009, 12:52 AM
NonCommAlg
Quote:

Originally Posted by Random Variable
Let x be a random real number from the interval (0, 1].

Let nint(x) be the nearest integer function of x.

What is the probability that nint(1/x) is even?

Nearest integer function - Wikipedia, the free encyclopedia

my guess would be:

Spoiler:
$\displaystyle 2-\frac{\pi}{2}.$
• Jul 10th 2009, 02:36 AM
Random Variable
Quote:

Originally Posted by AlephZero
I will be the first fool to state that I think it should be 1/2, which I suppose is wrong, otherwise I don't see why you'd pose the question. So I'm curious.

However, I've seen "nearest integer" defined in different ways. By your definition, does nint(1/2)=0 or 1?

Since we're dealing with a continuous distribution, I don't think it matters.
• Jul 10th 2009, 02:41 AM
Random Variable
Quote:

Originally Posted by NonCommAlg
my guess would be:

Spoiler:
$\displaystyle 2-\frac{\pi}{2}.$

Yep.
• Jul 10th 2009, 03:05 PM
Random Variable
Since NonCommAlg didn't explain how he did the problem, I'll give some hints for those still interested.

Hint 1 :

Spoiler:
If $\displaystyle \text{nint}\big(\frac{1}{x}\big) = 2n$ (where $\displaystyle n \in \mathbb{Z}$ ) , then $\displaystyle 2n - \frac{1}{2} < \frac{1}{x} < 2n + \frac{1}{2}$. (Whether or not they should be strict inequalties does not effect the calculation of the probability.)

Hint 2 :

Spoiler:
Write out the terms of the series and use the fact that $\displaystyle 1 - \frac {1}{3} + \frac{1}{5} - \frac {1}{7} + \frac {1}{9} + ... = \frac {\pi}{4}$
• Jun 10th 2010, 07:13 PM
chiph588@
Quote:

Originally Posted by Random Variable
Since NonCommAlg didn't explain how he did the problem, I'll give some hints for those still interested.

Hint 1 :

Spoiler:
If $\displaystyle \text{nint}\big(\frac{1}{x}\big) = 2n$ (where $\displaystyle n \in \mathbb{Z}$ ) , then $\displaystyle 2n - \frac{1}{2} < \frac{1}{x} < 2n + \frac{1}{2}$. (Whether or not they should be strict inequalties does not effect the calculation of the probability.)

Hint 2 :

Spoiler:
Write out the terms of the series and use the fact that $\displaystyle 1 - \frac {1}{3} + \frac{1}{5} - \frac {1}{7} + \frac {1}{9} + ... = \frac {\pi}{4}$

Care to elaborate? (Wink)
• Jun 10th 2010, 08:55 PM
simplependulum
Probably this technique is always used in nowadays MO contests .

Consider the function $\displaystyle f(x) = \frac{1}{x}$ then partition the y-axis : $\displaystyle 1 \leq y = \frac{1}{x} < +\infty$ into such intervals : $\displaystyle [1,1.5) , [1.5,2.5) , [2.5,3.5) , [3.5,4.5) ...$ then consider the intervals which are mapped to the x-axis from them :

$\displaystyle ( \frac{2}{3} ,1 ] , ( \frac{2}{5} , \frac{2}{3} ] , (\frac{2}{7} , \frac{2}{5} ], (\frac{2}{9} , \frac{2}{7} ]..$ Shade the intervals $\displaystyle (\frac{2}{5} , \frac{2}{3} ] , (\frac{2}{9} , \frac{2}{7} ]..$ and consider the total length of the shaded intervals which is :

$\displaystyle \frac{2}{3} - \frac{2}{5} + \frac{2}{7} - \frac{2}{9} + ...$

$\displaystyle = 2 \left[ \frac{1}{3} - \frac{1}{5} + \frac{1}{7} - \frac{1}{9} + ... \right] = 2 ( 1 - \frac{\pi}{4} ) = 2 - \frac{\pi}{2}$

The required probability is the ratio of it to the unit length , also $\displaystyle 2 - \frac{\pi}{2}$

Remark : Intuitively , if the function is replaced with step function , the answer will be something like $\displaystyle \ln{2}$