Applied Mathematics
Vol.3 No.11A(2012), Article ID:24755,8 pages DOI:10.4236/am.2012.331243

Quantum Tic-Tac-Toe: A Genuine Probabilistic Approach

Marius Nagy, Naya Nagy

College of Computer Engineering and Science, Prince Mohammad Bin Fahd University, Al Azeziya, KSA


Received July 16, 2012; revised August 23, 2012; accepted September 1, 2012

Keywords: Quantum Games; Tic-Tac-Toe; Quantum Measurement; Superposition; Entanglement; Computational Power


We propose a quantum version of Tic-Tac-Toe which accurately reflects the inherent probabilistic nature of the measurement principle in quantum mechanics. We then formulate a quantum strategy which allows a quantum player to consistently win over a classical player, with a certain probability. This result can be seen as another proof of the superior computational power of a quantum system with respect to a classical one. Our investigation also reveals that the non-determinism and complexity introduced by the principles of quantum mechanics into even the most simple games make brute-force strategies considerably more difficult to implement. Consequently, games in which machines have gained the upper hand over humans may be made fair again by upgrading them to a quantum level.

1. Introduction

The field of quantum information is concerned with ways of embodying information in physical systems whose behavior can only be described by the laws of quantum mechanics and exploring the consequences of this novel physical support on how information is manipulated and processed. Weird quantum mechanical principles, like superposition of states and entanglement can effectively be harnessed in order to achieve higher efficiency or security than it is possible by using classical means: quantum algorithms that are faster than their classical counterparts [1,2], quantum protocols for key distribution that are qualitatively more secure against eavesdropping than any classical cryptosystem [3-7], reduced communication complexity [8].

Not surprisingly, the laws of quantum mechanics have been applied to game theory as well, with the same result: better, more successful quantum strategies than the classical ones [9-11]. The main motivation behind applying quantum information into game theory is the ability to formulate many problems as games between two parties: quantum cryptography can be seen as a game between those who wish to communicate secretly and the eavesdroppers [5]; quantum algorithms may be seen as games between classical and quantum agents [12]; even quantum cloning or the measurement process itself may be interpreted as a game played against nature [13,14]. Consequently, quantum game theory tries to apply the properties of quantum systems in an abstract manner with the purpose of making better decisions in adversarial situations.

In this paper, we take a different approach to quantum games. Rather than seeking a unified theory of games and quantum mechanics, we wish to explore the effects of “upgrading” particular, well known games to the quantum level. This upgrading refers to the physical support of the game (like the board, for example) as well as the legal moves the players are allowed to do. Therefore, in a board game, the board is embodied as a quantum system and each move in the game is viewed as a quantum operation or transformation acting upon and changing the current quantum state of the system.

The questions that will guide our exploration are: How can a particular game be upgraded to a quantum version? What is the best strategy to follow, once the rules are precisely defined? How would a “classical” player fare against a “quantum” opponent? What is the level of complexity introduced by the quantum upgrade? How would this upgrade affect (if at all) the chances of a human player against a machine? In this respect, our investigation is closer to the approach taken in [15] to explore a quantum version of Chess.

Our investigation will focus on a much simpler game, Tic-Tac-Toe, in order to better observe the effects of the quantum upgrade, unobscured by the game inherent intricacies. Also, we are interested in a “genuine” quantum upgrade, where the laws of quantum mechanics are applied as they are, without “accommodating” them to better suit the game at hand. For example, we choose to implement a non-deterministic measurement process identical in every respect to a probabilistic quantum measurement, which is different from the version of Tic-TacToe defined in [16] where the player has direct control over how a superposition collapses and the outcome of the measurement. In this way, we make sure that the game can be physically implemented using a quantum system whose behavior must obey the rules of quantum mechanics throughout the entire game play.

