# Murphy’s law: A simple and intuitive view into how it works

Murphy’s Law[1] was named after Edward Murphy[2], who was an American aerospace engineer. Although the law itself might be as old as the civilization itself. In layman’s terms, the law can be stated as,

If anything can go wrong will go wrong, given enough trials.

It is such a simple and intuitive statement yet so hard to wrap your head around in mathematical terms. Today I am going to share with you how I make sense of Murphy’s law in mathematical terms.

To achieve this, first let’s paint a scenario where we are in a dark room and we need to switch the light on. There are five switches on the switchboard and only one of them turns the light on. As the room is dark, we can’t really see which one is the right switch.

Now, if we try to choose the right switch from the switch board, what will be the probability of our success and failure? We can calculate it like this:

\begin{align*} P(success) &= \frac{number \: of \: right \: switches}{total \: number \: of \: switches} \\ &= \frac{1}{5} \\ &= 0.20 \end{align*}

\begin{align*} P(failure) &= \frac{number \: of \: wrong\: switches}{total \: number \: of \: switches} \\ &= \frac{4}{5} \\ &= 0.80 \end{align*}

Let’s assume we chose the wrong switch(we will consider the most extreme case in order to demonstrate the outcomes). In the next step, there will be four switches left and we have to choose from them. At this step, the probability of success and failure will be:

\begin{align*} P(success) &= \frac{1}{4} \\ &= 0.25 \end{align*}

\begin{align*} P(failure) &= \frac{3}{4} \\ &= 0.75 \end{align*}

Like this, the probability of success and failure will be 0.33 and 0.67 respectively in the next step. And it will be 0.50 and 0.50 in the next after that. At this point we have a fifty-fifty chance of choosing the right switch and if we fail we will choose the right switch with 100% certainty in the next step.

Now, we all can see that during the whole process, up until the last switch, the best odds of choosing the right switch we had was 50%. All the rest of the time, the probability of failure was larger than the probability of success.

For this reason, Murphy’s law prevails in a practical way. We might choose the right switch at any step of the process, even in the first try every now and then. But if we continue to run this experiment long enough and enough times, we will see that Murphy’s law has a profound immersion in everything. Because there are so many ways something can go wrong and so few ways it can go right.