Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I have an array of $n$ numbers in the range [0,1) and have the following events for $y$:
for $i=1$ to $n$ :
generate a new number $y$ in [0,1) uniformly and independent of previous
if $y\ge0.5$ then
toss a fair coin if the coin turns up "HEADS" then

I need to find out what is the probability that y is in the range [0,1/n)
My solution: $1/2+1/2\cdot1/2=3/4$ - the first 1/2 is the probability when y is not greater than 0.5. The second $1/2\cdot1/2$ is the probability when $y>0.5$ AND because of the fair coin - we have 1/2 change of being HEADS.

Is it the correct way ? Do I need to add n into the equation? Please correct me if I am wrong. Thanks!

share|cite|improve this question
Yes, you need your answer to depend on $n$ because obviously the chance of $y<1/2$ is much better than the chance of $y<1/1000000$. What you have computed is the right answer for $n=2$. You'll probably need to treat the case $n=1$ as a special case. – Henning Makholm Nov 4 '11 at 19:34
The relationship between $y$ and the array of $n$ numbers isn't clear to me. Does $y$ represent one of the $n$ numbers, or is it an additional number? If additional, what is its relationship to the $n$ numbers? If it's one of them, does that mean the same coin toss procedure is applied to all $n$ numbers, and are you interested in all or (at least) one of them lying in the given range? And what's the significance of $n$ turning up again as an interval bound? Please clarify. – joriki Nov 4 '11 at 19:53
Your edit hasn't resolved any of my questions. You're now generating $n$ numbers $y$ instead of just one, but their relationship to the numbers in the array is still unclear. – joriki Nov 4 '11 at 22:30
up vote 0 down vote accepted

Assume $n$ is fixed beforehand. Then for each $y$ probability that it will be in range [$0,1/n$) is

because with probability $\frac{3}{4}$ $y$ is a random number from [$0,1/2$) and there with probability $\frac{1/n}{1/2}$ it belongs to the range [$0,1/n$).

1. Probability that all $y \in$ [$0,1/n$) is equal to $$(\frac{3}{2n})^n$$ 2. Probability that exists $y \in$ [$0,1/n$) is equal to:$$1-(1-\frac{3}{2n})^n$$ which is $1-$ probability that all $y \in$ [$1/n,1$)

share|cite|improve this answer
Thanks! So based on the above if I want to find probability of y being in the [1/2,n) then it would be 1-3/4=1/4n ? – user629034 Nov 4 '11 at 21:02
What does [1/2,n) mean ? isn't n >= 1 always ? if so, then it's equal to probability of y being in [1/2,1) because y cannot be greater than 1, and that probability is 1-3/4=1/4. – Grigor Gevorgyan Nov 5 '11 at 6:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.