Comments about "Tic tac toe or Nought and Crosses" in Wikipedia
This document contains comments about the article Tic tac toe or Nought and Crosses in Wikipedia
- The text in italics is copied from that url
- Immediate followed by some comments
In the last paragraph I explain my own opinion.
Contents
Reflection
Introduction
The article starts with the following sentence.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
1. Gameplay
-
In the following example, the first player (X) wins the game in seven steps:
| |X O| |X O| |X O| |X O| |X O| |X O| |X
----- ----- ----- ----- ----- ----- -----
| | | | | | |O| |O| |O|O O| |O
----- ----- ----- ----- ----- ----- -----
| | | | X| | X| | X| |X X| |X x|x|X
|
Game of Tic-tac-toe, won by X
Okay.
-
-
Because of the simplicity of tic-tac-toe, it is often used as a pedagogical tool for teaching the concepts of good sportsmanship and the branch of artificial intelligence that deals with the searching of game trees.
-
This is also an argument that playing tic-tac-toe against a computer is not: artificial intelligence
The simple reason is that the intelligence of the program is the same as that of the human who develloped the computer program based on the search or learning algorithm.
-
-
-
-
-
-
2. History
-
-
-
-
-
-
-
-
-
-
3. Combinatorics
-
-
-
-
-
-
-
-
-
-
4. Strategy
-
-
-
-
-
-
-
-
-
-
4.1 Further details
-
-
-
-
-
-
-
-
-
-
5. Variations
-
-
-
-
-
-
-
-
-
-
6. English names
-
-
-
-
-
-
-
-
-
-
7. In popular culture
-
-
-
-
-
-
-
-
-
-
8. See also
Following is a list with "Comments in Wikipedia" about related subjects
Reflection 1 - The evolution of AI using the game Tic-toc-toe
Consider I have just written my first Tic-tac-toe program. This program is a simulation of the Tic-tac-toe game.
This program of course can be played by two persons, but it also can be played in computer mode. That means the sets played are decided by the program.
Our next step is to test the program.
- In the first test 2 players are going to play the game 100 times. The assumption is that both players have no experience with the game. The result is undecided. Both players will almost win the same number of games.
- In the second test is in full computer mode. That means sets of each players are performed by a computer. The game is played 100 times.
Also in this case, the result is undecided. This is easy to explain because the strategy for each player i.e. the computer program, is identical.
- In the third test is in semi computer mode. That means one player is replaced by the computer. Again the game is played 100 times.
In this case there is a clear winner: The player wins more times than the computer. What is the reason?
The general reason is that the player slowly learns while the strategy of the computer stays the same i.e. the computer does not learn.
There are two strategies to consider: from the computer and from the player.
- The strategie from the computer is simple: each time the computer will play an arbitrary or random set.
- The strategie from the player is in the beginning the same: initial he or she will play a random move, but slowly the player will remember what was played before and will try not to repeat loosing sets.
To understand it is important what this means.
-
From an experimental point of view: the player sometimes realizes, from a specific situation, that he has a choice between two posibilties, but what ever he does the computer will win in his next selection. You can call that a winning strategy from your oponent point of view.
- That means, he, himself, also should also try to use such a winning strategy. That is an important lesson.
- He can also try to in his previous set to prevent that the computer uses such a winning strategy.
- From a more mathematical point of view:
When the player starts he has to perform 5 moves i.e. move #1, #3, #5, #7 and #9.
In the case of move #9, 8 fields are already occupied. There is actual no choice, and the game is finished
In the case of move #7 there are 3 choices. The player should try each of these three moves and observe if there is a winning move. If there is none than he has to change set #5.
In the case of set #5 there are 5 choices. etc
This describes the manner the player learns and improves his chance of winning.
For the computer this is different, the startegy used is always the same; a computer cannot learn. In order to improve his chance: a programmer or a team has to modify the strategy of the program i.e. the algorithm.
Such an algorithm has to be tested. Again it is a team which has to supervise this testing.
Reflection 2 - Intelligence of a computer
Game 1
The central question is: How intelligent is a computer.
The issue is that a computer is not intelligent. What can be called intelligent is the person or team that develloped the program, used by the computer, to perform a certain task. And if we agree with that definition than the computer can never be more intelligent the team that created and tested the program.
One strategy of the program can be what is called a learning algorithm. In the case when such a program is used the program learns from its own mistakes every time when the program is executed. This is done by storing the final sets when the computer looses the game, in what I call: an exception list. The set which the computer plays, after which his oponent wins is called: the loosing set. That means when the players repeat the game and perform the same sets when the computer is supposed to perform a loosing set he will do something different.
Consider the following game of tic tac toe:
All the sets are performed by player 1 or player 2
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 | | | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1|2 2|1|2 | | | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | | | 1| | | | | |
1 2 3 4 5 6 7 8 9
|
Player 1 wins
There are two ways to describe this game:
As 9 numbers of bord displays: | 100000000 120000000 121000000 121200000 121210000 121212000 121212100 000000000 000000000 |
As 9 numbers to describe the order-of-sets: | 100000000 120000000 123000000 123400000 123450000 123456000 123456700 000000000 000000000 |
The first task is to write a program called WIN to calculate if there is a winner.
This program will declare all 5 bord displays:
1|1|1 | | | | 1| | | |1
----- ----- ----- ----- -----
| | 1|1|1 | | |1| |1|
----- ----- ----- ----- -----
| | | | 1|1|1 | |1 1| |
1 2 3 4 5
|
which can also described as: 111000000, 000111000, 000000111, 100010001 and 001010100, that player 1 wins.
This is set 7 (in red). That means set 6 by player 2 was wrong.
The computer (i.e. player 2) will learn from this wrong move and store the order-of-sets: 1234500000, 123456000 and 123456700 in a exception list.
- The first order-of-sets 123450000 (121210000) is by player 1 and should warn player 2
- The second order-of-sets 123456000 (121212000)is by player 2 and shows him set #6 he should not perform. This is the the loosing set.
That means player 2 should either perform 123457000 or 123458000 or 123459000, i.e. the set indicated by the red number.
- The third order-of-sets in red 123456700 (121212100) is by player 1 and shows the final situation when player 1 wins.
Game 2 Continuation
Game 2 is a repetition of game 1.
Set #6 is played by the computer.
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1| 2|1|
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | 2| | 2| |1
1 2 3 4 5 6 7 8 9
|
Player 1 wins again
There are two ways to describe this game:
As 9 numbers of bord displays: | 100000000 120000000 121000000 121200000 1212100000 121210200 121210201 000000000 000000000 |
As 9 numbers to describe the order-of-sets: | 100000000 120000000 123000000 123400000 1234500000 123457000 123457900 000000000 000000000 |
Again the subprogram WIN will calculate that player 1 will win
The computer program (i.e. player 2) will learn from this wrong move and store the order-of-sets: 1234500000, 123457000 and 123457900 in a exception list.
- The first order-of-sets 123450000 (121210000) is by player 1 and should warn player 2
- The second order-of-sets 123457000 (121210200)is by player 2 and shows him set #6 he should not perform.
- The third order-of-sets in red 123457900 (121210201) is by player 1 and shows the final situation when player 1 wins.
What that means is that set #4 is wrong.
This means that also the order-of-sets 123000000, 123400000, 1234500000 wil be stored in the exception list.
Game 3 Continuation
In the next game in set #4 the computer plays instead of 123400000 the order-of-sets 12350000.
In set #2, #6 and #8 it is player #2
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | |2| |2| 2|2| 2|2|1 2|2|1 2|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | |1| |1| |1| 2|1| 2|1|1
1 2 3 4 5 6 7 8 9
|
There are two ways to describe this game:
As 9 numbers of bord displays: | 100000000 120000000 121000000 121020000 121020010 121220010 121221010 121221210 121221211 |
As 9 numbers to describe the order-of-sets: | 100000000 120000000 123000000 123500000 123580000 123584000 123584600 123584670 123584679 |
In this case player 1 wins. The loosing set is #8.
This means that also the order-of-sets 123584600, 123584670, 123584679 wil be stored in the exception list.
Game 4 Continuation
Game 4 is the repetition of Game 3.
The sets #4 and #8 are played by the computer
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | |2| |2| 2|2| 2|2|1 2|2|1 2|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | |1| |1| |1| |1|2 1|1|2
1 2 3 4 5 6 7 8 9
|
The final result is a draw.
As 9 numbers of bord displays: | 100000000 120000000 121000000 121020000 121020010 121220010 121221010 121221210 121221112 |
As 9 numbers to describe the order-of-sets: | 100000000 120000000 123000000 123500000 123580000 123584000 123584600 123584670 123584697 |
Game 2 Continuation 1
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1| 2|1|1 2|1|1 2|1|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | |2| |2| |2|2 1|2|2
1 2 3 4 5 6 7 8 9
|
Game 2 Continuation 2
In the above game the order-of-sets is 100000000 120000000 123000000 123040000 123040050 123640050
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1| 2|1|1 2|1|1 2|1|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | | |2 | |2 2| |2 2|1|2
1 2 3 4 5 6 7 8 9
|
As 9 numbers of bord displays: | 100000000 120000000 121000000 121200000 1212100000 121210020 121212100 121211220 121211221 |
As 9 numbers to describe the order-of-sets: | 100000000 120000000 123000000 123400000 1234500000 123450060 123457060 123457860 123457869 |
1| | 1| |2 1| |2 1| |2 1| |2 1| |2 1|1|2 1|1|2 1|1|2
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | |1| |1| |1|1 2|1|1 2|1|1 2|1|1 2|1|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | |2 | |2 | |2 |2|2 | |2 | |2
|
In this example player 1 is the computer
1| | 1| |2 1| |2 1| |2 1| |2 1| |2 1| |2 1| |2 | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | |2| |2| 2|2| 2|2| | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | |1 | |1 | |1 1| |1 1| |1 1| |1 | |
|
Reflection 3
Reflection 4 - Intelligence of a computer = player 1 - under construction
Game 1
Consider the following game of tic tac toe:
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 | | | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1|2 2|1|2 | | | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | | | 1| | | | | |
|
Player 1 wins
There are two ways to describe this game:
As 9 numbers of bord displays: | 100000000 120000000 121000000 121200000 1212100000 121212000 121212100 000000000 000000000 |
As 9 numbers to describe the order-of-sets: | 100000000 120000000 123000000 123400000 1234500000 123456000 123456700 000000000 000000000 |
The computer program (player 2) will learn from this wrong move and store the order-of-sets: 123456700 and 123456000 in a exception list.
Continuation game 2
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1| 2|1|1 2|1|1 2|1|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | 2| | 2| | 2|2| 2|2|1
1 2 3 4 5 6 7 8 9
|
There are two ways to describe this game:
As 9 numbers of bord displays: | 100000000 120000000 121000000 121200000 1212100000 121210200 121212100 121211220 121211221 |
As 9 numbers to describe the order-of-sets: | 100000000 120000000 123000000 123400000 1234500000 123450600 123457600 123457680 123457689 |
That means the order-of-sets 123450600 is wrong. And so are 123450060 and 123450006.
And what is more important: and so is 123400000.
Continuation game 1
In the next game instead of 123400000 in set 4 the order-of-sets 12350000 is used.
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1| 2|1|1 2|1|1 2|1|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | 2| | 2| | 2| |2 2|1|2
1 2 3 4 5 6 7 8 9
|
There are two ways to describe this game:
As 9 numbers of bord displays: | 100000000 120000000 121000000 121020000 1210200010 121200 121212100 121211220 121211221 |
As 9 numbers to describe the order-of-sets: | 100000000 120000000 123000000 123050000 1230500080 123450600 123457600 123457680 123457689 |
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | |2| |2| 1|2| 1|2| | | | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | |1| |1| 2|1| | | | |
|
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | |2| |2| 1|2| 1|2| 1|2|x 1|2|
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | |1| |1| 2|1| 2|1|y 2|1|
1 2 3 4 5 6 7 8 9
|
After set 7 there are two open spaces. Player 2 (the computer)
The result will be a draw.
Game 5
In the above game the order-of-sets is 100000000 120000000 123000000 123040000 123040050 123640050
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | |2| |2| |2| 2|2| |2|
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | |1| 1|1| 1|1| 1|1|1
|
**************************************************************************
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1| 2|1|1 2|1|1 | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | 2| | 2| | 2| |2 2|1|2
1 2 3 4 5 6 7 8 9
|
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1| 2|1|1 | | | |
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | |2| 2| | 2| |2 2|1|2
1 2 3 4 5 6 7 8 9
|
1| | 1|2| 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1 1|2|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | 2| | 2|1| 2|1| 2|1|1 2|1|1 2|1|1
----- ----- ----- ----- ----- ----- ----- ----- -----
| | | | | | | | | | | |2 2| | 2| |2 2|1|2
1 2 3 4 5 6 7 8 9
|
loosing sets are 123456 123457 123458 123459
121212 1212102
Feedback
If you want to give a comment you can use the following form Comment form
Created: 17 December 2022
Go Back to Wikipedia Comments in Wikipedia documents
Back to my home page Index