返回题库

找到同生日的人

30: Finding Your Birthmate

专题
Probability / 概率
难度
L6

题目详情

你想找到一个与你生日相同的人。最少需要问多少个陌生人的生日,才能有 50% 的概率至少遇到一个与你同生日的人?(忽略闰年,假设一年 365 天等可能)

You want to find someone whose birthday matches yours.

What is the least number of strangers whose birthdays you need to ask about to have a 50–50 chance?

解析

任一陌生人生日不等于你的概率为 364365\frac{364}{365}

nn 个人都不等于你的概率为 (364365)n\left(\frac{364}{365}\right)^n

要求至少 50% 概率“有人等于你”,即

(364365)n12.\left(\frac{364}{365}\right)^n\le \frac12.

解得 n253n\approx 253,因此至少问 253 人。


Original Explanation

The probability that a randomly chosen stranger does not share your birthday is:

364365\frac{364}{365}

The probability that nn strangers all do not share your birthday is:

(364365)n\left( \frac{364}{365} \right)^n

To have at least a 50% chance of finding someone who does share your birthday, solve for the smallest nn such that:

(364365)n0.5\left( \frac{364}{365} \right)^n \leq 0.5

Taking logarithms:

nlog(364365)log(0.5)n \cdot \log\left( \frac{364}{365} \right) \leq \log(0.5)

Solving gives:

nlog(0.5)log(364365)253n \geq \frac{\log(0.5)}{\log\left( \frac{364}{365} \right)} \approx 253

Answer:
You need to ask at least 253 people to have a 50-50 chance that one of them shares your birthday.