新年早々,
そういうご時世にもかかわらず
さて今回は,
ガチャと提供確率
ソシャゲのガチャに大金を投じてしまう
さて,
カプセルトイを排出する物理的な
それに対し,
もっとも,
高校数学の
一方,
このあたり,
この手の試行錯誤的な作業は,
$ python Python 3.7.7 (default, Nov 20 2020, 21:28:25) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> rate = 0.01 >>> player = 1000 >>> counter = [] >>> for i in range(player) : ... c = 1 ... while random.random() > rate : ... c += 1 ... counter.append(c) ... >>>
random.
>>> print(counter) [1, 27, 202, 64, 160, 327, 7, 17, 38, 2, 33, 7, 135, 327, 19, 18, 39, 80, 1, 36, 37, 138, 83, 20, 106, 196, 22, 5, .... 245, 7, 50, 169, 24, 81, 69, 41, 18, 21, 138, 167]
ざっと見,
>>> print(sorted(counter)) [1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, ... 442, 445, 451, 451, 458, 466, 498, 532, 581, 595, 650, 671, 785]
今回の例では,
>>> [x for x in counter if x > 100 ] [532, 198, 170, 157, 198, 118, 151, 581, 357, 426, 164, 129, 231, 327, 203, 207, 151, 205, 220, 111, 297, 107, 118, 263, ... 113, 595, 187, 203, 187, 333, 177, 167, 116, 140] >>> len([x for x in counter if x > 100 ]) 362
先に