All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Random log (Posted on 2018-02-04) Difficulty: 3 of 5
If r is a uniformly distributed random number between 0 and 1, what is the probability that floor(log2(1/r)) is odd?

See The Solution Submitted by Charlie    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Solution with generalization Comment 1 of 1
f(r)=floor(log2(1/r))

From 1/2 to 1 the function is 0: even
From 1/4 to 1/2 the function is 1: odd
From 1/8 to 1/4 the function is 2: even
From 1/16 to 1/8 the function is 3: odd
etc
Each even interval has a corresponding odd interval which is half as wide, so overall the P(even)=2*P(odd) 
P(even) = 2/3
P(odd) = 1/3
This can also be seen as an alternating geometric series
1/2-1/4+1/8-1/16+1/32-1/64 ... = 1/3

In general for base b logarithm
P(odd) = 1/(b+1)

The above formula works for any positive real base (except 1) 


  Posted by Jer on 2018-02-04 13:19:07
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (5)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2018 by Animus Pactum Consulting. All rights reserved. Privacy Information