- 477 名前:132人目の素数さん mailto:sage [2021/07/04(日) 18:09:05.44 ID:7uY6Kq8E.net]
- >>451
(1) pbinom(2,5,1/4,lower=FALSE) (2) pgeom(5,1/3,lower=FALSE) (3) dnbinom(0:4,3,1/3) (4) pnorm(132.62,130,36)-pnorm(132.52,130,36) シミュレーションで検算 (1) > replicate(1e5,sum(runif(5)<1/4)>=3) |> mean() [1] 0.10382 (2) > janken=\(){ + count=1 + win=rbinom(1,1,1/3) + while(win==FALSE){ + count=count+1 + win=rbinom(1,1,1/3) + } + count + } > replicate(1e5,janken()>6) |> mean() [1] 0.08799 (3) > ball=\(){ + red=0 + white=0 + while(red<3 & white<4){ + b=rbinom(1,1,p) + if(b) red=red+1 else white=white+1 + } + white + } > k=1e5 > table(replicate(k,ball()))/k 0 1 2 3 4 0.01586 0.03515 0.05345 0.06619 0.82935 (4)はシミュレーションは無理。
|

|