Re: [問卦] 13顆骰子要骰幾次才可以累積到13000點消失

看板Gossiping作者時間6年前 (2017/12/26 01:12), 編輯推噓4(511)
留言7則, 7人參與, 最新討論串10/10 (看更多)
※ 引述《grapherd (NULL)》之銘言: : ※ 引述《p2p8ppp (給我錢)》之銘言: : : https://imgur.com/7cLC5iT
: : 初學者來ㄌ : : 我模擬1000次就跑好久 : : 是因為我用13顆骰子慢慢骰嗎? : : 接下來要弄次數分配怎麼寫啊= = : from collections import defaultdict : dd = defaultdict(int) : # 每次 result 直接放入 dd : dd[result] += 1 : print(dd) # 次數分配結果 : 然後,已經 2017 年了,快改用 python 3 好嗎,別再用 2 了。 : : 不奢望畫圖了= = : pyplot 或是 matplotlib 都能夠做到,加油,好嗎? Python 模擬一萬次出來也是一樣歐 https://i.imgur.com/2HjGhzA.png
不過這個有掉到280次以下的 # python3 import numpy as np import seaborn as sns def roll_die(): points_total = 0 cutoff = 0 while points_total < 13000: points_total += np.sum(np.random.randint(1, 7, 13)) cutoff += 1 return cutoff results = np.array([roll_die() for i in range(10000)]) sns.distplot(results, kde=False) -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 68.71.180.136 ※ 文章網址: https://www.ptt.cc/bbs/Gossiping/M.1514221939.A.D84.html

12/26 01:12, , 1F
我聞到臭味
12/26 01:12, 1F

12/26 01:12, , 2F
我看不懂
12/26 01:12, 2F

12/26 01:13, , 3F
常態分佈欸
12/26 01:13, 3F

12/26 01:13, , 4F
你真的有夠無聊的
12/26 01:13, 4F

12/26 01:14, , 5F
12/26 01:14, 5F

12/26 01:31, , 6F
說不定拍森的亂數表剛好是常態分佈阿
12/26 01:31, 6F

12/26 01:37, , 7F
XDDDDDDDDD
12/26 01:37, 7F
文章代碼(AID): #1QGJ5ps4 (Gossiping)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 10 之 10 篇):
文章代碼(AID): #1QGJ5ps4 (Gossiping)