How can compretion be possible?

  • Thread starter prysdieheer
  • Start date
In summary: PKZIP also allows for the use of a dictionary to encode phrases (LZ2 like) in addition to the other two methods.As compression algorithms improve, they become more complex and use multiple techniques in order to achieve the best compression possible. This involves analyzing the data and choosing the most efficient method for compressing it. Some algorithms, like PKZIP, use a combination of different techniques to compress different parts of the data. Overall, the goal of compression is to reduce the size of data in order to save storage space and make transferring data quicker and more efficient.In summary, compression is possible by identifying patterns and using techniques such as replacing frequently occurring characters with longer bit strings or using a combination of different methods. However, there is no algorithm
  • #1
prysdieheer
10
1
How can compretion be possible?

Since a 64bit integer can store 2^64 possible combinations and a 63bit integer can store 2^63 possible combinations and 64<63, how is it possible to compress anything?
::::::::::::::::::::::::::::::::::::::::::::

In love
Prys die Heer!
 
Technology news on Phys.org
  • #2


prysdieheer said:
Since a 64bit integer can store 2^64 possible combinations and a 63bit integer can store 2^63 possible combinations and 64<63, how is it possible to compress anything?
::::::::::::::::::::::::::::::::::::::::::::

In love
Prys die Heer!

Every compression algorithm actually increases the size of many inputs. They are useful because they decrease the size of the ones you are most likely to be using.
 
  • #3


Thank You Sylas, that is a very good answer, really helps me.
But I have one more question, do you think it is possible to compress things over and over again, because I think I know an algorithm that can( It also makes a very good sorting algorithm)
::::::::::::::::::::::::::::
In Love
Ashton
 
  • #4


prysdieheer said:
Thank You Sylas, that is a very good answer, really helps me.
But I have one more question, do you think it is possible to compress things over and over again, because I think I know an algorithm that can( It also makes a very good sorting algorithm)
::::::::::::::::::::::::::::
In Love
Ashton

If is a formal mathematical proof that there is no algorithm which compresses over and over again indefinitely. A good algorithm will normally (that is, on the inputs of interest) return a string that cannot be compressed a second time. If you have an algorithm that often compresses its input a second time, then the algorithm is not a good one for that class of inputs.
 
  • #5


prysdieheer said:
do you think it is possible to compress things over and over again, because I think I know an algorithm that can
I have an excellent algorithm that compresses any input into a single bit.
Unfortunately I haven't written the decompression algorithm yet.
 
  • #6


"I have an excellent algorithm that compresses any input into a single bit.
Unfortunately I haven't written the decompression algorithm yet."

I love you.
 
  • #7


To the OP:

The theory of compression is basically that, even though 2^64 different values are possible, in practice you use many fewer than these. If you're writing a letter in English, you probably use ~ 100 characters, tops. Also, some values occur more frequently than others. Using this information, you can replace frequently occurring characters with longer bit strings and vice versa, so it all works out in the end.
 
  • #8


prysdieheer said:
Since a 64bit integer can store 2^64 possible combinations and a 63bit integer can store 2^63 possible combinations and 64<63, how is it possible to compress anything?
::::::::::::::::::::::::::::::::::::::::::::

In love
Prys die Heer!

Some examples:

Instead of sending a document as letters, you can replace each word with a single number and use a lookup table to reconstruct the message along with a dictionary.

What if I want to send the string "00101011". This has 8 numbers, each number represented by a byte. But since I only used 2 different possible numbers, it could all be encoded as bits in a single byte.

What if I want to send "5555555566666666666" I could send that as 19 numbers, or I could send "8.5.11.6" which represents 8 fives followed by 11 sixes.

An audio file is a sequence of numbers representing the magnitude of the combined waveform at each instant in time. If it remains a constant pitch, then this will look like a sine wave. If you just send the parameters of the sine wave, you don't need to send an infinite number of magnitude measurements.. a music file can be compressed by extracting a bunch of waves which, when added together, recreate the original music. The same thing is done in JPEG images, but with colors.Compression uses these sorts of tactics
 
  • #9


mgb_phys said:
I have an excellent algorithm that compresses any input into a single bit.
Unfortunately I haven't written the decompression algorithm yet.

I have an excellent algorithm that compresses any input to half its size. I wrote it on the margin of a book somewhere. Unfortunately, I have compressed all my books, and now the margins look like everything else, and I can't find the algorithm again.
 
  • #11


sylas said:
There is no algorithm which compresses over and over again indefinitely.
Perhaps he meant an algorithm that iterates thorugh various schemes to find an optimal compressed encoding of data. pkzip and later compression algortihms do this, such as a check to see if huffman encoding of 8 bit values (bytes) is beneficial (text files are good for this scheme), in addition to choosing a huffman encoding table for lengths and offsets using a moving window (LZ1 like) compression algorithm.
 

1. How does compression work?

Compression is the process of reducing the size of a file or data without losing any information. This is achieved by encoding the data in a more efficient way, such as removing redundant or unnecessary information, or using mathematical algorithms to represent the data in a more compact form.

2. What are the benefits of compression?

Compression allows for more efficient storage and transmission of data, as it reduces the amount of space or bandwidth needed. This can save time and resources, especially when dealing with large amounts of data. Compression also helps to reduce costs, as less storage or bandwidth is needed.

3. Is it possible to compress any type of data?

Yes, compression can be applied to various types of data, including text, images, videos, and audio files. However, the level of compression and the methods used may vary depending on the type of data, as some types may be more compressible than others.

4. Can compressed data be recovered to its original form?

Yes, compression techniques are designed to ensure that the compressed data can be recovered to its original form without any loss of information. However, it is important to use reliable compression algorithms and to properly decompress the data to avoid any potential data loss.

5. Are there any potential drawbacks of compression?

One potential drawback of compression is the loss of quality in some types of data, such as images or videos, which may affect the overall user experience. In addition, compression can also add processing overhead, which may impact the performance of the system. It is important to carefully consider the trade-offs and choose the appropriate compression method for a specific use case.

Similar threads

  • Programming and Computer Science
Replies
32
Views
1K
  • Programming and Computer Science
Replies
3
Views
764
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
2
Replies
47
Views
3K
  • Calculus and Beyond Homework Help
Replies
8
Views
1K
Replies
9
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Programming and Computer Science
Replies
6
Views
989
  • Precalculus Mathematics Homework Help
Replies
3
Views
880
  • Programming and Computer Science
Replies
3
Views
1K
Back
Top