Show HN: Play rock paper and scissors against a untrained neural network
github.com
github.com
The code updates x and y, then trains the model, and then makes a prediction. “Fair” code would make a prediction, then update x and y and train the model
This explains the behavior mentioned in the comments where the computer gets an impressive early lead due to the players next move being one of only a few datapoints it learns from, then backs off to a more plausible advantage as the leaked data is diluted by past data.
The young economist looks down and sees a $20 bill on the street and says, “Hey, look a twenty-dollar bill!”
Without even looking, his older and wiser colleague replies, “Nonsense. If there had been a twenty-dollar lying on the street, someone would have already picked it up by now.”
(99% joke and snark. Of course this isn't going to work on the stock market, but that kind of efficiency argument isn't perfect.)
There's a great deal of people who seem to mistake "the market isn't actually 100% efficient" for "oh, I guess we can just ignore the question of 'efficiency because if it's not 100% it must be 0%". Not that they say the last part out loud, of course.
This is kind of a shot in the dark because I am not familiar with RPS strategy, but I think it makes sense.
I am under the impression that you can't game random -- unless you are aware of the random generator being used is broken..
I'm unaware of the name of the property that RPS exhibits that makes it ungameable by a random opponent (zero-sum?) but ordinary RPS played by humans certainly doesn't exhibit it, only in the magic world of computers where things like simultaneity of play can be guaranteed does RPS exhibit that property.
If played in the real world like real humans traditionally played it, ongoing RPS matches between a human and an AI would soon see the AI dominating. I'd be very curious to see what real-world RPS would look like between two AIs that can 'explain their model'.
Imagine making a rule that gives a Xms window for making plays. Then strategy can start to emerge.
I thik it was already pointed out but I have not had a chance to verify. This game uses your played move in tht training set to train before making it's predictions.
If the players rolled dice and biggest roll wins, that's a game of chance. The dice can't pick how they're thrown, nor can the throwers influence the outcome. If either of those two things change, the game is no longer purely one of chance.
The game can be set up in many ways that invite strategy. If they set up a camera and watched the human playing out the moves physically, that lets the algorithm read the person's patterns the way a human might read someone's poker tell.
Which is the point of this thread. Random vs AI.
The entire point of this thread is that some of use pitted random vs this AI. And tht AI is winning more often than it should. Zero humans were involved.
Which brings us back to you can't game random.
Games with complete information (eg noughts and crosses, chess, go etc) have "pure strategies" (ie randomness is not required and there should always be an absolute best move in any given situation which you should pick 100% of the time).
Here's an intro to the concept of Nash equilibrium in mixed strategies http://www.econport.org/content/handbook/gametheory/useful/e...
Edit: In case it's not clear, the hidden information in RPS is the opponent's move. Whereas in chess you are either starting the game or you know what the opponent has done, in RPS you move simultaneously with the opponent, so don't know their move.
You’re essentially saying that a good neural network can predict the next value of a good random number generator. Good luck with that one!
Maybe while you’re at it, have neural networks invert cryptographically secure hash functions :)
I’m basically suggesting a predictable distribution can be exploited in RPS.
Honestly, the bot could always be winning against the RNG by dumb luck. More experimentation would be needed to be sure. I am just making guesses.
With a random choice, the chance of playing the same choice in a row is 1/3. This does not give you any advantage over having no information (where each choice has a 1/3 chance.)
I think the misunderstanding is in > a randomizer has pretty even distribution
Having an even distribution over a long time does not make any specific choice less random. https://en.wikipedia.org/wiki/Gambler%27s_fallacy
How is this possible? Nothing is physically changing about the dice between rolls.
No.
A good random distribution actually gives more and longer runs than a human trying to appear random.
500 plays - Player: 144, Computer: 179, Tie: 177
1000 plays - Player: 325, computer: 359, tie: 316
https://gist.github.com/mbrumlow/49f0a3fa311cc3002e4e1fae2e2...
const times = 1000;
function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
async function run() { for (let i = 0; i < times; i++) { await sleep(10); play(Math.floor(Math.random()*3)); } }
run();
for(i=0; i<100; i++) { play(Math.floor(Math.random()*3)) }
Right in the JavaScript console.
500 plays - Player: 163, Computer: 179, Tie: 158
1000 plays - Player: 306, Computer: 365, Tie: 329
I've run it several times and the computer has won every time against random, it must have an unfair advantage.
Not sure a bigram or trigram model would not do better than the neural network.
I can’t fully put my head around this, but what would it be like if each AI could read the architecture of the other’s brain before each move. The AI’s would be permitted to reconfigure themselves as they play. An “obvious” strategy may be to simulate your opponent and ask what they are likely to play. Though, simulating their behavior is likely to involve you simulating someone else simulating your behavior, ad-infinium, until your computing resources bottom out. It is like fighting the man in the mirror who can choose to mirror you or not.
day | visits | pages | hits | bytes
26 Jul 2019 | 4,688 | 16,507 | 60,489 | 163.89 MB
Not enough trials or is there something else going on here?
1. Humans aren't good at random, try using a RNG or dice.
2. If you toss 10 coins, what is the probability of 5 heads and 5 tails? It isn't very likely, even though it's the most likely outcome.
Player: 144, Computer: 179, Tie: 177,
Although I think I got more equal results when I did 1000 iterations, but failed to record that one.
I was right.