<p>It's fine. Since AA has probability more than 1/2 it's encoded by 1 bit to minimize expected codeword length. You have a kind of superincreasing distribution and Kraft's inequality forces the other codeword lengths higher.</p>

CC BY-SA 3.0
2015-03-30T21:29:11.930Z
thanks man. I just have never seen that inter looping before and was confused.
Jack Armstrong
CC BY-SA 3.0
2015-03-30T21:25:05.277Z
2015-03-30T21:25:05.277Z
kodlu
<p>I am trying to figure out how to code these symbols. I am pretty sure I have it, but it gets a little tricky. Let A,B, and C have probabilities .71, .16, and .13 respectively. I am trying to code the pairs of them. I use 0 for up and 1 for down. Observe</p>

<p>AA .71^2=.5041</p>

<p>AB .1136</p>

<p>BA .1136</p>

<p>AC .0923</p>

<p>CA .0923</p>

<p>BB .0256</p>

<p>BC .0208</p>

<p>CB .0208</p>

<p>CC .0169</p>

<p>After I have dealt with the lower 4 ones. I get the sum of .0841. Then I add that sum to CA to get .1764. Now I have this</p>

<p>AA .71^2=.5041</p>

<p>AB .1136</p>

<p>BA .1136</p>

<p>AC .0923</p>

<p>** .1764</p>

<p>Now my problem here is that when I add BA to AC since they are the lowest, I get .2059. Then I add AB to .1764 to get .29 to get</p>

<p>AA .5041</p>

<p>.29</p>

<p>.2059</p>

<p>Then add .2059 and .29. Hence I get this as a coding</p>

<p>0 100 110 111 1010 101100 101101 101110 101111</p>

<p>which I might be correct. Please help.</p>

<coding-theory>
Complicated Huffman coding
Jack Armstrong
# Complicated Huffman coding

(Asked by: username_0 on 2015-03-30)

I am trying to figure out how to code these symbols. I am pretty sure I have it, but it gets a little tricky. Let A,B, and C have probabilities .71, .16, and .13 respectively. I am trying to code the pairs of them. I use 0 for up and 1 for down. Observe

AA .71^2=.5041

AB .1136

BA .1136

AC .0923

CA .0923

BB .0256

BC .0208

CB .0208

CC .0169

After I have dealt with the lower 4 ones. I get the sum of .0841. Then I add that sum to CA to get .1764. Now I have this

AA .71^2=.5041

AB .1136

BA .1136

AC .0923

\*\* .1764

Now my problem here is that when I add BA to AC since they are the lowest, I get .2059. Then I add AB to .1764 to get .29 to get

AA .5041

.29

.2059

Then add .2059 and .29. Hence I get this as a coding

0 100 110 111 1010 101100 101101 101110 101111

which I might be correct. Please help.

**Tags:** coding-theory

---

## 1 answers

### Answer by username_1 on 2015-03-30. Score: 0 | Accepted answer

It's fine. Since AA has probability more than 1/2 it's encoded by 1 bit to minimize expected codeword length. You have a kind of superincreasing distribution and Kraft's inequality forces the other codeword lengths higher.

> **Comments:**
> **username_0**: thanks man. I just have never seen that inter looping before and was confused.  

---

