Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

I am currently following a course on probability theory in coursera (https://www.coursera.org/course/probas) and I’ve seen some graphs concerning the outcome of some dice throws. Being an R-nerd I wrote a little function to do this in R. This is nothing fancy just I find it interesting the process of thoughts going from a real-world problem (100 throws of two dice) to some code and graphs (histogramms of the empirical and theoretical results of the sum of the two dice).

Here is the problem: We throw two six-faced fair dice a certain number of times and we compute the sum of their values, we want to compare the theoretical expectations with empirical ones as we are varying the number of times dice are thrown.