
这个是自己想的概率解法,求大佬指点。

这个是自己想的概率解法,求大佬指点。
|
obliviousApr 19, 2019
1
合格:990 choose 100 / 1000 choose 100 = 0.347
不合格:1 - 0.347 = 0.653 简单验证: from random import sample failed = 0 repeat = 100000 for i in range(repeat): list1 = ([0] * 990) + ([1] * 10) sampled = sample(list1, 100) if sum(sampled) > 0: failed += 1 print(failed/repeat) 0.65397 [Finished in 8.4s] |
|
obliviousApr 19, 2019
2
感觉很蠢因为代码不能缩进。
``` # 测试一下代码环境 if True: print('Test...') ``` |
|
rrfengApr 19, 2019 via Android
3
一个以上是指 2 个起
算合格概率:100 个全好,100 个有一个坏 |
|
obliviousApr 19, 2019
4
自闭了,求问怎么在 v2 打出漂亮的代码 block。
不死心: <code> if True: print('Test...') </code> |
|
wAtcher789Apr 19, 2019 via Android
5
可以看下超几何分布
|
|
7
@oblivious
(```) from random import sample failed = 0 repeat = 100000 for i in range(repeat): list1 = ([0] * 990) + ([1] * 10) sampled = sample(list1, 100) if sum(sampled) > 0: failed += 1 print(failed/repeat) (```) |
|
WinGApr 19, 2019
10
好像不需要排列组合.
全部及格的概率 : (990 / 1000) * (989 / 999) .................. (890 / 900) 不及格概率 1 - (990 / 1000) * (989 / 999) .................. (890 / 900) |