home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!sdd.hp.com!elroy.jpl.nasa.gov!ames!pacbell.com!pacbell!osc!jgk
- From: jgk@osc.COM (Joe Keane)
- Newsgroups: comp.compression
- Subject: Re: Compression technique mentioned in PCW
- Summary: You can't win.
- Keywords: golden ratio
- Message-ID: <5704@osc.COM>
- Date: 20 Aug 92 03:14:52 GMT
- References: <1992Aug18.155518@sees.bangor.ac.uk>
- Reply-To: Joe Keane <jgk@osc.com>
- Organization: Versant Object Technology, Menlo Park, CA
- Lines: 31
- Weather: sunny, high 75, low 55
- Moon-Phase: waning gibbous (63% of full)
-
- In article <1992Aug18.155518@sees.bangor.ac.uk> mather@sees.bangor.ac.uk (Paul
- Mather) writes:
- >However, in the compression scheme mentioned in the letter, instead of
- >using a stout piece of oak :-), the decimal fraction was compressed by
- >determining two numbers, a and b, such that a/b = N. To transmit the
- >original file, one need only transmit a and b. Decompression would
- >involve calculating a/b and enumerating the result.
-
- >When my friend asked me what I thought of the proposed method, my gut
- >reaction was to say that finding the values of a and b sounded pretty
- >intractable to me. It also occurred to me that it was likely that for
- >some N the enumeration of the integers a and b could be longer than N
- >itself but my number theory is very rusty so I didn't speculate on that
- >to my friend. :-)
-
- This trick of turning decimals into rationals doesn't buy you much. Of course
- you should suspect that, since if it worked all the time, you would have a
- general method of compressing anything. The only exception i can think of is
- that if you know your digits string ends with a repeated pattern, then you may
- be able to get some gain. But then there are simpler ways to take care of
- this case.
-
- We want to find the smallest p and q such that p/q starts with a given string
- of digits. This is a simple exercise in continued fractions. You can look up
- theorems about approximating with rationals to see how big we expect p and q
- to be. The answer is that if you want to match N digits, the length of p and
- q will usually be around, surprise surprise, N/2.
-
- --
- Joe Keane, amateur mathematician
- jgk@osc.com (uunet!amdcad!osc!jgk)
-