Test
1 Information Theory M/CS 4890
1. Shannon's Noiseless Coding Theorem(20
points):
State Shannon's Noiseless Coding Theorem.
Compute the Entropy of the follow alphabet and probability distribution. You can use the approximation
Symbol
Probability
A
1/4
B
1 /6
C
1 / 6
D
1 /6
E
1 / 4
Construct the associated Huffman Code.
What does Shannon's Noiseless Coding Theorem say about expected code lengths? Confirm this numerically by computing the
expected lengths of encoded symbols in the Huffman
Code.
Answer:
Given a set of symbols with probability distribution any binary prefix code for satisfies the equation
Symbol
Probability
A
1 /4
B
1 / 6
C
1 /6
D
1 /6
E
1 / 4
Symbol
Probability
A
1 /4
E
1 /4
B
1 / 6
C
1 / 6
D
1 / 6
Symbol
Probability
[C,D]
1 /3
A
1 / 4
E
1 /4
B
1 / 6
Symbol
Probability
[E,B]
5 /12
[C,D]
1 /3
A
1 / 4
Symbol
Probability
[[C,D],A]
7 /12
[E,B]
5 /12
Symbol
Code
[[C,D],A]
0
[E,B]
1
Symbol
Code
[C,D]
00
A
01
E
10
B
11
Symbol
Code
C
000
D
001
A
01
E
10
B
11
2. Shannon's Noisy Coding Theorem(15
points):
Let and , then for sufficiently large integers and we can find:
an code with :.
.
, where is to be read " cannot be unambiguously decoded.".
such that
Letting the approximate value of .:
What does the Noisy Coding Theorem about transmitting copies of The Complete Works of William Shakespeare?
Nothing really it is really about not . In particular, for close to . may have to be very very large, lots of noise and for close to . little noise, can be close to the code size you actually need.
In general, letting , numerically, what does the Noisy Coding Theorem assert?
For sufficiently large integers
you
can find an
code
with
arbitrarily close to
and such that the probability of a symbol being decoded incorrectly is less
than
3. (20 Points): Do a worst case analysis of the four ball weighing problem, 3 the same and 1 heavier or lighter. What is the Shannon Clue?
Compute the Information provided by the various experiments in your analysis. Does the total worst case Information gained conform to the Shannon Clue
Answer:
There are 4 balls and 1 is heavier or lighter so there are 8 equiprobable outcomes.so the Information gained learning which ball is the odd ball and whether it is heavier or lighter is
Bits of information. So the Shannon Clue is that if somehow I could learn a little more than Bits of Information in each of 2 weighings, as I had done before, I might be able to solve the problem in two weighings.
The possible experiments are
one ball on each side two off the balance.
two balls on each side
This second possibility has two possible outcomes, left side up left side down. It produces Bit of Information, not enough Information, given the Clue, it is also easy to see that one additional weighing is not going to be enough.
In the case of one ball on each side two off the balance , there are three possible outcomes, the left side goes up, the left side goes down or the scale balances.
They are not equiprobable. The scale balances in possible ways. The odd ball could be either of the two off the scale and the odd ball could be heavier or lighter Thus the probability of the scale balancing is
thus learning that this is the outcome give
Bit of Information.
The left side could only go down in 2 possible ways. The left side has the odd
ball and it is heavier or the right side has the odd ball and it is
lighterThus the probability of the left side going down is
and learning that this is the outcome gives
Bits of Information. and we only need
based
on the Shannon Clue ..
Indeed in this case one additional weighing would be enough. Just weigh the
ball on the left side against a good ball. If the scale goes down again, the
ball on the left is a heavy ball, if the scale balances the ball that was on
the right was a light ball.
Similarly for the left side side going up
Since we are considering worst case, in the case that the odd ball was off the
scale in the first weighting we know the odd ball is one of the two left but
we don't know if it is heavier or lighter. One additional weighting is not
enought to determine this. However, knowing it is one of two, we can weight
them against each other and use the previous strategy to solve the problem in
a second additional weighing, Hence; The worst case is that it takes 3
weighings to solve the 4 ball weighing problem ( no better than the 12 ball
problem)
4. (20 Points): Letting be define by the matrix ,
and the two code words are certainly apart.
Show that it is also a Perfect Code. The Hamming Balls of radius 1 fill up the space.
Define a one bit error checkingmatrix . ( and any )
As an aside, this is the Hamming
Code.
Answer:
Besides and , in there are vectors with one . These are Hamming Distance away from There are also vectors with two s that are Hamming Distance away from
, hence is a Perfect Code.
To know we need an even number of s in each column and to know any we need a in the th row of at least 1 column.
has both of these properties.
5. (25 Points):Solve the following variant of the Three Doors Problem
The Host hides a money prize behind one of three randomly chosen doors with
probability 1/2 for door 1 and 1/4 for doors
2 and 3
.
The Player chooses door 1.knowing the hosts preference
.
The Host opens either door 2 or door 3 using the following rules:
If the money is behind door 1 open 2 or 3 at random.
If it is a head open 2 and if it is a tail open 3.
If the money is behind door 2 open 3 and if it is behind 3 open 2.
The Question: Suppose the Host opens door 3, should the Player open door 1 or open door 2.?
Your answer should consist of filling in the following outline.
The Random Variable: The door that the money is hidden behind: , which takes on the values
with
The Conditional Distribution:
The Random Variable: The door that the Host opens , which takes on the values
with
since
The Posterior Distribution:
The Decoding Strategy:
either
or
and
either
or
both are equiprobable
The Marginal Information using any formula version.