Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Given probabilities in the screenshot, let's verify if they indeed sum up to 1.
- # Probabilities listed are: 1/16 (six times) and 1/48 (two times).
- total_probability = (1/16) * 6 + (1/48) * 2
- total_probability
- # Output: 0.4166666666666667
- —-
- from fractions import Fraction
- # Convert the total probability to a fraction
- fraction_total_probability = Fraction(total_probability).limit_denominator()
- fraction_total_probability
- # Output: Fraction(5,12)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement