How do you win a US presidential election?
Donald Trump or Hillary Clinton will become the next president of the United States after they are voted in by the electoral college, but what is it, why does it matter, and how does the US electoral system work?
What is the Electoral College?
Rather than voting directly for a presidential candidate, Americans actually vote for electoral college members - or electors - who have pledged allegiance to their preferred candidate.
Electors are not normally named on the ballot.
There are 538 electors who will decide whether Donald Trump or Hillary Clinton will become the next president of the United States.
The 538 electors correspond to the nation's 435 Representatives, 100 Senators, and three electors given to the District of Columbia.
The magic number (or absolute majority as it is known) is 270 - the first out of Clinton or Trump to reach the number will become president.
Are all states equal?
Each state in the US has a different number of electors – depending on the size of its population.
California - for example - has a population of 38.8 million people. They get 55 electoral college votes.
Montana, which is roughly the same land size, has just over a million residents - so they only have three electoral votes.
Both candidates can bank on certain states voting for them – California will more than likely vote for Ms Clinton, while Texas look set to go for Mr Trump.
So the election will be won and lost in the so-called swing states - the states where the vote could go either way.
One of the key swing states is Florida, which ultimately resulted in the election of George W Bush in 2000.
Other swing states keep an eye on are North Carolina, Virginia, Colorado and Nevada.
And watch out for how Ohio votes - they've correctly predicted 28 of the last 30 presidents.
Voting systems within states
Except for Maine and Nebraska, the candidate who wins the majority of votes in a state wins all of that state's electoral college votes.
Maine and Nebraska do not have winner-takes-all systems, instead electoral votes are assigned by proportional representation. In these states the top vote-getter wins two electoral college votes (for the two Senators) while the remaining votes are allocated by congressional district.
Therefore both Trump and Clinton could receive electoral votes from Nebraska and Maine.
Who chooses the electors?
It differs from state to state.
Usually, political parties nominate electors at their state conventions.
Electors tend to be state-elected officials, party leaders, or people with a strong affiliation to the presidential candidate.
Electors cast two votes - one for the president and one for the vice-president.
Do electors have to vote for their party's candidate?
Neither the US Constitution nor Federal election laws compel electors to vote for their party's candidate, however, 27 states have their own laws which say that electors must vote for their party's candidate if that candidate gets a majority of the state's popular vote.
What if neither candidate gets an absolute majority of 270 votes?
If the electoral college fails to elect a president or vice-president then the House of Representatives (a bit like Parliament in the UK) will decide.
Each state is allocated one vote under this system.
This is called the Twelfth Amendment.
Why does the US have an electoral college?
The electoral college system was created in 1787, a time when a presidential candidate could not mount a national campaign and there was little in the way of national identity.
Electing the president by direct popular vote was vetoed as it was feared that people would simply vote for their favourite local candidate, and no one would emerge with a popular majority sufficient to govern the whole country.
The system of electors, based loosely on the Roman Catholic College of Cardinals selecting the Pope, was chosen with the theory that the most knowledgeable and informed people from each state would select a president on merit, disregarding state loyalties.
Can a president win the election but not the popular vote?
Yes.This is seen as a major drawback of the system.
Since 1804, four presidents have been elected without winning the popular vote, the most recent was George W. Bush in 2000.
Mr Bush lost the popular vote to Al Gore by 0.51%, but won the electoral college 271 to 266, making him president.
On the Monday following the second Wednesday in December - December 19 this year - the electors of each state meet to formally cast their votes. The results are then sent to the Senate and read out on January 6.
However, normally the electoral college result mirrors the popular vote. Since 1804, 48 out of 52 elections produced a popular mandate.
The electoral college system also means that a candidate needs to get a spread of votes from across the country.
When does the new president start work?
Under the US constitution, the new president is inaugurated on January 20 of the year following the election.
Between the election and January 20 the "lame duck" president works to shape their legacy.
If the vote is decisive, in the weeks after the election the victor will assemble their administration and begin crafting through a more thorough policy agenda.