Having outlasted all his opponents, Donald Trump is the presumptive nominee of the Republican Party. Hillary Clinton is closing in on locking up the Democratic nomination.

Clinton and Trump may have won primaries, but are they really representative of what the American people want? In fact, as we will show, it is John Kasich and Bernie Sanders who are first in the nation’s esteem. Trump and Clinton come last.

So how has it come to this? The media has played a big role, of course, but that Trump versus Clinton will almost surely be the choice this November is the result of the totally absurd method of election used in the primaries: majority voting.

This is a strong statement. But as mathematicians who have spent the last dozen years studying voting systems, we are going to show you why it’s justified and how this problem can be fixed.

The problem with majority voting

With majority voting (MV), voters tick the name of one candidate, at most, and the numbers of ticks determine the winner and the order of finish. It’s a system that is used across the U.S. (and in many other nations) to elect presidents as well as senators, representatives and governors.

But it has often failed to elect the candidate preferred by the majority.

In 2000, for example, George W. Bush was elected president because of Ralph Nader’s candidacy. In the contested state of Florida, Bush had 2,912,790 votes, Al Gore 2,912,253 (a mere 537 fewer) and Nader 97,488. There is little doubt that the large majority of those who voted for Nader, and so preferred him to the others, much preferred Gore to Bush. Had they been able to express this preference, Gore would have been elected with 291 Electoral College votes to Bush’s 246. Similar dysfunctions have also occurred in France.

Imagine how different the U.S. and the world might be today if Gore had won.

As Trump is a particularly divisive candidate, it is safe to suppose that most – or at least many – of them strongly opposed him. The media, however, focused on the person who got the largest number of votes – which means Trump. On the Democratic side of the ledger, the media similarly poured its attention on Hillary Clinton, ignoring Bernie Sanders until widespread enthusiastic support forced a change.

The source of the problem

An election is nothing but an invented device that measures the electorate’s support of the candidates, ranks them according to their support and declares the winner to be the first in the ranking.

The fact is that majority voting does this very badly.

With MV, voters cannot express their opinions on all candidates. Instead, each voter is limited to backing just one candidate, to the exclusion of all others in the running.

Bush defeated Gore because Nader voters were unable to weigh in on the other two. Moreover, as we argue further on, majority voting can go wrong even when there are just two candidates.

The point is that it is essential for voters to be able to express the nuances of their opinions.

What is to be done? Use majority judgment

MJ asks voters to express their opinions much more accurately than simply voting for one candidate. The ballot offers a spectrum of choices and charges voters with a solemn task:

To be the President of the United States of America, having taken into account all relevant considerations, I judge that this candidate as president would be a: Great President | Good President | Average President | Poor President | Terrible President

To see exactly how MJ ranks the candidates, let’s look at specific numbers.

We were lucky to find on the web that the above question was actually posed in a March Pew Research Center poll of 1,787 registered voters of all political stripes. (It should be noted that neither the respondents nor the pollsters were aware that the answers could be the basis for a method of election.) The Pew poll also included the option of answering “Never Heard Of” which here is interpreted as worse than “Terrible” since it amounts to the voter saying the candidate doesn’t exist.

As is clear in the table below, people’s opinions are much more detailed than can be expressed with majority voting. Note in particular the relatively high percentages of voters who believe Clinton and especially Trump would make terrible presidents (Pew reports that Trump’s “Terrible” score increased by 6 percent since January.)

Using majority judgment to calculate the ranked order of the candidates from these evaluations or grades is straightforward. Start from each end of the spectrum and add percentages until a majority of voters’ opinions are included.

Taking John Kasich as an example, 5 percent believe he is “Great,” 5+28=33 percent that he is “Good” or better, and 33+39=72 percent (a majority) that he is “Average” or better. Looked at from the other end, 9 percent “Never Heard” of him, 9+7=16 percent believe he is “Terrible” or worse, 16+13=29 percent that he is “Poor” or worse, and 29+39= 68 percent (a majority) that he is “Average” or worse.

Both calculations end on majorities for “Average,” so Kasich’s majority-grade is “Average President.” (Mathematically, the calculations from both directions for a given candidate will always reach majorities at the same grade.)

Similarly calculated, Sanders, Clinton and Cruz all have the same majority-grade, “Average President.” Trump’s is “Poor President,” ranking him last.

To determine the MJ ranking among the four who all are rated “Average,” two more calculations are necessary.

The first looks at the percentage of voters who rate a candidate more highly than his or her majority-grade, the second at the percentage who rate the candidate lower than his or her majority-grade. This delivers a number called the “gauge.” Think of it as a scale where in some cases the majority grade leans more heavily toward a higher ranking and in others more heavily toward a lower ranking.

In Kasich’s case, 5+28=33 percent evaluated him higher than “Average,” and 13+7+9=29 percent rated him below “Average.” Because the larger share is on the positive side, his gauge is +33 percent. For Sanders, 36 percent evaluated him above and 39 percent below his majority-grade. With the larger share on the negative side, his gauge is -39 percent.

A candidate is ranked above another when his or her majority-grade is better or, if both have the same majority-grade, according to their gauges (see below). This rule is the logical result of majorities deciding on candidates’ grades instead of the usual rule that ranks candidates by the numbers of votes they get.

