jcryptool / crypto

JCrypTool Crypto Plug-ins
https://www.cryptool.org
Eclipse Public License 1.0
68 stars 39 forks source link

Number shark: update optimal values #259

Closed simlei closed 4 years ago

simlei commented 5 years ago

Numbershark gets an update of optimal values See https://oeis.org/A019312

simlei commented 4 years ago

Found the sequence to appear here:

1) https://github.com/jcryptool/crypto/blob/0efc66a5c3d9c802ca2aaf9ec3cc16449534aab1/org.jcryptool.games.numbershark/src/org/jcryptool/games/numbershark/strategies/CalculationThread.java#L89

2) https://github.com/jcryptool/crypto/blob/0efc66a5c3d9c802ca2aaf9ec3cc16449534aab1/org.jcryptool.games.numbershark/src/org/jcryptool/games/numbershark/dialogs/EndOfGameDialog.java#L37

3) https://github.com/jcryptool/crypto/blob/0efc66a5c3d9c802ca2aaf9ec3cc16449534aab1/org.jcryptool.games.numbershark/src/org/jcryptool/games/numbershark/strategies/ZahlenhaiBestwerte.java#L1373

I fixed 2) For 1) and 3) I don't know how to set the accompanying values:

            /* 168,5290 */{ 8906, 72 },
            /* 169,5411 */{ 8954, 72 },
            /* 170,5411 */{ 9124, 73 },

The current state (with 2) fixed) is at https://github.com/simlei/crypto/tree/issue259 Contributions or pointers to how to set values for 1) and 3) welcome!

@be4 since you authored the OEIS entry, do you perhaps know which is the corresponding value to the optimal number in 3)? Thanks :)

simlei commented 4 years ago

For the record, quoted from be4:

Hier am Beispiel von n=168:
Bei dieser Anzahl Zahlen n sind insgesamt (nach der Gauss-Formel)  1/2 *
n * (n+1)  =  14.196 Punkte zu vergeben.
Wenn die optimale Punktzahl für den Spieler 8906 ist, dann bleiben dem
Hai 14196 - 8906 = 5290 Punkte.

Die 72 ist die Anzahl der Züge, die der User brauchte für diese optimale
Zahl.

All das erhält man in ff. Dialog angezeigt (wenn man auf die Ikone zur
Anzeige optimaler Strategien klickt -- rechts von der Neustart-Ikone):

Per Kontextmenü kann man sich in dem Dialog den Inhalt einer Zeile
rauskopieren:
168|8906|5290|167,121,143,91,161,133,119,115,155,145,125,93,159,141,129,123,111,106,166,158,146,142,134,122,118,75,165,99,153,117,81,135,164,148,124,116,92,76,152,147,105,98,70,110,154,88,56,140,112,100,80,160,128,150,138,114,102,136,90,162,78,130,104,156,132,108,84,168,126,120,96,144|28ms

Schaut man sich die 4. Spalte genauer an, steht da die Zugreihenfolge
mit 72 Werten:
167,121,143,91,161,133,119,115,155,145,
125,93,159,141,129,123,111,106,166,158,
146,142,134,122,118,75,165,99,153,117,
81,135,164,148,124,116,92,76,152,147,
105,98,70,110,154,88,56,140,112,100,
80,160,128,150,138,114,102,136,90,162,
78,130,104,156,132,108,84,168,126,120,
96,144

Was ich momentan nicht weiß ist, ob Hr. van Nek uns nur die optimalen
Werte (wie die 8906) oder auch die Zugreihenfolge lieferte.
- Wenn wir die Zugreihenfolge haben, können wir uns die Anzahl der Züge
(72) ja leicht selbst generieren.
- Haben wir die Zugreihenfolge nicht [...]?

We do not have the sequence of moves for every optimal number. There is code to generate it in the project; however, I am not familiar with it.

simlei commented 4 years ago

applying a solution from either heuristic or optimal does not work