Birthday Problem question

What is the probability that in a class of 30 people everyone has a different birthday.

Would the answer be $1-\frac{364}{365} \cdot \frac{363}{365}\cdot\frac{362}{365}\cdots$ as it is written in my book or would it be $\frac{365}{365}\cdot\frac{364}{365}\cdot\frac{363}{365}\cdots$ I dont understand where the $1 -{}$ comes from

• It's the latter, but I doubt the book has it wrong. I expect they are computing the probability that there is a duplicate birthday in the crowd...that's what the first expression computes. – lulu Apr 12 '18 at 15:53

The quantity $\frac{364}{365} \cdot \frac{363}{365}\cdots$ is the probability that no two people in the same room share a birthday. Thus, to obtain the probability that someone in the room shares a birthday from someone else, we take one minus this quantity.
Assuming uniform distribution, $$\frac{364}{365} \cdot \frac{363}{365}\cdot\frac{362}{365}\cdots$$ is the probability of all have different birthdays.
$$1-\frac{364}{365} \cdot \frac{363}{365}\cdot\frac{362}{365}\cdots$$ is the probability of at least two people have the same birthday.