3 In the early 1600s, Galileo was asked to explain the fact that, although the number of triples of integers from 1 to 6 with sum 9 is the same as the number of such triples with sum 10, when three dice are rolled, a 9 seemed to come up less often than a 10-supposedly in the experience of gamblers.
(a) Write a program to simulate the roll of three dice a large number of times and keep track of the proportion of times that the sum is 9 and the proportion of times it is 10.
t9 = 0
t10 = 0
n = 1000000
for (i in 1:n)
{
d = runif(3,1,6)
#print(d)
d[1] = floor(d[1])
d[2] = floor(d[2])
d[3] = floor(d[3])
if (sum(d) == 9)
{
t9 = t9 + 1
}
else if (sum(d) == 10)
{
t10 = t10 + 1
}
}
print(t9)
## [1] 152557
print(t10)
## [1] 143971
(b) Can you conclude from your simulations that the gamblers were correct?
No. From my simulation running more than 10 million trials for the triple dice several times, the gamblers were wrong. In fact, 9 seemed to come up more often than 10 in my simulation.