Chapter SUMS OF DISCRETE RANDOM VARIABLES
Exercise 1 Page 289
A die is rolled three times. Find the probability that the sum of the outcomes is:-
- greater than 9.
Solution
We know a dice has 6 sides. That means the number of possibilities per roll is 6. If we roll the dice 3 times. The total number of possible outcomes are \[ 6^3 = \] 216
n = 216
dice = seq(1,6)
gtrthnine = 0
for (i in 1:6) { # First Roll
for (j in 1:6) { # Second Roll
for (k in 1:6) { # Third Roll
if ((i+j+k) > 9) # Calculate if the sum is greater than 9
gtrthnine = gtrthnine + 1
}
}
}
The number of total events where the sum of 3 rolls is greater than 9 is :- 135
Probability of the same is :- gtrthnine/n = 0.625
- an odd number.
Solution
Lets consider the probability if getting an odd for
n = 216
dice = seq(1,6)
odd = 0
for (i in 1:6) { # First Roll
for (j in 1:6) { # Second Roll
for (k in 1:6) { # Third Roll
if ((i+j+k)%%2 != 0) # Calculate if the sum is Odd
odd = odd + 1
}
}
}
The number of total events where the sum of 3 rolls is greater than 9 is :- 108
Probability of the same is :- odd/n = 0.5