professorhat:
In very simple terms, lossless compression works like this. Say I have a binary code which is 01010101 - I could compress this using an algorithm which says 014 - the algorithm knows that the 4 means 01 is repeated four times, so I've compressed 8 bits of information (8 numbers) down to 3 bits (3 numbers) for storage. When I want to read the data, I decode it using the algorithm and since it knows 014 means 01010101, I haven't lost any information.
On the other hand, if I have a binary code of 00111010, then I might compress this down to 0213010 - (i.e. 0 is repeated 2 times, 1 is repeated 3 times and 010 is left as is since there's no pattern). Since it's more complicated, I only managed to compress it down to 7 bits instead of 3 bits, but I used the same concept in the algorithm i.e. when the number is more than 1, it means the numbers in between are repeated that many times.
As I say, this is an incredibly simplified version, but it shows how you can get different compression rates depending on how clever the algorithm is and how complicated the data you are compressing is.
Thanks Proff and all.
No idea where this blind spot of mine has come from, but im getting there.