I am trying to understand generating function. I have the following problem:
There are 50 students in the International Mathematical Olympiad (IMO) training programme. 6 of them are to be selected to represent Hong Kong in the IMO. How many ways are there to select 6 students?
The answer:
Generating function is $G(x)=(1+x)^{50}$
But this could just as easily be done with the binomial distribution no?
$$ \binom {50} 6 = 15890700$$
However, unless i am not understanding something correctly, if we plug in $G(6)=(1+6)^{50} $that is $1.79\times10^{42}$ but why am i getting 15890700
If you expand the generating function, the coefficient of $x^6$ will give the answer you want.
As you say, it is ${50 \choose 6}$.
One way to find the coefficient of $x^6$ is to take the sixth derivative of $G(x)/6!$ evaluated at $x=0$.