Answer:
27720
Step-by-step explanation:
Denote by [tex]\binom{n}{k}=\frac{n!}{k!(n-k)!}[/tex] the binomial coefficient "n choose k". Given k<n, [tex]\binom{n}{k}[/tex] is the number of ways of choosing k elements from a set of n elements (the order in which we choose the elements doesn't matter).
First, we can form the group of 3 students. This is done by choosing 3 students from the class of 12 students, so it can be done in [tex]\binom{12}{3}[/tex] ways. We can't repeat students, then we must form the other groups from the remaining 9 students. If we next form the group of 4 students, there are [tex]\binom{9}{4}[/tex] ways of choosing it. Now, there remain 5 students without a group, so they have to conform the group of 5 and this can only be done in 1 way. By the multiplication principle, the number of ways of forming the groups is [tex]\binom{12}{3}\binom{9}{4}=27720[/tex]