
Lecture 17: Huffman Coding
Ankur Moitra teaches this session of MIT's 18.200 Principles of Discrete Applied Mathematics, covering Shannon's noiseless coding theorem and the construction of optimal prefix free codes. He defines prefix free codes and shows how a binary tree lets them be decoded efficiently, then walks through Huffman's algorithm for building the optimal such code given a set of symbol frequencies. The lecture runs seventy-eight minutes and builds the argument step by step on the board, connecting information theory's coding limit to a concrete, implementable algorithm. It assumes the probability and combinatorics groundwork laid earlier in the course and is aimed at students who want to see why Huffman coding is provably optimal rather than just how to run it.