Week 1 Four Birthday Problems - Fourth Problem

I’m little confused about the analytical solution for Fourth Problem.

So for one student, Q1=(1 - 1/365) ^ n. This makes sense.

However, the solution says Q1=(1 - 1/365) ^ (n^2). The solutions says we sample students. thus we calculate the probability of no student matches " any of the 𝑛 given dates".

Should we consider the case when sample n students, there might be a match and we won’t get n dates?

Please advise. Thanks!

Yes, if you were writing a simulation and you needed an exit condition.

But in the problem, we’re computing the probability of a series of independent events.