Probability of randomly selecting a number in the set ${2^n}$ from positive natural numbers?

120 Views Asked by At

From substituting up to the first $m$ natural numbers I found that the probability of an integer being in the set of integers $2^n$ is approximately $\frac{\ln(m)}{m\ln(2)}$. For example, for the first 10 natural numbers (1,2,3,...,10 where $m=10$), the probability of randomly selecting a integer in $2^n$ (there are three here – 2,4,8) is $\frac{3}{10}$ or 0.3. The approximation defined this as 0.332. However, I don't know the intuition behind this approximation (i.e. if it will work for all $m$) and I can't seem to find an exact form of this. I would be grateful for any help (btw, my main issue is finding an exact form of the problem).

1

There are 1 best solutions below

1
On BEST ANSWER

$\dfrac{\ln(m)}{m\ln(2)} = \dfrac1m \log_2(m)$ is not a bad approximation, and is a lower bound, while $\dfrac1m \log_2(m+1)$ is a slightly better lower bound (tight when $n=2^k-1$ for some $k$)

$\dfrac1m \left(\log_2(m) +1\right)$ is an upper bound (tight when $n=2^k$ for some $k$) and is $\frac1m$ higher than your expression

As lulu says in the comments, the exact value is $\dfrac1m\left(\lfloor \log_2m\rfloor+1\right)$, shown as black below; your expression is shown in red and the upper bound in blue

enter image description here