Question
Find the Huffman code for the following set of characters:
| Character | a | b | c | d | e | f |
| Frequency | 50 | 30 | 20 | 12 | 5 | 3 |
Show all the steps of the algorithm. Also compute the number of bits require to encode the data.
Answer :
Word Count : 605
___ _________ ________ ___ _____.
______ ___ ____ __________ ________ _______ _________ ____ ___ ______ ______.
____ _____ __________ ____ _____ __________ _________ ___ ________.
___ ____ ________ __________ ________ _______ __________ _____.
____ _________ ___ ___ ____ ______ ____.
_________ _________ __________ ___ ____.
___ _________ _______ _____ _______ ____ __________ ______ _______.
______ ______ ___ ___ ________.
_________ _______ _______ ______ ___ ____ ____ ________ _______.
______ _________ __________ _______ _______ __________ ___ ___ ______.
___ ______ ________ _____ _________ ___ __________.
____ _______ __________ ____ ____ _____.
____ _____ _______ ________ _____ __________.
______ ______ ______ ______ ____.
_____ _____ ________ _____ _____ __________ ________ ____ _______ ______.
_______ ___ _________ _______ __________ _____ _____ _________ _________.
_______ __________ ___ ____ ______ ________ _____ ______ _______.
____ _____ ______ __________ ______.
_____ ____ _____ ____ ________ ________ _________.
____ __________ ______ ___ _________ _________ __________ _____ _______ ____.
_________ _______ ________ _______ _________ _______ ____ ________ __________ ___ _______ __________.
_________ ______ _____ ____ ___ ________.
_______ ______ __________ ____ _______ _____ _________ ________.
_________ ________ _____ __________ ________ __________ __________ ___ ____ _________ __________.
_________ ____ __________ _______ ________ ___.
_______ _____ _________ _________ _______ __________.
________ ____ ____ ________ ______ _______ _________.
_________ ____ _________ _______ ______ _______ ___ ______ ___ ________.
______ _____ _______ ___ _____ ____ ___ __________ ___ ____ ______.
_______ ___ ________ _______ _____ ___ _______ _________ ___ ________.
______ __________ ______ _____ _______.
________ __________ ___ ________ __________ ________ _____ _________ ___ _________.
___ __________ _________ _________ __________ ___ _____ ______ ______.
_______ _____ ___ ___ ____ ______ _________ ________ _______ __________ _____ _____.
____ _____ __________ _____ ____ _______ _________ _____ ___ _______.
_____ _____ __________ ____ ____ ________ _____ ____ _________ ________ _______.
___ _________ _________ ______ ____ _________ ___ ________ ____ _____ _______ __________.
______ _____ __________ _____ _______ _____ ___ __________ ____ ______ ________.
________ _____ ____ _______ _____ ______ __________.
_______ ___ ________ _____ __________ ____ _________ __________.
____ ______ __________ _______ ________ ________ __________ _________ ___ ___ __________.
____ _________ ____ _________ _________ __________ _________ ___.
______ _____ __________ _______ ________ __________ ____ _____ ______.
________ _______ _____ _______ _________ ____.
__________ ________ ________ ____ ____ ______ ______.
____ _________ ___ ___ ___ _______ ________ _____.
_________ ___ ________ _______ ______.
____ _____ ___ __________ _______ ___ _____ ___ __________ _________ ___.
_________ ______ _________ _________ _________.
__________ _________ ________ __________ ____ __________ __________ ____ ______ _________ ____.
_______ _______ ________ _______ ______ ________.
Skip in 10
To solve the problem, we will apply Huffman coding to the given set of characters and their frequencies. The goal is to assign binary codes to the characters in such a way that the total number of bits is minimized. Here's how we can proceed step by step: ### Step 1: Sort the characters by frequency We begin by listing the characters along with their frequencies: | Character | a | b | c | d | e | f | |-----------|----|----|----|----|----|----| | Frequency | 50 | 30 | 20 | 12 | 5 | 3 | Sorted in increasing order of frequency: | Character | f | e | d | c | b | a | |-----------|----|----|----|----|----|----| | Frequency | 3 | 5 | 12 | 20 | 30 | 50 | ### Step 2: Build the Huffman Tree 1. Step 2.1: Combine the two characters with the lowest frequencies. - Combine `f (3)` and `e (5)` to create a new node with frequency `8`. We assign a binary code to these: `0`
____ ____ __________ ___ ___ __________ ____ _______ _____ __________.___ _________ ________ ___ _____.
______ ___ ____ __________ ________ _______ _________ ____ ___ ______ ______.
____ _____ __________ ____ _____ __________ _________ ___ ________.
___ ____ ________ __________ ________ _______ __________ _____.
____ _________ ___ ___ ____ ______ ____.
_________ _________ __________ ___ ____.
___ _________ _______ _____ _______ ____ __________ ______ _______.
______ ______ ___ ___ ________.
_________ _______ _______ ______ ___ ____ ____ ________ _______.
______ _________ __________ _______ _______ __________ ___ ___ ______.
___ ______ ________ _____ _________ ___ __________.
____ _______ __________ ____ ____ _____.
____ _____ _______ ________ _____ __________.
______ ______ ______ ______ ____.
_____ _____ ________ _____ _____ __________ ________ ____ _______ ______.
_______ ___ _________ _______ __________ _____ _____ _________ _________.
_______ __________ ___ ____ ______ ________ _____ ______ _______.
____ _____ ______ __________ ______.
_____ ____ _____ ____ ________ ________ _________.
____ __________ ______ ___ _________ _________ __________ _____ _______ ____.
_________ _______ ________ _______ _________ _______ ____ ________ __________ ___ _______ __________.
_________ ______ _____ ____ ___ ________.
_______ ______ __________ ____ _______ _____ _________ ________.
_________ ________ _____ __________ ________ __________ __________ ___ ____ _________ __________.
_________ ____ __________ _______ ________ ___.
_______ _____ _________ _________ _______ __________.
________ ____ ____ ________ ______ _______ _________.
_________ ____ _________ _______ ______ _______ ___ ______ ___ ________.
______ _____ _______ ___ _____ ____ ___ __________ ___ ____ ______.
_______ ___ ________ _______ _____ ___ _______ _________ ___ ________.
______ __________ ______ _____ _______.
________ __________ ___ ________ __________ ________ _____ _________ ___ _________.
___ __________ _________ _________ __________ ___ _____ ______ ______.
_______ _____ ___ ___ ____ ______ _________ ________ _______ __________ _____ _____.
____ _____ __________ _____ ____ _______ _________ _____ ___ _______.
_____ _____ __________ ____ ____ ________ _____ ____ _________ ________ _______.
___ _________ _________ ______ ____ _________ ___ ________ ____ _____ _______ __________.
______ _____ __________ _____ _______ _____ ___ __________ ____ ______ ________.
________ _____ ____ _______ _____ ______ __________.
_______ ___ ________ _____ __________ ____ _________ __________.
____ ______ __________ _______ ________ ________ __________ _________ ___ ___ __________.
____ _________ ____ _________ _________ __________ _________ ___.
______ _____ __________ _______ ________ __________ ____ _____ ______.
________ _______ _____ _______ _________ ____.
__________ ________ ________ ____ ____ ______ ______.
____ _________ ___ ___ ___ _______ ________ _____.
_________ ___ ________ _______ ______.
____ _____ ___ __________ _______ ___ _____ ___ __________ _________ ___.
_________ ______ _________ _________ _________.
__________ _________ ________ __________ ____ __________ __________ ____ ______ _________ ____.
_______ _______ ________ _______ ______ ________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.