Capacity of a Discrete Channel
A system whereby a sequence of choices from a finite set of elementary symbols can be transmitted from one point to another. Each of the symbols is assumed to have a certain duration in time seconds (not necessarily the same for different ).
Referenced by (1 direct, 3 transitive)
Direct references:
Transitive (depth 1):
The capacity of a discrete channel is given by
where is the number of allowed @signals of duration
Referenced by (3 direct)
Direct references:
Given an information source where all symbols are of the same time duration, and each symbol represents bits of information (because it is chosen freely among symbols), and the channel can transmit symbols per second then the capacity of the channel is defined to be bits per second.
In the more general case we have to deal with symbols of various lengths that take different amounts of time to transmit, and so capacity measures not the number of symbols transmitted per second but the amount of information transmitted per second, retaining bits per second as its unit.
If represents the number of sequences of duration then
This number is equal to the sum of the numbers of sequences ending in This is a recursive definition - if the last symbol is and then we have time remaining for the previous symbols in the sequence, and we repeat the same question on that remainder.
A "well-known result" in finite differences tells us that
where is constant and is the largest real solution of the characteristic equation:
and therefore
Consider Morse code as used in telegraph. We have the following rules:
- A dot symbol consists of one time unit of line closure followed by one time unit of line open.
- A dash symbol consists of three time units of line closure followed by one time unit of line open.
- A letter space symbol consists of three time units of line open.
- A word space symbol consists of six time units of line open.
We're never allowed to send two space symbols in a row, because two sequential letter space symbols are indistinguishable from a word space symbol.
Now, our possible terminating states are
| Symbol | Composition | Duration (time units) |
|---|---|---|
| Dot | 1 unit closed + 1 unit open | 2 |
| Dash | 3 units closed + 1 unit open | 4 |
| Letter space preceded by dot | 1 unit closed + 4 units open | 5 |
| Letter space preceded by dash | 3 units closed + 4 units open | 7 |
| Word space preceded by dot | 1 unit closed + 7 units open | 8 |
| Word space preceded by dash | 3 units closed + 7 units open | 10 |
Note that we had to consider the last two symbols in the case of the last symbol being a space in order to deal with our "no sequential spaces" constraint.
Now we have
So, our characteristic equation is
With a substitution of we get
and the largest positive root of this equation, found numerically, is about and so
Note that in this Morse telegraphy system, we have two states that the channel can be in, based on what the previous symbol transmitted was.
- If the previous symbol transmitted was a space, we're in state and the next symbol can only be a dot or a dash, and the state will change.
- If the previous symbol transmitted was not a space, we're in state and the next symbol can be anything, and the state may or may not change depending on what the next symbol is.
We can think of these states being the @nodes of a @directed-graph with the transitions between them being the @edges. A generalization of this is given in the theorem below.
Let be the duration of the -th symbol which is allowable in state and leads to state Then the channel-capacity is equal to where is the largest real root of the @determinantal-equation
where is the @Kronecker-delta.
For example, for our Morse telegraphy example, we have
Expanding the @determinant on the LHS gives the characteristic equation above.
Information and Entropy in a Discrete Channel
Given a real number and an outcome of a discrete random variable with probability mass function the self-information of is defined as the negative log probability
Referenced by (5 direct, 21 transitive)
Direct references:
Transitive (depth 1):
- Cross-Entropy
- Entropy Rate
- Gibbs' Inequality
- Chain rule for joint entropy
- joint-entropy-is-less-than-or-equal-to-entropy-of-parts
- KL Divergence
- note-25
- note-8
- proof-of-joint-entropy-is-less-than-or-equal-to-entropy-of-parts
- proof-of-theorem-44
- proof-of-theorem-50
- remark-14
- theorem-12
- Weak Asymptotic Equipartition Property
- theorem-44
- theorem-50-intuition
- Noiseless channel transmitting discrete symbols
Transitive (depth 2):
We can view self-information as an alternative casting of probability, like how odds are, with some desirable properties:
- An event with probability provides no information - we knew it was going to happen so it happening tells us nothing new.
- The less probable an event is, the more surprisal it yields.
- self-information is @additive - if two individual events are measured separately, the total amount of information is the sum of the self-informations of the individual events.
The function given above is the unique function of probability (up to a multiplicative scaling factor) that satisfies these three properties.
In a related vein we can develop a function that asks how much choice is involved in the selection of an event, or equivalently, how much uncertainty there is in the outcome. If are the probabilities of events occurring, we want a measure that has the following properties:
- should be continuous in the That is, a small change in a should result in a small change in
- If all the are equal, then should be a @monotonic @increasing function of With equally likely events there is more choice, or uncertainty, when there are more possible events.
- If a choice is broken down into two successive choices, the original should be the weighted sum of the individual values of For example, we should have that
Given a discrete random variable which may be any element within the set and is distributed according to the entropy is
We can choose different bases for the logarithm; throughout these notes a bare means giving the unit of @bits.
An alternative, equivalent definition is that entropy is the expected value of the self-information of a random variable:
The unit for entropy is bits per symbol.
Referenced by (20 direct, 4 transitive)
Direct references:
- Discrete Entropy
- theorem-12
- remark-14
- theorem-16
- note-25
- Chain rule for joint entropy
- Cross-Entropy
- KL Divergence
- Gibbs' Inequality
- theorem-44
- proof-of-theorem-44
- joint-entropy-is-less-than-or-equal-to-entropy-of-parts
- proof-of-joint-entropy-is-less-than-or-equal-to-entropy-of-parts
- proof-of-theorem-50
- theorem-50-intuition
- Entropy of a Discrete Information Source
- Entropy Rate
- Weak Asymptotic Equipartition Property
- Noiseless channel transmitting discrete symbols
- note-8
Real numbers are commensurable if there exists a common measure such that each is an integer multiple of it: Equivalently, all pairwise ratios are rational: for all (with ).
Referenced by (1 direct)
Direct references:
The only satisfying the three required properties above is the entropy function defined above, up to multiplication by a constant.
Assume we have a function that satisfies the three properties listed above, such that
Then, by property (3) above, we can decompose a choice from equally likely possibilities into a sequence of choices each from equally likely possibilities. For example, if we have equally likely possibilities, the probability of any given event is . If we instead we have a series of choices each with probability, we end up with as the probability of any specific sequence of events. So, we have that
Now, with arbitrarily large we can also have such that by the same logic, and we can pick such that
Now, we can take the logarithm of each term to get
and dividing by gives
and because is arbitrarily large,
where is arbitrarily small.
By property (2) of (it is a @monotonically-increasing function of ,)
Then, dividing by gives
Now, by the @triangle-inequality, we have that
Since can be arbitrarily small, we have that with so that property (2) holds. Now we know what is, and thus what is when we have equal probabilities for all events.
Now let's say that we have a choice from possible events with commensurable probabilities We can break down a choice from possibilities into a choice from possibilities with probabilities and then, if the th possibility was chosen, choices of equal probability We do this because above, we found how to find when all events are equally likely, and property (3) of our desired function lets us break down our overall choice from possibilities. This gives us
Then,
If the are incommensurable, we can approximate them as closely as we'd like with rationals, since The rationals are dense in the reals.. By the first property we assumed for it is continuous in the and so its value at the incommensurable equals its limit as we approach via the rationals, and so our expression holds in general. is left to us to pick, picking it is equivalent to picking a base for the logarithm.
The entropy of a random variable quantifies the average level of uncertainty or information associated with the variable's possible outcomes. It measures the expected amount of information needed to describe the state of the variable, considering the distribution of probabilities across all potential states.
When we decrease the probability of an element occurring, its self-information increases only logarithmically, while its weight in the entropy sum decreases linearly.
The demo below makes these quantities concrete. It uses a discrete alphabet of symbols whose probabilities follow a Zipfian distribution,
where the skew controls how unevenly probability mass is spread across symbols. At every symbol is equally likely (the uniform distribution), so entropy is maximal at As grows the distribution concentrates on the first few symbols, the rare symbols carry ever more self-information, and the entropy falls toward The bar chart shows the probability of each symbol alongside its self-information; the second chart traces the entropy as sweeps from uniform to highly skewed.
Examples to cover: [https://claude.ai/chat/0702d3b2-a181-4b5b-a572-e5464d9d24d5]
Example: Coin Flip
For a fair coin flip, and Then, and
Let's say we have an unfair coin and Then
and for entropy of we get
Example: Six-Sided Die
For a fair six-sided die, and for all Then, and
Let's say we have an unfair die and and for Then
and for entropy of we get
Some Theorems on Entropy
When a random variable is uniformly distributed over an alphabet of elements, the self-information of any given element equals the entropy of the random variable and is
We use the Logarithm Change of Base here.
iff all the but one are zero, this one having the value of one.
Suppose Then, Note that because we have and (with the convention since ). Assume for contradiction that more than one is non-zero. Then, because each non-zero is in and therefore its and the sum of these terms is therefore non-zero, a contradiction. Now, since all probabilities are required to sum to 1, it can't be the case that all probabilities are zero, which means that exactly one probability must be non-zero and that probability must be
Joint and Conditional Entropy
The joint entropy of a pair of @discrete random variables with a joint distribution is defined as
which can also be expressed as
Referenced by (2 direct, 1 transitive)
Direct references:
Transitive (depth 1):
Let and be random variables, not necessarily independent. The probability that takes the value when takes the value (for any specific ) is called the conditional probability and is given by:
(Note that is the joint probability of )
We define the conditional entropy of given as the average of the entropy of for each value of weighted according to the probability of getting that particular That is,
Referenced by (1 direct)
Direct references:
We can obtain the above formula for conditional entropy as follows. First, if then our entropy for is
Now, summing across gives:
The entropy (joint entropy) of the joint event is the entropy of plus the entropy of when is known.
Note that
The first term on the RHS is just The second is
Altogether, we have that or
TODO: Cover & Thomas, corollary to Theorem 2.2.1.
Referenced by (1 direct)
Direct references:
Relative Entropy and Mutual Information
Given two discrete probability distributions, and that share a support cross-entropy measures the average number of bits needed to represent an event drawn from when the coding scheme is optimized for an estimated distribution rather than the true distribution Its formula is very similar to that of entropy, except surprisal is calculated using while expectation uses :
We can write it in expectation form as
where is expectation under
Referenced by (4 direct, 2 transitive)
Direct references:
Transitive (depth 1):
Note that when cross-entropy equals entropy. The symbol is overloaded: with distributions as arguments means cross-entropy, while with random variables as arguments means joint entropy.
For discrete probability distributions, and that share a support the relative entropy from to is defined to be
which is just cross-entropy minus entropy:
Note that we don't always use the subscript where it's obvious from the context.
We can also write it as
which makes it clear that it's the expected inefficiency in an encoding optimized for rather than
Referenced by (1 direct)
Direct references:
kl divergence tells us how different an approximating distribution is from a true probability distribution It's not a true distance metric - it's asymmetric, but it does behave like distance in that it gets smaller as gets more like and is zero when It is a sort of directed distance.
Another way to think about it is as a measure of how inefficient a coding scheme optimized for is when the actual distribution is If says some event is rare, and so we use a longer symbol for it (more bits), but the event actually occurs frequently, we'll waste bits representing the event when we could have used a shorter symbol for it.
Consider two random variables and with joint probability mass function and marginal probability mass functions and The mutual information is the relative-entropy between the joint distribution and the product distribution :
Relationship Between Entropy and Mutual Information
TODO: Cover & Thomas Theorem 2.4.1.
Chain Rules
TODO: Cover & Thomas Theorem 2.5.1.
TODO: Cover & Thomas, Section 2.5.
TODO: Cover & Thomas Theorem 2.5.2.
TODO: Cover & Thomas, Section 2.5.
TODO: Cover & Thomas Theorem 2.5.3.
Inequalities
For discrete probability distributions and that share a support
with equality iff Equivalently, cross-entropy is never less than entropy: with equality iff
Because Log is Concave, by Jensen's Inequality we have that
Then, since we have that
Now, note that if and Conversely, suppose Since is strictly @concave, it is not @affine, and Jensen's Inequality condition for equality gives us that Now, and since is a probability distribution, and therefore and
TODO: Cover & Thomas, corollary to Theorem 2.6.3.
TODO: Cover & Thomas, corollary to Theorem 2.6.3.
TODO: Cover & Thomas, corollary to Theorem 2.6.3.
Referenced by (1 direct)
Direct references:
A random variable has the most entropy when the elements of its alphabet are all equally likely to occur.
We will use a @Lagrangian function of entropy to show this. Let
Then, for any we want
But, this means doesn't depend on and so is the same for each and therefore
It remains to show that this extreme of is a maximum. This follows from the facts that the domain is a @convex, compact set and that the entropy function is strictly @concave. TODO: more details on these.
The uncertainty of is never increased by knowledge of It will be decreased unless and are independent events, in which case it is not changed.
From Let and be discrete random... and Chain rule for joint entropy, we have
hence
Let and be discrete random variables with alphabets and and let be the probability of the joint occurrence of and
The entropy of the joint event (the joint entropy), is less than or equal to the sum of the individual entropies, i.e.
with equality iff and are independent, that is, iff
The entropy of the joint event is
This is just treating each possible pair of individual outcomes as its own outcome, i.e. we have possible outcomes. Writing and for the marginals (the argument names the distribution), we have
So,
Now, let's define a new random variable for convenience, We now have that
Now, by Jensen's Inequality, because Log is Concave, we have that Now,
Therefore and we have that and
Now, for the equality part. Suppose Then, and recalling that In Jensen's Inequality, equality holds only if our function is @affine or if is constant; since is @affine on no interval, must be constant, and since
Now, suppose Then and
so
Referenced by (1 direct)
Direct references:
Take a @doubly-stochastic matrix and probability vector let Then with equality iff is a @rearrangement of .
Note that by the definition of vector matrix multiplication. Now we'll define a couple of joint distributions:
Now we find the relative-entropy from to :
Now, addressing the first term on the RHS of the last line:
And the second term on the RHS of the last line:
So, we end up with Since by Gibbs' Inequality, we have which implies that which is what we wanted to show.
Now, the equivalence case. If is just a rearrangement of then obviously it has the same entropy as we can just re-index to recover Now assume Then, whenever Now, for each value appearing in or let
that is is the set of indices of where and similarly with and Now, consider row For any we have so i.e. every nonzero entry of row lies in a column of so the columns have the entire mass of row Similarly, for column for nonzero so and the rows contain all of column 's mass. Taking as the @indicator-vector of a set we have that
that is, rows in sum to over the columns while rows outside have no mass in the columns at all. Now we count the mass:
Therefore, for all so each appears equally often in and in and is therefore a rearrangement of
Averaging (well, replacing each probability with a convex combination of all the probabilities in a way that retains their summing to 1) the probabilities in can only bring them closer to each other (if it doesn't just rearrange them), which increases entropy.
Log Sum Inequality and Its Applications
TODO: Cover & Thomas Theorem 2.7.1.
TODO: Cover & Thomas Theorem 2.7.2.
TODO: Cover & Thomas Theorem 2.7.3.
Data-Processing Inequality
TODO: Cover & Thomas, Section 2.8.
Referenced by (4 direct)
TODO: Cover & Thomas Theorem 2.8.1.
TODO: Cover & Thomas, corollary to Theorem 2.8.1.
Sufficient Statistics
TODO: Cover & Thomas, Section 2.9.
TODO: Cover & Thomas, Section 2.9.
TODO: Cover & Thomas, Section 2.9.
Fano's Inequality
TODO: Cover & Thomas Theorem 2.10.1.
TODO: Cover & Thomas, Section 2.10.