Skip to main content
#information-theory#probability#entropy#robotics

Information Theory 001 β€” Why is information logarithmic in probability?

Read UF 2026 Lecture 2's original PDF pages and derive logarithmic self-information, distinguish bits from code length, and calculate what dependent sensor reports add.

Estimated reading Β· 23 min

Information Theory Β· Foundations, applications and research

26 modules Β· 324 learning units. Each article follows one question through its sources, derivation and applications.

Reading Β· Information Theory 001 β€” Why is information logarithmic in probability?

Explore the full learning map

Learning units are grouped into articles as the series develops. Curriculum and sources

  1. I01Information and mathematical foundations 12 units

    Information and mathematical foundations. Theory, assumptions and reproducible applications.

    Reading Β· Information Theory 001 β€” Why is information logarithmic in probability?

  2. I02Discrete entropy and shared information 12 units

    Discrete entropy and shared information. Theory, assumptions and reproducible applications.

  3. I03Divergences, variational forms and inequalities 15 units

    Divergences, variational forms and inequalities. Theory, assumptions and reproducible applications.

  4. I04Continuous information and information geometry 13 units

    Continuous information and information geometry. Theory, assumptions and reproducible applications.

  5. I05Processes, typicality and large deviations 12 units

    Processes, typicality and large deviations. Theory, assumptions and reproducible applications.

  6. I06Lossless compression: limits and algorithms 12 units

    Lossless compression: limits and algorithms. Theory, assumptions and reproducible applications.

  7. I07Universal coding, MDL and prediction 12 units

    Universal coding, MDL and prediction. Theory, assumptions and reproducible applications.

  8. I08Channel theorems and finite blocklength 14 units

    Channel theorems and finite blocklength. Theory, assumptions and reproducible applications.

  9. I09Constructive error-correcting codes 12 units

    Constructive error-correcting codes. Theory, assumptions and reproducible applications.

  10. I10Gaussian, waveform and spatial channels 11 units

    Gaussian, waveform and spatial channels. Theory, assumptions and reproducible applications.

  11. I11Rate–distortion theory and quantization 14 units

    Rate–distortion theory and quantization. Theory, assumptions and reproducible applications.

  12. I12Multiterminal and network information theory 13 units

    Multiterminal and network information theory. Theory, assumptions and reproducible applications.

  13. I13Secrecy, privacy and randomness 12 units

    Secrecy, privacy and randomness. Theory, assumptions and reproducible applications.

  14. I14Testing, estimation and statistical decisions 13 units

    Testing, estimation and statistical decisions. Theory, assumptions and reproducible applications.

  15. I15Learning, generalization and adaptive analysis 12 units

    Learning, generalization and adaptive analysis. Theory, assumptions and reproducible applications.

  16. I16Representations and generative models 12 units

    Representations and generative models. Theory, assumptions and reproducible applications.

  17. I17Language models, tokenization and low-bit computation 14 units

    Language models, tokenization and low-bit computation. Theory, assumptions and reproducible applications.

  18. I18Visual, audio and perceptual compression 12 units

    Visual, audio and perceptual compression. Theory, assumptions and reproducible applications.

  19. I19Sensor fusion, active perception and control 14 units

    Sensor fusion, active perception and control. Theory, assumptions and reproducible applications.

  20. I20Multivariate information, time series and causality 12 units

    Multivariate information, time series and causality. Theory, assumptions and reproducible applications.

  21. I21Algorithms, information complexity and combinatorics 12 units

    Algorithms, information complexity and combinatorics. Theory, assumptions and reproducible applications.

  22. I22Estimating information and reproducible computation 13 units

    Estimating information and reproducible computation. Theory, assumptions and reproducible applications.

  23. I23Quantum information theory 13 units

    Quantum information theory. Theory, assumptions and reproducible applications.

  24. I24Physics, energy, biological and neural information 12 units

    Physics, energy, biological and neural information. Theory, assumptions and reproducible applications.

  25. I25Storage, retrieval and distributed computation 11 units

    Storage, retrieval and distributed computation. Theory, assumptions and reproducible applications.

  26. I26Integrative projects and research reading 10 units

    Integrative projects and research reading. Theory, assumptions and reproducible applications.

