R

R, an interpreted statistical programming language. I will be posting a lot more R scripts in the near future. Writing my C++ solutions to Project Euler problems in R.

R program that generates a sample of 1000 fair coin tosses.

x<-table(sample(1:2,1000,replace=TRUE,prob=c(0.5,0.5)))
names(x) <- c("Heads","Tails")
x

Leave a Reply

Your email address will not be published. Required fields are marked *