Shannon Information Theory: From Mathematical Measurement to a Thinking Framework

    This article explains Shannon’s mathematical definition of information and entropy, the source and channel coding limits, and why these ideas form a practical thinking framework. It uses two widely circulated schemes—storing data via π and storing infinite data on a rope—to show why coding cannot beat entropy or channel capacity, then discusses applications to the classic ball-weighing problem and modern communication systems.

    1. The Core Contribution of Information Theory: Measuring Information Mathematically

    Before Shannon, “information” was a vague concept. People knew that speaking, writing letters, and sending telegrams all conveyed information, but it was hard to answer what information is and how much information a message contains. In 1948, Shannon published a paper that abstracted information from its physical carrier and gave a mathematical definition of the amount of information: the information content of an event is negatively correlated with its probability; the lower the probability, the greater the information content when it occurs.

    On this basis, Shannon defined information entropy to characterize the average uncertainty of a source:

    1. H(X) = -Σ p(xi) · log2 p(xi)

    The base of the logarithm determines the unit. With log2, entropy is measured in bits.

    The significance of entropy is that information now has an objective, computable standard. Thermodynamics uses temperature to turn the sensation of hot and cold into a measurable physical quantity; Shannon used entropy to turn information into an object that can be measured, compared, and optimized.

    Shannon also established two limit theorems. The source coding theorem gives the theoretical lower bound for lossless compression, known as the Shannon limit. The channel coding theorem gives the upper rate limit for reliable communication over a noisy channel, known as channel capacity. Information theory states both what can be done and the boundary of what cannot be done.

    2. Using Information Theory to Identify Pseudoscientific Schemes: Two Typical Cases

    Information theory can quickly identify some schemes that sound clever. The two examples below have circulated widely online.

    2.1 Storing All Information with Pi?

    One idea is: if π is a normal number—meaning every finite digit sequence appears in its decimal expansion—then one only needs to record the starting position and length of a segment after the decimal point in π to store that piece of information.

    From an information-theoretic perspective, this is merely an encoding scheme, and the average codeword length of an encoding cannot fall below the lower bound determined by the source entropy. A concrete calculation also illustrates the problem. For any fixed pattern of length L bits, if the sequence behaves like a random sequence, the expected position of the pattern’s first occurrence is about 2^L. Recording this position requires about L bits, and adding overhead such as the length makes the total length no less than the original pattern. Therefore, on average, this scheme cannot compress data; it is more redundant instead.

    Note that whether π is a normal number remains unproven. Even if it is normal, the above conclusion still holds, because the cost of encoding the position offsets the benefit.

    2.2 Storing Infinite Data on a Rope?

    Another idea is: encode data as a binary fraction and then mark a point on a rope at the corresponding proportion. The number of real numbers is greater than the number of natural numbers, so in theory a single real number can encode an infinitely long bit string; thus a rope seems able to store infinite information.

    This idea ignores noise. Any physical measurement has a precision limit, and thermal noise, quantum effects, and instrument resolution all introduce errors when reading the mark. Each additional encoded bit roughly halves the spacing between adjacent marks, which is quickly overwhelmed by noise. Shannon’s channel capacity theorem states that for a channel with bandwidth B and signal-to-noise ratio S/N, the upper limit for reliable transmission rate is C = B·log2(1 + S/N). Marks on a rope are essentially a noisy channel, so infinite storage is not physically valid.

    Both examples lead to the same conclusion. They are variants of encoding and decoding, and encoding cannot exceed the boundaries set by information theory.

    3. Applications of Information Theory to Non-Information Problems

    3.1 The Ball-Weighing Problem: Why Not 13 Balls?

    The classic problem is: among 13 balls, one has an abnormal weight, but it is unknown whether it is lighter or heavier. Can a balance scale without weights, used three times, find the bad ball and determine whether it is lighter or heavier?

    Information theory can first perform a quick necessary-condition check. The problem has 13 × 2 = 26 possibilities, since each ball may be lighter or heavier. Each of the three weighings has three outcomes: left-heavy, right-heavy, or balanced, producing at most 3³ = 27 outputs. Since 26 ≤ 27, information volume does not rule out a solution.

    But this inequality is only a necessary condition; it is not enough to prove solvability. Each weighing requires the same number of balls on the left and right pans, so outcomes cannot be assigned arbitrarily, and the number of actually distinguishable cases is less than 27. The classic result is: the maximum number of balls solvable in k weighings is (3^k − 3)/2. When k = 3, the upper limit is 12 balls, so 13 balls cannot be solved in three weighings. The information inequality can quickly rule out cases where information is clearly insufficient, but a complete impossibility proof also requires analysis of the weighing constraints.

    In the 12-ball case, a common construction is to first divide the balls into groups of 4, 4, and 4, weigh two groups of 4 in the first weighing, and then gradually narrow the range based on the result. If an engineering implementation is needed, ternary encoding or a decision tree can be used to generate a concrete scheme, as a positive example for testing.

    At a deeper level, a good weighing scheme should make the output of each weighing approximately uniform, so that each weighing obtains about log₂3 bits of information. The idea of “maximizing information gain at each test” later became a core principle in decision trees, active learning, and hypothesis-test design.

    3.2 Channel Capacity and Modern Communication Technology

    Shannon’s formula gives a theoretical upper bound and has guided the evolution of modern communication systems. Turbo codes were proposed in 1993.