3 ms·
By using "1" for left (lastKey = 0) and "0" for right (lastKey = 1), I get 12%. A de Bruijn sequence DB(2, k) is spelled by an Eulerian path in the correspondi
by sebhtml 8y ago
By using "1" for left (lastKey = 0) and "0" for right (lastKey = 1), I get 12%.
A de Bruijn sequence DB(2, k) is spelled by an Eulerian path in the corresponding de Bruijn graph, whose vertices are {0, 1}^k and where any arc (x, y) has the following property: x[2..k] == y[1..k-1].
Obviously, there are as many Eulerian paths as there are de Bruijn sequences.
Each such de Bruijn sequence has a different capability at getting a good score at the game "https://www.expunctis.com/2019/03/07/Not-so-random.html" https://www.expunctis.com/2019/03/07/Not-so-random.html".
diff --git a/not-so-random.html b/not-so-random.html
index 48c04da..168a287 100644
--- a/not-so-random.html
+++ b/not-so-random.html
@@ -169,8 +169,12 @@
randomHelpFunc = function(evt) {
evt.preventDefault();
//document.onkeydown = null;
- for (let i = 0; i<10; i++) {
- lastKey = Math.round(Math.random());
+
+ // db(2, 6)
+ var inputString = "0000001000011000101000111001001011001101001111010101110110111111";
+
+ for (let i = 0; i< inputString.length; i++) {
+ lastKey = inputString[i] == "0" ? 1 : 0;
testPrediction();
updateAll();
predictNext()
- dcbadacd 8y agoHow to find which sequence is the best?