Newsgroups: comp.compression Path: utzoo!utgpu!cunews!dfs From: dfs@doe.carleton.ca (David F. Skoll) Subject: Re: IP gnitaluclaC rof margorP (Was Re: Program for Calculating PI) Message-ID: Sender: news@ccs.carleton.ca (news) Organization: Carleton University, Ottawa, Canada References: <28916@dime.cs.umass.edu> <24380001@hpdmd48.boi.hp.com> <1991Apr11.022122.26142@garfield.cs.mun.ca> Date: 12 Apr 91 14:28:14 GMT In <1991Apr11.022122.26142@garfield.cs.mun.ca> matthew1@garfield.cs.mun.ca (Matthew J. Newhook) writes: >I'd be inclined to say that you can compress pi by a considerable amount. >Ok... Assume 8 bits per byte. Storing, say, 1000 digits of pi would therefore >take up 8008 bits (1000 * 8 + 1 * 8, for the . in 3.14...). >Since we only get characters from 0-9 ignoring the . then we can encode >any digit in 4 bits. Like so... So, you're expressing Pi in BCD? Why not go whole hog and express it in straight binary, thus using somewhat under 4 bits per digit. But Pi is obviously immensely compressible - write a program to compute it to any desired accuracy. The length of such a program will be much less than the length of the closest approximation to Pi that it can compute on a decent computer. The whole issue of maximum compression possible is a very sticky one. Assuming that (for some reason!) you transmit Pi very (very!) often. Just make your compressors and decompressors very smart about generating Pi, use a Huffman code, and you can compress Pi down to 1 bit. (And that's about as good as it gets! :-)) -- David F. Skoll