123456789101112131415161718192021 |
- #coding=utf-8
- '''
- Created on 2017年6月9日
- @vsersion:python3.6
- @author: liuyuqi
- '''
- from scipy.special import comb, perm
- from math import factorial
- #1-C(365,n)n!/(365)^n
- init=365;
- k=0;
- for n in range(4,init):
- pk=1-comb(365,n)*factorial(n)/pow(365,n);
- if pk>=0.5 :
- k=n;
- break;
- print(k)
- # perm(m, n) 排列数
- # comb(3, 2) 组合数
- # pow(a,b) n次方
- # factorial (x)阶乘
|