The remainder of the paper is organized as follows. Section 2 describes in detail the quantum version of TicTac-Toe that we choose to investigate, carefully defining the initial configuration of the board, the legal moves allowed and the objectives of the game. In order to quantify the power of a quantum player relative to a classical one, we need precise definitions for the abilities of a quantum and a classical player. This is done in Section 3. The next section introduces a quantum strategy which, when followed, consistently gives more chances to the quantum player to win the game to the detriment of a classical player. This result is consistent with previous results in quantum game theory in general [9,12] and can also be interpreted as a reformulation of the idea developed in [17], using a game setting as a new vehicle for showing that a quantum “entity” is strictly more powerful and can solve a larger set of problems than a classical entity.

Section 5 goes on to analyze the equilibrium developed when both players are endowed with quantum powers and touches on the issue of human vs. machine playing. In this respect, we argue that the complexity and uncertainty introduced by quantum properties make the game more fair, rendering a brute-force strategy (usually adopted by a machine) more difficult, if not impossible to implement. Section 6 discusses several ways in which our quantum version of Tic-Tac-Toe can be extended. Finally, a summary of the problems discussed and the results obtained concludes the paper.

2. Rules of the Game

In this section we provide a detailed description of our quantum version of the Tic-Tac-Toe game, which we will refer to as Q3T. The simplicity in defining the legal moves is deliberate. Our aim is to explore the consequences introduced in gaming by the same principles that govern the behavior of quantum systems, without “adjusting” or “customizing” them in any way. In order to observe and analyze these consequences, it is best to start with the simplest form of a quantum game, so as to avoid situations in which it is not clear whether a certain observed behavior is a result of the “quantum enhancement” of the game or it is due to the game’s inherent complexity, or perhaps both.

2.1. Initial Configuration of the Board

At the outset, each square on the board is in a grey state: a balanced superposition of White (W) and Black (B). Formally, the quantum state of any of the nine squares on the board can be expressed as


in the usual Dirac notation employed to describe quantum states.

2.2. Legal Moves

There are only two possible moves (operations) a player can choose from: 

1) The first one applies to any one square on the board that does not have a definite state (White or Black) yet. From a quantum mechanical perspective, it corresponds to an observation or measurement of the quantum system representing the physical realization of the square being observed. Following this observation, the respective square acquires a definite state: White or Black, with equal probability. In quantum mechanical terms, we say that the superposition collapses to one of the base vectors: or.

2) The second possible move acts on a pair of squares and consequently, it is implemented through a two-qubit gate, namely the Controlled-NOT or more simple, CNOT. The effect of applying the CNOT operator on the four basis vectors required to describe the state of a two-qubit system () is specified by the following matrix:


In simple terms, the CNOT gate flips the state of the target qubit (the second qubit) from to or from to if and only if the control qubit (the first qubit) is set to. However, in our Q3T game, the application of the CNOT gate is restricted to the case where the control qubit is in superposition and the target qubit is in a “classical” state (or). Under this restriction, the second type of move will entangle the control and target qubits together. The following two equations describe the effect of a CNOT operator applied on a White target square (Equation (3)) and a Black target square (Equation (4)), respectively.



Such an entanglement can be extended to several qubits if the control qubit is already part of an entanglement. The rationale behind restricting the application of CNOT to a pair of qubits satisfying certain conditions (as explained above) is twofold: to simplify the game and to prevent a player from directly changing the color of a square from to or from to.

It is important to mention here that squares “caught” in an entanglement are displayed as Grey, similar to any other square whose quantum state is in a superposition. As a consequence, when a Grey square is measured, one or more squares can “collapse” to one of the two basic colors, depending on whether the “observed” square is entangled with other squares on the board or not. In an extreme case, a single measurement is enough to trigger the “collapse” of all nine squares (provided they are all part of an entangled state) and therefore end the game.

2.3. Game Objective

As in classical Tic-Tac-Toe, the objective of the game is for any of the two players to “mark” a full row, column or diagonal with the player’s color. By convention, White is assigned to Player 1, while Player 2’s color is Black. The two players take turns in executing a legal move until one of the players achieves the game objective or no further legal moves are possible.

