バイナリ文字列の統計的ランダム性を判断するにはどうすればよいですか?
エルゴ、自分のテストをコーディングして、統計的ランダム性に対応する単一の値、0 から 1.0 までの値 (0 はランダムではなく、1.0 はランダム) を返すにはどうすればよいでしょうか?
テストは、任意のサイズのバイナリ文字列で機能する必要があります。
ペンと紙でそれを行う場合、次のような文字列を調べることができます:
0 (任意のランダム性、他の選択肢は 1 のみ)
00 (ランダムではなく、繰り返しであり、サイズに一致します)
01 (より良い、2 つの異なる値)
010 (ランダム性が低く、パリンドローム)
011
(ランダム性が低く、1 が多い、それでも許容範囲
)
ケース例:
サイズ: 1、可能性: 2
0: 1.0 (ランダム)
1: 1.0 (ランダム)
サイズ: 2、P:4
00: ?
01: 1.0 (ランダム)
10: 1.0 (ランダム)
11: ?
S:3, P:8
000: ? non-random
001: 1.0 (random)
010: ? less random
011: 1.0 (random)
100: 1.0 (random)
101: ? less random
110 1.0 (random)
111: ? non-random
And so on.
I feel that this may play a lot into breaking the string into all possible substrings and comparing frequencies, but it seems like this sort of groundwork should already have been done in the early days of computer science.