Addition Rules & Counting Principles
Mutually exclusive events, general addition theorems, multi-category frequency tables, permutations, and combinatorial probability with Python 3.
Lab 01 Tasks: Model Review
Complement Defect Model: Defect rate p = 0.08, n = 4. Probability of at least one defect.
Badge Key Permutations: 2 uppercase letters + 5 digits without repetition. P(Crack) = 4.89e-8.
Dependent 3-Card Draw: King then Queen then Jack without replacement.
Task 1: 0.28361
Task 2 Keys: 20442240 | P: 4.89e-08
Task 3: 0.000483
Mutually Exclusive Events
Fours and Aces: 4 fours and 4 aces in standard 52-card deck
Direct Sum: Add mutually exclusive probabilities without overlap
P(4 or Ace): 0.15385
General Addition Rule
Identify Overlap: Event A below 3 and Event B odd share outcome 1
Apply Theorem: (2/6) + (3/6) - (1/6) = 4/6 ≈ 0.6667
P(A or B): 0.6667
Blood-Type Addition Counts
Substitute Counts: Type B (45) + Rh-Neg (65) - Overlap (8) = 102
Calculate Ratio: Divide favorable category sum by sample size (409)
P(B or Rh-): 0.2494
Factorials & Permutations
Sudoku Row: 9 distinct digits in 9 positions: 9×8×7×6×5×4×3×2×1
Code without repeats: 10 choices × 9 choices × 8 choices
Sudoku: 362880 Codes: 720
Combinations Formula
Choose 4 Companies from 16: (16×15×14×13)/(4×3×2×1) = 1,820
4-Company Selections: 1820 House Arrangements: 13860
Combination Probability
Affected & Unaffected: C(3,1) × C(397,3)
All Selections: C(400,4) = 1,050,739,900; Ratio = 0.02955
Probability: 0.02955