Securin Python Assessment
- Combinations
The total combinations when rolling two six-sided dice can be calculated by multiplying the number of faces on each die. In this case,
it's 6 * 6 = 36.
- Distribution of Combinations
To display the distribution of all possible combinations, we can create a 6x6 matrix where the element at position (i, j) represents the sum of Die A's i-th face and Die B's j-th face.
- Probability of Sums
Calculate the probability of each sum by counting the occurrences and dividing by the total number of combinations.
Undoom Dice
I devised a function called undoom_dice. I iterated through each face of Die A, checking if the number of spots exceeded 4. If it did, I replaced it with 4, ensuring that no face had more than 4 spots. Die B was simply copied as is since it could have any number of spots.