Write , , and
On the support of , define the probability mass function
For any real length function satisfying the Kraft inequality, put and . The Gibbs inequality gives
Equality holds for the ideal weighted lengths
Thus the smallest average weighted description length is
When has full support, the displayed attains this minimum. If some strings have zero probability, the same value is the infimum over finite lengths and is attained by the extended-real ideal assignment there; finite codewords of arbitrarily large length approach it.
The mean extension in an ensemble of molecules is
with constraints and . For occupancies , the number of assignments of the distinguishable ensemble members to the states is the multinomial coefficient
Thus maximizing the probability at fixed and is equivalent to maximizing the stated Lagrange multiplier expression.
Because , the Stirling formula gives . Differentiating with respect to each gives
Normalization by therefore yields the probability mass function
Here is the fixed-tension partition function that normalizes the probabilities.
The source is reliably encodable at rate if, for each block length , there are an encoder with at most outputs and a decoder such that the block error probability
tends to zero as .
Its information rate is the limiting information entropy per source symbol,
when this limit exists.
Let be probability mass functions on a finite alphabet, with absolutely continuous with respect to . A decision region accepts the null law . Write
for its type-I and type-II errors. Stein's lemma states that for every fixed ,
where logarithms and relative entropy use base two.
For achievability, let
Under , the normalized log-likelihood ratio converges in probability to by the weak law of large numbers, so . On , , whence .
For the converse, let
Again . If , then
The final factor has positive lower limit at least . Taking exponential rates and then proves the converse and the lemma.
Let and define the exponentially tilted probability mass function
For this choice every ratio equals , so equality holds in the Jensen inequality used in part (d). Hence
and is the maximizer. This is the finite-alphabet Gibbs variational principle for relative entropy.
Weakly typical sequence 2026-10-05
For an IID random variable source with probability mass function , a word is weakly typical when . It has probability on the scale . The weak law of large numbers makes the typical set probable, but does not make every word in it representative: for a uniform source every possible word is weakly typical.
A Poisson distribution conditioned on a positive count has probability mass function for and .