This commit is contained in:
Trance-0
2025-10-27 11:56:32 -05:00
parent 0d93eb43d3
commit fb1ffcd040
17 changed files with 219 additions and 134 deletions

View File

@@ -187,7 +187,8 @@ $$
where $L(\mu)$ is the minimum mean code word length of all uniquely decipherable codes for $(A,\mu)$.
Proof:
<details>
<summary>Proof</summary>
First, we show that
@@ -278,7 +279,7 @@ $$
\end{aligned}
$$
QED
</details>
### Entropy
@@ -387,13 +388,9 @@ n1 symbols.
By the inductive hypothesis, the code on $A'$ is optimal.
is optimal.
By Step 2 above, assigning the two merged symbols $a$ and $b$ codewords $w_0$ and $w_1$ (based on
1
$w_1$ (based on $c$'s codeword $w$) results in the optimal solution for $A$.
By Step 2 above, assigning the two merged symbols $a$ and $b$ codewords $w_0$ and $w_1$ (based on 1.1.4) results in the optimal solution for $A$.
Therefore, by induction, Huffmans algorithm gives an optimal prefix code for any $n$.
QED
</details>