how is the electoral votes for each state determined
All states except California (before 1913), Maine, and Nebraska have chosen electors on a "winner-take-all" basis since the 1880s. Under the winner-take-all system, the state's electors are awarded to the candidate with the most votes in that state, thus maximizing the state's influence in the national election. Maine and Nebraska use the "congressional district method," selecting one elector within each congressional district by popular vote and awarding two electors by a statewide popular vote. Although no elector is required by federal law to honor his pledge, there have been very few occasions when an elector voted contrary to a pledge, and not once has it impacted the final outcome of a national election.