Wednesday, May 21, 2008

Looking at life Differently

I am continuing my blog after a long gap...It's ten past twelve and dead silence prevails in my room except the sound of the fan..This blog is about looking life differently. For many Life is Happy when only they have no problems.They look problems as obstacles which hinder their growth.If you are in this trap , you can't experience the beauty of nature and the thrills of life..People should know to live life wisely."The greatest game to be played in Life is, playing the game of life wisely".

Many are hurt by incidents.Their whole life goes in sorrow,jealousy and don't experience happiness.When you operate from these things you miss many rich things that should be enjoyed and cherished.Think yourself as an empty pot.All your hurt,sorrow are like holes in the pot.Though happiness and Divine energy flows through you, it will leak through those holes. So you have to be with no sorrows and worries to cherish each and every moment in Life.

Actually if looked closely, the problems and situations in life doesn't create sorrow and hurt.It is your interpretation in your mind that is hurting you.Just reflect on this story. A monk was giving lecture to a group of people.The lecture was for a long time.One of the men seated in the last row fell asleep.So the monk asked the man, who slept to come and sit in the first row.There were really lot of people in the crowd and the man who fell asleep was so popular and a rich man. The man said to the monk that, you had hurt me.The monk replied with innocence, "How did I hurt you...?". The man said, you have ashamed me in front of a crowd.Actually it was not the words of the monk that hurt him.It was his interpretation in the mind. His interpretation in the mind was, I am such a popular and a rich person, How come this monk hurt me in front of such a crowd.After some time, this happened the monk asked another person to come and sit in the first row..That man said to the monk that, I am really happy as you had asked me to come and sit in the first row.The man was happy because in this mind the interpretation was as I was listening the lecture very attentively , seeing my interest the monk has called me in the front.The monk used the same words.But it was the interpretation of the minds of both people.Reflect on this story very closely.

Similarly, in our life incidents and situations doesn't hurt.It's your interpretation in your mind that hurts.While reading on apply this to your life.Only then it becomes a wisdom rather than knowledge.Please understand that in life nobody can hurt you.Only you hurt yourself by the interpretation in your mind.Problems will be there in Life.But don't look at problems as problems.Because the problem is not the problem.The problem is that, when problem comes, the interpretation in your mind is the problem.

Learn to look at problems differently.I 'll narrate another story to look at problems differently. All parents send their kids to their school at the age of 3.The child cries out when he goes to school.For that child it seems as an act of cruelity at that time. But the child will later realize the value he/she had gained by going to school. The child will realize using his/her experience that,parents had sent him/her to the school to make him better and better.Similarly God gives problems for you to make you better and better but not bitter and bitter. It's an act of extreme love by God.A child while looking at a surgeon doing surgery will say it as a cruel act.But later he/she will realize the use of it.Similar are problems in life.They are divine surgeries.It doesn't mean that while problems come you should be hurt and sorrow.It means that problems are there and it is your wish whether to suffer in that or not.

Once Buddha was scolded by a person in public.Buddha din't over react to that situation by again scolding him.He kept silent and replied to the man who was scolding that, though you are words are fiery, they don't hurt me.It's like throwing fire into a moving stream.As soon as the fire touches the river, it gets put off.Similar is my internal state of mind said Buddha.If you had deveoped this art, problems will not be solved but problems will be dissolved.For being in this state of mind, you should be void of hurt,worries and sorrow and the Divine should flow through you.As this seems blogs seems to go longer and longer, I end by here now.Still there are lots of things to say about problems and there are beautifull stories to reflect upon.It will come in my next blog.Live life wisely and enjoy the thrills of life.Every moment is a gift of god.God knows what is the best for you at that moment.

Tuesday, February 19, 2008

Algorthm Design

Algorithms is one of my favorite subjects in my life which I love so much. There are many Algortithm design techniques available.It's good for students who have taken computer science as the majors to have a deep knowledge about algorithms and it's various design techniques.

Most of the time when a programming puzzle is given most of the students try to Brute force for the solution.Although this is also a technique to find the solution to the problem,don't resort to it always.Resort to Brute force when you have no other way to solve the problem.And if you are going to brute force you are assured of a solution but the time taken to execute is very large for very big inputs.

There are various algorithm design techniques like Divide and Conquer,Dynamic Programming,Greedy algorithms,Branch and Bound,Linear Programming,Backtracking etc.It's very important to know what each design technique means and try to analyze and compare the various design techniques.To be more confident on these design techniques try to solve the programming problems at www.topcoder.com .

I will give you a simple problem in probability.Try to solve this.I am writing this problem because it cannot be solved using brute force method.Think very smart and different to find the solution.

A redundant storage system can survive a certain number of hard drive failures without losing any data. You are doing some analysis to determine the risk of various numbers of drives failing during one week. Your task is complicated by the fact that the drives in this system have different failure rates. You will be given a double[] containing n elements that describe the probability of each drive failing during a week. Return a double[] containing n + 1 elements, where element i is the probability that exactly i drives will fail during a week. Assume that drive failures are independent events.

Examples

0)

{1.0, 0.25, 0.0}
Returns: {0.0, 0.75, 0.25, 0.0 }
The first drive is guaranteed to fail, the second has a 25% chance of failing, and the third is guaranteed not to fail. So there is a 25% of two failures and a 75% chance of only one failure.
1)

{0.4, 0.7}
Returns: {0.18000000000000002, 0.54, 0.27999999999999997 }
There is a probability of 0.4 x 0.7 = 0.28 that both drives will fail. The chance that only the first will fail is 0.12 and that only the second will fail is 0.42, for a total probability of 0.54 that exactly one drive will fail. This leaves a probability of 0.18 that no drives will fail.
2)

{0.2, 0.3, 0.0, 1.0, 0.8, 0.9}
Returns:
{0.0, 0.011199999999999993, 0.15319999999999995, 0.5031999999999999, 0.2892, 0.0432, 0.0 }

If you could solve the problem,write the code in the comments.
hit counter