Explore Library
Code QuizIntermediate

Independence Check via Joint Probability

Find the flaw in testing whether two events are statistically independent.

Codepython
p_a = 0.5
p_b = 0.4
p_a_and_b = 0.2

# Events are independent if the joint equals ...
is_independent = abs(p_a_and_b - (p_a + p_b)) < 1e-9
print(is_independent)

What is the bug in this independence check?