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
Chapter 5: Sample from N(0,1)
Linear and Log linear Model
Chapter 2 Stats In class work
Julia set variant
26-08-2020AjusteCurvaLinearizab
Change text from ALL CAPS to Title Case
Ejercicios R
05-08-2020-Resolução-equaçao
EulerPendulo
Practice series1(37)