What is the Huffman Tree?

What is the correct Huffman tree for the following symbol/probability set?

Symbol A B C D E Probability 0.6 0.1 0.1 0.1 0.1 \begin{array} { | c | c | c | c | c | c | } \hline \text{Symbol} & A & B & C & D & E \\ \hline \text{Probability} & 0.6 & 0.1 & 0.1 & 0.1 & 0.1 \\ \hline \end{array}

Tree 2 Tree 1 Tree 3

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Karleigh Moore
May 11, 2016

Relevant wiki: Huffman Code

The elements with the smallest probabilities are B, C, D, and E. We will arbitrarily choose D and E to be the first subtree. We update our list to remove D and E, and add subtree DE with probability . 1 + . 1 = . 2 .1 + .1 = .2 .

Symbol Probability
A 0.6 0.6
B 0.1 0.1
C 0.1 0.1
DE 0.2 0.2

The next two elements with the smallest probability are B and C. We update our list to remove B and C, and add subtree BC with probability . 1 + . 1 = . 2 .1 + .1 = .2 .

Symbol Probability
A 0.6 0.6
BC 0.2 0.2
DE 0.2 0.2

The next two elements with the smallest probability are BC and DE. We update our list to remove BC and DE, and add subtree BCDE with probability . 2 + . 2 = . 4 .2 + .2 = .4 .

Symbol Probability
A 0.6 0.6
BCDE 0.4 0.4

Finally, we combine the last two elements to get ABCDE with a probability of 1.

This Huffman tree resembles tree #3.

I found Tree 3 but this option on Tree2 position, i miss click. omg

anron software - 1 year, 10 months ago
B D
Mar 7, 2020

B, C, D and E have the same probability, so they must need the same number of steps to get to them. The only tree which follows this is the third one.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...