Americans will cast their ballots for a new president, but the electoral college will make the final decision.

An earlier version of the graphic wrongly listed New Hampshire as a "winner takes all" state.

In the 2000 US presidential election, Vice President Al Gore received 543,000 more votes than his rival, George W Bush, then governor of Texas. But when the election and legal disputes were over, Bush was declared the winner .

How did that happen? The answer: The electoral college.

Contrary to popular belief, Americans do not vote directly for their president and vice president. Instead, they work on an electoral college system.

So, while they pick the names of the candidates they are voting for, they are actually casting their ballots for the electors in their respective states. Those electors will then vote for the candidates who got the highest popular votes in that state.

INTERACTIVE: US elections glossary

The president and vice president are elected as a ticket, not separately.

The number of electors is determined by adding the number of senators – two in each state – and congressional district representatives.

Electoral votes by state 2016 California: 55 Texas: 38 New York, Florida: 29 each Illinois, Pennsylvania: 20 each Ohio: 18 Georgia, Michigan: 16 each North Carolina: 15 New Jersey: 14 Virginia: 13 Washington: 12 Arizona, Indiana: 11

Massachusetts, Tennessee: 11 each Maryland, Minnesota, Missouri, Wisconsin: 10 each Alabama, Colorado, South Carolina: 9 each Kentucky, Louisiana: 8 each Connecticut, Oklahoma, Oregon: 7 each Arkansas, Iowa, Kansas, Mississippi, Nevada, Utah: 6 each Nebraska, New Mexico, West Virginia: 5 each Idaho, Maine, Rhode Island, New Hampshire, Hawaii: 4 each Alaska, Delaware, North Dakota, South Dakota, Vermont, Wyoming, Montana: 3 each

The larger the state’s population, the larger the size of the electoral college. For example, California, the state with the largest population, is assigned the highest number of electors, 55.

Based on the “winner-take-all” rules and traditions in 48 of the 50 states, the electors will then cast their votes in favour of the winning candidate of that state.

The states of Maine and Nebraska allocate their electors based on the winner of each district and the overall winner of the state.

Again using California as an example, the winner gets all of the 55 electoral votes, while the loser gets none.

In all, there are 538 electors representing the 50 states plus the capital, District of Columbia.

To win, a candidate needs 50 percent plus one of the total 538 electors. The magic number is 270 .

In essence, a candidate will have to run 51 separate presidential campaigns – one in each state – if he or she wants to maximise the probability of victory.

But in practice, that is not the case.

REPORTER’S NOTEBOOK: Getting voters out, or to stay home

There are states that are reliably Democrat or Republican, based on the number of registered voters.

In California, almost 45 percent of the voters are Democrats and only 27 percent are Republicans. In Texas, which has the second highest electoral votes at 38, Republicans edge out Democrats .

So candidates usually skip those states, except for fundraising purposes.

Instead, candidates concentrate on the so-called “swing states”, where the Democratic and Republican registration numbers are almost even, or where there is a large number of “independent” voters , such as New Hampshire.

Other states that could swing either way based on demographics include Ohio and North Carolina. So most often in the 2016 race, Democrat Hillary Clinton and Republican Donald Trump have been seen campaigning in those states numerous times, as well as in Florida and Wisconsin.

There are different paths and factors to 270 and victory. In 2008 and 2012, President Barack Obama won swing states such as Ohio and Pennsylvania by assembling a coalition of female voters, African Americans and more urban area voters.

OPINION: What the polls won’t tell us

The framers of the US constitution also made sure that smaller states are equitably represented, and their voices are heard. Thus, they are also assigned at least three electoral votes, like the state of Wyoming.

In close races, winning smaller states becomes even more crucial in reaching the 270 magic number.

In the 2000 presidential race for example, Al Gore lost his home state of Tennessee, where he served as congressman and senator for 16 years. Had he won Tennessee’s 11 electoral votes, he would have obtained 277 electoral votes, seven more than the required 270, winning the presidency even without the contested popular votes in Florida.

After a Supreme Court ruling, Florida’s 25 electoral votes were awarded to George W. Bush, giving him a slim 271 electoral votes over Gore’s 267, paving Bush’s path to the White House.

Before 2000, there have been only three other instances of US presidential elections, when candidates who won the popular vote lost the electoral vote and the presidency. In 1888, Republican Benjamin Harrison won with 233 electoral votes, even though Grover Cleveland, the incumbent Democrat president won 100,456 more votes. One even ended up being decided by Congress.

Leading up to the November 8, 2016, race, there have been some speculations of an electoral college tie .

But based on the current polls, the eventual winner could end up winning both the popular vote and the electoral college vote, while making history in the process.