Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Human-like

Chess Playing
Program
Petro Gordiievych
What is the different between computer
and human way to play chess?
“While current computers search for millions of
positions a second, people hardly ever generate more
than a hundred. Nonetheless, the best human chess
players are still as good as the best computer programs.
Although this model operates excellently in computer
programs, it has very little realism where human thinking is
concerned. It is probabilistic and in most task environments
the generation of all possibilities even to the depth of one
„move” is unrealistic. In making an investment decision, for
example, one cannot normally generate all imaginable
ways to invest and heuristically select the best: there simply
exist too many ways to make the decision. This is why
heuristic search models are too coarse to be realistic
models of the mind. Much more sophisticated analysis is
required in order to explain human problem-solving
behaviour” (Saariluoma 1998).
Chunking
We consider term „chunking” as process
whereby chess pieces are combined into groups. A
„chunk” is simply a group of some of the chess pieces
that appear on a chessboard and the action of
„chunking” is the grouping together of chess pieces.
Chunking
Much of the evidence for chunking in chess is taken from
psychological experiments such as de Groot’s memory test on
expert and novice players. In this well-known experiment de
Groot tested three classes of chess player: Grandmaster plus
Master, Expert and Class „A” player, (a „Class A player” is a good
chess player, but below expert level), by showing them a
chessboard configuration from an unfamiliar game with twenty-
two pieces on average, for a few seconds (de Groot 1978). The
subjects were then asked to reconstruct the configurations, either
verbally or on another board. The experiment was repeated by
Chase and Simon but included a novice group. The results
showed Masters scoring 81% correct, Class „A” players 49% and
the novices 33%. But when the positions were randomised each
group only recalled only three or four pieces correctly. This
dramatic result implies that advanced chess players remember
pieces in structured positions, and that pieces are remembered
as groups or chunks rather than the individual pieces themselves.
DEFINING A CHUNK
• Chunks are learnt constellations
• Chunks are frequently occurring configurations
• Chunks contain elements that are related to each
other
• Pieces are related by proximity
• Pieces are related by attacking/defending
relationships
• Experts have larger chunk knowledge than the
novice
DEFINING A CHUNK
Chunks are absolutely positioned

Shifting pieces from 'a' to 'b' changes winning


position from White to Black (from Lane and Gobet, 2010)
What a chunk looks like
Chunks may be composed of either or both
color pieces:
What a chunk looks like
A chunk may be built from smaller chunks:
What a chunk looks like
Pieces in the chunk may be unrelated (below
left). A chunk may be part of the initial board layout
(below right)
Chunk statistics
From an analysis of chessboards it is clear that
there are many patterns or constellations of pieces
that occur frequently. The repeated constellations or
chunks exist due to the properties of the chess pieces
and the rules of the game. It is easy to extract chunks
from chess games; the difficulty is finding meaning
associated with the chunks. The existence of chunks in
itself is not a measure of the player's skill as chunks are
found across the whole range of skill sets. Therefore
attempts to correlate the player's skill with chunks used
are futile, but rather, it is the player's skill that
recognizes chunks to assist his chess play.
How many chunks on the
board
To illustrate how to count chunks, consider the chessboard
figure above, with just five pieces. The chessboard shows five pieces on
squares as follows: qd8, ke4, Kg6, Rc4, Bf1. The pieces combine to
produce chunks as follows:
How many chunks on the
board
A chunk is shown within chevrons and pieces
separated by commas. This notation is used de Groot and
Gobet (1996). The piece is denoted by the piece name
(R=Rook, B=Bishop, N=Knight, Q=Queen, K=King, P=Pawn),
followed by the square location on the board. If the piece
name is lowercase then the piece color is black, otherwise
it is white.
The pieces combine giving a number of chunks
increasing as a piece is added. With each piece added,
the number of resulting chunks follow the series,
1,3,7,15, 31...
 This series can be expressed as a
formula:
Combinations = (2 n) – 1
Where „n” is the number of pieces
on the chessboard.
How many chunks on the
board
Chunks statistic
The average number of chunks found on the
chessboard
Chunks statistic

The average number of chunks found on


the chessboard excluding ‘base chunks’
Defensive Chunks
Using the chunk list generated by CHREST
(Chunk Hierarchy and REtrieval STructures) program
and removing all of the pieces, except those pieces
that defend each other within the chunk, the number
of chunks reduces to 2,504. These chunks („defensive
chunks”) have each piece protecting another piece
within the same chunk and in this way the group of
pieces making up the chunk have an intrinsic value.
Chunks in this case are therefore only composed of
pieces of the same colour, yielding 972 white and
1,532 black chunks. These patterns are only chunks
where the pieces defend each other.
Examples of ‘defensive’
chunks
The occurrence of defensive chunks
throughout a game
The persistence of defensive chunks
with player skill

The results of the analysis comparing the persistence of


defensive chunks shows no significant differences between skill
groups. It was therefore not considered necessary to perform any
further statistical analysis on these data.
CLAMP (Chunk Learning and Move Prompting)
CLAMP program (created by Andrew Cook) analyses
Master and Grandmaster games, building a library of
frequently occurring patterns (chunks) that precede
moves of chess pieces. When presented with a new
board configuration CLAMP uses its ‘chunk
knowledge’ to suggest which pieces are most likely to
be selected to play the best move. CLAMP does not
use forward searching or minimax techniques but from
pattern matching alone, in the mid-game, can
appropriately select the most likely pieces to move
with a statistically high probability.
The Bratko/Kopec tests
Test 4 (best move: pawn lever)
Results of Bratko/Kopec test
The top five CLAMP scores

Shows the top five CLAMP scores with the


position of the move in order of preference from an
analysis by the Fritz chess engine, with “1” being the
best move and “38” being the worst move.
Basic chess combinations
In my research I go from different side and
develop statistic knowledge about basic
combinations which people learn from the begging
when they start play chess:
o fork;
o double attack;
o skewers (in this work I’ll not make difference between absolute and
relative, pin and skewer).

Its important to know how often players use


these small and simple chunks for building their game
strategy and complicated combinations. The goal is
to find out how players recognize opportunities to add
right combination in the game situation, on which
sides and directions they focus attention.
Fork
This combination appear when pawn attacks
two of opponent’s pieces at the same time.
Double attack
Similar to Fork, just instead pawn here we have
other kind of pieces:
Skewers
A skewer is a move which attacks two pieces in
a line.
As data source I used database of chess games from FICS (Free Internet Server)
for 2008 year. During analysis were processed 300000 games within moves
between 20 from the start of game and 20 before end (suppose its middle game
part). Results shown in next table:

In percent

Where
F – fork
DA – double attack
S – skewer
From provided results we can see that Whites
statistically won more often then Blacks (49.57% to 46.34%)
and just in 4.09% of cases there are draws. Percentage of
forks appearing doesn’t show significant information just tell
that Whites can make it more often (possible more simple)
then Blacks. Skewers as well as forks don’t show so much
correlation with won side. Most interested is Double Attack
combination, its appear in 50.433% Whites to 49.268% of
Blacks moves when Whites won. In the games where Blacks
won Blacks have higher percentage of Double attacks
compare with Whites. This can lead us to simple conclusion
– side which will have double attacks in most of the moves
has more chance to win, it has sense in case if we merge
this with chosen strategy.
For future research I am planning to split middle
game by number of pieces (I guess it has correlation with
percentage of chunks), add new combinations (split
skewers to absolute, relative and distinct with pin
combinations) and make tests to check efficient of
suggestions, which can make based on this analysis,
compare with Fritz chess engine.

You might also like