Live data from Hacker News

Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

chessboardjs.com

21–30 of 131 posts

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#21
post #2

Seems like it always queens pawns; I'd hoped to see some exciting random promotions :/.

This is also a fascinating phenomenon. To some of the moves really didn't look random -- but of course there were.

We imprint our own flawed notions of randomness on everything.

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#23
post #12
post #7

Because check mate is a very small subset of possible moves at the end game, I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. This assumes most games will make it past the hump of mid game where its possible the king's motion will be limited and a checkmate can erroneously happen, I suspect this is a rare case as well. On a side note I wonder what kind of useful…

I saw one game quickly become a lone white king against six black pieces. The king eventually captured three of them, and then the game gave up after some number of fruitless moves. Even with that advantage, black couldn't randomly stumble across checkmate.

Are you sure you didn't end with a stalemate?

That's what I got and I think once you get to the end, a stalemate with an imbalance of pieces on one side may be the most likely.

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#24
post #7

Because check mate is a very small subset of possible moves at the end game, I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. This assumes most games will make it past the hump of mid game where its possible the king's motion will be limited and a checkmate can erroneously happen, I suspect this is a rare case as well. On a side note I wonder what kind of useful…

> I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time.

Hah, that's what I got on my second run: http://i.imgur.com/joLf3BX.png

The game stopped right there, though.

Edit: Hah! Again! http://i.imgur.com/2ItU89S.png

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#25
post #16
post #11

Earlier quoted context omitted.

If it's impossible to checkmate then it's a stalemate. So if one side has one king and the other side one king (or even one king and a pawn, bishop, knight or rook) then it's a stalemate and the game ends. edit: forgot you can checkmate with just a king and a queen

Pawn wouldn't be stalemate because it can be promoted to a queen. I think it's also possible to checkmate with a rook + king (if you corner the king and have your king cover the escape route from check).

Yup, you're right! The algorithm works like this: (each "move" is an implicit "continue" in the pseudocode)

    while no checkmate:
        If your rook is about to be taken, move it to the other end of the current rank.
        If the enemy king is on rank n and your rook is anywhere but rank n-1, move your rook to rank n-1 (unless it can then be taken, in which case move it to the end of its current rank.)
        If your king is anywhere but rank n-2, move towards there.
        If your kings are on the same file, advance the rook to rank n (unless it can be taken...)
        If |file of your king - file of opponents king| is odd, make a wasted move with the rook (keeping it on the same rank).
        If you've gotten this far, move your king towards the opponent's king (staying on the same rank n-2).

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#26
post #7

Because check mate is a very small subset of possible moves at the end game, I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. This assumes most games will make it past the hump of mid game where its possible the king's motion will be limited and a checkmate can erroneously happen, I suspect this is a rare case as well. On a side note I wonder what kind of useful…

> I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. Hah, that's what I got on my second run: http://i.imgur.com/joLf3BX.png The game stopped right there, though. Edit: Hah! Again! http://i.imgur.com/2ItU89S.png

Yes, its because no other piece can take a king but a king can take all other pieces. The case for taking a king is actually quite rare!

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#27
Some interesting things happen here, the queens almost always seem to go first in my games (perhaps because of their freedom of movement they tend to end up in dangerous territory quickly). Also lots of pawn promotions make the mid-end games a lot more fun, although as the promotion is also random I've ended up with unwinnable endgames (e.g. two knights).

I don't play chess beyond knowing the rules, but this is a lot more fun than watching a tournament!

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#28
post #11
post #7

Because check mate is a very small subset of possible moves at the end game, I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. This assumes most games will make it past the hump of mid game where its possible the king's motion will be limited and a checkmate can erroneously happen, I suspect this is a rare case as well. On a side note I wonder what kind of useful…

If it's impossible to checkmate then it's a stalemate. So if one side has one king and the other side one king (or even one king and a pawn, bishop, knight or rook) then it's a stalemate and the game ends. edit: forgot you can checkmate with just a king and a queen

You can easily checkmate with a king and a rook, it just has to be along an edge of the board.

In rare circumstances you can checkmate with a king and a single bishop: http://www.chess.com/forum/view/more-puzzles/mate-with-one-b...

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#29
post #16
post #11

Earlier quoted context omitted.

If it's impossible to checkmate then it's a stalemate. So if one side has one king and the other side one king (or even one king and a pawn, bishop, knight or rook) then it's a stalemate and the game ends. edit: forgot you can checkmate with just a king and a queen

Pawn wouldn't be stalemate because it can be promoted to a queen. I think it's also possible to checkmate with a rook + king (if you corner the king and have your king cover the escape route from check).

[deleted]

Re: Chess: Who will win in this riveting game of Math.random() vs. Math.random()?

#30
post #7

Because check mate is a very small subset of possible moves at the end game, I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. This assumes most games will make it past the hump of mid game where its possible the king's motion will be limited and a checkmate can erroneously happen, I suspect this is a rare case as well. On a side note I wonder what kind of useful…

> I'm guessing the vast majority of games will end(?) with 2 kings moving around randomly for all of time. Hah, that's what I got on my second run: http://i.imgur.com/joLf3BX.png The game stopped right there, though. Edit: Hah! Again! http://i.imgur.com/2ItU89S.png

This is a drawn game according to the rules of chess, since checkmate is impossible.

Other draw conditions include:

* Stalemate (=The side to move has no legal moves)

* 50 moves in a row without any permanent changes happening ("permanent changes" means a pawn moving or a piece being captured)

* Exactly the same game state occurs for the third time ("game state" is whose turn it is + status of castling ability + status of en passant possiblity + which pieces are where)

* Agreed draw

Fun fact: In normal time controls (not blitz) at competitive levels, chess games virtually never end in one of the termination conditions. I don't have statistics on hand but I would expect resignations and agreed draws account for 98%+ of grandmaster-level games.

Post reply on HN