Quoto

Courses / Information theory

Shannon entropy

9 cards2 min readProbability

Card 1 of 9
  1. Idea: Bits per message

    A feed sends updates, trades, cancels and halts with chances , , , .

    • A fixed code needs bits for each
    • Code words , , , : short for common
    • No word starts another, so no separators are needed
  2. Example: The average code length

    With code words , , , for chances , , , , what is the average length in bits?

    1. Lengths , , ,
    2. bits
  3. Formula: Entropy

    The average surprise −log₂ p, in bits: the floor for any lossless code.

  4. Idea: Surprise

    Each code length above is : chance took bits.

    • Rare outcomes surprise more
    • A certain outcome carries no surprise
    • counts good yes or no questions on average
  5. Formula: Independent sources add

    Chances of independent events multiply, and logs turn products into sums.

  6. Idea: Both ends of the scale

    On values, for every distribution.

    • when one value is certain
    • when all are equally likely
    • equal sectors: bits
  7. Quick check: Kind and venue

    Each message also comes from venue A, B or C with chances , , , independent of its kind. What is the entropy of the pair?

    Show the answer

    Answer:

    Venue bits plus kind bits: .

  8. Common mistake: Entropy is not variance

    Payoffs , , and , , with the same chances have the same entropy.

    Instead asks which outcome comes; variance asks how far apart the outcomes lie.

  9. Idea: Say it in an interview

    Entropy is the average bits an optimal code needs: uncertainty about the outcome.

    • Show it on chances that are powers of
    • Then every logarithm is a whole number