<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=92.201.19.30</id>
	<title>formulasearchengine - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=92.201.19.30"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/wiki/Special:Contributions/92.201.19.30"/>
	<updated>2026-05-24T03:36:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0-wmf.28</generator>
	<entry>
		<id>https://en.formulasearchengine.com/index.php?title=Iwasawa_algebra&amp;diff=26698</id>
		<title>Iwasawa algebra</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/index.php?title=Iwasawa_algebra&amp;diff=26698"/>
		<updated>2013-12-10T20:30:14Z</updated>

		<summary type="html">&lt;p&gt;92.201.19.30: /* Iwasawa&amp;#039;s theorem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[information theory]], &#039;&#039;&#039;Shannon–Fano–Elias coding&#039;&#039;&#039; is a precursor to [[arithmetic coding]], in which probabilities are used to determine codewords.&amp;lt;ref&amp;gt;&lt;br /&gt;
{{cite book&lt;br /&gt;
 | url = http://books.google.com/books?id=0QuawYmc2pIC&amp;amp;pg=PA127&lt;br /&gt;
 | title = Elements of information theory&lt;br /&gt;
 | author = T. M. Cover and Joy A. Thomas&lt;br /&gt;
 | edition = 2nd&lt;br /&gt;
 | publisher = John Wiley and Sons&lt;br /&gt;
 | year = 2006&lt;br /&gt;
 | pages = 127–128&lt;br /&gt;
 | isbn = 978-0-471-24195-9&lt;br /&gt;
 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Algorithm description ==&lt;br /&gt;
&lt;br /&gt;
Given a [[Discrete random variable#Discrete probability distribution|discrete random variable]] &#039;&#039;X&#039;&#039; of [[Total order|ordered]] values to be encoded, let &amp;lt;math&amp;gt;p(x)&amp;lt;/math&amp;gt; be the probability for any &#039;&#039;x&#039;&#039; in &#039;&#039;X&#039;&#039;.  Define a function &lt;br /&gt;
:&amp;lt;math&amp;gt;\bar F(x) = \sum_{x_i &amp;lt; x}p(x_i) + \frac 12 p(x)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Algorithm:&lt;br /&gt;
:For each &#039;&#039;x&#039;&#039; in &#039;&#039;X&#039;&#039;,&lt;br /&gt;
::Let &#039;&#039;Z&#039;&#039; be the binary expansion of &amp;lt;math&amp;gt;\bar F(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
::Choose the length of the encoding of &#039;&#039;x&#039;&#039;, &amp;lt;math&amp;gt;L(x)&amp;lt;/math&amp;gt;, to be the integer &amp;lt;math&amp;gt;\left\lceil \log_2 \frac {1}{p(x)} \right\rceil + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
::Choose the encoding of &#039;&#039;x&#039;&#039;, &amp;lt;math&amp;gt;code(x)&amp;lt;/math&amp;gt;, be the first &amp;lt;math&amp;gt;L(x)&amp;lt;/math&amp;gt; [[most significant bit]]s after the decimal point of &#039;&#039;Z&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Let X = {A, B, C, D}, with probabilities p = {1/3, 1/4, 1/6, 1/4}.&lt;br /&gt;
:For A&lt;br /&gt;
::&amp;lt;math&amp;gt;\bar F(A) = \frac 12 p(A) = \frac 12 \cdot \frac 13 = 0.1666...&amp;lt;/math&amp;gt;&lt;br /&gt;
::In binary, Z(A) = 0.&#039;&#039;&#039;001&#039;&#039;&#039;0101010...&lt;br /&gt;
::L(A) = &amp;lt;math&amp;gt;\left\lceil \log_2 \frac 1 \frac 1 3 \right\rceil + 1&amp;lt;/math&amp;gt; = &#039;&#039;&#039;3&#039;&#039;&#039;&lt;br /&gt;
::code(A) is 001&lt;br /&gt;
&lt;br /&gt;
:For B&lt;br /&gt;
::&amp;lt;math&amp;gt;\bar F(B) = p(A) + \frac 12 p(B) = \frac 13 + \frac 12 \cdot \frac 14 = 0.4583333...&amp;lt;/math&amp;gt;&lt;br /&gt;
::In binary, Z(B) = 0.&#039;&#039;&#039;011&#039;&#039;&#039;10101010101...&lt;br /&gt;
::L(B) = &amp;lt;math&amp;gt;\left\lceil \log_2 \frac 1 \frac 1 4 \right\rceil + 1&amp;lt;/math&amp;gt; = &#039;&#039;&#039;3&#039;&#039;&#039;&lt;br /&gt;
::code(B) is 011&lt;br /&gt;
&lt;br /&gt;
:For C&lt;br /&gt;
::&amp;lt;math&amp;gt;\bar F(C) = p(A) + p(B) + \frac 12 p(C) = \frac 13 + \frac 14 + \frac 12 \cdot \frac 16 = 0.66666...&amp;lt;/math&amp;gt;&lt;br /&gt;
::In binary, Z(C) = 0.&#039;&#039;&#039;1010&#039;&#039;&#039;10101010...&lt;br /&gt;
::L(C) = &amp;lt;math&amp;gt;\left\lceil \log_2 \frac 1 \frac 1 6 \right\rceil + 1&amp;lt;/math&amp;gt; = &#039;&#039;&#039;4&#039;&#039;&#039;&lt;br /&gt;
::code(C) is 1010&lt;br /&gt;
&lt;br /&gt;
:For D&lt;br /&gt;
::&amp;lt;math&amp;gt;\bar F(D) = p(A) + p(B) + p(C) + \frac 12 p(D) = \frac 13 + \frac 14 + \frac 16 \frac 12 \cdot \frac 14 = 0.875&amp;lt;/math&amp;gt;&lt;br /&gt;
::In binary, Z(D) = 0.&#039;&#039;&#039;111&#039;&#039;&#039;&lt;br /&gt;
::L(D) = &amp;lt;math&amp;gt;\left\lceil \log_2 \frac 1 \frac 1 4 \right\rceil + 1&amp;lt;/math&amp;gt; = &#039;&#039;&#039;3&#039;&#039;&#039;&lt;br /&gt;
::code(D) is 111&lt;br /&gt;
&lt;br /&gt;
==Algorithm analysis==&lt;br /&gt;
&lt;br /&gt;
===Prefix code===&lt;br /&gt;
Shannon–Fano–Elias coding produces a binary [[prefix code]], allowing for direct decoding.&lt;br /&gt;
&lt;br /&gt;
Let bcode(x) be the rational number formed by adding a decimal point before a binary code.  For example, if code(C)=1010 then bcode(C) = 0.1010.  For all x, if no y exists such that &lt;br /&gt;
:&amp;lt;math&amp;gt;bcode(x) \le bcode(y) &amp;lt; bcode(x) + 2^{-L(x)}&amp;lt;/math&amp;gt;&lt;br /&gt;
then all the codes form a prefix code.&lt;br /&gt;
&lt;br /&gt;
By comparing F to the [[Cumulative distribution function|CDF]] of X, this property may be demonstrated graphically for Shannon–Fano–Elias coding.&lt;br /&gt;
&lt;br /&gt;
[[File:Shannon fano elias cdf graph.jpg|&amp;quot;CDF&amp;quot;|The relation of F to the CDF of X]]&lt;br /&gt;
&lt;br /&gt;
By definition of L it follows that &lt;br /&gt;
: &amp;lt;math&amp;gt;2^{-L(x)} \le \frac 12 p(x)&amp;lt;/math&amp;gt;&lt;br /&gt;
And because the bits after L(y) are truncated from F(y) to form code(y), it follows that&lt;br /&gt;
: &amp;lt;math&amp;gt;\bar F(y) - bcode(y) \le 2^{-L(y)}&amp;lt;/math&amp;gt;&lt;br /&gt;
thus bcode(y) must be no less than CDF(x).&lt;br /&gt;
&lt;br /&gt;
So the above graph demonstrates that the &amp;lt;math&amp;gt;bcode(y) - bcode(x) &amp;gt; p(x) \ge 2^{-L(x)}&amp;lt;/math&amp;gt;, therefore the prefix property holds.&lt;br /&gt;
&lt;br /&gt;
===Code length===&lt;br /&gt;
&lt;br /&gt;
The average code length is &lt;br /&gt;
&amp;lt;math&amp;gt;LC(X) = \sum_{x \epsilon X}p(x)L(x) = \sum_{x \epsilon X}p(x)(\left\lceil \log_2 \frac {1}{p(x)} \right\rceil + 1)&amp;lt;/math&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
Thus for H(X), the [[Entropy (information theory)|Entropy]] of the random variable X,&lt;br /&gt;
:&amp;lt;math&amp;gt;H(X) + 1 \le LC(X) &amp;lt; H(X) + 2&amp;lt;/math&amp;gt;&lt;br /&gt;
Shannon Fano Elias codes from 1 to 2 extra bits per symbol from X than entropy, so the code is not used in practice.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
{{Compression Methods}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Shannon-Fano-Elias coding}}&lt;br /&gt;
[[Category:Lossless compression algorithms]]&lt;/div&gt;</summary>
		<author><name>92.201.19.30</name></author>
	</entry>
</feed>