Understanding Huffman Code and Symbol Encoding - Explained Simply

  • Thread starter *Jas*
  • Start date
  • Tags
    Code
In summary, the conversation is about someone seeking help with understanding a question about the Huffman code and the average length of an encoded symbol. They have provided the symbols and frequencies for the problem and have drawn a tree for the code. They are unsure about the bits to use for each symbol and have received a warning about opening a "doc" file from someone they don't know.
  • #1
*Jas*
Huffman code?!?

Hi there!:smile:

Im having abit of trouble getting my head around this question concerning the Huffman code,the average length of an encoded symbol etc...
:confused:
the full question is attached!...help would be v. much appreciated!
 

Attachments

  • huffman_code.doc
    33.5 KB · Views: 288
Physics news on Phys.org
  • #2
You should be aware that most people will not open a "doc" file from someone they don't know. They area notorious for having viruses.
 
  • #3
The virus risks are overstated (that, and I'm using OOo not Word).

The problem reads:
"Consider the symbols and frequencies:
[itex]e:0.36\;\;a:0.14\;\;d:0.26\;\;s:0.24[/itex]

(a) Find the Huffman code, and the average length of an encoded symbol.
(b) Give another prefix code for the symbols a, e, d, s. Compare the average lengths of an encoded symbol for the two codes."

So, what have you done on the problem so far? Seems straightforward enough to me.
 
  • #4
So far iv drawn the tree for the code concerned (attached image!)...however I am not sure whether it looks correct?? I am not sure about the bits in red?!?

im not sure which of the following to use:

d: 100
a: 101
s: 110
e: 111

or

e: 0.36 - 0

d: 0.26 - 10

s: 0.24 - 110

a: 0.14 - 111
 

Attachments

  • huffman.jpg
    huffman.jpg
    7.1 KB · Views: 444
  • #5
dis is wrong u shuld dissconect from the site. u dnt deserve 2 be on the the website
 

1. What is Huffman code and symbol encoding?

Huffman code and symbol encoding is a lossless data compression technique that assigns variable-length codes to symbols based on their probability of occurrence in a given input. It is commonly used in file compression to reduce the size of data without losing any information.

2. How does Huffman code and symbol encoding work?

Huffman code and symbol encoding works by first analyzing the input data and creating a frequency table of the symbols. Then, a binary tree is created by combining the two least frequent symbols into a parent node until all symbols are included in the tree. The resulting codes are then assigned to each symbol based on their position in the tree.

3. What are the benefits of using Huffman code and symbol encoding?

The main benefit of using Huffman code and symbol encoding is that it can significantly reduce the size of data without any loss of information. This makes it ideal for compressing large files and improving data transfer speeds. Additionally, it is a relatively simple and efficient algorithm, making it widely used in various applications.

4. What are some common applications of Huffman code and symbol encoding?

Huffman code and symbol encoding is commonly used in file compression, such as in ZIP files, JPEG images, and MP3 audio files. It is also used in data transmission and storage, as well as in encryption and error correction algorithms.

5. Are there any limitations or drawbacks to using Huffman code and symbol encoding?

One limitation of Huffman code and symbol encoding is that it requires a prior analysis of the input data to create the optimal coding scheme. This means that it may not be suitable for real-time applications where the data is constantly changing. Additionally, the compression may not be as effective for data with a high level of randomness or for files with a small size.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
932
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
Replies
11
Views
2K
  • Mechanical Engineering
Replies
2
Views
709
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
5K
  • Mechanical Engineering
Replies
6
Views
273
  • General Math
Replies
6
Views
2K
  • Programming and Computer Science
Replies
3
Views
307
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
Back
Top