Communication Chapter 2 Flashcards
(28 cards)
Noiseless Communication scheme
source -> source encoder (compressor) -> noiseless channel -> source decoder (extractor) -> destination
random source model
Let p = (p₁,..,pₘ) be a discrete probability distribution. A random source S={s₁,..,sₘ} has probability distrubution p={p₁,…,pₘ} if
(1) The random source produces letters one at a time
(2) The letter sᵢ in S is produced with probability pᵢ
(3) The letter is produced independently of the past.
H(P)=
H(P)= - the sum from i=1 to m of pᵢ log₂ pᵢ = H(S)
H(S)=
H(S) = the sum from i=1 to m of pᵢ log (1/pᵢ) = H(P)
How to find the binary entropy function
sub in the values of p into the formula
H(P)= - the sum from i=1 to m of pᵢ log₂ pᵢ
High entropy =>
unpredictable
Low entropy =>
predictable
What range can the entropy be in
0≤H(P)≤logm
When does H(P)=0
if p₁ = 1 and pᵢ = 0
When does H(P) = logm
if pᵢ=1/m (i.e. equal chance for each)
Gibbs Lemma
Let r₁,…,rₘ be a sequence of positive real numbers that have a sum less than or equal to one. Let p = (p₁,…,pₘ) be a probability distribution. Then,
H(P)≤ the sum from i=1 to m of pᵢ log (1/rᵢ) (*)
ENCODING
Takes the source and assigns each letter a codeword
DECODING
Takes one of the codewords and maps it to the associated letter
𝔼(ℓ(f))
𝔼(ℓ(f))= the sum from i=1 to m of pᵢ |f(sᵢ)|
Shannons Noiseless Encoding Theorem
Let S be a random source and f:S->{0,1}* be an optimal prefix-free encoding of S. Then, H(S)≤𝔼(ℓ(f))≤H(S)+1.
How to use Shannons Theorem to work out an optimal encoding
- Find a prefix-free code s.t. H(S)=𝔼(ℓ(f)) (this is best possible) so must be optimal
Just because shannons inequality holds…
doesn’t mean f is an optimal prefix-free encoding
Huffman coding creates…
a PREFIX FREE, OPTIMAL encoding
How to see if a code is a huffman code
- check it is prefix free
- check it is optimal (put into binary tree an check al vertices have exactly 2 children)
- work out probabilities and run the Huffman encoding algo through
How to work out the probability distribution from a Huffman code
- draw out the binary tree for the huffman code
- find inequalities for the probabilities based on the branching. Solve to find probabilities that satisfy these and add up to 1.
Huffman encodings always have the lowest possible _______ amongst all _______
expected length, prefix-free encodings.
a code is more efficient if….
it has a shorter expected length
ℓ(f)
The random variable for the codeword f(s) where s is the letter produced by the source according to the probability distribution P.
How to show an encoding is not optimal
- find a encoding that has smaller expected length