Read this lesson as text
Probability Examples
Math for CS · Axiom Academy
Step-by-step probability problems for CS Problem: In a group of 23 people, what is the probability that at least two share a birthday? (Assume 365 equally likely birthdays.) Person 1 can have any birthday: 365/365 Person 2 must differ from person 1: 364/365 Person 3 must differ from both: 363/365 And so on... Example 2: Expected Value of a Randomized Algorithm Problem: A randomized algorithm succeeds with probability p = 0.3 on each independent attempt. How many attempts are needed on average to get the first success? This is a Geometric (p) random variable with p = 0.3 . On average about 3-4 attempts, but with significant variability. Example 3: Binomial -- Network Reliability Problem: A system sends 15 packets, each arriving independently with probability 0.9. What is the probability that at least 13 arrive? About 81.6% chance at least 13 of 15 packets arrive. Example 4: Bayes' Theorem -- Diagnostic Testing Problem: A hardware diagnostic test has a 95% true positive rate and a 3% false positive rate. If 2% of chips are actually defective, and a chip tests positive, what is the probability it is truly defective? Let D = defective, + = tests positive. Only 39.2%! Even with a good test, when the base rate is low, most positives are false positives. Example 5: Chebyshev Bound on Sampling
This is the written version of the interactive lesson above. See the full Math for CS course.