Challenge Version 2 – A General Purpose Random Compressor
Challenge 1 is interesting because it is nearly, but not assuredly impossible. Challenge 2 is more along the lines of troll bait, because it is patently impossible: create a system to compress and then decompress any file of size 415,241 bytes. In other words, create a compressed file that is smaller than the input, then use only that compressed file to restore the original data.
Unlike Challenge 1, there are no size limitations on Challenge 2. Your compressor and decompressor can be as large as you like. Because the programs have to be able to handle any input data, size is of no particular advantage – there is no data to hide.
This challenge is for the contestant who is sure that he or she has figured out a way to compress the million digit file, but finds that their program takes 100 MB of space. Okay, that’s fine, we shall first see if it can compress the file. It then must be able to correctly compress and decompress a file of the same size. Let’s say, on 1,000 different files.
To keep it simple, the files will be simple permutations of the million digit file – scrambled with an encryption system, or perhaps a random number generator, or whatever. The point is, they should have all the same numeric characteristics as the original file, just organized slightly differently.
Again, I will emphasize that Challenge 2 is at its heart provably impossible to beat. No program can compress all files of a given size, and the chances of any program being able to compress 1,000 different files of this length is so vanishingly small that it can safely be ruled out, even if every computer on earth was working on it from now until we are engulfed in flames during Sol’s red giant phase.
Moj Predlog:
Compression
1. Cut all leading bits whatever they are 0 or 1 (if in the begining there only zeroes cut all zeroes, if they are ones cut all ones from the beggining, if there is only one bit that kind cut that one bit) and the rest of the file save as compresed file under exstension cf1 (compresed file type 1)
2. There are 2 files lenght 451,241 where if you cut all same bits you wil cut whole file those are files containing only zeroes and file contains only ones, if it is such file just write 0 or 1 to determine which type of file is and save under extension cf2 (compressed file type 2)
Decompression:
1. If the first bit in compressed file is 1, then add as much zeroes to fill up to 415,241 bytes, If the very first bit in compressed file is 0 then add as much ones as you need to beggining of file to made up 415,241 bytes file
2. If file is under extension cf2 see what is in it 0 or 1, if it is 0 then make file 415,241 bytes all bits zero, if in compressed file is 1 then do the same but all ones.
I sad on gnjavi kako sam sakrio informacije
I am afraid that you are hiding information in the file system in two different ways.
First, using different file extensions to distinguish file types is very obviously using the file system to save one bit of information.
The second part is more subtle, but it relies knowing the size of the file. If you didn't know the size of the file your algorithm would fail.
A nisam jer je napisao ovo u uslovima challenga: Because the programs have to be able to handle any input data, size is of no particular advantage – there is no data to hide. i ovo: create a system to compress and then decompress any file of size 415,241 bytes.
I neće da isplati pošteno zaradjeni novac! :)