Math Problem Statement

# You can use this cell for your calculations (not graded) # Define the sides of the fair 6-sided dice dice_sides_fair = np.array([1, 2, 3, 4, 5, 6]) # Calculate the probabilities for the first throw probabilities_first_throw = np.array([1, 1, 1, 1, 1, 1]) / 6 # Initialize an empty dictionary to store the probabilities for the second throw probabilities_second_throw = {} # For each possible outcome of the first throw for outcome in dice_sides_fair: # If the outcome is greater or equal to 3, calculate the probabilities for the second throw if outcome >= 3: # Calculate the probabilities for the second throw probabilities = np.array([1, 1, 1, 1, 1, 1]) / 6 else: # If the outcome is less than 3, set the probabilities for the second throw to 0 probabilities = np.zeros(6) # Store the probabilities for the second throw in the dictionary probabilities_second_throw[outcome] = probabilities # Initialize an empty dictionary to store the combined probabilities for each outcome combined_probabilities = {} # For each possible outcome of the first throw for outcome, probabilities_first_throw in zip(dice_sides_fair, probabilities_first_throw): # If the outcome is greater or equal to 3, combine the probabilities for the first and second throws if outcome >= 3: combined_probabilities[outcome] = probabilities_first_throw * probabilities_second_throw[outcome] else: # If the outcome is less than 3, only consider the probabilities for the first throw combined_probabilities[outcome] = probabilities_first_throw # Print the PMF for outcome, probabilities in combined_probabilities.items(): print("Outcome:", outcome, "Probability:", round(probabilities, 3))

Solution