Discrete Probability and Counting Techniques
4.2 Probability Theory
Probability theory is the mathematical study of randomness and uncertainty. It provides a
framework for quantifying the likelihood of events occurring. Key concepts include sample
spaces, events, and probability distributions.
4.3 Bayes' Theorem
Bayes' Theorem describes how to update probabilities based on new evidence:
P(A | B) = (P(B | A) * P(A)) / P(B)
where P(A | B) is the probability of A given B, P(B | A) is the probability of B given A, and
P(A) and P(B) are the independent probabilities of A and B.
4.4 Expected Value and Variance
The expected value (mean) of a random variable X is:
E[X] = Sum (x * P(X = x))
Variance measures the spread of a distribution:
Var(X) = E[X^2] - (E[X])^2
4.5 Advanced Counting Techniques: Recurrence Relations
Recurrence relations define sequences based on previous terms. They are useful in counting
problems and algorithm analysis.
Example: Fibonacci sequence:
F(n) = F(n-1) + F(n-2), with F(0) = 0, F(1) = 1.
4.6 Solving Linear Recurrence Relations
Linear recurrence relations can be solved using characteristic equations.
Example: Solve F(n) = 2F(n-1) + 3F(n-2).
Find characteristic equation: r^2 - 2r - 3 = 0.
4.7 Divide-and-Conquer Algorithms and Recurrence Relations
Divide-and-conquer algorithms break problems into smaller subproblems.
Example: Merge Sort:
T(n) = 2T(n/2) + O(n). Solve using recurrence techniques.
4.8 Generating Functions
Generating functions encode sequences as power series.
Example:
G(x) = Sum (a_n * x^n).
Useful in solving recurrence relations and combinatorial counting.
4.9 Inclusion-Exclusion Principle
Inclusion-Exclusion Principle counts elements in overlapping sets.
|A Union B| = |A| + |B| - |A Intersection B|.
For three sets:
|A Union B Union C| = |A| + |B| + |C| - |A Intersection B| - |A Intersection C| - |B Intersection
C| + |A Intersection B Intersection C|.
4.10 Applications of Inclusion-Exclusion
Applications include:
1. Counting surjective functions.
2. Counting derangements.
3. Probability of at least one event occurring.
4. Euler's Totient Function (coprime counting).
5. Hamiltonian Paths in Graph Theory.