Information Entropy
Information entropy is a measure of the uncertainty of a random variable, proposed by Claude Shannon in 1948. It quantifies, on average, how much surprise a single observation delivers; it is the beginning of information theory and the computational starting point for almost all machine-learning loss functions and decision-tree algorithms today.
Core Principles
Shannon derived the form of entropy from three intuitive requirements: uncertainty should be a continuous function of probability; the more equally likely events there are, the greater the uncertainty; and overall uncertainty can be split into two steps for computation. The function satisfying all three is uniquely H = -sum p(i) log p(i), where the base of the logarithm determines the unit, base 2 giving bits and base e giving nats.
The meaning of this formula is worth unpacking. When an event's probability is close to 1, log p is close to 0 and it provides almost no information; when the probability is very small, -log p is large, exactly matching the intuition that "rare events carry more information". Entropy is the probability-weighted average amount of surprise. Flipping a fair coin has entropy of 1 bit, while a fake coin with the same face on both sides has entropy of 0, because the outcome is fully predictable.
A concrete example: draw one card at random from a 52-card deck. Its suit has four kinds of 13 cards each, with entropy of 2 bits; if the suit is then given to you, the entropy of the rank is about 3.7 bits, and the two add up exactly to the entropy of the whole card, about 5.7 bits. This "additivity" is the most basic structural property of entropy, and it is the source of the chain rule H(X,Y) = H(X) + H(Y|X).
Entropy also has an extremum property: over n values, the uniform distribution has the maximum entropy, log n; any skew reduces entropy. This property makes it the basis for "the most conservative assumption when there is no other information", and it is the source of the maximum entropy principle.
Key Points
Units need extra care: entropy with base 2 is measured in bits and with base e in nats, and the two differ by a constant factor of ln 2. Mixing them in papers is not rare, so values must be made consistent before comparison.
In machine learning, what is actually used are several derived quantities of entropy: conditional entropy H(Y|X) denotes how much uncertainty remains in Y after X is known; mutual information I(X;Y) = H(Y) - H(Y|X) denotes the amount of information the two share, equal to how much uncertainty about Y knowing X removes; and cross entropy measures the cost of encoding real data with a wrong distribution. Information gain in decision trees is essentially mutual information.
Estimating entropy also has its subtleties. With limited samples, computing directly from empirical frequencies systematically underestimates entropy; this is the so-called "plug-in bias", and corrections such as Miller-Madow are needed. Entropy estimation for high-dimensional continuous variables is an even more classic hard problem in statistics.
The relationship between entropy and compression is also worth remembering. Shannon's source coding theorem states that the average code length of lossless compression cannot be lower than the entropy, and Huffman coding and arithmetic coding can approach this lower bound. Hence "a file that will not compress" means in practice that its bitstream is close to random and its entropy is close to its length, which is also a rough way to judge whether data have already been encrypted.
Common Misconceptions
Treating entropy as "the amount of information" itself is a muddled statement. Entropy is uncertainty in the average sense, while the information content of a single message is -log p. Also, high entropy does not mean useful: pure random noise has the highest entropy but contains no learnable structure, which is exactly why "high entropy" in language models can mean either diversity or nonsense.
Note also that a continuous distribution has no absolute meaning of "absolute entropy"; it actually depends on the coordinate scale, which is why differential entropy can be negative, and only differences between two distributions (such as KL divergence) are coordinate-invariant. At the same time, avoid equating entropy directly with everyday words such as "chaos" or "disorder": mathematically it is only a function of a probability distribution, and its correspondence with physical entropy requires additional statistical-mechanics assumptions.
Application Scenarios
Data compression and Huffman coding, feature selection in decision trees, maximum entropy language models, cross-entropy loss in deep learning, entropy regularization in generative models, password strength assessment, measures of ecological and linguistic diversity, and sample uncertainty screening in active learning.