Arithmetic Coding
We get a group of symbols and probabilities for each of the symbols to show up in our code and want to calculate the encoding of a word, For example:
We want to encode the word “hi” with the symbols:
{a=0.2, h=0.5, i=0.05, t=0.25}.