Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Testing a faked dice
# testing a faked dice library(MASS) op <- par(mfcol=c(2,1)) DiceProb <- c(1/9,rep(1/6,4),2/9) dice <- function (n, t) { w <- NA w <- sample(1:6,n,replace=TRUE, prob = DiceProb) bp <- barplot( table(w)/n*100 , main = t , xlab = "Augen" , ylab = "Würfe [%]" , ylim = c(0,35) ) text( x = bp , y = 0 , labels = table(w) , pos = 3 , cex = 1 , col = "black" ) s = sqrt(5/36/n) abline ( h = ( 1/6 - 1.96 * s ) * 100 , col = "green" ) abline ( h = ( 1/6 + 1.96 * s ) * 100 , col = "green" ) s = sqrt(4*14/18/18/n) abline ( h = ( 4/18 - 1.96 * s ) * 100 , col = "red" ) abline ( h = ( 4/18 + 1.96 * s ) * 100 , col = "red" ) s = sqrt(8/81/n) abline ( h = ( 1/9 - 1.96 * s ) * 100 , col = "blue" ) abline ( h = ( 1/9 + 1.96 * s ) * 100 , col = "blue" ) rm (bp) } dice(100, "Test mit 100 Würfen") dice(1000, "Spiel mit 1.000 Würfen") dice(2000, "Spiel mit 2.000 Würfen")
run
|
edit
|
history
|
help
0
EulerEx3
Gab1A(resumido)
Ex-02-02-21
Assignmentno1 (3351)
Mandelbrotset
Read input in R console
Ass2 q2
Exp 2
19-08-2020-GaussSeidelSistema-menos-calc
Controle-22-03-2021