由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问道数学题
相关主题
same birthday面试概率题贴简历 求建议
一道LeetCode Unique Paths的变种上一算法面试题
请教一到面试概率题,怎么算?谢谢bb FSD 电面
Twitter team match求收留careercup上这道题我竟然没看懂
发点非科班找码工经验,希望能鼓励一些人谁给个数组分段题二分法的总结啊?
经典activity selection的问题问道关于快速找bucket的面试题
同学们来帮忙解个题吧~问个google面试题
问一道算法题按十字题的O(M*N)时间解
相关话题的讨论汇总
话题: 365话题: person话题: 364话题: 2nd话题: 363
进入JobHunting版参与讨论
1 (共1页)
p****3
发帖数: 448
1
足够多的, 互无联系的人, 随机排成一队, 挨个报出自己生日.
直到有重复的生日出现.
问平均报出了多少生日?
m***n
发帖数: 62
2
You can do repeated expectation:
let the expectation you want to be x;
fix the first person;
conditioning on the 2nd person has the same bday as the 1st person, you got
2;
conditioning on the 2nd person has a different bday as the 1st person, you
can condition on the 3rd person; if the 3rd person has the same bday as the
previous two people, you got 3;
otherwise keep going...
so x = 1/365*2+364/365*2/365*3+363/365*3/365*4+...
then x = 1/365* sum_{n = 1}^{364} n*(n+1)*(365-n+1)/365 and it is a power
summation
z****p
发帖数: 18
3

got
the
The solution seems to have a problem:
Look at the 4th person. The condition for the 4th person to have an
opportunity is that "the 2nd person failed and the 3rd person failed as well
". The probability for this to happen is
(364/365)*(363/365) instead of 363/365

【在 m***n 的大作中提到】
: You can do repeated expectation:
: let the expectation you want to be x;
: fix the first person;
: conditioning on the 2nd person has the same bday as the 1st person, you got
: 2;
: conditioning on the 2nd person has a different bday as the 1st person, you
: can condition on the 3rd person; if the 3rd person has the same bday as the
: previous two people, you got 3;
: otherwise keep going...
: so x = 1/365*2+364/365*2/365*3+363/365*3/365*4+...

d*****n
发帖数: 44
4
Every person is Bernoulli distribution with various success probabilities.
Denote the i-th person has success probability Pi. And I assume we do not
count the last repeated b-day.
1st: P1 = 1
2nd: P2 = p(1st and 2nd have different b-days) = 1*(364/365)
3rd: P3 = p(1st, 2nd, and 3rd have different b-days) = p(3rd person
different b-day|1st and 2nd people different b-days)*p(1st and 2nd people
different b-days) = (363/365) *[1*(364/365)]
4th: P4 = p(4th person different b-day|1st, 2nd, and 3rd people different b-
days)*p(1st, 2nd, and 3rd people different b-days) = (362/365) *[1*(364/365)
*(363/365)]
...
Result: 1+1*(364/365)+1*(364/365)*(363/365)+1*(364/365)*(363/365)*(362/365)
+...
s*****n
发帖数: 134
5
根据抽屉原理,不考虑闰年的话,最多有365个人没有相同的生日,到366的时候至少有
一对相同的生日。所以你列出的期望 应该是从第二个人到第366人 N×P(N)的和。
具体的计算好像可以用泰勒级数近似,但是这个Wiki里给出的结果只是 N个人里没有两
个人有相同生日的 CDF, 感觉上和计算从第几个人开始出现相同生日的期望不一定一
样。
http://en.wikipedia.org/wiki/Birthday_problem

b-
365)

【在 d*****n 的大作中提到】
: Every person is Bernoulli distribution with various success probabilities.
: Denote the i-th person has success probability Pi. And I assume we do not
: count the last repeated b-day.
: 1st: P1 = 1
: 2nd: P2 = p(1st and 2nd have different b-days) = 1*(364/365)
: 3rd: P3 = p(1st, 2nd, and 3rd have different b-days) = p(3rd person
: different b-day|1st and 2nd people different b-days)*p(1st and 2nd people
: different b-days) = (363/365) *[1*(364/365)]
: 4th: P4 = p(4th person different b-day|1st, 2nd, and 3rd people different b-
: days)*p(1st, 2nd, and 3rd people different b-days) = (362/365) *[1*(364/365)

1 (共1页)
进入JobHunting版参与讨论
相关主题
按十字题的O(M*N)时间解发点非科班找码工经验,希望能鼓励一些人
想做题的进来挑战一下自己吧。。经典activity selection的问题
发个论坛上某已经淡出隐牛的一道Google Onsite概率题同学们来帮忙解个题吧~
请教一道随机数生成器的面试题问一道算法题
same birthday面试概率题贴简历 求建议
一道LeetCode Unique Paths的变种上一算法面试题
请教一到面试概率题,怎么算?谢谢bb FSD 电面
Twitter team match求收留careercup上这道题我竟然没看懂
相关话题的讨论汇总
话题: 365话题: person话题: 364话题: 2nd话题: 363