0

What is the expected number of bit $1$'s when writing a random integer from $1$ to $1024$ in binary?

I noticed that $1024 = 2^{10}$, so maybe linearity of expectation could help here?

Semiclassical
  • 15,842

1 Answers1

3

If the binary number were selected uniformly from the range $\{000000000_2, 111111111_2\}$, the number of 1's would have a binomial distribution ${\cal Bin}(9, \tfrac 1 2)$, and an expected number of $4.5$.

Can you adjust this for a selection from the range of $\{0000000001_2, 1000000000_2\}$?

Graham Kemp
  • 129,094