答网友Mai Zhou
网友Mai Zhou 于2007-6-8 上午5:49来信提到:
Saw your page from Lu canghai's link.
Your solution is not the easiest to understand and not easier to compute.
Prob(no birthday are the same among k person) = (365/365) (364/365) (363/365) (362/365) ...a total of k terms.
The reason goes like this:
the first person can take anyday as his birthday, 365/365,
the second person can take any of the 364 days left to avoid same birthday, i.e. 364 out of 365,
the third person can take any of the 363 days for his birthday (because two days are already taken), (363/365),
etc, etc.
Using your argument, it is not immediatly clear why for different combination the probability is a product,or independent.
正如网友Mai Zhou所言,K个人不在同一天的概率为(364/365)(363/365)(362/365)...((365-K+1)/365),这种算法比较直观也好理解。
本站中的算法是POWER((364/365),COMBIN(K,2)),相对而言不太直观。并且还有一个问题,就是当K大于365时算出的结果很小但不为零,因此必须限制K不能大于365。而上面网友提出的方法可以正确处理这个问题无需加以说明。
本站采用的方法主要是从方便计算出发的。
网友Mai Zhou所提公式在K数值不大时是可以计算的,但计算时的工作量随K的变大而变大,当K较大时是相当不方便的。虽然可以将该式的分母整合成365的K-1次方,分子整合成364的阶乘除以365-K的阶乘,在EXCEL中可以用函数式FACT(364)/FACT(365-K)/POWER(365,(K-1)),但大数阶乘计算是一个问题,一般计算机软件只能做到170的阶乘,超过会出现溢出错误而无法计算,必须用专门的计算程序处理。如果用程序做的话,直接用(364/365)(363/365)(362/365)...((365-K+1)/365)还方便些,当然用EXCEL不用编程也能做,但单元格的关系与编程是完全类似的,也是较复杂的。
本站中说明这是一个很经典的概率问题,也就是个老问题,应该是老到没有计算机也没有计算器的年代,本站采用的方法是在那个年代的老方法,只要有数学用表(查对数表与反对数表)就能用手工计算出结果。就算是在现在,用计算器或计算机,不用编程的话也是老方法计算操作量少,在EXCEL中可以用函数式POWER(364/365,COMBIN(K,2))直接就可求出。当然用程序做都一样,输入参数就出结果。
