Probability foundations: counting & conditional probability
◈ 4 cardsCounting rules, permutations vs combinations, the sample-space definition of probability, Kolmogorov’s axioms, expectation, and conditional probability.
Why probability, and why here
Classical logic (Modules 1–6) reasons about what is provably true. Real agents — a physician, a diagnostic program, a self-driving car — must act on incomplete, noisy evidence. Stochastic methods (Luger Ch 5) attack uncertainty head-on: maintain explicit probability distributions over hypotheses and update them with evidence. The pay-off, in contrast to the heuristic confidence numbers of Module 4, is a mathematically principled framework. The cost is tractability — full probabilistic inference can be exponential, which is exactly why the later parts of this module (certainty factors, naive Bayes, belief networks) trade rigor for feasibility.
Counting: the two rules everything is built on
Probabilities of equally likely outcomes reduce to counting. Two rules generate the rest:
- Addition rule — for sets and , . You subtract the overlap so shared elements are not double-counted (this is inclusion–exclusion).
- Multiplication rule — if a first choice has options and a second has , there are combined outcomes. This underlies the Cartesian product, permutations, and combinations.
Permutations vs combinations — the one distinction that trips people up: does order matter?
- A permutation is an ordered arrangement. The number of permutations of items taken at a time is Arranging books on a shelf is a permutation — a different order is a different arrangement.
- A combination is an unordered subset: Picking a committee is a combination — the same people in a different order are the same committee. Dividing by collapses the re-orderings of each chosen subset into one, so always .
Probability as a ratio, and Kolmogorov’s axioms
The sample space is the set of all outcomes of an experiment; an event is a subset of . For equally likely outcomes, All of probability theory follows from Kolmogorov’s three axioms: (1) every event’s probability lies in ; (2) and ; (3) (the addition rule again, now over probabilities). The complement rule falls straight out of these.
Expectation
The expectation (expected value) of an outcome with reward at probability and cost otherwise is i.e. the probability-weighted average payoff. Worked example — roulette. A European wheel has 37 slots. Bet $\$1$ on one number: you win $\$35$ with probability $1/37$ and lose $\$1$ with probability $36/37$, so $$\mathrm{ex} = 35\cdot\tfrac{1}{37} + (-1)\cdot\tfrac{36}{37} \approx -\$0.027\text{ per play.} The *negative* expectation is precisely why the house wins in the long run — and the same machinery (maximize expected reward) drives decision-theoretic planning and reinforcement learning later in AI. ## Conditional probability When we *know* event B occurred, the probability of A updates to the **conditional probability** p(A \mid B) = \frac{p(A \cap B)}{p(B)}.$$ Read it as: restrict the universe to the part where $B$ holds, then ask what fraction of that is also $A$. A fatal-but-common error is to assume $p(A\mid B) = p(B\mid A)$ — they are usually very different (the base-rate fallacy). Converting between the two is exactly the job of Bayes’ theorem in the next lesson.