Example: Two state system
Let’s consider a simple example of a two-state system, which is a common model in various fields like physics, information theory, and thermodynamics. In this system, the random variable ( X ) can take on one of two possible states:
and
. Each state has a certain probability associated with it.
Example Setup
Suppose we have a system with the following probabilities:
- The probability of state
is ( p ). - The probability of state
is
.
These two states could represent anything from the spin of a quantum particle (up or down), the outcome of a coin toss (heads or tails), or the binary state of a bit (0 or 1).
Shannon Entropy for the Two-State System
The Shannon entropy
of this two-state system is calculated using the formula:
![]()
Specific Cases
-
Case 1: ( p = 0.5 ) (Maximum Entropy)
This is the case of maximum uncertainty, where both states are equally likely (e.g., a fair coin toss).
![Rendered by QuickLaTeX.com [ H(X) = - \left( 0.5 \times -1 + 0.5 \times -1 \right) = 1 \text{ bit} ]](https://i0.wp.com/science.awjunaid.com/wp-content/ql-cache/quicklatex.com-8046499fdfb78f8075d37daa545ce372_l3.png?resize=322%2C19&ssl=1)
Here, the entropy is 1 bit, which means that on average, 1 bit is required to encode the outcome of this system. This makes sense since with equal probabilities, there is maximum uncertainty about the outcome.
-
Case 2: ( p = 0.9 ) (Low Entropy)
In this case, one state is much more likely than the other (e.g., a biased coin that lands heads 90% of the time).
![Rendered by QuickLaTeX.com [ H(X) \approx - \left( -0.137 + -0.332 \right) = 0.469 \text{ bits} ]](https://i0.wp.com/science.awjunaid.com/wp-content/ql-cache/quicklatex.com-4e3f893e23cae121bc9de77467dbf8be_l3.png?resize=335%2C19&ssl=1)
Here, the entropy is lower (about 0.469 bits) because there is less uncertainty; the outcome is more predictable.
-
Case 3: ( p = 1 ) (Zero Entropy)
In this case, the system is fully deterministic (e.g., a coin that always lands heads).
![Rendered by QuickLaTeX.com [ H(X) = - \left( 1 \log_2(1) + 0 \log_2(0) \right) ]](https://i0.wp.com/science.awjunaid.com/wp-content/ql-cache/quicklatex.com-fb6a75421fff5d6395ccdb5efcab8707_l3.png?resize=258%2C19&ssl=1)
Since
and the term
is considered to be 0 by convention (as it represents a probability of 0, meaning that outcome never occurs), the entropy is:![Rendered by QuickLaTeX.com [ H(X) = 0 \text{ bits} ]](https://i0.wp.com/science.awjunaid.com/wp-content/ql-cache/quicklatex.com-4bf98519d957b4343e8e6b8552385ba1_l3.png?resize=119%2C19&ssl=1)
Here, the entropy is zero because there is no uncertainty; the outcome is certain.
Summary
In a two-state system, Shannon entropy quantifies the uncertainty in predicting the outcome. When the two states are equally likely
, the entropy is at its maximum, reflecting maximum unpredictability (1 bit). As the probabilities become skewed (( p ) moves towards 0 or 1), the entropy decreases, indicating lower uncertainty. When one state is certain
, the entropy is zero, as there is no uncertainty about the outcome.
Discover more from Science blog by awjunaid
Subscribe to get the latest posts sent to your email.