In the latter case, the entire board is in a classical state, with each of the nine squares being colored in White or Black, but without any row, column or diagonal sharing the same color. This situation is a draw and has a direct correspondent in classical Tic-Tac-Toe. But in Q3T there is another situation that may lead to a draw. Imagine that after a measurement, several squares acquire a White or Black color, forming both a White and a Black “suite” (row, column or diagonal) at the same time. This scenario, only possible due to entanglement is also considered a draw. In all other cases, either there are still valid moves available, or a single player can claim victory following a measurement that completes a full row, column or diagonal with the player’s color.

3. Quantum Player vs. Classical Player

In [17] we have investigated the relative power of a computational device capable of manipulating information at the quantum level with respect to its traditional or classical counterpart. The conclusion was that a quantum computer is strictly more powerful than a classical one because some problems that require a quantum description can only be successfully addressed if information can be accessed at the physical level used to encode it.

The question that we ask in this paper is: How is this superior computational power manifesting itself in the context of quantum games? Will a quantum player be able to always “beat” a classical opponent? Or, perhaps, most of the time? Or the fact that he can manipulate the board at the quantum level will make no difference in the end? We will consider these questions in the following for the particular case of the Q3T game, as defined above. But before any comparison can be made, we must define precisely what we understand by a quantum player versus a classical player.

A quantum player has no constraints in manipulating the squares on the board, except for those specified in the rules of the game. Consequently, he is free to choose any one of the two legal moves, provided that both are possible at that point. On the other hand, a classical player has only one move at his disposal, the observation or measurement of a square, because this is the only way to acquire (classical) information about a quantum system. Furthermore, following a measurement, the state of the system can always be described in classical terms, consistent with the outcome of the measurement. Therefore, a classical player in Q3T behaves similar to a player of “regular” Tic-Tac-Toe, choosing the next square to put his mark on or deciding which square to measure next, respectively.

Clearly, according to these definitions, the quantum player is the more powerful one. But is this extra power (quantum power) enough to give him a clear, provable advantage during the game, considering that none of the players have direct control on what color is assigned to each square? Indeed, the measurement process is completely non-deterministic, in the sense that each square has an equal chance of ending up as a White or Black square, following an observation. Yet, a quantum player can harness the power of entanglement to consistently guide the outcome of a game in his favor, as we prove in the next section.

4. The Road to Victory: Entangle Your Opponent

For concreteness, let us assume that Player 1 or the White Player is a classical player, while Player 2 or the Black Player is a quantum player. Without loss of generality, we consider the case where both players try to gain control over the squares composing the main diagonal of the board. The central square is the first “target” since it is the best strategically placed square, offering control over one row, one column and two diagonals. Once the central square is “acquired” by one of the players, attention shifts towards the top-left and bottom-right squares, respectively.

The classical player can only measure these squares, in the hope that they will “turn” White, the color of the classical player. The quantum player could follow the same strategy and measure any of the Grey squares, but this purely classical approach will not give him any advantage over his opponent: both players will have a 50% chance of winning the game. In order to gain the upper hand, the quantum player must bring entanglement into play. The following strategy will ensure that the quantum player wins most of the time: whenever the classical player measures a square as White, the quantum player entangles it with one of the Grey squares left on the board.

Intuitively, this strategy is a winning one because every time a square is measured as White (“bad luck” for the quantum player), he can get a second chance on it by entangling it with a Grey square. Formally, assume that we have two squares, denoted by S1 and S2, and four possible events corresponding to the four possible outcomes when the two squares are measured:

1) W1 ® S1 is observed to be White.

2) B1 ® S1 is observed to be Black.

3) W2 ® S2 is observed to be White.

4) B2 ® S2 is observed to be Black.

All these four events are equally likely and we have:


Note that and therefore. Similarly, and.

We define the random variable X to be the number of Black squares created by measuring (observing) S1 and S2. We have:




Therefore, the expected value of random variable X is:


This result conforms with the intuition that when we resort only to measurements, on average, we expect to see one White square and one Black square emerging after the two measurements. What happens now if the Black player has the option of bringing entanglement into play? More precisely, each time the measurement on S1 yields a White square, the Black player (quantum player) will entangle S1 and S2 together, using a CNOT gate with S1 as the target qubit and S2 as the control qubit (see Equation (3)).

