Tuesday, August 31, 2010

The solution: Binary numbers

So what is the way to convert a binary number, say, 11011 to its decimal equivalent? A basic simple question for anyone who has gone through high school mathematics. Since I am one of them let me solve it here.

1*16 + 1*8 + 0*4 + 1*2 + 1*1 = 27

In words, number 27 is the sum of 1, 2, 8, and 16. More importantly any decimal number can be seen as a sum of numbers that are powers of two. And the binary equivalent of the number decides which of the power of two numbers take part in the summation. Like in the above case it was 1, 2, 8 and 16. Basic binary number concept right?

Lets take a fresh look at the puzzle I shared at this link. And the solution would become obvious to you. So all numbers less than 128 (binary equivalent of 128 is 1111111) can be seen as summation of numbers 1,2,4,8,16,32 and 64.

Off-course I didn't come to the solution through this route. I picked 1 and 2 and then kept including all the numbers that I could not sum up by using the numbers I already had. So 3 I got from 1+2. Because I could not get 4 from 1 and 2, I included 4 and marched on. By the time I reached 8, I noticed the pattern and  tried 16 to verify. And then the above concept of binary numbers came to my mind. And so I was sure I had the answer.

Also I would like to share one interesting solution Rajesh gave. I will quote his response directly here. You can find his answer at this link in the comment section.

The answer is:
ONE each weight of 1,3,9,27 and 81 kg.
...
I want to weigh 2 as 3-1 and 4 kg as 9-(3+1).
I think this sequence can be extended up to 1000. If fact 1,3,9,27 and 81 can weigh up to 121 kgs.

6 comments:

Rajesh Kumar 'Nachiketa' said...

Nice discussion. This reminds me of old binary days....B.Sc. (Ramjas College). I think it deserves a nice post on binary arithmetic. I should write..mostly about doing all functions (addition, subtraction, multiplication and division) by only addition.
I really enjoyed it when I read that calculators and computers can do only and only addition....writing about it would be great.
anyways the number systems in itself is great and WASIM RAJA does many things with this kind of number systems....

Rajesh Kumar 'Nachiketa' said...

Sequence in the problem of weight is in raising powers of 3. So these numbers (1,3,9,27....) will be used to convert a number on base 3 to a number in decimal system. for example.
(121)_3 =1*9 + 2*3 + 1 = (16)base10


Digits in a multy-digit number should be multiplied by its base to the power its place value. This is the way we do in decimal.

532=5*10^2 + 3*10^1 +2*10^0

cool.....

Utpal said...

@Rajesh: In response to your first comment, yes i think you should write a post on what you mentioned. Would wait to see that.

In response to your second comment: I didn't quite follow that comment. I off course followed the mathematical points but i didn't quite make sense of it. I sensed you are trying to say something in the comment but could make of it. Please elaborate.

Also, your expression of getting 16 using the combination of powers of three seems all fine but in context of the puzzle you would need 1,3,9, and 27 to get 16.

16= 27-9-3+1

otherwise you would need 2 weights each of 3 kgs to get 16. Which off course you know and understand and that's the reason I am confused as to what you wish to say.

Interestingly, why is it that we learn about base 2 (binary), base 4 (Quaternary), base 8 (octal) and base 16 (hexadecimals) and NOT base 3 or base 5 or base 7?

Rajesh Kumar 'Nachiketa' said...

@Utpal,
I understand your approach to get any number by adding any multiple of 2 (1,2,4,8....). Because of constraint of the weighing problem, where I can use some weight on the opposite side, The numbers which can be used to get any number are (+/-)1, (+/-)2, (+/-)4, (+/-)8.

This reminds me of the methods of writing negative numbers using the negative weight value as the sign bit of that number. I will elaborate in my later post.

ZEAL said...

.

Rajesh ji,

I have also written a post on 'Binary numbers' on 7th sept.

Kindly have a look. Here is the link --

द्विआधारिय गणितीय पद्धती [ Binary numeral system ] ---ZEAL

http://zealzen.blogspot.com/2010/09/binary-numeral-system-zeal.html

I very much liked this post of yours .

Regards,
Divya

.

Rajesh Kumar 'Nachiketa' said...

Liked the post and thanks for sharing the origin of the binary numbers.....
mujhe yaad hai Pitaji (teacher in school too) padhaate the alag alag adhaar ki snkhaayon ke baare me..

Mythology: Does it have scientific answers?

When one talks about religion, it's scientific aspect is never discussed. A scientist would probably define religion or a religious r...