Overview
Compression algorithms are the mathematical engines behind everything from zip files on a laptop to streaming high‑definition video across the globe. At their core, these algorithms exploit redundancy and statistical regularities in data, encoding the same information with fewer bits. The process can be lossless, where the original data can be perfectly reconstructed (e.g., ZIP, PNG), or lossy, where some detail is discarded in exchange for dramatically higher compression ratios (e.g., JPEG, MP3). The choice between lossless and lossy hinges on the application: archival storage demands exact recovery, while multimedia delivery tolerates perceptual loss.Mathematically, compression is often framed in terms of entropy, the average amount of information per symbol. Claude Shannon’s seminal formula
\[
H = -\sum_{i=1}^{n} p_i \log_2 p_i
\]
gives a lower bound on the number of bits needed to encode a source with symbol probabilities \(p_i\). An optimal compressor approaches this bound, turning the abstract notion of “information content” into concrete byte savings. Modern compressors blend probabilistic modeling, dictionary techniques, and transform coding to achieve results that would have seemed impossible just a few decades ago.
History/Background
The story of compression begins in the 1940s with Shannon’s information theory, which formalized the limits of data representation. Early practical algorithms emerged in the 1960s: Huffman coding (1952) provided the first widely used optimal prefix code for lossless compression, while run‑length encoding (RLE) offered a simple way to compress repetitive sequences, famously used in early fax machines. The 1970s saw the birth of dictionary‑based methods such as LZ77 (1977) and LZ78 (1978), the foundation for the ubiquitous ZIP and GIF formats.The 1990s introduced transform coding, most notably the Discrete Cosine Transform (DCT) used in JPEG, which shifted the focus to frequency domain representation and enabled high‑quality lossy compression of images. Audio followed suit with MP3 (1993) and later AAC, leveraging psychoacoustic models to discard inaudible frequencies. In the 2000s, Brotli, Zstandard, and LZMA pushed lossless compression ratios higher while maintaining speed, and the rise of machine‑learning‑based codecs (e.g., Google's RAISR, Facebook’s Neural Image Compression) signaled a new era where neural networks learn optimal representations directly from data.
