Who wins in this tic-tac-toe game?

Question sourced from Brilliant.org

Jack and Jill are playing Tic-Tac-Toe, with Jack being Os and Jill being Xs. Now, being perfectly logical beings narrow-minded one-move-foresight beings, they move following these rules:

1. If it is possible to win immediately, then WIN!

2. If the opponent is about to win immediately, then BLOCK them (if they have multiple wins available, choose randomly)

3. Otherwise, move randomly

So, who wins?

• @downvoter why the downvote? This seems to be a perfectly valid puzzle Dec 18 '17 at 1:55
• I suspect the down vote is because this puzzle appears at first glance to be trivial. It takes some thought to realise it is a genuine puzzle (and a good one!). Dec 19 '17 at 18:33

The winner is:

Jill (the one with Xs).

Because:

If Jack starts first then, Jack's first two moves will be one of these:

In both A and B, the first rule is broken, because Jack could've placed his third O at the top-right or the bottom-right squares, respectively, to win. But he didn't.

As for C, we know that Jill first two moves, with Jack's moves from C above, will be one of these:

A: Jack next O should block Jill from winning. The blocking should occur if Jack placed the O at the top-right square. Since he didn't, the second rule is broken.
B: Jack should put his next O at the top-middle square to win. He didn't and so the first rule is broken.
C: Jack will put his next O at the bottom-left square, Jill should block him by placing her next X at the top-right square. She didn't and so the second rule is broken.

Conclusion:

There is no scenario where Jack plays first and the rules don't get broken. So it must be Jill who started this, and so she will win (because it's her turn).

NOTE: I actually made a list of all scenarios (green ones mean OK, red ones mean not OK) to check whether the other assumption is also true. It is true, and the only scenarios that follow the rules are these four:

Jill (X) will win as she went first

.

At least this is the only sequence I got :)

I assume they play to win while putting X and Os:

Jill is supposed to win

Because,

Jill has started to put X first as shown below.

The reason is

If O was started to play, he would have won already after the third move whatever Jill played to block or win.

To explain it more:

Firstly,

In the example above, if Jack would have started to play on this corner, whereever Jill puts his X, Jack would put his O in the yellow part and would have forced Jill to put her X on the right hand side of the board so it is impossible.

Secondly,

Let's assume Jack put his O in the middle first, his second move cannot be the yellow one as explained before, so his next move could only be Green square.

For the green sqaure:

After Jack puts his O to the green square (3,2), Jill will have to put her X to (1,2) if she did not put it already, but it does not matter. If she already put it there, Jill's next move will have to be (2,1) not to force Jack to put his O to the (1,3). So after that, Jack would put his O to (3,1) and this will force Jill to put his X to (1,3) or (3,3) which was not the case. I will not explain the third possibility since it is very obvious.

So the play could be like below and for sure

Jill won this game as the next player would be her.

Animated play:

Whomever moves next, wins. What's the puzzle? OK Assuming what needs to be assumed. We don't know who moved first, so we assume one and see if it leads to a contradiction.

In fact we assume X just moved. Now clearly X just moved to top row, centre column, because either of the other two moves violates "block opponent if you can". Then O's last move is a contradiction, because whichever one it was, he could have won instead. So O moved last, and X wins.

• But who is the person who moves next? You will have to figure out who had the first move. Dec 17 '17 at 11:06
• Must be X to move. If X just moved it must have been to top centre, and O would have had a win on the previous move. Dec 17 '17 at 11:53
• This is the best answer as it does an analysis why X must have played first. If O played first it would already have won. You should add this to your answer. (By the way, let's forget that X always plays first in a tic-tac-toe game.)
– dr_
Dec 17 '17 at 17:29