In how many different ways can we arrange $120$ students into $6$ groups for $6$ different classes so that the largest group has at most $2$ members more than the smallest group?
My initial plan was to use a generating function, but I stumbled across a problem. Let's mark the groups with numbers $1$ to $6$ and let $n_i,i\in\{1,\ldots,6\}$ denote the number of members of the $i-$ th group in some arrangment. To see where this would lead me, for a moment, I assumed $n_1\le n_2\le\cdots\le n_6\le n_1+2$ in hope to find some range $\{m,\ldots M\}$ for $n_i$'s and use a generating function $f(x)=(x^m+\cdots+x^M)^6$ and find $\langle x^{120}\rangle-$ the coefficient in front of $x^{120}$, however students are distinct entities and $m$ and $M$ still remained misterious. I then tried figuring out if I was on the somewhat right track by, again taking $m=\min\{n_1,\ldots, n_6\}$ and write $n_i=m+j_i, j_i\in\{0,1,2\}.$ I believe, an arrangement with $2$ groups of $19, 2$ groups of $20$ and $2$ groups of $21$ people suggests there should be at least $19$ people in each group.
I also had a look at this problem:
The number of the partition of the set $A$ into $k$ bounded blocks.
but, again, I don't have any bounds on the blocks.
How should I proceed?
Let $l$ be the size of the smallest group, we get $6l \leq 120 \leq 6l+5\times 2$. Hence we must have $6l = 120$ or $6l= 114$.
If $6l = 120$ then there is $\binom{120}{20,20,20,20,20,20}/6!$ solutions as all groups have size $20$. See this related question.
So lets move to the other case. We must see the possibilities for the group sizes, each group has size at least $19$ but there is $6$ extra people if they all have size $19$, so we must find all partitions of $6$ into at most $5$ summands, such that each is at most $2$.
There are only $3$ ways:
$2,2,2$. This corresponds to groups of sizes $19,19,19,21,21,21$ for which there are $\binom{120}{19,19,19,21,21,21}/(3!3!)$ partitions.
$1,1,2,2$. This corresponds to groups of sizes $19,19,20,20,21,21$ for which there are $\binom{120}{19,19,20,20,21,21}/(2!^3)$ partitions.
$1,1,1,1,2$. This corresponds to groups of sizes $19,20,20,20,20,21$ for which there are $\binom{120}{19,20,20,20,20,21}/{4!}$ partitions.