There is no need to be high

How many 1's are there in the binary equivalent of ( 5 × 1024 + 3 × 256 + 15 × 16 + 3 × 4 ) (5\times 1024 + 3 \times 256 + 15\times16 + 3\times4) ?

7 8 5 9 10

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

The given expression can be written as

( 2 2 + 1 ) 2 10 + ( 2 2 1 ) 2 8 + ( 2 4 1 ) 24 + ( 2 2 1 ) 2 2 = (2^{2} + 1)*2^{10} + (2^{2} - 1)*2^{8} + (2^{4} - 1)*2{4} + (2^{2} - 1)*2^{2} =

( 2 12 + 2 10 ) + ( 2 10 2 8 ) + ( ( 2 8 2 4 ) + ( 2 4 2 2 ) = (2^{12} + 2^{10}) + (2^{10} - 2^{8}) + ((2^{8} - 2^{4}) + (2^{4} - 2^{2}) =

2 12 + 2 2 10 2 2 = 2 12 + 2 11 2 2 . 2^{12} + 2*2^{10} - 2^{2} = 2^{12} + 2^{11} - 2^{2}.

Now note that 2 0 + 2 1 + 2 2 + . . . . + 2 9 + 2 10 = 2 11 1 , 2^{0} + 2^{1} + 2^{2} + .... + 2^{9} + 2^{10} = 2^{11} - 1,

and so 2 11 2 2 = 2 11 1 2 0 2 1 = 2 2 + 2 3 + . . . . + 2 9 + 2 10 . 2^{11} - 2^{2} = 2^{11} - 1 - 2^{0} - 2^{1} = 2^{2} + 2^{3} + .... + 2^{9} + 2^{10}.

Thus the binary equivalent of 2 12 + 2 11 2 2 2^{12} + 2^{11} - 2^{2} is 101111111110 0 2 , 1011111111100_{2},

which has 10 \boxed{10} 1's.

You can solve it by more easy way...

Lov Kumar - 5 years, 9 months ago

Log in to reply

Tell me your way please!

Adam Phúc Nguyễn - 5 years, 9 months ago
Sajid Mamun
Oct 10, 2015

Work out the denary answer first:

5 × 1024 + 3 × 256 + 15 × 16 + 3 × 4 = 5120 + 768 + 240 + 12 = 6140 5 \times 1024 + 3 \times 256 + 15 \times 16 + 3 \times 4 = 5120 + 768 + 240 + 12 =6140

To convert this to binary, subtract powers of 2 until you get 0. Start with the biggest power of 2 that is smaller than 6140, and note down each time you subtract a power of 2. The total number of times you subtract a power of 2 is the solution, as this is how many ones are in the 2 0 2^{0} or 2 1 2^{1} or 2 2 2^{2} ... columns.

The first number to subtract is 2 12 2^{12} , which is 4096 4096 . 6140 4096 = 2044 6140 - 4096 = 2044 Next, it is 2 10 2^{10} as 2 11 2^{11} ( 2048 2048 ) is bigger than 2044. Next, it is 2 9 2^{9} , then 2 8 2^{8} , 2 7 2^{7} , 2 6 2^{6} , 2 5 2^{5} , 2 4 2^{4} , 2 3 2^{3} , and finally 2 2 2^{2} .

This is a total of 10 numbers subtracted, so there are 10 of those numbers in 6140, hence there are 10 \boxed{10} ones in the binary equivalent of 6140.

Ahmed El-Ȝshry
Aug 22, 2015

multiplying in binary system is like the decimal system, we used to, when you counter zeros, it doesn't change then multiply the non-zero numbers. ex, in decimal,

2 100 = 200 2 * 100 = 200 ,

in binary, 2 100 = 1000 2*100 = 1000 .

we just multiply the nonzero number but in the binary form. Note that in binary ( 2 x ) 10 = ( 1 0 x ) 2 (2^{x})_{10} = (10^{x})_2

so, ( 5 2 10 ) 10 = ( 5 ) 10 ( 1 0 10 ) 2 = ( 101 ) 2 ( 1 0 10 ) 2 (5 * 2^{10} )_{10} = (5)_{10} * ( 10^{10} )_{2} = (101)_{2} * (10^{10})_{2}

similarly,

( 3 2 8 ) 10 = ( 11 ) 2 ( 1 0 8 ) 2 (3 * 2^{8} )_{10} = (11)_{2} * (10^{8})_{2}

( 15 2 4 ) 10 = ( 1111 ) 2 ( 1 0 4 ) 2 (15 * 2^4)_{10} = (1111)_2 * (10^4)_2

( 3 2 2 ) 10 = ( 11 ) 2 ( 1 0 2 ) 2 (3 * 2^2 ) _{10} = (11)_2 * (10^2)_ 2

Now, we can easily see that the number : ( 11 ) 2 ( 1 0 2 ) 2 + ( 1111 ) 2 ( 1 0 4 ) 2 + ( 11 ) 2 ( 1 0 8 ) 2 + ( 101 ) 2 ( 1 0 10 ) 2 = (11)_2 * (10^2)_ 2 + (1111)_2 * (10^4)_2 + (11)_{2} * (10^{8})_{2} + (101)_{2} * (10^{10})_{2} =

101111111110 0 2 1011111111100_2

and it has 10 10 ones

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...