Monday, February 27, 2006

Information bits in permutations

perl -lwe 'for $i ( 1 .. 10 ) { for $j ( 1 , $i .. $i + 3 ) { $v = $i * $j ; $s = 0 ; for ( 1 .. $v ) { $s += log ( $_ ) } $s /= log ( 2 ) ; print "$v $s" } }' | sort -nu

10
21
32.58496250072116
44.58496250072116
56.90689059560852
69.49185309632968
712.2992080183873
815.2992080183873
918.4691330198296
1021.791061114717
1228.8354552340754
1540.2501404698826
1644.2501404698826
1852.5075283125753
2061.0773839209062
2479.0376574191005
2583.6815136088752
2897.9441957512373
30107.709067341973
35132.924403629914
36138.094328631356
40159.159039824179
42169.908909251575
48202.9495720297
49208.564281873815
54237.063811080429
56248.652525716012
63289.995143941724

No comments :