A camera monitoring a work area detects a person. A second program receives a copy of the same image and reports the same detection. There are two reports, but one observation. A camera looking from another direction might instead reveal a previously hidden area. Its report could have exactly the same file size while changing what we know. Can file size, observation count, and newly obtained information all be measured by the same number?

The first question in this information theory series concerns measurement. We will construct the self-information of an individual outcome from its probability and prove why a logarithm appears. We will then calculate how this quantity differs from the number of bits actually transmitted and what we must know before adding the information in two observations. Entropy, the average information quantity, will be the central question of the next installment.

Our starting source is Lecture 2, January 14, 2026, five review slides and seven lecture-note pages, from Mingyue Ji’s University of Florida EEL6532, Spring 2026. We link those pages in order. The proofs, camera examples, and coding calculations below are independently developed teaching material. The official lecture video is an accompanying reference link. This article is not a transcript checked against the video’s speech or timestamps.

The original Lecture 2 has two distinct PDFs: five review slides and seven handwritten lecture-note pages, both published by the university. Each original page is displayed here from the university-linked source, followed by explanations, proofs, and supplementary examples. No author-redrawn guide substitutes for an original lecture page. On browsers that cannot embed PDFs, open the matching original page using the link beneath it. Source documents: lecture notes Β· review slides.

#Original review slide 1/5 β€” Lecture title

UF EEL6532 Β· 2026-01-14 Β· Original review slide 1/5
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: The lecture title, instructor Mingyue Ji, and January 14, 2026 date. Open official original PDF Original PDF file Source document 1/5. If the viewer cannot load, use the official PDF links above and go to this page.

The cover establishes the lecture, instructor, and date. Before measuring information, we define an experiment. Changing the experiment can change the probability assigned to exactly the same statement.

Suppose we choose a time interval at random and record whether a person was present in a work area. There are two outcomes, person present and person absent. Before reading the record, either is possible. After reading it, we know which occurred. As a starting point, an information measure can quantify how unexpected the particular outcome was under its assigned probability.

The statement person present does not determine that number by itself. Its probability differs between an experiment in which an operator is almost always present and one in which people enter only occasionally. We must first decide what counts as a trial and which times and environments define the probability. All numerical examples below belong to their specified probability models. They are not measurements from an actual laboratory.

#The two uses of the word bit

A binary digit is a storage or representation unit taking the value 0 or 1. A bit of information is a unit for a quantity calculated under a probability model. Coding and communication theorems connect the two precisely, but their numerical values need not agree in an individual case. MacKay distinguishes these uses while defining individual information content and its average in Β§2.4, chapter PDF page 11 / printed page 32.

If a receiver already knows the exact contents of a 100-bit file, receiving another copy does not reduce uncertainty about those contents. Conversely, a physical one-bit alarm can have an active outcome whose self-information exceeds one bit if that outcome is rare. The physical signal has not suddenly grown into a longer message. We will examine that distinction explicitly in the coding example.

#Original review slide 2/5 β€” The two questions of the lecture

UF EEL6532 Β· 2026-01-14 Β· Original review slide 2/5
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: The two guiding questions: what is information, and how can it be measured? Open official original PDF Original PDF file Source document 2/5. If the viewer cannot load, use the official PDF links above and go to this page.
UF EEL6532 Β· 2026-01-14 Β· Original handwritten note 1/7
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Handwritten page 1: the two questions of what information means and how to measure it. Open official original PDF Original PDF file Source document 1/7. If the viewer cannot load, use the official PDF links above and go to this page.

Review slide 2 states the two questions for the lesson. The eight-state binary decision tree that follows is an independently authored mathematical example, not a figure from the original slide.

Begin with a restricted problem. A robot is in one of eight possible states. We can ask questions with yes-or-no answers and want to identify the state without error. In this example, questions can be designed freely. We do not separately charge for sending the questions and receiving the answers.

The first question divides the eight states into two groups of four. The second divides the remaining four into two groups of two. The third distinguishes the final pair. Concatenating the three answers produces the eight patterns from 000 to 111. This is a binary decision tree that reaches every answer within three questions.

2kβ‰₯M⟺kβ‰₯log⁑2M.2^k\geq M \quad\Longleftrightarrow\quad k\geq\log_2 M.

