-- Practice Final Thread
Team - 4: Vrinda and William
Q4. Give a concrete example involving your name of how a Canonical Huffman code might be written as a preamble to encoding a string.
Vrinda
Letter probabilities:
({'v'}, 1/6), ({'r'}, 1/6), ({'i'}, 1/6), ({'n'}, 1/6), ({'d'}, 1/6), ({'a'}, 1/6)
Preamble: ((‘v’, 000), (‘r’, 001), (‘i’, 010), (‘n’, 011), (‘d’, 1), , (‘a’, 11))
William:
Letter probabilities:
({'a'}, 1/7), ({'m'}, 1/7), ({'w'}, 1/7), ({'i'}, 2/7), ({'l'}, 2/7)
Combine {'a'} and {'m'}
({'w'}, 1/7), ({'i'}, 2/7), ({'l'}, 2/7), ({'a', 'm'}, 2/7)
Combine {'w'} and {'i'}
({'l'}, 2/7), ({'a', 'm'}, 2/7), ({'w', 'i'}, 3/7)
Combine {'l'} and {'a', 'm'}
({'w', 'i'}, 3/7), ({'l', 'a', 'm'}, 4/7)
Combine {'w', 'i'} and {'l', 'a', 'm'}
({'w', 'i', 'l', 'a', 'm'}, 1)
Preamble: ((‘w’, 00), (‘i’, 01), (‘l’, 10), (‘a’, 110), (‘m’, 111))
(
Edited: 2021-05-17)
Team - 4: Vrinda and William
Q4. Give a concrete example involving your name of how a Canonical Huffman code might be written as a preamble to encoding a string.
Vrinda
Letter probabilities:
({'v'}, 1/6), ({'r'}, 1/6), ({'i'}, 1/6), ({'n'}, 1/6), ({'d'}, 1/6), ({'a'}, 1/6)
((resource:Screen Shot 2021-05-17 at 2.32.29 PM.png|Resource Description for Screen Shot 2021-05-17 at 2.32.29 PM.png))
Preamble: ((‘v’, 000), (‘r’, 001), (‘i’, 010), (‘n’, 011), (‘d’, 1), , (‘a’, 11))
----
William:
Letter probabilities:
({'a'}, 1/7), ({'m'}, 1/7), ({'w'}, 1/7), ({'i'}, 2/7), ({'l'}, 2/7)
Combine {'a'} and {'m'}
({'w'}, 1/7), ({'i'}, 2/7), ({'l'}, 2/7), ({'a', 'm'}, 2/7)
Combine {'w'} and {'i'}
({'l'}, 2/7), ({'a', 'm'}, 2/7), ({'w', 'i'}, 3/7)
Combine {'l'} and {'a', 'm'}
({'w', 'i'}, 3/7), ({'l', 'a', 'm'}, 4/7)
Combine {'w', 'i'} and {'l', 'a', 'm'}
({'w', 'i', 'l', 'a', 'm'}, 1)
((resource:Screen Shot 2021-05-17 at 2.32.35 PM.png|Resource Description for Screen Shot 2021-05-17 at 2.32.35 PM.png))
Preamble: ((‘w’, 00), (‘i’, 01), (‘l’, 10), (‘a’, 110), (‘m’, 111))