← Writing & notes

FROM THE NOTEBOOK

Mathematics for Computer Science - MIT 6.1200J

MIT 6.1200J Mathematics for Computer Science, Spring 2024 - YouTube

This course provides a rigorous introduction to the foundational mathematical concepts that underpin modern computer science. The curriculum is structured into four major units: Proofs, Number Theory, Graph Theory, and Probability, equipping students with the essential language and tools for formal reasoning, algorithmic analysis, and modeling complex systems.
The course begins with the fundamentals of mathematical proof. It defines the core components of a proof—propositions, axioms, and logical deductions—and establishes a "cookbook" of standard proof techniques. Students learn to construct direct proofs, proofs by contrapositive, proofs by contradiction, and proofs by cases. A central focus is proof by induction, including the more powerful strong induction, which is motivated and demonstrated through classic problems like the Tromino Tiling puzzle and the analysis of recursive algorithms.
The second unit delves into Number Theory, focusing on properties of integers that are critical for cryptography. Key topics include divisibility, the Greatest Common Divisor (GCD), and Euclid's Algorithm for its efficient computation. These tools are motivated by the Die Hard water pouring puzzle, which is shown to be equivalent to solving linear Diophantine equations. The unit culminates in modular arithmetic, developing the rules for operating with congruences, the concept of multiplicative inverses, and proving foundational theorems like Fermat's Little Theorem and the Chinese Remainder Theorem. These principles are then synthesized to explain the mechanics and security of the RSA public-key cryptosystem.
The third unit introduces Graph Theory, the abstract language for modeling networks and relationships. It covers fundamental concepts for both undirected and directed graphs, including vertex degrees, the Handshake Lemma, walks, paths, and cycles. Connectivity is explored in depth, leading to the concepts of connected components in undirected graphs and strongly connected components (SCCs) in directed graphs. The course examines classic graph problems such as Eulerian tours, bipartite matching, and the stable matching problem, for which the elegant Gale-Shapley algorithm is analyzed. A significant focus is placed on Directed Acyclic Graphs (DAGs), their properties (like the existence of sources and sinks), and their application to scheduling problems via topological sorting.
The final unit covers Discrete Probability, providing the framework for reasoning about uncertainty. The course builds from first principles, starting with sample spaces, events, and the axioms of probability. The tree method is used as a systematic tool for solving problems involving sequential random processes, such as the Monty Hall problem. Key concepts of conditional probability, independence (pairwise vs. mutual), and Bayes' Rule are developed and applied to analyze common statistical paradoxes like the base rate fallacy and Simpson's Paradox. The concept of a random variable is introduced, leading to the study of expectation and variance. The transformative linearity of expectation is highlighted as a powerful problem-solving tool. The course concludes with an analysis of tail bounds—including Markov's, Chebyshev's, and Chernoff's inequalities—which provide powerful methods for bounding the probability that a random variable deviates significantly from its mean.

L1: Predicates, Sets, and Proofs

1. Introduction and Course Logistics
The lecture, led by instructor Zachary Abel, begins by welcoming students and outlining the structure and logistics of the course.

2. The Nature of Proofs
The central theme of the lecture is introduced: understanding the nature of mathematical proofs.

3. Propositions and Predicates

4. Logical Operators and Truth Tables
The lecture explains how to combine propositions using logical operators, defined by truth tables.

5. Set Theory Basics
The lecture provides a brief introduction to the language of sets.

6. Axioms and the Foundations of Mathematics
The final key term from the definition of a proof is explained.

L2: Contradiction and Induction

1. Logical Deductions and Inference Rules
The lecture, led by instructor Zachary Abel, completes the definition of a mathematical proof by focusing on the third key component: logical deductions.

