There are 3 candidates for class monitor and one is to be elected by the votes of 5 voters. In how many ways the votes can be given? My approach:
I tried to find the no. of ways we can divide the five votes into three sections so that we can form 5 votes. Then permuting the total no. of ways, I would get the total no. of ways of voting.
So, the total no. of ways I get,  to form $5$ out of $0,1,2,3,4,5$
$0+0+5$
$0+1+4$
$0+2+3$
$1+2+2$
$1+3+1$
There are no unique ways left to cast the votes according to my approach. 
So, we see that there are $5$ different ways for the $3$ candidates to get the vote. So total no. of ways they can get the vote $= 5 . 3!$ But the book says the answer is $243$. Their approach is $3^5=243$. I accept that. But can you tell me exactly why my approach wrong? What did I miss? 
 A: You made two mistakes:


*

*You can only multiply by $3!$ when there are three different vote totals.

*You have not accounted for which voter voted for which candidate.


Let's modify your count:
One candidate receives all five votes:  There are $3$ cases, one for each candidate who could receive all five votes.
One candidate receives four votes and another candidate receives one vote:  There are $3$ ways to choose which candidate receives four votes, $\binom{5}{4} = 5$ ways for four of the five voters to select that candidate, and $2$ ways to choose which candidate receives one vote from the remaining voter.  Hence, there are $3 \cdot 5 \cdot 2 = 30$ such cases.
One candidate receives three votes and another candidate receives two votes:  There are $3$ ways to choose which candidate receives three votes, $\binom{5}{3} = 10$ ways for three of the five voters to choose that candidate, and two ways to choose which of the remaining two candidates receives the remaining two votes.  Hence, there are $3 \cdot 10 \cdot 2 = 60$ such cases.
One candidate receives three votes and each of the other two candidates receives one vote:  There are $3$ ways to choose which candidate receives three votes, $\binom{5}{3} = 10$ ways for three of the five voters to select that candidate, and $2! = 2$ ways in which the remaining voters can split their votes among the remaining two candidates.  Hence, there are $3 \cdot 10 \cdot 2 = 60$ such cases.
Two candidates each receive two votes and the other candidate receives one vote:  There are $\binom{3}{2} = 3$ ways to choose which two candidates receive two votes, $\binom{5}{2} = 10$ ways for two of the voters to select the candidate among those two whose name appears first in an alphabetical list, $\binom{3}{2} = 3$ ways for two of the other three voters to select the other candidate who receives two votes, and one way for the remaining voter to select the remaining candidate.  Hence, there are $3 \cdot 10 \cdot 3 = 90$ such cases.
Total:  Since the five cases are mutually exclusive and exhaustive, the number of ways the votes can be cast is $3 + 30 + 60 + 60 + 90 = 243$.
It is much more efficient to observe that each of the five voters has three choices, so there are $3^5 = 243$ ways for them to cast their votes.  
A: You missed that case when the first gets all 5 votes, or second gets all the 5 votes and so on. The different cases will be applied to all the 3 candidates.
It can properly be seen by linking them into sets.
Set A having 5 voters and Set B having 3 candidates. 
The ways to link Set A to Set B will be = $3^5$ = 243