Here MM is the number of states to distinguish and kk is the number of bits used for the answer. Binary strings of length exactly kk have only 2k2^k distinct values. A binary question tree that always finishes within kk questions also distinguishes at most that many outcomes. The inequality is therefore necessary. Assigning a different binary string to each state achieves the corresponding fixed-length bound.

State counts and required binary questions
Number of possible states MMlog⁑2M\log_2 MMinimum fixed length / minimum worst-case questions
100 bits / 0 questions
211 bit / 1 question
3Approximately 1.5849632 bits / 2 questions
422 bits / 2 questions
833 bits / 3 questions

Notice the three-state row. Although log⁑23\log_2 3 lies between one and two, an individual fixed-length message cannot contain 1.584963 binary positions. Length is an integer, so we must take a ceiling. If there is only one possible state and both parties know that, no message is needed to identify it.

kmin⁑=⌈log⁑2MβŒ‰.k_{\min}=\left\lceil\log_2 M\right\rceil.

#Why multiply the possibilities but add the information?

Repeat the eight-state experiment independently twice. There are 64 possible ordered pairs. Three bits identify the first result and another three identify the second, for six bits in total. The number of possibilities multiplied while the representation length added.

log⁑2(8Γ—8)=log⁑28+log⁑28=6.\log_2(8\times8)=\log_2 8+\log_2 8=6.

A logarithm converts multiplication into addition. This is a central motivation for a logarithmic information measure. Moser introduces the Hartley measure of outcome count at this point in his 2026 lecture notes, version 6.22, Β§1.1, PDF page 20 / printed page 2. A natural motivation does not yet determine every information measure over probabilities. We now extend the question to outcomes that have different probabilities.

#Original review slide 3/5 β€” Information as uncertainty

UF EEL6532 Β· 2026-01-14 Β· Original review slide 3/5
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Information is introduced as uncertainty about the outcome of a random experiment. Open official original PDF Original PDF file Source document 3/5. If the viewer cannot load, use the official PDF links above and go to this page.
UF EEL6532 Β· 2026-01-14 Β· Original handwritten note 2/7
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Handwritten page 2: comparing uncertainty for fair and biased coins. Open official original PDF Original PDF file Source document 2/7. If the viewer cannot load, use the official PDF links above and go to this page.

Handwritten note page 2 compares uncertainty under fair and biased coins. The functional-equation derivation and uniqueness proof that follow are supplementary analysis rather than the lecturer’s stated proof.

Knowing that an experiment has two outcomes does not tell us how predictable they are. An experiment with probabilities 1/2 and 1/2 uses the same number of symbols as one with probabilities 99/100 and 1/100, but prediction begins from a different position. Before assigning one number to the experiment as a whole, we will assign a number to the particular outcome that occurred.

For an outcome with probability pp, write its self-information as s(p)s(p), with domain 0<p≀10<p\leq1. Its input is the probability assigned to the outcome, rather than the outcome’s meaning or reward. Outcomes assigned the same probability receive the same number.

We choose the following conditions for our derivation. The probabilities of independent events multiply, so we require the information in their joint occurrence to add. We require continuity, preventing a small change in probability from producing a sudden jump in the quantity. Finally, we normalize the information in an outcome of probability 1/2 to one bit.

s(pq)=s(p)+s(q),0<p,q≀1,sΒ isΒ continuousΒ onΒ (0,1],s(1/2)=1Β bit.\begin{aligned} s(pq)&=s(p)+s(q), &&0<p,q\leq1,\\ s&\text{ is continuous on }(0,1],\\ s(1/2)&=1\ \mathrm{bit}. \end{aligned}

The first condition is a functional equation over probabilities. It does not assert that we may multiply the probabilities of any two events. It requires information to add in a situation where the joint probability is the product. For dependent observations, we will use conditional probabilities below.

Continuity is a regularity condition. We use it here to make the proof direct. Monotonicityβ€”requiring information not to decrease when probability decreasesβ€”can also provide the needed regularity. We need not list both as separate necessary assumptions. We should, however, avoid writing additivity alone and then asserting that every real-valued solution must be logarithmic.

#Deriving the logarithm by constructing an additive function

For tβ‰₯0t\geq0, represent a probability as p=2βˆ’tp=2^{-t}. Call the information at that probability g(t)g(t).

g(t):=s(2βˆ’t),tβ‰₯0.g(t):=s(2^{-t}),\qquad t\geq0.