2. Standard Proof Outlines
The lecture presents several common "proof outlines" or templates for structuring proofs based on the form of the theorem being proven. These are scaffolds to guide thinking and ensure all necessary components of a proof are addressed.

  1. Direct Proof:
    • Outline: Assume P is true, and then use a chain of logical deductions to show that Q must also be true.
    • Example: To prove "If n is a multiple of 10, then n is even," we assume n=10k, show that this means n=2(5k), which is the definition of an even number.
  2. Proof by Contrapositive:
    • Logic: Relies on the fact that P => Q is logically equivalent to its contrapositive, (NOT Q) => (NOT P).
    • Outline: Assume NOT Q is true, and use a chain of logical deductions to show that NOT P must also be true.
    • Example: To prove "If n² is even, then n is even," we prove the contrapositive: "If n is odd, then n² is odd." We assume n = 2k+1 and show that n² = 2(2k²+2k)+1, which is the definition of an odd number.
  3. Proof by Contradiction:
    • Logic: Relies on the inference rule ((NOT P) => False) => P.
    • Outline: To prove a proposition P, first assume NOT P. Then, derive a contradiction (a statement R that is both true and false, e.g., R AND (NOT R)). Since a contradiction is impossible in a consistent logical system, the initial assumption (NOT P) must be false, meaning P must be true.
    • Example: To prove "√2 is irrational," we assume for contradiction that √2 is rational. This means √2 = a/b in lowest terms. Squaring and rearranging leads to a² = 2b², which implies a is even. Substituting a = 2c leads to b² = 2c², which implies b is also even. If both a and b are even, they share a common factor of 2, which contradicts the assumption that the fraction was in lowest terms. Therefore, the initial assumption must be false.

3. The Principle of Induction
The final and most substantial part of the lecture is a deep dive into proof by induction.

L3: Casework and Strong Induction

1. Review of Proof Techniques
The lecture, led by instructor Eric Demaine, begins by reviewing the "cookbook" of proof techniques established in the previous lecture. This serves as a foundation for the new methods to be introduced. The reviewed techniques include:

2. Proof by Cases
The first new technique introduced is proof by cases.

3. Strong Induction
The second major technique introduced is strong induction, a more powerful (but logically equivalent) version of the induction principle.

4. Examples of Strong Induction
Two detailed examples are used to demonstrate the utility of strong induction, particularly in "divide and conquer" style arguments.

L4: State Machines

1. Introduction: State Machines and Proofs
The lecture, led by instructor Erik Demaine, introduces state machines as a formal tool for modeling and reasoning about processes that evolve over time, such as algorithms. The primary goal is to use this formalism to prove properties of these processes, particularly their correctness and termination, using a technique called invariants, which is a form of induction.

2. Case Study: The 8-Puzzle
To motivate the need for formal proofs about state machines, the lecture introduces the 8-puzzle.

3. State Predicates, Preservation, and Invariants
To prove properties like the impossibility of solving certain 8-puzzle configurations, the concepts of state predicates and invariants are introduced.

4. Proving the 8-Puzzle Impossibility
The invariant principle is now applied to the 8-puzzle.

  1. Define a Predicate: The crucial step is to define a clever predicate. Let P(q) be the proposition: "The number of inverted pairs in state q is even."
    • An inverted pair is a pair of tiles (i, j) such that i > j but i appears before j in the reading order of the grid (ignoring the blank).
  2. Prove Preservation: The lecture proves that this predicate is preserved.
    • Case 1 (Horizontal move): A horizontal slide does not change the reading order of the tiles, so the number of inverted pairs remains unchanged. The parity (odd/even) is preserved.
    • Case 2 (Vertical move): A vertical slide is shown to be equivalent to swapping a tile with two others in the reading order. Each adjacent swap changes the number of inversions by ±1 (an odd number). Two such swaps change the total number of inversions by an even number. Therefore, an even number of inversions plus an even number is still even; an odd number plus an even number is still odd. The parity of the number of inverted pairs is always preserved.
  3. Apply the Invariant Principle:
    • Consider a starting state like 1, 2, 3, 4, 6, 5, 7, 8, which has one inverted pair (6, 5). The predicate P(q₀) is false (the number of inversions is odd).
    • Since the parity of inversions is a preserved property, it must be an invariant for all states reachable from q₀. This means every reachable state must also have an odd number of inverted pairs.
    • The solved state 1, 2, 3, 4, 5, 6, 7, 8 has zero inverted pairs. The predicate P(q_final) is true (the number of inversions is even).
    • Conclusion: Since the start state has an odd number of inversions and the final state has an even number, and the parity can never change, the final state is unreachable from this starting state.

