Expanded Discrete Probability and Counting
Expanded Discrete Probability and Counting
Example:
If a fair die is rolled, what is the probability of rolling an even number?
Solution: Favorable outcomes = {2, 4, 6}, Total outcomes = {1, 2, 3, 4, 5, 6}
P(Even) = 3/6 = 1/2 = 0.5.
Example:
A factory has two machines producing items: Machine A produces 60% of items and has a
5% defect rate, while Machine B produces 40% of items and has a 10% defect rate.
What is the probability that a randomly selected defective item came from Machine A?
Solution:
Let D be the event that an item is defective.
P(D | A) = 0.05, P(D | B) = 0.10, P(A) = 0.60, P(B) = 0.40.
Using Bayes' Theorem:
P(A | D) = (P(D | A) * P(A)) / (P(D | A) * P(A) + P(D | B) * P(B))
= (0.05 * 0.60) / (0.05 * 0.60 + 0.10 * 0.40)
= 0.03 / (0.03 + 0.04) = 0.03 / 0.07 = 3/7 ≈ 0.4286 (42.86%).
E[X] = Σ x * P(X = x)
Example:
A fair die is rolled. Let X be the outcome.
E[X] = (1*1/6) + (2*1/6) + (3*1/6) + (4*1/6) + (5*1/6) + (6*1/6)
= (1+2+3+4+5+6) / 6 = 3.5.
Example:
Fibonacci sequence: F(n) = F(n-1) + F(n-2), with F(0) = 0, F(1) = 1.
Example:
A person can climb 1 or 2 steps at a time. How many ways can they climb a staircase with n
steps?
Solution: Let f(n) be the number of ways. We can either:
1. Take 1 step and then solve f(n-1).
2. Take 2 steps and then solve f(n-2).
Thus, f(n) = f(n-1) + f(n-2), similar to Fibonacci sequence.
Example:
Find the number of integers from 1 to 100 that are divisible by 2 or 3.
Solution:
|A| = Numbers divisible by 2 = 100/2 = 50.
|B| = Numbers divisible by 3 = 100/3 = 33.
|A ∩ B| = Numbers divisible by 6 = 100/6 = 16.
Using Inclusion-Exclusion:
|A ∪ B| = |A| + |B| - |A ∩ B|
= 50 + 33 - 16 = 67.