The condition on probability products now becomes a condition on sums of real numbers.

g(u+v)=s(2βˆ’(u+v))=s(2βˆ’u2βˆ’v)=s(2βˆ’u)+s(2βˆ’v)=g(u)+g(v).\begin{aligned} g(u+v)&=s(2^{-(u+v)})\\ &=s(2^{-u}2^{-v})\\ &=s(2^{-u})+s(2^{-v})\\ &=g(u)+g(v). \end{aligned}

Normalization gives g(1)=1g(1)=1. Because g(0)=g(0)+g(0)g(0)=g(0)+g(0), we also have g(0)=0g(0)=0. For every positive integer mm, adding one that many times yields g(m)=mg(m)=m. Next, divide one into nn equal parts.

1=g(1)=n g(1/n)⟹g(1/n)=1/n.1=g(1)=n\,g(1/n)\quad\Longrightarrow\quad g(1/n)=1/n.

We therefore know the answer for every nonnegative rational number.

g(m/n)=m g(1/n)=m/n.g(m/n)=m\,g(1/n)=m/n.

For any nonnegative real number tt, choose a sequence of rational numbers rjr_j converging to it. Since ss and the exponential function are continuous, gg is continuous too. This is where the regularity assumption enters the proof.

g(t)=lim⁑jβ†’βˆžg(rj)=lim⁑jβ†’βˆžrj=t.g(t)=\lim_{j\to\infty}g(r_j)=\lim_{j\to\infty}r_j=t.

Substituting t=βˆ’log⁑2pt=-\log_2p determines the function satisfying our conditions.

s(p)=βˆ’log⁑2p=log⁑21pbits.\boxed{s(p)=-\log_2p=\log_2\frac1p\quad\text{bits}.}

This proves uniqueness under the stated conditions. It does not prove that every kind of information, knowledge, or value must use this measure. The axioms of entropy, average code lengths, and channel capacity each introduce their own conditions and operational problems.

#Halving the probability adds one bit

Read the difference between two information values rather than memorizing the formula alone.

s(p/2)βˆ’s(p)=βˆ’log⁑2(p/2)+log⁑2p=1Β bit.s(p/2)-s(p)=-\log_2(p/2)+\log_2p=1\ \mathrm{bit}.

Reducing probability from 1/2 to 1/4 adds one bit, and so does reducing it from 1/100 to 1/200. A probability ratio determines this difference, rather than a fixed absolute probability change.

Self-information at different probabilities
Outcome probability ppSelf-information βˆ’log⁑2p-\log_2 pInterpretation
10 bitsCertain under the model
34\frac{3}{4}Approximately 0.415037 bitsMore predictable than a fair binary outcome
12\frac{1}{2}1 bitThe unit’s reference value
14\frac{1}{4}2 bitsOne bit more than an outcome of probability 12\frac{1}{2}
18\frac{1}{8}3 bitsOne bit more than an outcome of probability 14\frac{1}{4}
1100\frac{1}{100}Approximately 6.643856 bitsAn outcome assigned a small probability
Outcome probability p is on the horizontal axis and self-information in bits on the vertical axis. The curve rises as probability decreases, marking one bit at 1/2, two at 1/4, and three at 1/8.
Author-created supplementary figure β€” Self-information as a function of probability. Halving probability adds one bit.Author-created Β· calculated from the probability model in the text; definition reference: MacKay Β§2.4 Β· Original source Β· Full-size image

Differentiating the curve confirms that information decreases as probability increases and changes more steeply near zero.

sβ€²(p)=βˆ’1pln⁑2<0,sβ€²β€²(p)=1p2ln⁑2>0.s'(p)=-\frac{1}{p\ln2}<0,\qquad s''(p)=\frac{1}{p^2\ln2}>0.

Probability zero lies outside the domain of this real-valued function. The limit as probability approaches zero from the right is infinite. If we observe an outcome to which our model assigned probability zero, we should first examine whether the model’s support matches the data. The calculation does not mean that we have acquired an infinite amount of useful knowledge about the world.

#Original review slide 4/5 β€” Random variables and probability mass functions

UF EEL6532 Β· 2026-01-14 Β· Original review slide 4/5
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Defines a discrete random variable, its possible values, a probability mass function, and entropy. Open official original PDF Original PDF file Source document 4/5. If the viewer cannot load, use the official PDF links above and go to this page.
UF EEL6532 Β· 2026-01-14 Β· Original handwritten note 3/7
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Handwritten page 3: the random variable, outcome space, event X=x and its PMF. Open official original PDF Original PDF file Source document 3/7. If the viewer cannot load, use the official PDF links above and go to this page.

Handwritten note page 3 defines the random variable and probability mass function (PMF). The person-detection example below is an independently authored application of those definitions.

Write XX for a random variable, X\mathcal X for its possible values, and xx for one particular value. A discrete variable’s probability mass function, or PMF, assigns a probability to each value. Keeping these objects separate helps prevent mistakes about what goes into an information calculation.

pX(x)=Pr⁑(X=x),iX(x):=βˆ’log⁑2pX(x).p_X(x)=\Pr(X=x),\qquad i_X(x):=-\log_2p_X(x).
Notation for variables, outcomes, and information
NotationMeaningPerson-detection example
XXRandom variable defined before an outcome is knownThe detection report
xxOne possible value11 = person detected
pX(x)p_X(x)Probability assigned to that outcomePr⁑(X=1)=14\Pr(X=1)=\frac14
iX(x)i_X(x)Self-information of that particular outcomeiX(1)=2i_X(1)=2 bits
iX(X)i_X(X)An information random variable that varies across trialsEither 2 or approximately 0.415037 bits

The last row connects to the next installment. Before the observation, iX(X)i_X(X) is still a random variable. Detection produces two bits; no detection produces approximately 0.415037 bits. If we want to summarize the experiment by one number before knowing which outcome will occur, what operation should we choose? Keep that question separate from the definition of individual self-information.

#The logarithm’s base chooses the unit

Using a natural logarithm gives nats. Changing the base does not change which outcome is rarer; it changes the scale used to express the same quantity. The logarithmic units are listed in MIT 6.441 Spring 2016, Chapter 1, PDF page 2 / printed page 9.

inat(x)=βˆ’ln⁑pX(x)=(ln⁑2) ibit(x).i_{\rm nat}(x)=-\ln p_X(x)=(\ln2)\,i_{\rm bit}(x).

One bit is approximately 0.693147 nats, and one nat is approximately 1.442695 bits. An outcome of probability 1/4 has two bits or approximately 1.386294 nats of self-information. Match the units before comparing a training loss calculated with natural logarithms against a compression rate expressed in bits.

At this stage, pX(x)p_X(x) is a discrete outcome’s probability. Do not silently substitute a continuous probability density in its place. A density carries units and can exceed one. We will explain the need for coordinate transformations and differential entropy in the installments about continuous information measures.

#Can an outcome worth 6.64 bits be reported using one bit?

Let an alarm variable AA satisfy Pr⁑(A=1)=0.01\Pr(A=1)=0.01. Its active outcome has the following self-information.

iA(1)=βˆ’log⁑2(0.01)β‰ˆ6.643856Β bits.i_A(1)=-\log_2(0.01)\approx6.643856\ \mathrm{bits}.

The sender can nevertheless use the code 1 for an active alarm and 0 for an inactive alarm. The receiver learns the outcome exactly, and each codeword has length one bit. There is no contradiction. Self-information is a quantity derived from probability; code length describes a representation we choose. There is no general requirement that each outcome’s actual codeword be at least as long as its self-information. Theorems about average code length and compression limits consider the probabilities and the structure of the code together.

Return to the three-state example to understand fractional information values. Suppose its states are equally likely and we repeat the experiment independently nn times. Distinguishing all possible state sequences of length nn means distinguishing 3n3^n sequences. Map each block to a fixed-length binary string. The required block length and number of bits per state are then

Ln=⌈log⁑2(3n)βŒ‰=⌈nlog⁑23βŒ‰,Rn=Lnn.L_n=\left\lceil\log_2(3^n)\right\rceil=\left\lceil n\log_2 3\right\rceil,\qquad R_n=\frac{L_n}{n}.
Code lengths for blocks of three-state outcomes
States per block nnPossible sequences 3n3^nRequired total bits LnL_nBits per state RnR_n
1322
2942
524381.6
1059,049161.6

There are 256 binary strings of length eight, enough to distinguish all 243 sequences of five three-state outcomes. Sending each state separately in two bits would require ten bits. Numbering the entire block requires only eight. This assumes that both parties already know the numbering rule and the block boundaries. Larger blocks can introduce delay and implementation costs, so reducing storage alone does not complete a system design.

log⁑23≀Rn<log⁑23+1n,lim⁑nβ†’βˆžRn=log⁑23.\log_2 3\leq R_n<\log_2 3+\frac1n,\qquad\lim_{n\to\infty}R_n=\log_2 3.

We have used only a counting argument to distinguish all equally likely state sequences. We have not yet proved the source coding theorem for a general source with unequal probabilities. The example does, however, answer an initial question precisely: how can information be fractional if an individual binary codeword has an integer length? The ratio of the whole block’s integer length to its number of symbols can be a real number.

#Original review slide 5/5 β€” Entropy axioms and grouping

UF EEL6532 Β· 2026-01-14 Β· Original review slide 5/5
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Presents entropy axioms A1–A4, including normalization, uniform outcomes, continuity and grouping. Open official original PDF Original PDF file Source document 5/5. If the viewer cannot load, use the official PDF links above and go to this page.
UF EEL6532 Β· 2026-01-14 Β· Original handwritten note 4/7
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Handwritten page 4: entropy, normalization axiom A1 and uniform-outcome monotonicity axiom A2. Open official original PDF Original PDF file Source document 4/7. If the viewer cannot load, use the official PDF links above and go to this page.
UF EEL6532 Β· 2026-01-14 Β· Original handwritten note 5/7
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Handwritten page 5: continuity A3 and grouping A4 as a two-stage experiment. Open official original PDF Original PDF file Source document 5/7. If the viewer cannot load, use the official PDF links above and go to this page.
UF EEL6532 Β· 2026-01-14 Β· Original handwritten note 6/7
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Handwritten page 6: the three-outcome grouping formula and its weighted conditional term. Open official original PDF Original PDF file Source document 6/7. If the viewer cannot load, use the official PDF links above and go to this page.
UF EEL6532 Β· 2026-01-14 Β· Original handwritten note 7/7
Original PDF page; open the source below to read it. Loading original PDF page…
Rendered directly from the university-linked original PDF, page by page. No AI-created replacement slide. Page-by-page commentary: Handwritten page 7: generalized grouping for several groups with differing numbers of elements. Open official original PDF Original PDF file Source document 7/7. If the viewer cannot load, use the official PDF links above and go to this page.

Handwritten pages 4–7 proceed through normalization, monotonicity and continuity of entropy, then grouping, its three-outcome formula and its generalization. All four original pages appear in that order.

We derived s(p)s(p), which takes one probability as input. This page turns to conditions on H(p1,…,pm)H(p_1,\ldots,p_m), which takes an entire distribution. Their connection with logarithms does not make them the same uniqueness problem. Defining a distribution’s uncertainty also requires deciding how it decomposes when outcomes are grouped and then distinguished within the groups.

Write the grouping property for three outcomes. The positive probabilities p1,p2,p3p_1,p_2,p_3 sum to one. First determine whether the outcome belongs to the group consisting of the first two possibilities. Only if it does do we need to distinguish between those two possibilities.

H(p1,p2,p3)=H(p1+p2,p3)+(p1+p2)H(p1p1+p2,p2p1+p2).H(p_1,p_2,p_3)=H(p_1+p_2,p_3)+(p_1+p_2)H\left(\frac{p_1}{p_1+p_2},\frac{p_2}{p_1+p_2}\right).

The within-group term has weight p1+p2p_1+p_2, because that second step is not required on every trial. The equation s(pq)=s(p)+s(q)s(pq)=s(p)+s(q) for self-information had no such averaging over a distribution. One equation describes a particular joint outcome; the other summarizes an experiment over all of its possible outcomes.

This installment has solved the functional equation for self-information and identified the additional question entropy must answer. It does not claim a complete axiomatic uniqueness proof for entropy. Moser Β§1.1, PDF page 24 / printed page 6 likewise distinguishes intuitive motivations from sufficient conditions for uniqueness. A more formal set of conditions appears in Appendix 1.A, PDF pages 42–43 / printed pages 24–25.

#Adding two camera reports requires their joint probability

Return to the camera example. Let XX and YY be the binary results in two reports. If we observe X=1,Y=1X=1,Y=1, the self-information of that joint outcome is calculated from the joint probability, not from two marginal probabilities alone.

iX,Y(x,y)=βˆ’log⁑2pX,Y(x,y).i_{X,Y}(x,y)=-\log_2p_{X,Y}(x,y).

#A perfectly copied report does not double the information

Assign probability 1/4 to the first result being one, and let the second program copy the first result exactly: Y=XY=X. The only possible report pairs are (0,0) and (1,1). The probability of (1,1) is 1/4.

pX,Y(1,1)=14,iX,Y(1,1)=2Β bits.p_{X,Y}(1,1)=\frac14,\qquad i_{X,Y}(1,1)=2\ \mathrm{bits}.

Viewed separately, each report has probability 1/4 of being one. Multiplying those marginals to obtain 1/16 would replace the actual joint model with an independent model. It would produce four bits, but that would not answer the copying example. Once we have read the first report, the second is certain.

pY∣X(1∣1)=1,βˆ’log⁑2pY∣X(1∣1)=0.p_{Y\mid X}(1\mid1)=1,\qquad -\log_2p_{Y\mid X}(1\mid1)=0.
Both reports have marginal probability 1/4 of being one. Under independence, the joint probability of 11 is 1/16 and its information is four bits. For a perfect copy, off-diagonal probabilities vanish and 11 has probability 1/4 and information two bits.
Author-created supplementary figure β€” Identical marginals can produce different information for a report pair when the joint distributions differ. Independence is on the left; perfect copying is on the right.Author-created Β· calculated from the probability model in the text; probability notation reference: MacKay Β§2.1 Β· Original source Β· Full-size image

This does not imply that cameras pointed in the same direction always produce exact duplicates. Real sensors involve noise, occlusion, synchronization errors, and differing fields of view. Perfect copying is a clear limiting case for examining the claim that two reports necessarily contain twice the information.

#Calculating two partially dependent reports

The following author-defined joint distribution lies between perfect copying and independence. Each report is individually equally likely to be zero or one, but matching reports occur more often than mismatches.

Joint probabilities of two partially dependent reports
XXY=0Y=0Y=1Y=1Marginal probability of XX
038\frac{3}{8}18\frac{1}{8}12\frac{1}{2}
118\frac{1}{8}38\frac{3}{8}12\frac{1}{2}
Marginal probability of YY12\frac{1}{2}12\frac{1}{2}1

If the first report is one, the conditional probability of a second one is 3/4. The first report has one bit of self-information. After knowing it, seeing a second one adds approximately 0.415037 bits of conditional self-information.

pY∣X(1∣1)=3/81/2=34,iX,Y(1,1)=βˆ’log⁑238=βˆ’log⁑212βˆ’log⁑234β‰ˆ1+0.415037=1.415037Β bits.\begin{aligned} p_{Y\mid X}(1\mid1)&=\frac{3/8}{1/2}=\frac34,\\ i_{X,Y}(1,1)&=-\log_2\frac38\\ &=-\log_2\frac12-\log_2\frac34\\ &\approx1+0.415037=1.415037\ \mathrm{bits}. \end{aligned}

If the second report is zero instead, its conditional probability is 1/4, so the additional self-information is two bits. A mismatch is less expected under this particular model.

iX,Y(1,0)=βˆ’log⁑218=3=1+2Β bits.i_{X,Y}(1,0)=-\log_2\frac18=3=1+2\ \mathrm{bits}.

The calculation does not guarantee that disagreement improves our knowledge of the scene. To decide whether it indicates a sensor failure, discovery of a previously hidden person, or a false detection, we need a model connecting observations to the actual state. We have measured how unexpected the report pair itself is. Information obtained about a target will be distinguished in later installments on mutual information and inference.

#The general equation uses a conditional probability

For an observed pair with positive probability, the probability product rule gives the following result without assuming independence.

pX,Y(x,y)=pX(x) pY∣X(y∣x),iX,Y(x,y)=iX(x)+iY∣X(y∣x),iY∣X(y∣x):=βˆ’log⁑2pY∣X(y∣x).\begin{aligned} p_{X,Y}(x,y)&=p_X(x)\,p_{Y\mid X}(y\mid x),\\ i_{X,Y}(x,y)&=i_X(x)+i_{Y\mid X}(y\mid x),\\ i_{Y\mid X}(y\mid x)&:=-\log_2p_{Y\mid X}(y\mid x). \end{aligned}