5. Proving Termination: Derived Variables
The lecture shifts from proving correctness (what states are reachable) to proving termination (that the machine must eventually halt).

L5: Sums

1. Introduction to Algorithmic Analysis and Sums
The lecture, led by instructor Brynmor Chapman, shifts focus from proofs to algorithmic analysis, beginning with the fundamental tool of evaluating sums. Understanding how to find closed-form expressions for or approximate the value of summations is a critical skill for analyzing the runtime and behavior of algorithms.
2. Motivating Example: The Value of an Annuity
The lecture starts with a real-world example to motivate the need for evaluating sums.

3. Method 1: The Perturbation Method
This method is used to discover the closed form for a sum if it is not already known.

4. Method 2: The Ansatz (Educated Guess) Method
This method is used when you can make a good "educated guess" (ansatz) about the form of the closed-form solution.

5. Method 3: Handling Double Summations
This section deals with nested sums.

6. Method 4: The Integral Method for Approximation
This method is used when a nice closed form for a sum does not exist or is not needed. The goal is to find good upper and lower bounds for the sum.

L6: Asymptotics

1. Introduction: From Summations to Asymptotics
The lecture, led by instructor Zachary Abel, begins by wrapping up the topic of summations and transitioning to a core concept in algorithm analysis: asymptotic notation.

2. The Motivation for Asymptotic Notation
The core of the lecture is about developing a language to compare the efficiency of algorithms in a way that is robust to implementation details and focuses on fundamental scaling behavior.

3. Big O Notation (O)
Big O notation is the primary tool for providing an asymptotic upper bound on a function's growth.

4. Related Asymptotic Notations: Ω and Θ
To provide a complete language for asymptotic comparison, two related notations are introduced.

5. Little o and Little omega Notation
Two final notations are introduced to capture strict asymptotic inequalities.

6. Warning: Asymptotics and Induction Don't Mix
The lecture concludes with a critical warning and a "proof" of a false statement to illustrate a common pitfall.

L7: Recurrences

1. Introduction: Analyzing Recurrences
The lecture, led by instructor Brynmor Chapman, focuses on recurrences, which are sequences defined inductively. This is a core topic in algorithmic analysis, as the runtimes of recursive algorithms are naturally described by recurrence relations. The goal is to develop techniques for finding closed-form or asymptotic solutions to these recurrences.

2. Case Study: The Towers of Hanoi
This classic puzzle is used to demonstrate how recurrences arise from recursive algorithms.

3. Case Study: Sorting Algorithms
The lecture uses sorting algorithms to further motivate the analysis of recurrences and to set up the introduction of the Master Theorem.

4. The Master Theorem
The Master Theorem provides a "cookbook" method for finding asymptotic (Θ) solutions to a large class of divide and conquer recurrences without doing the full plug-and-chug derivation.

The Master Theorem is a powerful tool that simplifies the analysis of many divide and conquer algorithms, providing immediate asymptotic bounds without requiring a full derivation.

L8: Divisibility

1. Introduction to Number Theory
The lecture, led by instructor Erik Demaine, introduces the topic of Number Theory, the study of integers. This ancient branch of mathematics has found critical modern applications in computer science, particularly in cryptography and error correction. The lecture focuses on the foundational concepts of divisibility and the Greatest Common Divisor (GCD).
2. Divisibility

