1. Shannon's Source Coding Theorem, Average Length, and Efficiency
A memoryless discrete source emits symbols with probabilities and entropy (bits/symbol). Assigning binary codewords of lengths yields expected codeword length, efficiency, and redundancy: Shannon's Noiseless Source Coding Theorem: For any uniquely decodable -ary code (here bits), average length is fundamentally bounded by entropy: Note: efficiency reaches () iff every symbol probability is an exact dyadic power (, e.g. )! When probabilities are non-dyadic, grouping symbols together into an extended source drops per-symbol overhead below : as !