The advantages of knowing Computer Science

In India, Computer Science as a subject is mostly considered as a high status subject. It is as the top choice of all the top rankers in major entrance examination (for graduation) even though they really do not have any insight into programming. Ghastly isn't it. Its just a subject to get a good job.

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 ,
all we need to do is multiply each bit (starting from the right) with powers of 2 (from 0 to 7) and add them up.
Like this = (0x 27) + (0 x 26) + (1 x 25) + ... +(1 x 20)
            = (0x128) + (0x64) + (1x32) + (0x16) + (1x8) + (0x4) + (0x2) + (1x1)
which will evaluate to = 32 + 8 + 1= 41 (which is indeed the conversion of 41(decimal) in binary).

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:

20 , 21, ... , 24, 25, (100 - the amount put in) i.e:

1 , 2 , 4 , 8 , 16 , 32 , 37                          ---ANS


(But this is just one of the many combinations we can have, this one just attracts me)

So you see, computer science is indeed helpful to know for gathering various skills. So next time anyone comes and tells me that do all the computer stuff later and do physics or chemistry or maths, I shall tell them this small story which is a part of many larger and wonderful stories dealing with the versatility of Computer Science. Well, it has 'science' in its name doesn't it?

And on a second thought, I solved a good puzzle in just 1 byte. Thats good programming. I am going to buy myself something now.


--
Ashutosh Rishi
Stay Hungry, Stay Foolish


Little love for the Koala?


Karmic Koala was one of the most awaited ubuntu release. But soon after its released, It received completely mixed and extreme reviews. While some say they loved it and yes, it was the best Ubuntu ever, there were some who claimed it 'crashed' too often. On every forum, these people posted, they received heated arguments claiming that it was the fault of their hardware not really the software. 

But if you really think about it, Ubuntu Karmic is bringing about a lot of changes which are newly implemented and in a very short time (of 6 months). This results in some bugs. But as my experience with linux says: if you can fix it, its only on a linux. And this does turn out to be right! Ubuntu's community has solved most of the problems people were facing. But that shouldn't have been the situation in the first place!

Ubuntu's community is huge, but they work on a tight schedule. A new release every 6 months, and a Long Term Release (LTS) after 2 years. But working on a tight schedule will surely create unsolved problems! Right now, Ubuntu is like the forerunner and a host to newcomers switching to Linux. It should be at its best to win over users. Its amazing how the developers do it. They have already announced a new release after 6 months in May 2010, which will be a LTS - The Ubuntu 10.04 Lucid Lynx. (See! I told you they have catchy names)!

But yet, apart from some periodic problems, Ubuntu continues to surprise its users with amazing new features. For those people, who have Karmic up and running, are getting the best of Linux. I, have still not been able to try it. But even though I read these negative reviews, I will still try it and urge you to do the same. In fact most of the negative reviews stop making sense after the first paragraph (of 4 lines). Some even compare it to other free software which is stable and fast, like Mac OS X. Mac OS X is not even a free software!! Well, at least that helps us, trying to get people to go for the change. It only takes 10 minutes to install, 10 minutes to decide whether you like it, and 10 + 5 minutes, to uninstall! 

See this for reading those reviews (positve and negative): 

Taking part in my first Ubuntu Open Week

Oh yes, I am a very big fan of Linux, especially the Ubuntu operating system - an awesome design, easy use (dispelling all the old facts that Linux is just the command line, but if you do understand the power of the command line, Ubuntu has it too), plus its amazingly fast. But thats not the point, not just yet. After the release of Ubuntu Karmic Koala on 29th October, the Ubuntu community conducts an open week of discussions on its IRC channel with key persons conducting a hourly sessions. You really do tend to meet great people there.

The Internet Relay Chat (IRC) is an amazing place to meet brilliant people. Its like chat room with many channels, except the difference is that, the channels are all mostly composed of developmental projects, or are like a help-lines .etc. In short its a intellectual area. The Ubuntu channel is a bit different. Consisting of the most members on the whole of IRC at any given time, you can ask any question and expect many answers and none trying to tell you how stupid that question might be. Well thats an Ubuntu community, with respect for everybody.

The open week was on a totally different level. The sessions all ran smoothly and effectively. Personally I learnt a lot from there, not just about Ubuntu, but many other different aspects (I got to ask many questions too :) ). The session conductors were the most brilliant people have met. You could actually feel that as they spoke.

The Open Week is inspiring. But I couldn't stay for full sessions. The only full session I stayed for was 'Writing a book', and I think thats what I am going to do! And also start contributing to the art group on the Ubuntu Community.
Their community is what that makes them different and the best. (Also their cool names for releases! )

Getting in the wave

Having missed the deadline for requests for Google wave invitation, I found myself sending requests to Google team through all of my ids. Guess that would have just decreased my chances more. At the same time many sites took this glooming monetary opportunity and began trading Google wave invites (If I am not wrong, this isn't the first time this has happened with Google's invites). Giving up all hope to see the developer's preview of Google wave firsthand, I stopped looking for a free invite (You really need a good connection and a good RSS reader to keep track of all the sites claiming to distribute free invites), I prepared myself to wait for the final product. But the world is not devoid of irony, I got my invite from a friend.

Exited as I was, with only one contact in Google wave, I really felt lost. It looked pretty good. After reading through some sites, I first checked out the public wave search. I had no warning that there would be thousand waves springing up at the same instant making my already slow internet connection slower. The trouble did not stop, I needed to find a english wave because I could see none. With surprisingly fast clicking, I managed to open a newbie board before it was piled on by some japanese and chinese waves.

Clogging up is the main defect of public waves. With so many users editing at the same time, the best connection wins. There were so many replies and texts springing up that I had no choice but to close the wave. I tried some other waves (English) and the same procedure followed. After figuring out how to stop the public wave search to stop I started concentrating on editing my profile, as that was the only thing I could do peacefully.

And by the way, every wave you click comes up in the inbox, and there is no direct way of deleting them. Moving them to the trash doesn't really help because the trash does not have a empty option yet. The only way to get around this is to make a new folder and move the unwanted waves there and delete the folder.

I still haven't been able to reply in any public wave till date.


Stay Hungry, Stay Foolish

Hello And Welcome to my blog.

They say that adventures can happen anytime, anyplace, then why not on the web? Going through my daily routine of surfing and sometimes designing and coding, I sometimes stumble upon tasks which takes me around the web trying to get it right. It is surely a kind of adventure- all the tension, the time-limit, and limited resources. But nevertheless, it is fun.

If you have some of your own adventure stories, then I would like to hear them. Please do email them to me. If you want to hear mine, then why not comeback here and read them? You can also subscribe to my RSS feeds!