底辺私立医大を卒業した医者って頭悪いよね? Part5at HOSP底辺私立医大を卒業した医者って頭悪いよね? Part5 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト504:卵の名無しさん 18/07/03 13:45:30.56 22JZXDLY.net >>480 計算の前提 Bold play, as Lester E. Dubins and Leonard J. Savage call it in their How to gamble if you must, that is, betting $20 at once, gives him a probability of 18/38≈ 0.474 of achieving his goal. 505:卵の名無しさん 18/07/03 13:46:15.45 22JZXDLY.net このスクリプトでシミュレーションできる gmbl <- function(money=20,p=18/38){ while(0<money & money <40){ money=money+sample(c(1,-1),1,p=c(p,1-p)) } return(money==40) } mean(replicate(1e3, gmbl())) 506:卵の名無しさん 18/07/03 13:50:21.96 22JZXDLY.net Shuffle an ordinary deck of 52 playing cards containing four aces. Then turn up cards from the top until the first ace appears. On the average, how many cards are required to produce the first ace? 507:卵の名無しさん 18/07/03 14:14:15.68 22JZXDLY.net >>483 シミュレーションだと2行ですむ x=c(rep(1,4),rep(0,48)) mean(replicate(1e4,which(sample(x)==1)[1])) 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch