Roulette is a fascinating example of a betting game using random outcomes. In order to explore some properties of roulette spins, let's visualize some randomly drawn numbers in the range of those in an European roulette game (0 to 36). Histograms allow the graphic representation of the distribution of variables. Let's have a look at it! Type in the following code:
1 set.seed(1) 2 drawn = sample(0:36, 100, replace = T) 3 hist(drawn, main = "Frequency of numbers drawn", 4 xlab = "Numbers drawn", breaks=37)
Here we first set the seed number to 1
(see line 1). For reproducibility reasons, computer generated random numbers are generally not really random (they are in fact called pseudo-random). Exceptions exist, such as numbers generated on the website http://www.random.org (which bases the numbers on atmospheric variations). Setting the seed number to 1
(or any number really) makes sure the numbers we generate here will be the same as you will have on your screen...