http://www.perlmonks.org?node_id=1233642


in reply to Re^3: Data compression by 50% + : is it possible?
in thread Data compression by 50% + : is it possible?

BrowserUk:

There are remarkably fewer combinations than it would appear at first glance. The OP creates a vector of four random digits (0..9), but then enforces a few rules:

As a result of those rules, none of the output groups will contain 0 or 1. So with the OPs script, you should never see the characters:

$ perl -e 'print join(" ", map { chr(33+$_), chr(33+$_+1) } map {10*$_ +} 0 .. 8)' ! " + , 5 6 ? @ I J S T ] ^ g h q r

That removes 18 of the 90 values, greatly reducing the number of possible records generated. Additionally, the remaining digits aren't equally distributed: 2 appears about half as often as 3 and about a third as often as 9.

...roboticus

When your only tool is a hammer, all problems look like your thumb.