Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; ';-)': 0.03; 'algorithm': 0.04; 'granted,': 0.07; 'bits': 0.09; 'stored': 0.12; '"is': 0.16; '-tkc': 0.16; 'bit.': 0.16; 'compression': 0.16; 'extension.': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'janssen': 0.16; 'length.': 0.16; 'subject: \n ': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'byte': 0.24; 'header:In-Reply- To:1': 0.27; "doesn't": 0.30; 'waste': 0.30; 'program,': 0.31; 'piece': 0.31; 'subject:that': 0.31; 'file': 0.32; 'could': 0.34; 'test': 0.35; 'but': 0.35; 'charset:us-ascii': 0.36; 'generic': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'entire': 0.61; 'information,': 0.61; 'information': 0.63; 'cheating': 0.84; 'received:50.22': 0.84 Date: Mon, 4 Nov 2013 07:08:03 -0600 From: Tim Chase To: python-list@python.org Subject: Re: Algorithm that makes maximum compression of completly diffused data. In-Reply-To: References: <205bfa4f-29de-43de-be5a-72a12d77d0c9@googlegroups.com> <5275c065$0$29972$c3e8da3$5496439d@news.astraweb.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383570396 news.xs4all.nl 16000 [2001:888:2000:d::a6]:42279 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58442 On 2013-11-03 19:40, Mark Janssen wrote: > But you cheated by using a piece of information from "outside the > system": length. A generic compression algorithm doesn't have this > information beforehand. By cheating with outside information, you can perfectly compress any one data-set down to 1 bit. Just store the data in the program, then store 1 bit of "is this file the data we have stored in the program?". Granted, in modern OSes, you waste 7 extra bits since they require you to write an entire byte at a time. :-) And with that, you could even have an empty file and test for a file extension. ;-) -tkc