A better measure of how close an (American) election was. -ln(minimum optimally allocated flipped votes / total votes). Non-trivial part: finding the optimal allocation of the votes.
The 2016 election was the 7th closest American election according to my measure. This is summarized in the table below
| Year | Closeness measure |
|---|---|
| 2000 | 12.8788 |
| 1876 | 9.84789 |
| 1884 | 9.76972 |
| 1916 | 9.19277 |
| 1976 | 9.08467 |
| 1960 | 8.89035 |
| 2016 | 8.16830 |
| 2004 | 7.65743 |
| 1948 | 7.41799 |
| 1888 | 7.36812 |
| 1880 | 6.99848 |
| 1844 | 6.96478 |
| 1848 | 6.80285 |
| 1896 | 6.61915 |
| 2012 | 6.39987 |
| 1968 | 6.29357 |
| 1892 | 6.20013 |
| 1992 | 5.90432 |
| 1840 | 5.68754 |
| 2008 | 5.58167 |
| 1908 | 5.51479 |
| 1868 | 5.35187 |
| 1900 | 5.25117 |
| 1828 | 5.25075 |
| 1944 | 5.14849 |
| 1988 | 5.13771 |
| 1996 | 5.11971 |
| 1864 | 4.81021 |
| 1856 | 4.80715 |
| 1980 | 4.77334 |
| 1940 | 4.76239 |
| 1852 | 4.60067 |
| 1872 | 4.56999 |
| 1832 | 4.56226 |
| 1836 | 4.54657 |
| 1928 | 4.49430 |
| 1952 | 4.46076 |
| 1904 | 4.37798 |
| 1912 | 4.25195 |
| 1860 | 4.20753 |
| 1956 | 3.99510 |
| 1924 | 3.96937 |
| 1824 | 3.94658 |
| 1932 | 3.81664 |
| 1920 | 3.80465 |
| 1984 | 3.54461 |
| 1964 | 3.53527 |
| 1972 | 3.20482 |
| 1936 | 3.15439 |