In this scenario, we still have two measurements performed, one on S1 and the second on S2, so still four equally likely outcomes are possible: W1W2, W1B2, B1W2 and B1B2. The only difference is that the event W1B2 will now yield two black squares, as S1 has been entangled with S2 after the measurement on S1 took place, and must be observed in a state consistent with S2. Consequently, the probability distribution of random variable X changes as follows:




According to its change in its behavior, the new expected value of variable X becomes:


This means that the expected number of black squares seen after the two measurements is now 1.25, while the expected number of white squares drops to 0.75.

Extending this argument to 3 squares, Table 1 shows the number of black squares observed in each of the possible cases. Note that the quantum strategy assumes that whenever S1 has been measured as White, by the White player, the Black player will entangle S1 with S2 in response. This situation occurs in the first four rows of the table. Similarly, whenever S2 is measured White by the White player, the Black player responds by entangling S2 and S3 together, in the next move. This situation occurs in rows 1 and 2 in the Table 1.

The situation is different for rows 5 and 6, however. Since the two players alternate their moves, with the White making the first move, in rows 5 and 6 the Black player is in the situation of making a move after S1 has been measured as Black. Therefore, it makes no sense to entangle S1 with S2, so he chooses to measure S2. Unfortunately for him, S2 turns White, but then it is White’s turn again and the White player proceeds by measuring S3. Consequently, rows 5 and 6 are entanglement free.

According to the table we have constructed, the expected value of X after 3 measurements is:

Table 1. Number of black squares observed after 3 measurements. Black is a quantum player and white is a classical player. White has the opening move.


Consequently, after three measurements we expect to see 1.875 black squares and 1.125 white squares, on average. Note that three measurements is not equivalent to three moves, as some of the moves could be entanglement moves. Furthermore, if S1, S2 and S3 belong to the same “suite” (row, column or diagonal) then the chances for the quantum player to win the game after just three measurements are double the chances of the classical player (25% compared with 12.5%). This result is consistent with the fact that the set of problems solvable by classical means is a proper subset of the set of problems that can be solved if information can be manipulated at the quantum level.

Certainly, the equilibrium between the two players is restored if the White player also chooses to resort to quantum moves. He can use a similar strategy of entangling Black squares with Grey ones, in the hope that a second measurement on the same square will yield a more favorable outcome. However, since now a Black square is used as the target qubit, the entanglement created is of the form given in Equation (4) rather than that of Equation (3). This aspect emphasizes another unconventional characteristic of our game, still stemming from its quantum nature: the game is not symmetric with respect to the two players. If the first type of entanglement creates only White or only Black squares when measured, the second type always creates one White and one Black square. This strategy guarantees to the White player that the worst case of seeing two Black squares after two measurements is no longer possible.

The asymmetry between White and Black is clearly exposed if we construct a table similar to Table 1, but for the case where Black is now the classical player and has the opening move, while White is a quantum player. Table 2 shows the number of white squares after three measurements in all possible cases. The net effect of entangling a Black square with a Grey one, followed by a measurement is the “metamorphosis” of the Grey square into a White one. The input and output of such a ply is shown in Figure 1. The Black square can then be used to repeat the same ply and transform another Grey square into White. This explains why, in this case, the expected number of White squares after three measurements is


The equation above is derived taking into consideration that in Table 2 there is only one row (row 5) that corresponds to a single White square observed, only one row (row 8) that corresponds to three White squares observed, while all the other six remaining rows correspond to situations where two White squares are observed. This result is superior to the expected number of Black squares when Black was the quantum player. Consequently, when restricted to this strategy, the Black player would always end up loosing. Of course, the Black player may choose to measure a Grey square which is not entangled and this might offer him some chances of winning the game, but overall, White will still win most of the time.

An interesting open question raised by the asymmetry exhibited in this game is whether playing White or Black does offer any advantage (assuming both players are quantum) and if so, how big an advantage? In the most general case, the situation can get very complicated due to the multiple entanglements that can be formed. Remember that if the Grey square used as the control qubit in a CNOT gate is already part of an entanglement, then that entanglement can spread to more than two squares, generating a complex position. As we mentioned earlier,

