Murphy's law is a popular adage in Western culture, which broadly states that things will go wrong in any given situation. It is most commonly formulated as "if anything can go wrong, it will." The law was named for Edward A. Murphy, Jr., a development engineer working for a brief time on rocket sled experiments done by the United States Air Force in 1949.
The letter of the law
Accounts differ as to the precise origin of Murphy's law, and the details about how it was initially formulated. From 1947 to 1949, a project known as MX981 took place on Muroc Air Force Base (later renamed Edwards Air Force Base) for the purpose of testing the human tolerance for g-forces. The tests used a rocket sled mounted on a railroad track with a series of hydraulic brakes at the end.
Initial tests used a humanoid dummy, strapped to a seat on the sled, but subsequent tests were performed by John Paul Stapp, then a Captain. During the tests, questions were raised about the accuracy of the instrumentation used to measure the g-forces Captain Stapp was experiencing. Edward Murphy proposed using electronic strain gauges, attached to the restraining clamps of Stapp's harness, to measure the force exerted on them by his rapid deceleration. Murphy's assistant wired the harness, and a trial was run using a chimpanzee.
The sensors provided a zero reading, however; it became apparent that they had been installed incorrectly, with each sensor wired backwards. It was at this point that Murphy made his pronouncement. According to George Nichols, another engineer who was present, Murphy, in frustration, blamed the failure on his assistant, saying "If that guy has any way of making a mistake, he will." Nichols' account is that "Murphy's law" came about through conversation among the other members of the team; it was condensed to "If it can happen, it will happen," and named for Murphy in mockery of what Nichols perceived as arrogance on Murphy's part. Others, including Edward Murphy's surviving son Robert Murphy, deny Nichols' account, and claim that the phrase did originate with Edward Murphy. According to Robert Murphy's account, his father's statement was along the lines of “If there’s more than one way to do a job, and one of those ways will result in disaster, then somebody will do it that way.”
In any case, the phrase first received public attention during a press conference in which Stapp was asked how it was that nobody had been severely injured during the rocket sled tests. Stapp replied that it was because they took Murphy's Law under consideration; he then summarized the law and said that in general, it meant that it was important to consider all the possibilities before doing a test.
The spirit of the law
Regardless of the exact composition of the phrase, its spirit embodies the principle of defensive design — anticipating the mistakes the end-user is likely to make. Murphy's g-force sensors failed because there existed two different ways to connect them; one way would result in correct readings, while the other would result in no readings at all. The end-user — Murphy's assistant, in the historical account — had a choice to make when connecting the wires. When the wrong choice was made, the sensors did not do their job properly.
In most well-designed technology intended for use by the average consumer, incorrect connections are impossible. For example, the 3.5-inch floppy disk used in many personal computers will not easily fit into the drive unless it is oriented correctly. In contrast, the older 5.25-inch floppy disk could be inserted in a variety of orientations that might damage the disk or drive. Curiously, the even newer CD-ROM technology permits one incorrect orientation — the disc may be inserted upside-down. A defensive designer knows that if it's possible for the disc to be inserted the wrong way, someone will eventually try it.
From its initial public announcement, Murphy's law quickly spread to various technical cultures connected to aerospace engineering. Before too many years had gone by, variants had passed into the popular imagination, changing as they went. Generally, the spirit of Murphy's law captures the common tendency to emphasize the negative things that occur in everyday life; in this sense, the law is typically formulated as some variant of "If anything can go wrong, it will", a variant also known as Sod's law or Finagle's law. For example, whenever a buttered slice of bread falls on the floor, people tend to remember more vividly the times that it fell buttered-side-down, since a buttered-side-up landing is of lesser consequence. Hence, one gets the impression that the bread always falls buttered-side-down. Laws such as Murphy's are a direct expression of such seeming perversities in the order of the universe.
Additional mutations of the law and its corollaries have developed, many of them meta-laws in some way, either through some form of self-reference or referral to other laws or analogies. For instance, the buttered-bread analogy could be further extended: "The chance of a dropped slice of bread landing buttered-side down on a new carpet is proportional to the price of the carpet." (If the buttered side falls facing up, then obviously the wrong side is buttered.)
Some state that Murphy's law cannot operate as a subset of something useful; for example: "It will start raining as soon as I start washing my car, except when I wash the car for the purpose of causing rain." O'Toole's commentary on Murphy's law is: "Murphy was an optimist!" These mutant versions demonstrate Murphy's law acting on itself, or perhaps Finagle's law acting on Murphy's law.