Professional Documents
Culture Documents
Connect 4 Strategies
Connect 4 Strategies
APPRECIATION OF MATHEMATICS
STRATEGY OF CONNECT 4
INSTITUTE OF MATHEMATICAL
SCIENCES
FACULTY OF SCIENCE
UNIVERSITY OF MALAYA
SEMESTER 2 SESSION 2016/2017
GROUP 4
Instructor: Dr. Onn Shea Ming
1.0 Introduction
2
Connect-Four is a tic-tac-toe-like two-player game in which players
alternately place pieces on a vertical board 7 columns across and 6 rows
high. Each player uses pieces of a particular colour (commonly black and red,
or sometimes yellow and red), and the objective is to be the first to obtain four
pieces in a horizontal, vertical, or diagonal line. Because the board is vertical,
pieces inserted in a given column always drop to the lowest unoccupied row
of that column. As soon as a column contains 6 pieces, it is full and no other
piece can be placed in the column.
Both players begin with 21 identical pieces, and the first player to
achieve a line of four connected pieces wins the game. If all 42 men are
played and no player has places four pieces in a row, the game is drawn.
3
2.0 History
Connect 4, or commonly known by the popular version name Four in a
row is a game with a mysterious origin as precursor existed that date back to
the beginning of 20th century. Connect 4 with 6 by 7 grid design can host up
to over 4 trillion positions, 4,531,985,219,092 to be specific.
Connect 4's origin has been ambiguous as the earliest story regarding
the game is revolved around an explorer name Captain Cook, who has spent
excessive amount of time playing this game against travellers earned the
game name "Captain's Mistress". Milton Bradley trademarked a version of the
game called Connect 4 and distributed in the states in 1974, however there
are versions of Four in a Row described in Robbie Bell's book that dates to
Edwardian time near the beginning of 20th century.
4
3.0 The Strategy for Connect Four
3.1 The Nomenclature
X 2
X O O O O 1
a b c d e f g
It is now possible to make a list of the moves made during a game. For the
game of diagram above this could have been:
1. d1, d2
2. c1, d3
3. e1, b1
4. f1, O wins.
5
1) If we are assuming the O moves first, then some game configurations,
such as a stack in one column with X from bottom is impossible.
O 6
X 5
O 4
X 3
O 2
2) If the total number X 1 of occupied squares is
a b c d e f g
odd, the number of O is one more than
the number of X, otherwise it is an illegal position.
3) If a column contais an empty square, all squares above this empty square
are also empty.
4) Since the last move ended the game, at least one of the four squares in
the connected group must be the highest filled square in its column. If this
is not the case, or both players have connected four men, the position is
illegal.
6
Let us consider a set of strategic rules for the well-known game tic-tac-
toe, which some players might like to use. The rules have priority in the order
given:
This game shows that the four strategic rules do not always assure that
the best result possible (draw) can be reached, although the rules look
perfectly reasonable. In general, we must classify these sorts of rules into two
classes:
1. Rules that guarantee a certain results.
2. Rules that are generally advantageous but are not without downfall (like
the strategy of tic-tac-toe given above)
Well explore possible strategies to follow for Connect Four below. First
well learn some terminology associated with describing the strategy.
A. Threat
7
A threat is a square that if taken by opponent forms a game-winning
group of four. For example, in the game below O has threats at b1 and
f1:
6
5
4
X 3
X 2
O O O 1
a b c d e f g
B. Useless Threat
A useless threat is a threat that will never be able to be carried out by
the opponent. The diagram below illustrate the concept of a useless threat.
X X X X 6
X O O O 5
O O O O 4
X O O O 3
X X X X 2
X O O X 1
a b c d e f g
X X X X X 6
X O O O O 5
O O O O X 4
X O O O O 3
X X X X X 2
X O O X O 1
a b c d e f g
Now the time has come that O has to move in the b-column or the f-
column. As soon as this has been done, X will take the square in the
second row and win the game. Therefore, it is clear that in this game no
square of b3-b6 and f3-f6 will be used. Therefore, most of O s unfinished
8
groups are useless, as well as some of X groups. We have found two
serious threats: b2 and f2, while all other threats were useless. In the
position of diagram 3.4.1, it was already easy to count the empty squares
to see that eventually O would have to play b1 or f1. Moreover, suppose
we have, like in diagram 3.4.2, five columns filled up completely and the
two other columns empty. Without knowing anything about the way the
columns are filled, it is easy to see that it is Os turn. This does not
depend on the way the players filled the board, but depends only on the
number of moves (also known as number of squares) made. If an even
number of square are played, it is always Os turn, while X has to move
after an odd number of square played. Since five full columns consist of
thirty men, it must be Os turn. Therefore, in any position where some
columns are completely filled and the others are still empty, the number of
square played is always even and therefore it is Os turn.
9
4) O has an odd threat and X has an odd threat.
Usually neither of these threats end up working and depend on
other threats.
X X O X O 6
O O X O X 5
X X O X O 4
O O X O X 3
In this X O X O O 2 case O has threat at
X O O O X X X 1
f3 and X has a b c d e f g threat at c3. Now O
has to move. O will only can fill up column f in order not to lose.
Hence, O will fill f2 instead of f3. When column f fully filled, now X
has to move and can fill up column c only. Thus again X will fill c2
instead of c3. Both threat c3 and f3 are not working. In this particular
example, X eventually fills up f5 and creates threat at c2. After the
column f fully filled, X can win the game by filling c2.
D. Zugzwang
The formal definition of this strange German word: A situation where a
player is forced to make a move when he would rather make no move at
all. In connect four, a player is able to control the zugzwang if the player
is able to guide the way odd and even squares are divided up among
players. As an example, we look at the following game situation, where O
is about to move:
X 6
O 5
O O 4
O O 3
X X X X 2
X O O X 1
Note that all a b c d e f g columns contain an
even number of pieces, so O will never fill up a column since it must take
only odd squares (row 1,3,5). So X can just play follow-up and mimic
O every move. This will result in the following position:
X X X X X 6
O O O O O 5
X O O X X 4
O O O O O 3
X X X X X 2
X O O X O 1
a b c d e f g
10
Now O must play either b1 or f1, which X will follow, and win the
game with a group of four on the second row. So in conclusion, Zugzwang
involves being able to divide up how even and odd squares are distributed
to the two players. X wanted only even squares because eventually it
would be able to fulfil its even threat at either b2 or f2. But if it had wanted
odd squares, it could have just stopped playing follow up and played in a
different column. In this diagram, to play follow-up was a winning strategy
for X . Concluding this, we see that X is able to take all even squares,
without O being able to do anything about it, while X can take some odd
squares if he wants to, the price of which is the loss of some even
squares. Hence X controls the zugzwang.
4.0 Conclusion
Connect 4 also known as Captains Mistress, Four Up, Plot Four, Find Four,
Fourplay, Four in a Row and Four in a Line. It is a zero sum game which is one
player will always have an advantage whereas the another player will have a
disadvantage. As well as the basic benefits of playing games like practice following
rules, how to be a good sport winning or losing, the Connect Four game also will
have advantages.
11
Firstly, the Connect 4 games will build skills such as problem solving and
basic math. By playing Connect 4, It will encourage player to plan ahead, looking
opportunities to connect 4 discs and provide opportunity to detects patterns. Besides
that, playing Connect 4 also manage to improve players investigation of prediction of
the outcome of alternative moves for your own play as well as your opponents by
keeping an eye on their moves keeps your one step ahead.
In conclusion, the rules of the game are easy to learn and understand, but
difficult to master. That is the beauty of Connect 4.
12
5.0 References
Bertoletti. G Conenct 4 Tutorial (2017, February, 14) Retrived from:
http://www.ce.unipr.it/~gbe/cn4rules.html
Jelvis,T (2014, February, 23) What is the winning strategy for the first player in
Connect Four games? Retrived from: https://www.quora.com/What-is-the-winning-
strategy-for-the-first-player-in-Connect-Four-games
13