10.07.2015 Views

Information Theory, Inference, and Learning ... - Inference Group

Information Theory, Inference, and Learning ... - Inference Group

Information Theory, Inference, and Learning ... - Inference Group

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Copyright Cambridge University Press 2003. On-screen viewing permitted. Printing not permitted. http://www.cambridge.org/0521642981You can buy this book for 30 pounds or $50. See http://www.inference.phy.cam.ac.uk/mackay/itila/ for links.136 7 — Codes for Integersn c ω (n) n c ω (n) n c ω (n) n c ω (n)1 0 9 1110010 31 10100111110 256 11100010000000002 100 10 1110100 32 101011000000 365 11100010110110103 110 11 1110110 45 101011011010 511 11100011111111104 101000 12 1111000 63 101011111110 512 111001100000000005 101010 13 1111010 64 1011010000000 719 111001101100111106 101100 14 1111100 127 1011011111110 1023 111001111111111107 101110 15 1111110 128 10111100000000 1024 1110101000000000008 1110000 16 10100100000 255 10111111111110 1025 111010100000000010SolutionsSolution to exercise 7.1 (p.134). The use of the end-of-file symbol in a codethat represents the integer in some base q corresponds to a belief that there isa probability of (1/(q + 1)) that the current character is the last character ofthe number. Thus the prior to which this code is matched puts an exponentialprior distribution over the length of the integer.Table 7.5. Elias’s ‘universal’ codefor integers. Examples from 1 to1025.(a) The expected number of characters is q+1 = 256, so the expected lengthof the integer is 256 × 8 ≃ 2000 bits.(b) We wish to find q such that q log q ≃ 800 000 bits. A value of q between2 15 <strong>and</strong> 2 16 satisfies this constraint, so 16-bit blocks are roughly theoptimal size, assuming there is one end-of-file character.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!