Correctness
correctness
Foundations
Basic Proof Techniques
Goldbach's conjecture has been verified for every even integer up to 4 * 10^18, yet mathematicians still call it a conjecture because no amount of testing covers every case. Algorithm correctness has the same shape: a function can pass a hundred unit tests and still fail on the empty list or the input size your tests never reached. **Basic Proof Techniques** equips you with the small set of argument styles that turn intuition into certainty about correctness, complexity bounds, and data structure invariants. Direct proof chains definitions and prior facts to a claim. Proof by contradiction assumes the opposite and derives a logical impossibility, as in the irrationality of `sqrt(2)` and the `Omega(n log n)` lower bound for comparison sorts. Mathematical induction, in weak and strong forms, proves statements over the natural numbers via a base case and an inductive step, the backbone of recurrence solutions and loop invariants. Proof by contraposition swaps `P implies Q` for the equivalent `not Q implies not P`, and proof by cases breaks a claim into exhaustive subcases. This lesson builds on **Discrete Mathematics Basics**, where you met sets, propositional logic, implications, and the first taste of formal proof. Here those informal sketches become the disciplined patterns that algorithm analysis, theoretical CS, and clean engineering arguments all rely on. With proofs in hand, you have completed the foundations track and are ready to step into **Arrays & Strings** and the rest of the data structures curriculum, armed to analyze every operation rigorously.
Not Started
0%
Algorithms
Complexity & Proof Intuition (Optional)
Comparison-based sorting cannot do better than `O(n log n)`. That is not a statement about merge sort or quick sort or any specific algorithm; it is a statement about every possible algorithm in this model, including ones nobody has invented yet. The proof is a counting argument over decision trees, and learning to read it changes how you reason about algorithmic limits forever. Lower bounds, NP-completeness, P versus NP, and loop invariants all live in the same theoretical neighborhood. **Complexity & Proof Intuition (Optional)** is an enrichment tour of that neighborhood. You will use loop invariants to prove iterative algorithms correct, revisit amortized analysis with the potential method, work through NP-completeness via polynomial-time reductions and the Cook-Levin theorem, examine the P vs. NP question and its implications, derive the `Omega(n log n)` comparison-sorting lower bound via decision trees, and meet the broader complexity zoo (co-NP, PSPACE, EXP). This lesson rests on three earlier ideas. **Asymptotic Analysis Fundamentals** gave you the language of growth rates that complexity classes refine. **Dynamic Programming (Intro)** and **Greedy (Intro)** showed you exact polynomial-time algorithms; this lesson asks which problems will never have one. This concludes the algorithms track. From here, the natural next step is sustained problem solving on hard interview problems and competitive programming contests that exercise the full toolkit you have built.
Not Started
0%
Introduction to Algorithms
Two recipes can both bake the same cake, yet one calls for thirty minutes and the other for three hours. The same is true of code: a problem like sorting a list or finding the largest number in an array has many valid solutions, and the choice between them is exactly what an algorithm captures. This lesson defines what an algorithm actually is, naming the five characteristics every algorithm shares (input, output, definiteness, finiteness, effectiveness). It separates the abstract steps of a method from the concrete code that implements it, and walks through how to judge whether a procedure is _correct_ before worrying about whether it is fast. You will also build a first informal sense of efficiency, the way work grows as inputs get bigger, without any formal notation yet. In **How to Read Code (JS & Python)**, you practiced tracing variables, loops, and function calls in two languages. **Introduction to Algorithms** zooms out from individual lines to the recipe as a whole, treating those traces as evidence that a method does what it claims. From here you will move into **Iteration Patterns on Arrays/Strings**, where these abstract ideas about correctness and efficiency get applied to concrete traversal templates.
Not Started
0%
