All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Shrink needed (Posted on 2006-10-18) Difficulty: 2 of 5
A file compressor is great for shrinking stored files, but it depresses me whenever I see a file grow instead of shrink. So what I am looking for is a file compression algorithm that never inflates any files, although it is allowed that some files (not all of course!) have the same length after "compression". Ideally it should work on files of all sizes, but I would be satisfied with a compressor that operates only on files larger than 1MB. Can you provide such an algorithm? No programming knowledge is required for this problem.

See The Solution Submitted by JLo    
Rating: 3.6667 (6 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Impossibility #2 | Comment 6 of 26 |
Another way of looking at it: consider the bijective zipper applied to files of N bytes. If some file can be compressed, it becomes a N' bytes long file.

Now, consider all N' bytes long files. We must be able to compress at least one of this files, which will become a N" bytes long file. (If not, we would have at least TWO different files becoming the same N' bytes long file.)

Proceeding this way, we must be able to compress at least one N" bytes long file... but since N> N'> N">... we must eventually reach 0... but a 0 length file cannot be compressed!

Since we started out assuming that no files would be expanded and at least one file could be compressed, and we reached an illogical conclusion, it follows that our initial idea was wrong.

  Posted by e.g. on 2006-10-18 13:29:35
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information