3. Case Study: The Water Pouring Puzzle
The famous puzzle from the movie Die Hard 3 is used to motivate the need for GCDs.

4. The Greatest Common Divisor (GCD)
To formalize the solvability condition, the concept of the Greatest Common Divisor is introduced.

5. Euclid's Algorithm for Computing the GCD
The lecture develops an efficient algorithm for computing the GCD.

6. Bézout's Lemma and the Pulverizer Algorithm
The lecture circles back to connect the GCD with integer linear combinations.

L9: Modular Arithmic

1. Introduction to Modular Arithmetic
The lecture, led by instructor Brynmor Chapman, introduces modular arithmetic, a fundamental concept in number theory with wide-ranging applications in computer science.

2. Congruence and Remainders
The lecture formally defines the key concepts.

3. Rules of Modular Arithmetic
A key property of modular arithmetic is that addition, subtraction, and multiplication behave as expected with respect to congruence.

4. Modular Division and Multiplicative Inverses
The lecture then addresses the tricky question of division in modular arithmetic.

5. Fermat's Little Theorem
This famous theorem provides a powerful tool for simplifying exponents in modular arithmetic, addressing the issue raised earlier.

This theorem provides the missing piece for handling exponents and is a cornerstone of many cryptographic algorithms that rely on modular exponentiation.

L10: Cryptography

1. Introduction to Cryptography
The lecture, led by instructor Brynmor Chapman, shifts from pure number theory to one of its most critical applications: cryptography, the science of protecting information.

2. A History of Private Key Cryptography
The lecture begins with a historical overview of private key (or symmetric) cryptosystems, where Alice and Bob must share the same secret key for both encryption and decryption.

3. Public Key Cryptography
The lecture then introduces the modern paradigm of public key (or asymmetric) cryptography.

4. The RSA Cryptosystem
RSA is the most famous and widely used public key cryptosystem. Its security relies on the computational difficulty of factoring large numbers.

5. The Chinese Remainder Theorem (CRT)
The final topic is the Chinese Remainder Theorem, a powerful tool for solving systems of congruences. It is also used to speed up RSA computations in practice.

L11: Graphs and Coloring

1. Introduction to Graph Theory
The lecture, led by instructor Zachary Abel, marks the beginning of a new unit on Graph Theory. Graphs are presented as a powerful and versatile mathematical abstraction for modeling pairwise relationships between objects, with applications across computer science and beyond.

2. Fundamental Graph Terminology and the Handshake Lemma
The lecture introduces the basic vocabulary for discussing graphs.

3. Bipartite Graphs
A special class of graphs is introduced with a real-world example.

4. Graph Coloring
The lecture introduces a classic problem in graph theory: graph coloring.

5. The Greedy Coloring Algorithm
Since finding the optimal coloring is hard, a simple and fast heuristic algorithm is presented.

L12: Matchings

1. Introduction to Matchings
The lecture, led by instructor Zachary Abel, introduces the graph theory concept of a matching, a fundamental tool for modeling problems involving pairing up objects.

2. Maximal vs. Maximum Matchings
A crucial distinction is made between two notions of a "large" matching.

3. Perfect Matchings and Bipartite Graphs

4. The Stable Matching Problem
The main topic of the lecture is the stable matching problem, a classic problem with significant real-world applications, most famously the National Resident Matching Program for medical school graduates.

5. The Gale-Shapley Algorithm
This is a famous algorithm that is guaranteed to find a stable matching.

6. Analysis of the Gale-Shapley Algorithm
The lecture proves that the algorithm has several desirable properties.

7. Optimality Properties
A surprising result is that the algorithm is systematically biased depending on which side proposes.

L13: Connectivity and Trees

1. Introduction to Matchings
The lecture, led by instructor Zachary Abel, introduces the graph theory concept of a matching, a fundamental tool for modeling problems involving pairing up objects.

2. Maximal vs. Maximum Matchings
A crucial distinction is made between two notions of a "large" matching.

3. Perfect Matchings and Bipartite Graphs

4. The Stable Matching Problem
The main topic of the lecture is the stable matching problem, a classic problem with significant real-world applications, most famously the National Resident Matching Program for medical school graduates.

5. The Gale-Shapley Algorithm
This is a famous algorithm that is guaranteed to find a stable matching.

6. Analysis of the Gale-Shapley Algorithm
The lecture proves that the algorithm has several desirable properties.

7. Optimality Properties
A surprising result is that the algorithm is systematically biased depending on which side proposes.

L14: Digraphs and DAGs

1. Introduction to Directed Graphs (Digraphs)
The lecture, led by instructor Erik Demaine, transitions from undirected graphs to directed graphs (digraphs). This shift is motivated by scenarios where relationships are one-way, such as one-way streets, follower relationships on social media, or hyperlinks on the web.

2. Walks, Paths, and Reachability in Digraphs
The concepts of movement within a graph are adapted for the directed case.

3. Connectivity in Digraphs
The lack of symmetry in reachability leads to a more nuanced definition of connectivity.

4. Directed Acyclic Graphs (DAGs)
DAGs are a particularly important class of directed graphs that have no directed cycles.

5. Parallel Task Scheduling and Dilworth's Theorem
The lecture concludes with a practical application of DAGs: scheduling tasks with precedence constraints on a parallel machine.

L15: Relations and Counting

1. Introduction to Relations
The lecture, led by instructor Zachary Abel, introduces the concept of relations, which generalizes the idea of a function and provides a formal language for modeling relationships between objects.

2. Types of Relations: Functions
The lecture formalizes the connection between relations and functions.

3. Counting with Relations: The Bijection Rule
These definitions provide powerful tools for counting and comparing the sizes of sets.

This last rule, the bijection rule, is a cornerstone of combinatorics. It allows us to count the size of a complex set A by finding a simpler set B of known size and constructing a bijection between them. This is analogized to the "parable of the two shepherds," where a shepherd without number words can verify their flock's size by creating a one-to-one correspondence between sheep and pebbles.
4. Special Relations: Relations on a Set
The lecture then focuses on the special case where the domain and codomain are the same set (R ⊆ A x A). These are equivalent to directed graphs where V=A.

5. The Rules of Counting
The second half of the lecture introduces the fundamental principles of combinatorial counting.

  1. The Product Rule: If a process consists of a sequence of independent choices, the total number of outcomes is the product of the number of options at each stage. The size of a Cartesian product A₁ x ... x Aₙ is |A₁| * ... * |Aₙ|.
    • Example: The number of binary strings of length n is 2 * 2 * ... * 2 = 2ⁿ.
  2. The Bijection Rule (revisited): To count a set A, find a bijection to a set B whose size is known.
    • Example: The number of subsets of an n-element set is 2ⁿ. This is proven by constructing a bijection between subsets and binary strings of length n. A string b₁...bₙ corresponds to the subset containing element i if and only if bᵢ = 1.
  3. The Sum Rule: If a set A is the disjoint union of sets A₁, ..., Aₙ, then |A| = |A₁| + ... + |Aₙ|.
    • Intuition: "OR means add."
    • Example: The number of passwords of length 6, 7, OR 8 is the sum of the number of passwords of length 6, the number of length 7, and the number of length 8.
  4. The Generalized Product Rule: This extends the product rule to cases where the set of choices at a later stage depends on the specific choice made earlier, but the number of choices does not.
    • Example: To count the number of permutations of a 52-card deck:
      • There are 52 choices for the first card.
      • No matter which card was chosen first, there are 51 remaining choices for the second card.
      • No matter which two were chosen, there are 50 choices for the third, and so on.
    • The total number of permutations is 52 * 51 * ... * 1 = 52!.

L16: Counting Techniques

