I found by thinking that there are twelve ways to divide 5 votes into 3 sectors(where in a sector there may be zero).
And each of those 12 ways should be permuted.
For example: one way of casting vote is to give three persons 1,0 and 4 votes respectively. Any of these amount of votes can be got by any candidates. To get all possible way for casting those votes is to multiply 3! with that.
So total no ways of casting the votes= 12 . 3! = 72
But the answer given in the book is 243. Can you please show me the correct way of solving it? Thanks.
If each of the 5 men has 3 choices to vote for, there are $3^5=243$ possible ways to distribute the votes.