When voters are able to express their evaluations of every candidate – the good and the bad – the results are turned upside-down from those with majority voting.

According to majority judgment, the front-runners in the collective opinion are actually Kasich and Sanders. Clinton and Trump are the trailers. From this perspective the dominant media gave far too much attention to the true trailers and far too little to the true leaders.

Tellingly, MJ also shows society’s relatively low esteem for politicians. All five candidates are evaluated as “Average” presidents or worse, and none as “Good” presidents or better.

Majority voting’s failure with two candidates

But, you may object, how can majority voting on just two candidates go wrong? This seems to go against everything you learned since grade school where you raised your hand for or against a classroom choice.

The reason MV can go wrong even with only two candidates is because it does not obtain sufficient information about a voter’s intensity of support.

Take, as an example, the choice between Clinton and Trump, whose evaluations in the Pew poll are given in the first table above.

Lining up their grades from highest to lowest, every one of Clinton’s is either above or the same as Trump’s. Eleven percent, for example, believe Clinton would make a “Great” president to 10 percent for Trump. Trump’s percentages lead Clinton’s only for the Terrible’s and Never Heard Of’s. Given these opinions, in other words, it’s clear that any decent voting method must rank Clinton above Trump.

However, majority voting could fail to do so.

To see why, suppose the “ballots” of the Pew poll were in a pile. Each could be looked at separately. Some would rate Clinton “Average” and Trump “Poor,” some would rate her “Good” and him “Great,” others would assign them any of the 36 possible couples of grades. We can, therefore, find the percentage of occurrence of every couple of grades assigned to Trump and Clinton.

We do not have access to the Pew poll “ballots.” However, one could come up with many different scenarios where the individual ballot percentages are in exact agreement with the overall grades each received in the first table.

Among the various scenarios possible, we have chosen one that could, in theory, be the true one. Indeed, you can check for yourself that it does assign the candidates the grades each received: reading from left to right, Clinton, for example, had 10+12=22 percent “Good,” 16+4=20 percent “Average,” and so on; and the same holds for Trump.

So what does this hypothetical distribution of the ballots concerning the two tell us?

The first column on the left says 10 percent of the voters rated Clinton “Good” and Trump “Great.” In a majority vote they would go for Trump. And moving to the tenth column, 4 percent rated Clinton “Poor” and Trump “Terrible.” In a majority vote this group would opt for Clinton. And so on.

If you add up the votes in each of these 11 columns, Trump receives the votes of the people whose opinions are reflected in four columns: 10+16+12+15=53 percent; Clinton is backed by the voters with the opinions of columns with 33 percent support; and 14 percent are undecided. Even if the undecided all voted for Clinton, Trump would carry the day.

This shows that majority voting can give a very wrong result: a triumphant victory for Trump when Clinton’s grades are consistently above his!

A bird’s-eye view

Voting has been the subject of intense mathematical research since 1950, when the economist Kenneth Arrow published his famous “impossibility theorem,” one of the two major contributions for which he was awarded the 1972 Nobel Prize.

Marquis de Condorcet (1743-1794) was a French philosopher and mathematician.

This theorem showed that if voters have to rank candidates – to say, in other words, who comes first, second and so forth – there will inevitably be one of two major potential failures. Either there may be no clear winner at all, the so-called “Condorcet paradox” occurs, or what has come to be called the “Arrow paradox” may occur.

The Arrow paradox is familiar to Americans because of what happened in the 2000 election. Bush beat Gore because Nader was in the running. Had Nader not run, Gore would have won. Surely, it is absurd for the choice between two candidates to depend on whether or not some minor candidate is on the ballot!

Majority judgment resolves the conundrum of Arrow’s theorem: neither the Condorcet nor the Arrow paradox can occur. It does so because voters are asked for more accurate information, to evaluate candidates rather than to rank them.

MJ’s rules, based on the majority principle, meet the basic democratic goals of voting systems. With it:

Voters are able to express themselves more fully, so the results depend on much more information than a single vote.

The process of voting has proven to be natural, easy and quick: we all know about grading from school (as the Pew poll implicitly realized).

Candidates with similar political profiles can run without impinging on each other’s chances: a voter can give high (or low) evaluations to all.

The candidate who is evaluated best by the majority wins.

MJ is the most difficult system to manipulate: blocs of voters who exaggerate the grades they give beyond their true opinions can only have a limited influence on the results.

By asking more of voters, by showing more respect for their opinions, participation is encouraged. Even a voter who evaluates all candidates identically (e.g., all are “Terrible”) has an effect on the outcome.

Final grades – majority-grades – enable candidates and the public to understand where each stands in the eyes of the electorate.

If the majority decides that no candidate is judged an “Average President” or better, the results of the election may be rescinded, and a new slate of candidates demanded.

Reform now

It should come as no surprise that in answer to a recent Pew poll’s question “Do you think the primaries have been a good way of determining who the best qualified nominees are or not?” only 35 percent of respondents said yes.

Democracies everywhere are suffering. Voters protest. Citizens don’t vote. Support for the political extremes are increasing. One of the underlying causes, we argue, is majority voting as it is now practiced, and its influence on the media.

Misled by the results of primaries and polls, the media concentrates its attention on candidates who seem to be the leaders, but who are often far from being deemed acceptable by a majority of the electorate. Majority judgment would correct these failings.