~/ learn/ afm-113/ cards/ Conditional probability and the multiplication rule
1 of 7

Compute P(error | late), P(late | error) and P(both late) for two draws without replacement from Maple Ledger’s 50 invoices, using Fraction so the exact ratios are visible.

Compute P(error | late), P(late | error) and P(both late) for two draws without replacement from Maple Ledger’s 50 invoices, using Fraction so the exact ratios are visible.

Answer

from fractions import Fraction n, late, error, both = 50, 12, 8, 3 p_err_given_late = Fraction(both, late) p_late_given_err = Fraction(both, error) p_both_late = Fraction(late, n) * Fraction(late - 1, n - 1) print(f"P(err|late)={float(p_err_given_late):.4f} P(late|err)={float(p_late_given_err):.4f} P(both late)={float(p_both_late):.4f}") print(f"as fractions: {p_err_given_late} {p_late_given_err} {p_both_late}")

IBS1 §3.1 (conditional), §3.3 (multiplication rule), §3.4 (sampling with and without replacement), CC BY 4.0 — shape only; original dataset

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/effca8a0-c1ab-4bd7-8f50-1268c5d60e7e/flashcard utf-8 LF