To replace the conditional distribution by the marginal and apply iX(x)+iY(y)i_X(x)+i_Y(y) consistently to every outcome pair, the variables must be independent. Agreement for one particular pair does not establish independence. Moreover, sensors that are independent given the actual state need not be marginally independent when the state is unknown. The same person’s presence can influence both detection results. When assuming independence in sensor fusion, specify what has been held fixed by conditioning.

#Reproduce the calculations and check their interpretation

This code recalculates our teaching examples using only the Python standard library. It does not silently adjust inputs outside the stated domain. Replacing a zero probability with a small positive number changes the model, so such a decision should be made explicitly.

from math import ceil, isclose, log2


def self_information(probability: float) -> float:
    """Return self-information in bits for 0 < probability <= 1."""
    if not 0.0 < probability <= 1.0:
        raise ValueError("probability must satisfy 0 < p <= 1")
    return -log2(probability)


p_x1 = 0.5
p_11 = 3 / 8
p_y1_given_x1 = p_11 / p_x1
joint_bits = self_information(p_11)
chain_bits = self_information(p_x1) + self_information(p_y1_given_x1)

assert isclose(joint_bits, chain_bits, abs_tol=1e-12)
assert isclose(self_information(1.0), 0.0, abs_tol=1e-12)

print(f"joint: {joint_bits:.6f} bits")
print(f"additional: {self_information(p_y1_given_x1):.6f} bits")
print(f"duplicate pair: {self_information(1 / 4):.6f} bits")
print(f"independent pair: {self_information((1 / 4) ** 2):.6f} bits")

for block_size in (1, 2, 5, 10):
    bits = ceil(block_size * log2(3))
    print(f"n={block_size}: {bits} bits, {bits / block_size:.6f} bits/state")

The output gives 1.415037 bits for the joint outcome and 0.415037 bits for the conditional increment. The copied and independent pairs have identical marginals but give 2.000000 and 4.000000 bits respectively. Block sizes 1, 2, 5, and 10 require total lengths of 2, 4, 8, and 16 bits. This is a floating-point check of small examples. An implementation requiring exact coding lengths for enormous integers must also handle rounding error in logarithms.

When probabilities are estimated from data, we will distinguish a true distribution pp from an estimated model qq. Calculating βˆ’log⁑q(x)-\log q(x) for the same outcome describes how unexpected it was to that model. A misspecified model may consider an ordinary observation rare. A large information value alone does not establish observation accuracy, the utility of an action, or the safety of a robot.

#Check your understanding

  1. What is the joint self-information of independently observing an outcome of probability 1/8 twice? What changes if the second result is a copy of the first?
  2. What is the minimum fixed length for five equally possible states? Why does it differ from log⁑25\log_2 5?
  3. In the joint distribution above, calculate the total self-information and the conditional self-information of the second report when the first result is zero and the second is one.
  4. An alarm with probability 0.01 has occurred. Does the 6.64-bit calculation tell us the alarm system’s accuracy or the probability of an accident? What else would we need to define?

In the first question, the independent pair has six bits and the copied pair has three. The second answer is three bits: an exact binary representation requires an integer number of positions. The third gives three bits in total and two conditional bits. The fourth requires a joint model of alarms and actual states, along with the prediction or decision objective. Those ingredients are not yet present in the input to self-information.

#Next installment β€” How should we average information across outcomes?

We now have iX(x)=βˆ’log⁑2pX(x)i_X(x)=-\log_2p_X(x) and its chain rule using conditional probabilities. Independent observations have additive information; a perfect copy has zero conditional self-information after the original is known. A fixed-length code has integer length, while dividing a block’s bit count by its number of symbols gives a potentially fractional rate.

The next installment asks why entropy is average self-information. We have already constructed an experiment producing two bits with probability 1/4 and approximately 0.415037 bits with probability 3/4. We will calculate what weighting each information value by its probability measures, how that quantity satisfies grouping, and how a rare outcome with high self-information can coexist with low uncertainty for the experiment as a whole. That installment is planned.

#Sources and supplementary reading

Connect