Compute Probability Vector for Huffman Function (N=4bits)

  • Thread starter Thread starter ppp
  • Start date Start date
AI Thread Summary
To compute the probability vector for a source defined by the exponential function exp(-x) for use in a Huffman coding function with 4-bit symbols, the key is to determine the frequency of each symbol in the dataset. For a 4-bit representation, there are 16 possible symbols. The probability for each symbol is calculated by dividing the number of occurrences of that symbol by the total number of symbols in the sample data. An example illustrates this process, showing a sample data set and resulting in a probability vector where each entry corresponds to the frequency of each symbol. This approach provides the necessary probabilities to implement the Huffman coding function effectively.
ppp
Messages
1
Reaction score
0
My source is exp(-x) and I would like to compute the probability vector so as to use in huffman function for (N=4 bits).

[code,len]=Huffman(p)

May someone help me ?
I don't know hot can I find the probability vercto.

Thanks
 
Technology news on Phys.org
Lets say that you have n different symbols making up m symbols worth of sample data. The probability for each symbol is the number of occurances of n divided by m. The probability vector is just a vector of all of these probabilities (one for each symbol).

For 4-bit symbols you have 2^4 = 16 symbols. Suppose that you have the following trivial example:

0001 0010 0011 1000 1001 0011 0001

then the probability vector would be (column vector)

2/7
1/7
2/7
0
0
0
0
1/7
1/7
0
0
0
0
0
0

Hope this helps.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top