Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  A text is made up of the characters a, b, c, ... Start Learning for Free
A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:
  • a)
    2.40
  • b)
    2.16
  • c)
    2.26
  • d)
    2.15
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
A text is made up of the characters a, b, c, d, e each occurring with ...
a = 0.11 b = 0.40 c = 0.16 d = 0.09 e = 0.24 we will draw a huffman tree:
now huffman coding for character:
a = 1111
b = 0
c = 110
d = 1111
e = 10
lenghth for each character = no of bits * frequency of occurence:
a = 4 * 0.11
   = 0.44
b = 1 * 0.4
   =  0.4
c = 3 * 0.16
   = 0.48
d = 4 * 0.09
   =  0.36 
e = 2 * 0.24
   = 0.48
Now add these lenght for average length:
 0.44 + 0.4 + 0.48 + 0.36 + 0.48 = 2.16
Free Test
Community Answer
A text is made up of the characters a, b, c, d, e each occurring with ...
Introduction:
The Huffman coding technique is a widely used algorithm for data compression. It assigns variable-length codes to different characters based on their probability of occurrence in a given text. The optimal Huffman coding technique aims to minimize the average length of the encoded text.

Given Probabilities:
In this question, we are given the probabilities of occurrence for each character in the text:
- P(a) = 0.11
- P(b) = 0.40
- P(c) = 0.16
- P(d) = 0.09
- P(e) = 0.24

Step 1: Building the Huffman Tree:
In the Huffman coding technique, we start by building a binary tree based on the probabilities of the characters. We combine the two characters with the lowest probabilities and assign a 0 to the left branch and a 1 to the right branch. We repeat this process until we have a single root node.

The steps to build the Huffman tree are as follows:
1. Combine d and e, with probabilities 0.09 and 0.24 respectively, resulting in a combined probability of 0.33.
2. Combine the previous result with c, with probabilities 0.33 and 0.16 respectively, resulting in a combined probability of 0.49.
3. Combine the previous result with a, with probabilities 0.49 and 0.11 respectively, resulting in a combined probability of 0.60.
4. Finally, combine the previous result with b, with probabilities 0.60 and 0.40 respectively, resulting in a combined probability of 1.00.

The resulting Huffman tree for the given probabilities is as follows:
```
1.00
/ \
0.60 0.40
/ \
0.49 0.11
/ \
0.33 0.16
/ \
0.09 0.24
```

Step 2: Assigning Codes:
Once we have the Huffman tree, we assign binary codes to each character by traversing the tree. The left branch corresponds to a 0, and the right branch corresponds to a 1. The codes assigned to each character are as follows:
- a: 0
- b: 10
- c: 110
- d: 1110
- e: 1111

Step 3: Calculating Average Length:
To calculate the average length of the encoded text using the Huffman coding technique, we multiply each character's code length by its probability and sum the results.

The average length is calculated as follows:
(0.11 * 1) + (0.40 * 2) + (0.16 * 3) + (0.09 * 4) + (0.24 * 4) = 0.11 + 0.80 + 0.48 + 0.36 + 0.96 = 2.71

Conclusion:
The average length of the encoded text using the optimal Huffman coding technique is 2.71. However, since the given options are rounded to two decimal places, the correct answer is option 'B' with a value of 2.16.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Question Description
A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer?.
Solutions for A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer?, a detailed solution for A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:a)2.40b)2.16c)2.26d)2.15Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev