Musings

Wednesday, November 16, 2005

Code need not be a bore!

Have come across some funny error messages, funny documents. Would like all those who happen to read this to share whatever funny stuff they've found!

tar cvf road.tar
tar: Cowardly refusing to create an empty archive

---Ha Ha....I am sure that is what the Bangalore city corporation keeps doing!!! :-)

kill politicians
bash: kill: politicians: no such pid

---Ha Ha..

killall politicians
politicians: no process killed

---Read as no persons killed!

And the best one that I've seen so far is in Oracle alert logs -

*** SESSION ID:(1000.1) 2006-03-18 18:02:51.720
Background process SMON found dead

----Ha Ha Ha ..... the body was found in the lake. Luckily, there was a pid from which identification could be made! Police found that OOM killer was on prowl! :-)

Thursday, November 10, 2005

10 plus plus

10 Plus Plus
------------

That says it. The wonderful properties of the number 11.

All you have to do is add when multiplying by 11. Well, it is like this

456 X 11 = 5016
But, how do you get at 5016

Not by saying 11-6-are-66, write 6 carry 6, 11-5s-are-55.......
That is a little round about.

First write 6,
then add 5 and 6, write 1 (keep 1 as carry over)
Add 4 & 5 & carry over of 1 which is 10 so write 0
Add 1 to 4 and write 5

Verification using normal method -
456
X 11
-----
456
456
-----
5016
-----

Method: For multiplication by 11, simply add 2 adjacent digits at a time, starting
from your right most corner, write the residue and use the carry over for
the subsequent addition. Remember to first put a zero in front of the number.

How does it work: Well, look at the image of the normal method verification
We always end up adding the previous two digits when we write down. Hence,
we can just do the same mentally!!!

Now for any large number -

76543 X 11

Write
3
7 (3+4)
9 (4+5)
1 (1 carry over as 5+6 is 11)
4 (1 carry over as 7 + 6 + 1 is 14)
8 (0 + 7 + 1 is 8)
= 841973

Fine, so how about 9 X 11

Write
9 (The first digit)
9 (0+9, remember?!!)

So, 09 X 11 = 99

Ok, let us try something bigger

34587901 X 11

And the answer is -

380466911

Simple although we all know the 11 tables by heart!

P.S: Honest, this is my discovery - although I kinda feel that Aryabhatta, Ramanujan and all great mathematicians are having a hearty laugh up there!!! :-)