In certain sports, a magic number is a number used to indicate how close a front-running team is to clinching a division title and/or a playoff spot. It represents the total of additional wins by the front-running team or additional losses (or any combination thereof) by the rival teams after which it is mathematically impossible for the rival teams to capture the title in the remaining number of games. This assumes that each game results in a win or a loss, but not a tie. Teams other than the front-running team have what is called an elimination number (or "tragic number") (often abbreviated E#). This number represents the number of wins by the leading team or losses by the trailing team which will eliminate the trailing team. The largest elimination number among the non-first place teams is the magic number for the leading team.
The magic number is calculated as G + 1 − WA − LB, where
For example, in Major League Baseball there are 162 games in a season. Suppose the top of the division standings late in the season are as follows:
Then the magic number for Team A to win the division is 162 + 1 − 96 − 62 = 5.
Any combination of wins by Team A and losses by Team B totaling to 5 makes it impossible for Team B to win the division title.
The "+1" in the formula serves the purpose of eliminating ties; without it, if the magic number were to decrease to zero and stay there, the two teams in question would wind up with identical records. If circumstances dictate that the front-running team would win the tiebreaker regardless of any future results, then the additional constant 1 can be eliminated. For example, the NBA uses complicated formulae for breaking ties, using several other statistics of merit besides overall win/loss record; however the first tiebreaker between two teams is their head-to-head record; if the frontrunning team has already clinched the better head-to-head record, then the +1 is unnecessary.
The magic number can also be calculated as WB + GRB - WA + 1, where
This second formula basically says: Assume Team B wins every remaining game. Calculate how many games team A needs to win to surpass team B's maximum total by 1. Using the example above and with the same 162-game season, team B has 7 games remaining.
The magic number for Team A to win the division is still "5": 93 + 7 − 96 + 1 = 5.