Computer science is one subject I won't mind studying 16 hours a day because it interests me. Its not needed for any entrance examination I am going to give soon though. It is my get-away. A blissful world.
Recently my mother came up to me and handed me a maths problem. The problem reads:
"If you are given a total of Rs.100 (Rs. :Rupees, Indian currency) and 7 bags, How will you distribute the Rs.100 (in integral numbers) among the 7 bags so that if asked for any sum of money (from 1 to 100), you would just have to hand over certain number of those bags to achieve the denomination. You can hand in 1 bag or all the seven bags accordingly. "
I took the problem on a sheet of paper and put it away because I was busy with other stuff. I remembered having seen such a problem before and remembered faintly that the solution I saw was to do with geometric progressions. I continued my work without sparing a thought to the problem. I was doing physics. A subject which mattered for the entrance examination.
After a while, I finally became fed up with all the capacitors and my mind slowly began to drift over to thinking about what I had studied in computer science last night. Pretty soon, I was not drawing capacitors but a logical map of a program I had set for myself to practice ( I am still a new programmer and practice makes you perfect doesn't it). My eyes finally fell on the logic puzzle. I had taken it down as badly as I could and was having a hard time figuring out the writing. When I finally did, I read the puzzle out loud to myself. And the answer struck me immediately.
My mind had initially rejected the puzzle because it had the impression that it had to think over some geometric progression to get the answer. But when it was in its turbo state thinking about computer science, it evaluated the answer through the basics of computers devoid of any geometric sequence or any permutations. The logic was as simple as a gravy. I think I mean gravity but anyways. The logic was 1 byte.
Any person who knows how a computer works know that it is the 1's and the 0's that do the trick, And any person who dwelt further into it to find out how and why knows that 1 byte is an array of 8 bits where each bit has either 1 or 0 in it. With the combination of the 8 digits (containing only 1 and 0) you can obtain a number from 0 to 255. Any number! This is done in the following way:
ex: if the 1 byte looks like: 1 0 0 1 0 1 0 0 ,
Therefore, going back to the puzzle, we need only 7 bits, or bags. But if we really go by the above method word to word, we would end up with a total denomination of over 100. Hence we take only 6 bags and the 7th bag has 100 minus the amount already put in the bags. Our answer is therefore:
Stay Hungry, Stay Foolish