Table 2. Number of white squares observed after 3 measurements. White is a quantum player and Black is a classical player. Black has the opening move.

Figure 1. A (Controlled-NOT, Measure) ply that transforms the Grey input into White.

in an extreme case, all nine squares can be gradually incorporated into an entangled state. This makes the analysis much more complicated, but at the same time it makes the game more fair in a contest between a human and a machine. Indeed, in many cases (and chess is probably the most visible example) the competition between a human player and a machine is decided more and more in favor of the latter, only because the continuous increase in raw computational power allows a machine to apply a “brute force” strategy successfully and consider an increasing number of possible moves in the same amount of time.

The implicit non-determinism and explosion of the number of states that quantum mechanics brings into play make a “brute-force” strategy much more difficult to implement: considerably fewer levels in the game tree can be explored in a given amount of time. As a result, in the quantum version of a game, it is the “inspiration” of a player that might decide the outcome again, and not just raw computational power. This is visible even in a simple game like Tic-Tac-Toe. In the classical version it is almost trivial to plan your entire game (move by move) from the outset, yet when we switch to the simplest quantum version, where just two types of moves are allowed (from which only one is genuinely quantum), the simplicity and confidence characterizing the classical game seem to vanish. This is all the more so in a game with more complex rules or an extension of Q3T.

5. Possible Extensions

The quantum version of Tic-Tac-Toe discussed in this paper could be extended in several ways. One possibility is to introduce new moves in the set of legal moves a player can choose from. For example, we could add the Hadamard gate as another alternative for a quantum move. The Hadamard operation can turn a White or Black square into a Grey square again (recreating a superposition) and therefore it may have the effect of extending the length of the game, if introduced.

Another possibility is to modify the initial configuration of the board, such that we have two types of superpositions: and, randomly generated for each square. In this way, the squares will still look Grey to the two players, who will not know what particular type of superposition each square is in. Now, if a Hadamard gate is applied to a Grey square, the result could be either a White or a Black square, depending whether the initial superposition was

or, respectively.

This new rule would also affect the entangled states created during the game, as the two different superpositions will give rise to two different entangled states, when a Grey square plays the role of a control qubit in the application of a CNOT gate. Also note that the players cannot distinguish between a square in its initial superposed state and a square that is part of an entanglement, just by visually inspecting the board, since they will both look as Grey. Therefore, in a complex situation, it may be very difficult for a player to figure out which squares are entangled together and what is the exact entangled state spanning them.

But the most dramatic increase in complexity would arise from extending the board to an arbitrary size along with requesting a suite of five Black or White squares to win the game. Nevertheless, the observations formulated for our simple version of Q3T remain valid in all these possible extensions: a purely classical player will consistently be defeated by a player endowed with quantum abilities through the use of the strategies outlined above.

6. Conclusions

In this paper, we have formulated and analyzed a quantum version of Tic-Tac-Toe based on the actual (and not just inspired from the) physical laws describing the behavior of quantum systems. This property makes our quantum game fully implementable using an actual quantum system and not just an adapted simulation of a real quantum system. During the investigation, we have shown that there are quantum strategies which, when followed by a quantum player, consistently outwits a classical player with a certain probability. This result should not be surprising and should actually be seen as a direct consequence of the fact that a quantum information processing system is superior in computational power to a system that can only represent and process classical information.

Our investigation also clearly shows that the intrinsic complexity and non-determinism characterizing quantum systems can easily diffuse in the game play. Arguably the most simple quantum upgrade of classical Tic-Tac-Toe changes the original game dramatically, reviving it by making it interesting and challenging. This leads to another important property of quantum games. The difficulty to classically simulate the evolution of a quantum system may bring back the equilibrium between a human playing against a machine, an equilibrium that seemed to be lost due to the unfair possibility to apply brute-force strategies sustained by ever increasing computational speeds.

Another interesting property exhibited by our quantum game is asymmetry. The particular form of entanglement brought about by the White player is not the same as the entanglement created by the Black player. This brings a whole new dimension into the game and certainly deserves a more thorough investigation to fully understand its consequences.

