Best Answer bubbled, 06 May 2014 - 05:47 AM

Spoiler for My take

Go to the full post
You can use logic to find that n=2 is 1, n=3 is 3/4 and n=4 is 1/2. It gets harder to use logic after that. This problem begs for a simulation to get an idea of a simple formula.

Use the real interval [0,1] and choose p_1 to be .5 and then you can simply collect your random points in a list and see whether max.list - min.list is less than .5.

Here is the result of the simulation:

n = 3 Probability = 0.749789

n = 4 Probability = 0.499941

n = 5 Probability = 0.312493

n = 6 Probability = 0.187558

n = 7 Probability = 0.109467

n = 8 Probability = 0.062752

n = 9 Probability = 0.034904

n = 10 Probability = 0.019425

n = 11 Probability = 0.010682

n = 12 Probability = 0.005788

n = 13 Probability = 0.003232

n = 14 Probability = 0.001665

n = 15 Probability = 0.000889

n = 16 Probability = 0.000488

n = 17 Probability = 0.000283

n = 18 Probability = 0.00014

n = 19 Probability = 7.2e-05

An interesting pattern emerges. The probability for n=2 is 2/2, for n=3 is 2/2*3/4, for n=4 is 2/2*3/4*4/6, for n=5 is 2/2*3/4*4/6*5/8. This can be simplified to:

n/(2^(n-1))

Use the real interval [0,1] and choose p_1 to be .5 and then you can simply collect your random points in a list and see whether max.list - min.list is less than .5.

Here is the result of the simulation:

n = 3 Probability = 0.749789

n = 4 Probability = 0.499941

n = 5 Probability = 0.312493

n = 6 Probability = 0.187558

n = 7 Probability = 0.109467

n = 8 Probability = 0.062752

n = 9 Probability = 0.034904

n = 10 Probability = 0.019425

n = 11 Probability = 0.010682

n = 12 Probability = 0.005788

n = 13 Probability = 0.003232

n = 14 Probability = 0.001665

n = 15 Probability = 0.000889

n = 16 Probability = 0.000488

n = 17 Probability = 0.000283

n = 18 Probability = 0.00014

n = 19 Probability = 7.2e-05

An interesting pattern emerges. The probability for n=2 is 2/2, for n=3 is 2/2*3/4, for n=4 is 2/2*3/4*4/6, for n=5 is 2/2*3/4*4/6*5/8. This can be simplified to:

n/(2^(n-1))