1 A die is rolled three times. Find the probability that the sum of the outcomes
is
(a) greater than 9.
(b) an odd number.

a

total.way = 6*6*6
count.greater.than.nine = 0
for (i in c(1:6)) {
    for (j in c(1:6)) {
            for (k in c(1:6)) {
                    if (i+j+k > 9) {
                            count.greater.than.nine = count.greater.than.nine + 1
                    }
            }
    }
}
(count.greater.than.nine)
## [1] 135
(probability = count.greater.than.nine/total.way)
## [1] 0.625

b

total.way = 6*6*6
count.odd.number = 0
for (i in c(1:6)) {
    for (j in c(1:6)) {
            for (k in c(1:6)) {
                    if ((i+j+k) %% 2 != 0) {
                            count.odd.number = count.odd.number + 1
                    }
            }
    }
}
(count.odd.number)
## [1] 108
(probability = count.odd.number/total.way)
## [1] 0.5