Huffman's Algorithm

Reviewing, we considered a set of $\QTR{Large}{n}$ plaintext-probability pairs MATH that is the probability that the symbol MATH occurs in a message is $\QTR{Large}{p}_{i}$ .We also considered an instantaneous binary code MATH for MATH. Finally we set MATH

$\vspace{1pt}$

One wants to know how to achieve the lower bound for MATH. In fact this is not a "hard" problem! There is a rather simple algorithm to general a "best possible" code.

At the root of Huffman's algorithm is a simple idea, which is...choose the longest binary string for the least probable symbol because this would reduce the expected length of a transmission.

That is:

if MATH and MATH then MATH.

Hence MATH where the first summation is the result of interchanging $\QTR{Large}{d}_{i}$ and $\QTR{Large}{d}_{j}$ in the second.

The idea of the algorithm is to build a tree from the leaves back towards the root. At each stage we "combine" the two least probable symbols, in effect adding a new node to the tree.


Figure

a 0
b 10
c 110
d 1110
e 1111

______________________________________________________________________________________________________

Secrecy

Suppose we have a cryptosystem. MATH and an encrypted message $\QTR{Large}{c}~$the big question is can we find the original plaintext message $\QTR{Large}{p}$ . Information Theory provide a general framework to study this and related questions. Unfortunately the practical applications of this framework are somewhat limited, at least for our purposes. On the other hand, it is worthwhile to briefly review this area.

The first thing that must be done is to define "Conditional Entropy." That is given events $\QTR{Large}{X}$ and $\QTR{Large}{Y}$ we want to consider MATH the amount of uncertainty in $\QTR{Large}{X}$ knowing after $\QTR{Large}{Y}$ is revealed. The formula defining of MATH is an somewhat obvious extension of $\QTR{Large}{H(X)}$ . From the Information Theoretic point of view the formulation involves the three sets MATH. For example, the following definition:

Definition

: We say that a cryptosystem has perfect secrecy if MATH

In simple terms, the amount of uncertainty about a message is the same whether or not we know the encrypted message. In order for this definition to make sense we need to remember that for a message $\QTR{bs}{p}$ to be the plaintext of an encrypted message $\QTR{bs}{c}$ there needs to be some key $\QTR{bs}{k}~$with

MATH

$\vspace{1pt}$

Examples:

MATH

MATH

Questions:

  1. What about SHIFT and SUBSTITUTION Cyphers?

  2. What about RSA?

  3. Consider MATH, remember that if I have an encrypted message and the Key that was used then I can decode the message, is there a relationship between MATH and MATH?

  4. In all the about we are more or less assuming that the distribution of plaintext messages are equiprobable. What role does the fact that we are dealing with natural languages play in this?