Mathematics and Programming for FinTech

In Dice Game, you must run across a 140m bridge before it collapses. You are given two 6- sided dices with these numbers on their faces:

-8, -7, 1, 2, 7, 8 on the first dice
-7, -2, 1, 3, 7, 7 on the second dice

At every move, you throw the two dice simultaneously to obtain a score of X which is the product of the top faces of the two dice. You are then required to run forward X meters across the bridge. If unfortunately, X is negative, you need to run backward X meters.

You can only make 3 moves before the bridge collapses.

For example, if you throw (8, 7), (2, -2) and (-7, -7), you will have run a total of 101m (since 8 x 7 + 2 x (-2) + (-7) x (-7) = 56 – 4 + 49 = 101). Sadly, this means you will still be on the bridge when it collapses.

You are not allowed to import any packages in this question unless stated otherwise.

(a) List the unique scores X you can get per move in ascending order.

(b) Code a function pmf(x) that returns P(X = x). Compute to 6 decimal places the values
P(X = -21)
P(X = -14)
P(X = 14)
P(X = 50)

(c) Code a function cdf(x) that returns P(X x). Compute to 6 significant figuresthe values
P(X -21)
P(X < -14)
P(X < 50)

(d) What is the probability of you crossing the bridge successfully? Explain your reasoning clearly. Give your answer correct to 6 significant figures.

(e) Draw and label the step graphs of pmf(x) and cdf(x) for an integer x such that – x matplotlib.pyplot.