You will write a test for independence, a function for the probability that at least one of several independent events happens, and a test for mutual independence of three events. The checker uses two dice and three coins.
The idea. Events and are independent when . For independent chances , the probability that none happens is the product of the . Three events are mutually independent when every pair passes and the triple product also holds.
Your tasks.
independent(a, b, space). Return True when the probability of both equals the product of the two probabilities.at_least_one(chances). Return the probability that at least one of the independent events with these chances happens.mutually_independent(a, b, c, space). Return True only when the three pairs and the triple all pass the product rule.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…