Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
117 lines (112 sloc) 4.71 KB
*** Probability is Not Given. Probability was calculated using frequency of each character in the given String.
Original String: "what are the indications for getting a digoxin level?"
------------------------------------------------------------------------
Symbol Frequency Probability Shannon-F Code ASCII Code
------------------------------------------------------------------------
' ' 8.0 0.1509 0000 100000
'a' 4.0 0.0755 0001 1100001
'c' 1.0 0.0189 0010 1100011
'd' 2.0 0.0377 0011 1100100
'e' 5.0 0.0943 0100 1100101
'f' 1.0 0.0189 0101 1100110
'g' 3.0 0.0566 0110 1100111
'h' 2.0 0.0377 01110 1101000
'i' 6.0 0.1132 01111 1101001
'l' 2.0 0.0377 1000 1101100
'n' 4.0 0.0755 1001 1101110
'o' 3.0 0.0566 1010 1101111
'r' 2.0 0.0377 10110 1110010
's' 1.0 0.0189 10111 1110011
't' 5.0 0.0943 1100 1110100
'v' 1.0 0.0189 1101 1110110
'w' 1.0 0.0189 1110 1110111
'x' 1.0 0.0189 11110 1111000
'?' 1.0 0.0189 11111 111111
------------------------------------------------------------------------
Efficiency before Compression: 49.0%
Efficiency after Compression: 82.0%
------------------------------------------------------------------------
*** Probability is Not Given. Probability was calculated using frequency of each character in the given String.
Original String: "what are the indications for getting a digoxin level?"
------------------------------------------------------------------------
Symbol Frequency Probability Huffman Code ASCII Code
------------------------------------------------------------------------
' ' 8.0 0.1509 110 100000
'a' 4.0 0.0755 1001 1100001
'c' 1.0 0.0189 111010 1100011
'd' 2.0 0.0377 10100 1100100
'e' 5.0 0.0943 001 1100101
'f' 1.0 0.0189 010011 1100110
'g' 3.0 0.0566 1000 1100111
'h' 2.0 0.0377 10101 1101000
'i' 6.0 0.1132 011 1101001
'l' 2.0 0.0377 11110 1101100
'n' 4.0 0.0755 1011 1101110
'o' 3.0 0.0566 0101 1101111
'r' 2.0 0.0377 11111 1110010
's' 1.0 0.0189 01000 1110011
't' 5.0 0.0943 000 1110100
'v' 1.0 0.0189 111000 1110110
'w' 1.0 0.0189 111001 1110111
'x' 1.0 0.0189 010010 1111000
'?' 1.0 0.0189 111011 111111
------------------------------------------------------------------------
Efficiency before Compression: 49.0%
Efficiency after Compression: 100.0%
------------------------------------------------------------------------
*** Probability is Given. We did not calculate the probability.
Original String: "what are the indications for getting a digoxin level?"
------------------------------------------------------------------------
Symbol Frequency Probability Shannon-F Code ASCII Code
------------------------------------------------------------------------
' ' 8.94 0.1686 0000 100000
'a' 3.4 0.0642 0001 1100001
'c' 1.16 0.0218 0010 1100011
'd' 1.68 0.0317 0011 1100100
'e' 5.46 0.1031 0100 1100101
'f' 1.1 0.0208 0101 1100110
'g' 0.81 0.0152 0110 1100111
'h' 2.48 0.0467 01110 1101000
'i' 3.05 0.0575 01111 1101001
'l' 1.7 0.0321 1000 1101100
'n' 3.04 0.0574 1001 1101110
'o' 3.35 0.0632 1010 1101111
'r' 2.57 0.0484 10110 1110010
's' 2.72 0.0514 10111 1110011
't' 4.22 0.0796 1100 1110100
'v' 0.44 0.0083 1101 1110110
'w' 0.93 0.0175 1110 1110111
'x' 0.07 0.0013 11110 1111000
'?' 0.92 0.0173 11111 111111
------------------------------------------------------------------------
Efficiency before Compression: 50.0%
Efficiency after Compression: 84.0%
------------------------------------------------------------------------
*** Probability is Given. We did not calculate the probability.
Original String: "what are the indications for getting a digoxin level?"
------------------------------------------------------------------------
Symbol Frequency Probability Huffman Code ASCII Code
------------------------------------------------------------------------
' ' 8.94 0.1686 111 100000
'a' 3.4 0.0642 1100 1100001
'c' 1.16 0.0218 00101 1100011
'd' 1.68 0.0317 10001 1100100
'e' 5.46 0.1031 011 1100101
'f' 1.1 0.0208 00100 1100110
'g' 0.81 0.0152 100001 1100111
'h' 2.48 0.0467 0011 1101000
'i' 3.05 0.0575 1010 1101001
'l' 1.7 0.0321 11010 1101100
'n' 3.04 0.0574 1001 1101110
'o' 3.35 0.0632 1011 1101111
'r' 2.57 0.0484 0100 1110010
's' 2.72 0.0514 0101 1110011
't' 4.22 0.0796 000 1110100
'v' 0.44 0.0083 1000001 1110110
'w' 0.93 0.0175 110111 1110111
'x' 0.07 0.0013 1000000 1111000
'?' 0.92 0.0173 110110 111111
------------------------------------------------------------------------
Efficiency before Compression: 50.0%
Efficiency after Compression: 100.0%
------------------------------------------------------------------------