18/10/21 21:45:52.97 Z8EDA9Rx.net
>>212
バグ修正
> x=c(1,1,rep(0,10))
> PQ <- function(){
+ Q=sample(x)
+ z=matrix(Q,ncol=4,byrow=T)
+ P=as.vector(z)
+ c( even=which.max(P) == which.max(Q),
+ p1st=which.max(P) < which.max(Q),
+ q1st=which.max(P) > which.max(Q))
+
+ }
> k=1e6
> re=replicate(k,PQ())
> mean(re['even',]) ; 13/(26+27+13)
[1] 0.197025
[1] 0.1969697
> mean(re['p1st',]) ; 26/(26+27+13)
[1] 0.393803
[1] 0.3939394
> mean(re['q1st',]) ; 27/(26+27+13)
[1] 0.409172
[1] 0.4090909