In an electrical grid, contingency is an unexpected failure of a single principal component (e.g., an electrical generator or a power transmission line) that causes the change of the system state large enough to endanger the grid security. Some protective relays are set up in a way that multiple individual components are disconnected due to a single fault, in this case, taking out of all the units in a group counts as a single contingency. The choice of term emphasizes the fact that a single fault can cause severe damage to the system so quickly that the operator will not have time to intervene, and therefore a reaction to the fault has to be defensively pre-built into the system configuration. Some sources use the term interchangeably with "disturbance" and "fault". Contingency analysis The contingency analysis application periodically runs on the computers at the operations centers providing suggestions to the operators based on the current state of the grid and the contingency selection. The software provides answers to the "what if" scenarios in the form of "alarms": "Loss of component X will result in overload of Y by Z%". By the 1990s analysis of a large interconnected system involved testing of many thousands of contingency events (millions if double contingencies were considered). An effect of each contingency requires performing a power flow calculation. Due to the rapid change of the state of a power system the run of the application shall complete in minutes (up to 30) for the results to be useful. Typically only selected contingencies, mostly single ones with some double ones are considered to speed up the process. The selection of contingencies is using engineering judgment to choose the ones most likely to cause problems. N-X contingency planning Reliability of the energy supply usually requires that any single major unit failure leaves the system with enough resources to supply the current load. The system that satisfies this requirement is described as meeting the N-1 contingency criterion (N designates the number of pieces of equipment). The N-2 and N-3 contingency refers to planning for a simultaneous loss of, respectively, 2 or 3 major units; this is sometimes done for the critical area (e.g. downtown). The N-1 requirement is used throughout the network, from generation to substations. At the distribution level, however, the planners frequently allow a more relaxed interpretation: a single failure should ensure uninterrupted delivery of power to