1. Introduction: Counting Principles
The lecture, led by instructor Zachary Abel, continues the unit on counting and combinatorics. The focus is on developing systematic rules and techniques for counting the number of elements in a set, a crucial skill for probability, algorithm analysis, and other areas of computer science.
2. The Generalized Product Rule
The lecture begins by reviewing the Generalized Product Rule.

3. The Division Rule
This rule provides a powerful method for counting a set by relating it to another, easier-to-count set.

4. The Binomial Coefficient: "n choose k"
The lecture uses the division rule to derive one of the most important formulas in combinatorics.

5. The Recipe Method (Counting with Sequences)
This is a powerful and general problem-solving strategy that combines the previously discussed rules.

L17: More Counting Techniques

1. Introduction: The Principle of Inclusion-Exclusion (PIE)
The lecture, led by instructor Brynmor Chapman, begins by extending the Sum Rule of counting to handle sets that are not disjoint.

2. The Pigeonhole Principle
This is another fundamental counting principle, used for proving the existence of certain properties without necessarily constructing an example.

3. Combinatorial Proofs (Double Counting)
This is a powerful proof technique for establishing combinatorial identities.

L18: Probability

1. Introduction: The Challenges of Probability
The lecture, led by instructor Brynmor Chapman, begins the final unit of the course on probability. It is framed as a discipline that is both immensely important across science and computer science (used in algorithms, cryptography, machine learning, etc.) and notoriously counter-intuitive. Common sense is often a poor guide, making a rigorous, step-by-step approach essential.
2. Case Study: The Monty Hall Problem
The famous Monty Hall problem is used as the primary motivating example to illustrate the pitfalls of intuition and the power of a formal approach.

3. The Tree Method for Analyzing Probability
To solve the Monty Hall problem and other probability puzzles, the lecture introduces a systematic, rigorous procedure called the Tree Method (also known as the four-step method).
Before any analysis, it is critical to precisely define the problem and state all assumptions. The ambiguity in the original letter to Marilyn vos Savant is resolved by establishing a clear set of axioms:

  1. The prize is placed behind a random door with equal probability (1/3).
  2. The contestant's initial choice of door is also uniform and random (1/3).
  3. Monty must open a door that is not the contestant's choice and does not contain the prize.
  4. If Monty has a choice between two doors to open (which only happens if the contestant initially picked the car), he chooses between them randomly (1/2 probability).

The first formal step is to define the set of all possible outcomes, known as the sample space, S.

The next step is to compute the probability of each outcome in the sample space.

An event is simply a subset of the sample space S. The goal is to calculate the probability of a specific event occurring.

The probability of an event is the sum of the probabilities of all the outcomes contained within that event.

4. Non-Transitive Dice
The lecture concludes with another counter-intuitive example: Efron's non-transitive dice.

The lecture concludes by emphasizing that for probability, intuition is an unreliable guide. A rigorous, step-by-step analysis using tools like the tree method is the only way to arrive at correct conclusions.

L19: Conditional Probability

1. Introduction: Building on the Four-Step Method
The lecture, led by instructor Brynmor Chapman, continues the unit on probability. It builds upon the tree method (or four-step method) introduced in the previous lecture and explores more complex scenarios and key theorems like Bayes' Rule.
2. Rules of Probability
The lecture begins by formalizing several fundamental rules for calculating the probabilities of events. An event is a subset of the sample space.

3. Conditional Probability
The main topic of the lecture is conditional probability, which allows us to update our beliefs based on new information.

4. Bayes' Rule
Bayes' Rule is a fundamental theorem that allows us to "invert" conditional probabilities. It's simply a rearrangement of the product rule but has profound implications for inference and reasoning under uncertainty.

5. Applications and Paradoxes of Conditional Probability
The lecture uses several examples to illustrate the power and counter-intuitive nature of conditional probability.

L20: Independence

1. Introduction: The Rules of Probability
The lecture, led by instructor Brynmor Chapman, continues the unit on probability. It builds upon the tree method (or four-step method) introduced in the previous lecture and explores more complex scenarios and key theorems like Bayes' Rule.

