$10$ students, $16$ lessons, each lesson one student is chosen to be asked, probability that every student will be asked after $16$ lessons.
First solution:
Our sample space is strings of length $16$ which takes values in {$1,...,10$}. Let $A_k$ be event such that $k$-th student will be not asked after $16$ lessons. We can compute our desired probability $P(A)$ using inclusion-exclusion principle: $P(A)=1-P(\bigcup_{i=1}^{10}A_i)$.
Second solution:
Stars and bars method, think of giving students lessons in which they are asked. To count every possibilities of $10$ students being asked in $16$ lessons it is equivalent to count how many solutions there are to equation $x_1+...+x_{10}=16$ where $x_i\geq0$, ${16+10-1 \choose 10-1}$ possibilities. To count possibilities in which each student was asked it is equivalent to count how many solutions there are to equation $x_1+...+x_{10}=16$ where $x_i\geq1$, ${15 \choose 9}$ possibilities, so our desired probability is $$\frac{{15 \choose 9}}{25 \choose 9}$$
I think first method is correct, I am not sure about second. It seems okay but someone told me to not to use stars and bars doing probability. If it is wrong explain why.
The outcomes counted by stars and bars are not equally likely in almost every real-world scenario. The most likely method by which the teacher will be picking which student to answer which question would be... arrive at the next lesson and then pick a student uniformly at random to answer it, repeat this process until done. It is not "list out all possible ways in which quantities of lessons can be assigned to students... forget which lesson is which... remove duplicates... and then pick one of these arrangements uniformly at random."
Compare... stars and bars would have led you to believe that it is equally likely that the first student is asked every question as it would be that the first nine students are each asked one question and the tenth student asked the remaining seven... but there are many ways this could happen. You may only assume $\Pr(A)=\dfrac{|A|}{|S|}$ when the outcomes are equally likely. There are two outcomes to playing the lottery: you win or you lose. You obviously don't win with probability $\dfrac{1}{2}$ however
If you want a direct method to compute (or at least want to disguise the usage of inclusion-exclusion), then use Stirling Numbers of the Second Kind. The answer will be $$\dfrac{{16 \brace 10}10!}{10^{16}}$$