Answer:
We can use Huffman coding to find the compact coding. It goes as follows. List the possibilities in the order of non-decreasing probabilities from left to right. and keep combining the least two at each stage.
in all the following 'p' represents down. I intended write 'd' but didn't observe till the last moment.
List the possibilities
Combine the two least probabilites p and u
Follow this till the end
Next least are 0.2 and 0.15
Next are 0.35 and 0.25
Lastly
Now take any convention to assign the bits. i took left edge as 1 and rigth as 0
Now if we have to data for an entry, start from the bottom and note the bits in the path to the corresponding entry.
so, f (forward) = 1
r (right) = 010
l(left) = 001
h(hover) = 000
p(down) = 0101
u(up) = 0100
Average bit per data . multiply bit length of each entry with probability = (0.4*1)+(0.15*3)+(0.15*3)+(0.1*3)+(0.1*4)+(0.1*4) = 2.4
But we take a fixed 4 bit representation then each entry will take 4 bits
Inefficienvcy =
3. We want to transmit commands to a drone over a wireless channel. The commands and...
A data packet is transmitted over a lossy wireless channel with packet error rate 0.3. Most communication systems adopt the Automatic Repeat reQuest (ARQ) protocol. That is, if a packet is successfully (with probability 0.7) or unsuccessfully (with probability 0.3) received, the receiver respectively sends a one-bit ‘ACK’ or ‘NAK’ message (over a separate feedback channel) to the transmitter. After receiving an ‘ACK’, the transmitter will move on to the next packet transmission; otherwise, the transmitter will re-transmit the same...