Solving the binary puzzle

(This is the answer to the puzzle proposed in the previous post.)

If you write all binary numbers between 0 and 2n-1 you will notice that the columns show a pattern. See for example the first 8 binary numbers:

000
001
010
011
100
101
110
111

Each column has exactly the same number of zeroes and ones! Then the total number of ones is half the total number of digits:

\displaystyle \frac{n 2^n}{2} = n 2^{n-1}.

Once we have the formula, the values for n = 1 to 50 can easily be calculated.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s