Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Shannon's source coding theorem
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Proof: Source coding theorem for symbol codes == For {{math|1 β€ ''i'' β€ ''n''}} let {{math|''s<sub>i</sub>''}} denote the word length of each possible {{math|''x<sub>i</sub>''}}. Define <math>q_i = a^{-s_i}/C</math>, where {{mvar|C}} is chosen so that {{math|''q''<sub>1</sub> + ... + ''q<sub>n</sub>'' {{=}} 1}}. Then :<math>\begin{align} H(X) &= -\sum_{i=1}^n p_i \log_2 p_i \\ &\leq -\sum_{i=1}^n p_i \log_2 q_i \\ &= -\sum_{i=1}^n p_i \log_2 a^{-s_i} + \sum_{i=1}^n p_i \log_2 C \\ &= -\sum_{i=1}^n p_i \log_2 a^{-s_i} + \log_2 C \\ &\leq -\sum_{i=1}^n - s_i p_i \log_2 a \\ &= \mathbb{E} S \log_2 a \\ \end{align}</math> where the second line follows from [[Gibbs' inequality]] and the fifth line follows from [[Kraft's inequality]]: :<math>C = \sum_{i=1}^n a^{-s_i} \leq 1</math> so {{math|log ''C'' β€ 0}}. For the second inequality we may set :<math>s_i = \lceil - \log_a p_i \rceil </math> so that :<math> - \log_a p_i \leq s_i < -\log_a p_i + 1 </math> and so :<math> a^{-s_i} \leq p_i</math> and :<math> \sum a^{-s_i} \leq \sum p_i = 1</math> and so by Kraft's inequality there exists a prefix-free code having those word lengths. Thus the minimal {{mvar|S}} satisfies :<math>\begin{align} \mathbb{E} S & = \sum p_i s_i \\ & < \sum p_i \left( -\log_a p_i +1 \right) \\ & = \sum - p_i \frac{\log_2 p_i}{\log_2 a} +1 \\ & = \frac{H(X)}{\log_2 a} +1 \\ \end{align}</math>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)