# Difference between generating function and exponential generating function

I cannot understand why would we use exponential generating functions instead of just simple generating functions. In a problem like: How many different ways can we distribute 20 students in 5 different labs so that each lab gets at least 1 student, how would it be solved with generating functions and how with EGF?

• Do you know why to use generating functions for any particular problem? – Somos Aug 12 '18 at 13:04
• @Somos I have read this question math.stackexchange.com/questions/25430/… which is very similar to yours but I am not clear as to which problems gen. functions and EGF apply – Maverick98 Aug 12 '18 at 14:24
• It is great that you mention that MSE question. The choice is up to you. For any sequence you can always define the OGF and the EGF. Sometimes one is better than the other. Try OGF first and if you don't get good results, try EGF. – Somos Aug 12 '18 at 16:30
• Let $n$ be the number of students, $k$ be the number of labs, and $T(n,k)$ be the number of ways to distribute students in labs so that each lab gets at least $1$ student. What values of $T(n,k)$ have you found so far? – Somos Aug 12 '18 at 21:45
• Although any sequence has both an OPSGF and an EGF, usually one is simpler than the other. I.e., the nature of the problem usually dictates the choice of OPSGF or EGF. – awkward Aug 14 '18 at 12:49