The problem reads:
In a classroom there are $16$ students, $4$ rows of desks, each made up of $4$ desks.
- How many different ways are there to distribute the students over the desks?
- Assuming there are $4$ female students, and $12$ male students, how many ways are there to distribute the students over the desks so that all four females aren't in the same row?
Point $(1)$ was pretty straightforward in my opinion: we are trying to find the number of functions: $$f : \{1,2,...,16\} \rightarrow \{1,2,...,16\}$$ that are injective. Since the domain and codomain have the same cardinality, such number is $16!$, that is the number of permutations of a set of $16$ elements.
For point $(2)$, we have to take the number of permutations from the previous point, and subtract the permutations where all four females are sitting in the same row. Since there are $4$ females, the number of arrangements of those four students over a row of desks is $4!$. Since there are $4$ rows, the configurations that have $4$ female students, in any order, all sitting in the same one row out of the four, is $4\cdot4!$.
Therefore, the final answer is $16! - 4\cdot4!$. This is the first combinatory problem I try to solve so I'm not sure if my reasoning is correct. Feedback is much appreciated.
As user quasi made me notice in the comments, the correct answer is: $$16!-4\cdot4!\cdot12!$$ Because, for every one of those $4\cdot4!$ arrangements of the 4 female students over the 4 sets of 4 seats, the remaining $12$ male students can be arranged in $12!$ ways. Thank you for pointing it out to me.