Let and let be the probability cell of symbol . Its midpoint is . Use the binary expansion terminating in zeros at a dyadic rational, so truncation to bits gives
The chosen codeword corresponds to the dyadic interval . It contains , and its width satisfies . Consequently
Thus . The probability cells are disjoint, so the code intervals are disjoint. If one binary codeword were a prefix of another, its dyadic interval would contain the other's interval, contradicting this disjointness. Hence the code is instantaneous.
Finally, . Multiplying by and summing yields
This is the Shannon-Fano-Elias code: the extra bit makes the dyadic interval narrow enough to remain inside the cell around its midpoint.
Figure 1. . An original example with probabilities two fifths, three tenths, one fifth, and one tenth. Each orange dyadic code interval contains its black midpoint and lies inside its blue probability cell, proving that the displayed codewords cannot be prefixes of one another. Details.
Write . For each row put ; the positive row entries form a probability distribution because the row sum is one. When , define the probability distribution
Part (a), applied on this row support, gives . Its weighted sum expands as
Rows with contribute zero, since all in such a row vanish. Using the convention that zero-weight logarithmic terms are zero, the result is
Both stochasticity conditions have a role: row sums normalize the comparison distributions, while column sums preserve the total contribution from .
Use the continuous convention . Let . Applying the allowed logarithm inequality to for gives
Hence . Equality forces . Since every is strictly positive, this makes the entire alphabet. Equality in every weighted logarithm inequality then forces for every . Conversely makes every summand zero. Thus
This is Gibbs inequality for relative entropy, with zero probabilities in the first argument handled explicitly.
Fix the channel matrix . The mixed input induces the mixed output . The concavity of information entropy implies
For completeness, the difference is by Gibbs inequality, including zero coordinates with the usual conventions.
On the other hand, conditional output entropy is linear in the input law:
Subtracting gives the concavity of mutual information in the input distribution:
This makes maximizing mutual information over the input probability simplex a concave optimization problem: a local maximum is global. It also justifies averaging input distributions over channel symmetries when searching for an optimum, since symmetry averaging cannot lower the achieved mutual information. The channel itself is held fixed throughout.
For a finite joint distribution, the mutual information is
Zero-probability terms contribute zero. It measures the reduction in uncertainty about one variable upon observing the other.
A discrete memoryless channel has discrete input/output alphabets and a fixed transition matrix . Over successive uses it obeys
Thus the output at a use depends on that input and no other channel history. Its channel capacity is
in bits per use for base-two logarithms. On finite alphabets the maximum exists by continuity on the probability simplex; for more general discrete alphabets one uses a supremum.
Given an output of positive probability, the ideal observer chooses a symbol maximizing the posterior:
Ties may be broken arbitrarily, and the choice at an impossible output does not matter. This is maximum a posteriori decoding. It minimizes conditional error at each , because a deterministic decision is correct with probability ; a randomized decision is a weighted average of these success probabilities and cannot exceed their maximum.
Write . Then . Applying the two cases from part (b) to the posterior distribution gives
Average with respect to the output law to obtain the conditional entropy upper bound on minimum decoding error:
This is an upper bound on the optimum error probability; it does not hold for arbitrary deliberately poor decoding rules.

Pinned article: Introduction to the OurBigBook Project

Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
We have two killer features:
  1. topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculus
    Articles of different users are sorted by upvote within each article page. This feature is a bit like:
    • a Wikipedia where each user can have their own version of each article
    • a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
    This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.
    Figure 1.
    Screenshot of the "Derivative" topic page
    . View it live at: ourbigbook.com/go/topic/derivative
  2. local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:
    This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
    Figure 5. . You can also edit articles on the Web editor without installing anything locally.
    Video 3.
    Edit locally and publish demo
    . Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.
  3. https://raw.githubusercontent.com/ourbigbook/ourbigbook-media/master/feature/x/hilbert-space-arrow.png
  4. Infinitely deep tables of contents:
    Figure 6.
    Dynamic article tree with infinitely deep table of contents
    .
    Descendant pages can also show up as toplevel e.g.: ourbigbook.com/cirosantilli/chordate-subclade
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact