Information and Compression

  1. A Message Over an Alphabet

    A source alphabet lists the discrete symbols a message can contain. The choice of symbols can be bytes, tokens, or another agreed unit.

    Undergraduate
  2. A Fixed-Length Code for a Small Alphabet

    Choose how many bits per symbol a fixed-length binary code needs for a small alphabet.

    Undergraduate
  3. Variable Code Length and Expected Cost

    A variable-length code gives different symbols different lengths. Its expected length weights each symbol length by its probability.

    Undergraduate
  4. A Prefix-Free Code Can Mark Its Own Symbol End

    In a prefix-free code, no codeword is the start of a different codeword. That lets a decoder identify a symbol as soon as its full codeword is read.

    Undergraduate
  5. Finding an Ambiguous Encoded Message

    Some variable-length assignments allow the same encoded stream to describe several distinct symbol sequences.

    Undergraduate
  6. Reading a Prefix Code as a Tree

    A binary prefix tree can label edges with bits and leaves with symbols. Decoding follows edges from the root until it reaches a leaf.

    Undergraduate
  7. A Small Kraft Sum Calculation

    Check whether three codeword lengths can fit a binary prefix tree by adding their shares of the tree.

    Undergraduate
  8. Huffman Merges on Three Frequencies

    A binary Huffman construction repeatedly combines the two least available weights, making their subtrees siblings.

    Undergraduate
  9. Run-Length Encoding by Example

    Run-length encoding records a repeated symbol and the length of its consecutive run.

    Undergraduate
  10. Splitting a Run Across Bounded Count Fields

    A run length field can encode only a finite count. A codec needs a way to represent a longer run without overflow.

    Undergraduate
  11. Delta Coding Ordered Numeric Values

    Delta coding stores a starting value and changes from preceding values. A decoder reconstructs each value by accumulating the changes.

    Undergraduate
  12. Encoding Differences from a Prediction

    A predictive format can transmit residuals against a shared model. Compression can improve if those residuals have a distribution cheaply encoded by the chosen code.

    Undergraduate
  13. Replacing Repeated Fragments with Dictionary Entries

    A dictionary codec can assign compact references to repeated fragments and restore them during decoding.

    Undergraduate
  14. A Back Reference to Earlier Output

    A back-reference codec can describe a repeated fragment by where it begins in already reconstructed output and how much to copy.

    Undergraduate
  15. What the Compressed Size Includes

    An encoded result can contain payload, metadata, and padding. Comparing only payload bits may overstate the savings.

    Undergraduate
  16. Lossless and Lossy Format Guarantees

    A lossless format reconstructs its declared input exactly. A lossy format can change selected information according to its design.

    Undergraduate
  17. Quantizing Numeric Samples

    Quantization maps a range of inputs to a finite set of output codes or representable values. Its step and rounding rule determine error.

    Undergraduate
  18. Measuring Error from Uniform Quantization

    Uniform rounding to a nearest representable value can bound absolute rounding error by half a step for inputs within the usable grid range.

    Undergraduate
  19. Entropy of a Fair Bit

    Calculate the Shannon entropy of a fair bit and compare it with the entropy of a source that always returns the same value.

    Undergraduate
  20. The Information of a Rare Symbol

    Compare how much information two observed symbols convey under the same probability model.

    Undergraduate
  21. An Empirical Symbol Distribution

    Counting observed symbols and dividing by the message length gives a sample distribution. It describes that observed message under the selected alphabet.

    Undergraduate
  22. Why Order Can Matter for Compressibility

    Two messages with the same marginal frequencies can have different predictable structure across positions.

    Undergraduate
  23. Padding a Bitstream into Whole Bytes

    A bitstream stored as bytes may leave unused bits in its last byte. Its format needs a way to tell the decoder how many bits matter.

    Undergraduate
  24. Bit Order and Byte Order in a Packed Stream

    Byte order describes the order of multiple byte units. Bit packing also chooses which position inside each byte is filled first.

    Undergraduate
  25. Escaping a Reserved Framing Symbol

    A framing format can reserve a symbol for control and encode its occurrences inside payload with an escape convention.

    Undergraduate
  26. Resetting Codec State at a Record Boundary

    A codec can retain context across records or start each one from the same known state. That choice affects compression and independent reads.

    Undergraduate
  27. Testing a Lossless Codec with Independent Evidence

    Testing decode after encode verifies reconstruction. An independently known byte sample also checks compatibility when two implementations may share a mistake.

    Undergraduate
  28. The Cost of Using a Code for Another Distribution

    A code emphasizing common symbols in one source can perform poorly when the recipient data has different frequencies.

    Undergraduate
  29. Why a Compressor Can Produce a Larger File

    A format needs storage for its decoding information, and many inputs have few patterns the codec can exploit.

    Undergraduate
  30. Decoding with an Output Budget

    An encoded record can reconstruct more data than its input size suggests. A decoder can enforce a documented limit on the actual output it builds.

    Undergraduate