user-avatar
Today is Friday
May 1, 2026

Archives: 5 June 2008

June 5, 2008

just thinking

by viggy — Categories: Uncategorized — Tags: Leave a comment

I just completed watching all 3 parts of Godfather. No doubt they are counted in the list of best movies ever made. Wonderful story and so well directed and acted. Over all a very good movie. I was just thinking about the way it ended. Michael lost his daughter whom he had always thought of protecting. I am going to describe about some roles in the movie and how i understood them.

I think about the 3 gangsters, Vito Corleone, Santino Corleone and Micheal Coleone. Vito Corleone was a very good person by heart and i liked the way he ruled. His decision to go against supporting Drug dealing was right but as we know it had very bad consequences on him and his family. This again raises an importent moral question. Can a person try to be good while working along with bad persons? This is a very importent question and i am sure you would agree with me if i say that a definite yes or no for this question cannot be given. Santino, on the other hand,was a person who loved his family very much, but he was a person who had power but not the patience to think before useing it which ultimately made him loose his life.

Now the main character, Micheal Corleone, a gangster who never wanted to be a gangster, but had to become a gangster to protect his family. He liked his father very much but didnt like his father’s work. But still he got involved when his father needed him. So now let me share with you the moral question that i have always been thinking about. What do you do when someone whom you like very much but is superior to you (in some or other way) is doing wrong? You have only 2 option, either support him in whatever wrong deed he is doing or leave him and try to lead your own life leaving all concerns about the person. Micheal’s daughter choose the first option and was killed whereas his son choose the second option and became a good musician. Both loved their father very much but choose different way to show their love. So which is right? What would his son do if Micheal was shot instead of his daughter and was badly injured?

We find similar examples in both Ramayan and Mahabharta. In Ramayan, we see how Bharath cuts off all his relationship with his mother for being so unjust to his brother Ram. Where as in Mahabharta, due to the support Dhritarastra gives to his son, Duryodhana, he loses not only all his sons but also his dynasty is washed off completely. So history and also as in Godfather suggests that, it is always good for you to leave a person who is very much involved in his bad deeds.

June 5, 2008

Wonderful Divisibility Rule

by viggy — Categories: Uncategorized — Tags: Leave a comment

I had always appreciated the orderness of decimal number system. And that is why i always believed that even number 7 should have a divisibility rule. And with this belief, i had tried many times to find it. Well i had actually never tried seriously, i spent time thinking on it only when i had nothing else to do like when i was travelling on the train or on the bus or when i was sitting idle in my village. However I never succeeded in getting any closer to a solution.
But still i maintained my belief. And i was awarded for it when i was once looking into tutorial for programming in basic c++ in topcoder here. After going through the tutorial, i looked into the sample programming problems . That is when i found this problem statement and the wonderful theory about decimal number system. The theory stated that, for a ‘n’-digit number,x, to be divisble by a number ‘p’, there should exist a set of numbers a={a1,a2,a3…,an; a1=1, ai<=p}

y=(X1.a1)+(X2.a2)+(X3.a3)+….+(Xn.an),

is divisible by p where X1,X2,X3 are the n digits of the number x. For example, in case of 7, a1=1,a2=3,a3=2,a4=6,a5=4,a6=5…. Consider X=357, so X1=7,X2=5,X3=3. So

y = (X1.a1) +(X2.a2)+(X3.a3)
= (7.1)+(5.3)+(3.2)
= 7+15+6
= 28 which is divisble by 7.
Hence X=357 is divisible by 7.

This divisbility rule can be applied to any number and is very useful if to find whether a big number is divisible by a another big prime number. I still have not understood the rule completely like what is the reason behind it and whether there exist a proof for such rule. But,really, I was very happy to know this proof. It just requires that you know the number set, a.
Also finding the number set,a, is very easy. For Example, consider that we have to find the number set,a, for p=13. We know that,always, a1=1. Also for any n-digit number, p, ai=pow(10,i), where i<=n. Hence in this case, a1=1,a2=10. To find a3, consider a 3-digit number which is divisible by 13, like 117. So X1=7,X2=1,X3=1. Hence y=(1.a3)+(1.10)+(7.1). So now solve the above Equation by substituting values for a3 which are less than 13, such that y is divisible by 13. We find a unique solution, which is, 9. Following the same method, we find for p=13, a1=1,a2=10,a3=9,a4=12,a5=3.