These observed features of quantum Tic-Tac-Toe hold great promise to generalize to other games as well and potentially revolutionize the future of gaming industry. This could be accomplished by pursuing two main directions: create quantum versions of well-known, existing classical games, or trying to design a new quantum game from scratch in order to best exploit the potential benefits offered by quantum mechanical principles. Certainly, the applications of quantum mechanics into the gaming industry look quite promising and are worth further investigation.


  1. D. R. Simon, “On the Power of Quantum Computation,” Special Issue on Quantum Computation of the SIAM Journal on Computing, Vol. 26, No. 5, 1997, pp. 1474-1483.
  2. P. W. Shor, “Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer,” Special Issue on Quantum Computation of the SIAM Journal on Computing, Vol. 26, No. 5, 1997, pp. 1484-1509.
  3. S. Wiesner, “Conjugate Coding,” SIGACT News, Vol. 15, No. 1, 1983, pp. 78-88. doi:10.1145/1008908.1008920
  4. C. H. Bennett and G. Brassard, “Quantum Cryptography: Public Key Distribution and Coin Tossing,” Proceedings of IEEE International Conference on Computers, Systems and Signal Processing, Bangalore, 10-19 December 1984, pp. 175-179.
  5. A. Ekert, “Quantum Cryptography Based on Bell’s Theorem,” Physical Review Letters, Vol. 67, No. 6, 1991, pp. 661-663. doi:10.1103/PhysRevLett.67.661
  6. M. Nagy, S. G. Akl and S. Kershaw, “Key Distribution Based on the Quantum Fourier Transform,” International Journal of Security and Its Applications, Vol. 3, No. 4, 2009, pp. 45-67.
  7. M. Nagy and S. G. Akl, “Entanglement Verification with an Application to Quantum Key Distribution Protocols,” Parallel Processing Letters, Vol. 20, No. 3, 2010, pp. 227-237. doi:10.1142/S0129626410000181
  8. R. Cleve and H. Buhrman, “Substituting Quantum Entanglement for Communication,” Physical Review A, Vol. 56, No. 2, 1997, pp. 1201-1204. doi:10.1103/PhysRevA.56.1201
  9. J. Eisert and M. Wilkens, “Quantum Games,” Journal of Modern Optics, Vol. 47, No. 14-15, 2000, pp. 2543-2556.
  10. S. C. Benjamin and P. M. Hayden, “Multiplayer Quantum Games,” Physical Review A, Vol. 64, 2001, Article ID: 030301.
  11. I. Fialik, “Separation between Classical and Quantum Winning Strategies for the Matching Game,” International Journal of Foundations of Computer Science, Vol. 19, No. 6, 2008, pp. 1449-1459. doi:10.1142/S0129054108006388
  12. D. A. Meyer, “Quantum Strategies” Physical Review Letters, Vol. 82, 1999, pp. 1052-1055.
  13. R. F. Werner, “Optimal Cloning of Pure States,” Physical Review A, Vol. 58, No. 3, 1998, pp. 1827-1832. doi:10.1103/PhysRevA.58.1827
  14. D. Deutsch, “Quantum Theory of Probability and Decisions,” Proceedings of the Royal Society of London A, Vol. 455, 1999, pp. 3129-3137. doi:10.1098/rspa.1999.0443
  15. S. G. Akl, “On the Importance of Being Quantum,” Parallel Processing Letters, Special Issue on Advances in Quantum Computation, Vol. 20, No. 3, 2010, pp. 275- 286.
  16. A. Goff, “Quantum Tic Tac Toe: A Teaching Metaphor for Superposition in Quantum Mechanics,” American Journal of Physics, Vol. 74, No. 11, 2006, pp. 962-973. doi:10.1119/1.2213635
  17. M. Nagy and S. G. Akl, “Quantum Computing: Beyond the Limits of Conventional Computation,” International Journal of Parallel, Emergent and Distributed Systems, Special Issue: Emergent Computation, Vol. 22, No. 2, 2007, pp. 123-135. doi:10.1080/13547500600899209