title: How to find compression efficiency using Huffman encoding?
body: <p>I have compressed a binary file using Huffman encoding. Now I am trying to find the compression efficiency.</p>
  
  <p>In my binary file I have symbols (buch of 0 &amp; 1) and frequency (repetition of symbols).
  Suppose I have:</p>
  
  <ul>
  <li>symbol :0 freq : 173</li>
  <li>symbol :1 freq : 50</li>
  <li>symbol :2 freq : 48</li>
  <li>symbol :3 freq : 45 </li>
  </ul>
  
  <p>Currently every symbol is encoded in UInt64, so size of file would be (173+50+48+45)*8=2528 bytes if my way of calculating the size is correct. Please correct me if I am wrong. On debugging I get 2536, 8 more I don't know why?</p>
  
  <p>After compression I got encoding like this</p>
  
  <ul>
  <li>symbol : 0 Code : 1</li>
  <li>symbol : 1 Code : 00</li>
  <li>symbol : 2 Code : 011</li>
  <li>symbol : 3 Code : 010</li>
  </ul>
  
  <p>Could some one please tell me how to get Huffman compression of this binary file using these information? I tried searching on Google but there is no sample of binary file they have some frequency of float type which I am not able to understand how to relate them with my Binary file.</p>