n <- 10
#n-maliges Werfen eines Wuerfels
barplot(table(sample(1:6, size=n, replace = T)))
barplot(table(sample(c('gerade','ungerade'), size=n, replace = T))/n)
#zweimaliges Werfen einer Muenze, n Wiederholungen
wurf1 = sample(c('Kopf', "Zahl"), size = n, replace = T)
wurf2 = sample(c('Kopf', "Zahl"), size = n, replace = T)
tab = table(wurf1,wurf2)
barplot(tab,legend=colnames(tab), col=c("red", "blue"))
barplot(prop.table(tab), legend=colnames(tab), col=c("red", "blue"))