29 ms·
Hmm. I also tried this with four bit codes: $ for x in $(seq 1 1600000); do \ echo $((RANDOM % 2))$((RANDOM % 2))$((RANDOM % 2))$((RANDOM % 2)); \ done
by kazinator 3y ago
Hmm. I also tried this with four bit codes:
$ for x in $(seq 1 1600000); do \
echo $((RANDOM % 2))$((RANDOM % 2))$((RANDOM % 2))$((RANDOM % 2)); \
done | awk '
{ hist[$0]++ }
END { for (code in hist) print code, hist[code] }'
0100 99668
0101 99832
0110 100026
0111 99837
0000 99899
0001 100451
0010 99846
0011 99980
1000 100246
1001 100182
1010 100116
1011 100383
1100 100014
1101 99470
1110 99535
1111 100515
Doesn't seem like anything deviates too much. If there were excessive runs of 1's and 0's, the 1111 and 0000 codes would be excessively frequent.