
Probability for Computer Scientists: Counting (Lecture 1)
Chris Piech, Assistant Professor of Computer Science at Stanford, opens CS109 with the foundations of counting as the gateway into probability. He works through the logic of permutations and combinations, showing how to count arrangements and selections systematically before any probability formulas enter the picture, since most probability calculations ultimately reduce to counting outcomes correctly. The lecture builds up the multiplication rule, addition rule, and the distinction between ordered and unordered counting, using concrete examples such as passwords, card hands, and committee selection to make the abstract rules tangible. Piech is deliberate about notation and intuition together, pausing to show why formulas work rather than just stating them. As the first session of a Stanford computer science course, it sets the groundwork for everything that follows in the quarter, treating counting not as a side topic but as the mathematical backbone of discrete probability.