2. Conditional Probability and Independence
The main topic is conditional probability, which allows for updating beliefs based on new information, leading to the crucial concept of independence.

3. Pairwise vs. Mutual Independence
The concept of independence is extended from two events to a collection of n events.

4. The Birthday Paradox
This classic problem illustrates a surprising consequence of probability and is used as an application of the counting principles from previous lectures.

5. The Gambler's Fallacy
The lecture concludes by discussing another common cognitive bias related to probability.

L21: Random Variables

1. Introduction: Counting and Probability
The lecture, led by instructor Brynmor Chapman, continues the unit on probability. The main goal is to show how the counting techniques developed in the previous unit (like the Sum Rule and PIE) naturally extend from reasoning about the sizes of sets to reasoning about the probabilities of events.

2. Conditional Probability and Bayes' Rule
The lecture then formally introduces conditional probability, a cornerstone of probabilistic reasoning.

3. Random Variables (RVs)
The second half of the lecture introduces the crucial concept of random variables.

4. Distributions
Often, it is convenient to reason about a random variable without reference to the underlying sample space. This is done by studying its distribution.

5. The Binomial Distribution and Stirling's Approximation
The lecture concludes with a detailed analysis of the binomial distribution.

L22: Expectation

1. Introduction to Expectation
The lecture, led by instructor Erik Demaine, introduces the concept of expectation, a fundamental tool in probability theory for summarizing a random variable.

2. Alternative Formulas for Expectation
The lecture presents several equivalent, and often more convenient, formulas for calculating expectation.

3. Key Examples and Applications
Several classic probability problems are used to illustrate the calculation and application of expectation.

4. The Power of Linearity of Expectation
This is presented as the most important and useful property of expectation.

5. Examples of Linearity of Expectation
Several problems are solved using the decomposition technique.

The lecture powerfully demonstrates how linearity of expectation, combined with the technique of decomposing a complex random variable into a sum of simple (often indicator) variables, can elegantly solve problems that would be combinatorially difficult otherwise.

L23: Variance

1. Introduction to Expectation
The lecture, led by instructor Erik Demaine, introduces the concept of expectation, a fundamental tool in probability theory for summarizing a random variable.

2. Alternative Formulas for Expectation
The lecture presents several equivalent, and often more convenient, formulas for calculating expectation.

3. Key Examples and Applications
Several classic probability problems are used to illustrate the calculation and application of expectation.

4. The Power of Linearity of Expectation
This is presented as the most important and useful property of expectation.

5. Examples of Linearity of Expectation
Several problems are solved using the decomposition technique.

The lecture powerfully demonstrates how linearity of expectation, combined with the technique of decomposing a complex random variable into a sum of simple (often indicator) variables, can elegantly solve problems that would be combinatorially difficult otherwise.

L24: Large Deviations and Bounds

1. Introduction: Tail Bounds
The final lecture of the course, led by instructor Brynmor Chapman, focuses on tail bounds. While expectation and variance provide one- or two-number summaries of a random variable, tail bounds answer a more practical question: What is the probability that a random variable deviates significantly from its expected value?

2. Markov's Inequality
Markov's Inequality provides a simple, fundamental upper bound on the probability of a random variable being large.

3. Chebyshev's Inequality
Chebyshev's Inequality provides a stronger tail bound by incorporating information about the variance of the random variable.

4. Chernoff Bounds
Chernoff bounds provide even stronger, exponentially decreasing tail bounds, but they require a stronger assumption: the random variable must be a sum of mutually independent random variables.

5. Course Wrap-up and Farewell
The lecture concludes with a final summary and a farewell from the instructors.

This final lecture provides students with a powerful toolkit for analyzing the probabilistic behavior of algorithms and systems, capping off the course's journey from logic and proofs to the uncertainties of the real world.

All writing