Sunday, July 1, 2012

The Physics of a Chess Board


In Through the Looking Glass by the Reverend Lewis Carol, Alice walks through a mirror in her living room and finds the chessboard that normally resides there to be teeming with little chess pieces running around.  Leaving her mirror-house, the entire country around it has been transformed in to a chessboard.  Alice starts as a pawn and has to walk forward one step at a time to the end, when she will become a queen and be able to run as fast as she wants across the country.

While Carol's story is whimsical and fun, what would be the implications of living in a chess board?  What are the "physical laws" experienced by a given chess piece?

So imagine all the universe to be a discrete 8X8 grid, alternately tiled with black and white, and conceive of a chess piece as being a kind of elementary particle in this bizarre chess world.  We will look mostly at the free dynamics of such a chess particle - that is, how it behaves dynamically in the absence of other pieces.



Both space and time in the chess world are discrete.  Space is divided up in to tiles each of which is a square of length $a$.  Imagine that a dot is placed in the center of each tile - these dots will be the sites where chess particles are able to be located.  They cannot be located off of one of these dots.  We can then always describe the position of any particle by a pair of integers; thinking of columns as in the $y$-direction and ranks as in the $x$-direction, we can write $\vec{r} = (x,y) = a(n_x,n_y)$, where $n_x,n_y \in \mathbb{Z}_8$ (that is, the integers from 0 to 7).  Likewise, time is divided up in to turns.  We will denote the $n$th turn by $t_n = n\tau$ where $\tau$ is the length of a single turn and $n\in\mathbb{Z}$.  All dynamics in the chess world must happen between turns, and at the beginning of each turn each piece must be on a tile.

There are some interesting facts to note about the chess dynamics.  Firstly, it is Aristotelian, meaning, in symbols, that $\vec{F} = m\vec{v}$, or in words that an object is only in movement so long as it is being acted upon by an outside force, and that its velocity is proportional to the force.  Once a force stops acting, the particle stops moving.  The "mass" $m$ in this equation is not to be thought of as true mass, but as a proportionality constant; it relates to interactions of particles, and you can ignore it where it appears in equations.  The dynamics is also stochastic.  A piece, such as the queen, is not obligated to move any particular distance in any particular direction (unless something like perfect play were imposed, which it is not), so that each turn the movement is essentially random, though constrained by certain "physical" laws (i.e. the FIDE laws of chess).

Another interesting point, at least so far as I have modeled the interactions, is that each tile has a "charge"; the tile charge will be denoted by $q = \pm 1$.  The tile charge $q$ is inherent to each tile.  You can think of this as though there were some distribution of electrons and protons throughout all space and that they were fixed rigidly for all time.  But whether the tile charge is a property of the space tile itself or something else located there isn't important.  We will say that black tiles have $q=+1$ and white tiles have $q=-1$.

gradient and contour plot of q=cos(xπ)cos(yπ)
While it would be good enough to label all 64 points with $\pm 1$, it is actually easier to model this by a function $q(x,y) = \cos\left(\tfrac{\pi x}{a}\right) \cos\left(\tfrac{\pi y}{a}\right)$.  To see what I mean, a contour plot of the function is provided below.  The coloration varies from purple to light blue, purple being +1 and light blue being -1, and it is pretty clear how well this generates a chess board pattern.  While we will only be concerned with the discrete site where $q=\pm 1$, it may be possible to use such a grid to generalize the game to continuous space.  At any rate, it gives an easier representation of tile charge than enumeration.

This charge over the board will be called the background tile charge.

The chess particles also have a tile charge, in a sense, and interact with the background tile charge.  However, only ♗-particles (bishops) will have an inherent charge, either black or white, that will not change.  For ♖-particles (rooks), the tile charge of the ♖-particle is the tile charge of whatever tile it occupies (really, the same for ♗).  The ♕-particle (queen) will be considered as a superposition of ♖ and ♗.  The role that this tile charge plays is establishing a force between the chess particle and the surrounding background charge.  This will be covered in a moment.

We now turn briefly to dynamics before we come back to this charge.

The dynamics of a system normally begins with the definition of a differential equation.  Here, we are in discrete space and time, so we can speak of differentiation only loosely.  However, we can still define a "velocity"
$$\vec{v}(t_n)=\dot{\vec{r}}(t_n) = \frac{\vec{r}(t_n+\tau)-\vec{r}(t_n)}{\tau} = \frac{a}{\tau}(\Delta n_x, \Delta n_y) = v_o(\Delta n_x, \Delta n_y)$$
and hence to define the dynamics we need to define the allowable $\Delta n_x, \Delta n_y$.  This is really just the same as describing how the pieces move.  We could do this by enumeration.  For instance, we could define, for a rook,
$$\dot{\vec{r}}_♖ = \begin{cases} (n,0) \\ (0,n) \end{cases} \, n \in \mathbb{Z}$$
and more pedantically we could delineate, for each space, the allowable $n$.  However, that isn't really physics so much as it is writing chess moves down in mathematical language.  So rather than define explicitly the allowable movements, we are instead going to define stochastic forces that will act on our chess particles to produce these movements.  We will do this through what I will call "Artistotle's equation" $\vec{F} = m\dot{\vec{r}}$.

Normally in physics, we speak of forces being "attractive" or "repulsive".  For instance, in electrodynamics, the Coulomb force between two particles is defined by $$\vec{F} = - k \frac{q_1q_2}{r^2}\hat{r}.$$  If $q_1$ is positive and $q_2$ is positive, then the overall force will be negative, which will make it repulsive, whereas if $q_2$ is negative, then the overall force is positive, making it attractive.  For the tile interaction, we will instead speak of forces as being "acceptive" or "rejective".  Whether a tile is acceptive or rejective of the piece in question will depend on the tile force.  An acceptive force will allow the tile to receive that piece, a rejective force will forbid the tile to receive that piece.

First, we will model ♗-particles.  Each ♗ has some inherent charge, which we will call $q_o$.  It makes notation and conceptualization easier, but we can just as easily define the charge by $q(\vec{r})$ as given above, since ♗ never leaves its color.  We define the force felt by the ♗ at position $\vec{r}_♗$ during each turn to be
$$\vec{F}_♗(\vec{r}_♗)= \frac{1}{2}\left[1+q_oq(\vec{r}_♗+\vec{\Delta})\right] F \vec{\Delta} $$where $\vec{\Delta}$ is a random vector of the form $\vec{\Delta} = (\Delta_x, \Delta_y)$ with $\Delta_x,\Delta_y \in \{-1,0,1\}$ and $F$ is the magnitude of the force and is also a random integer between 1 and 7.  For the sake of ease, we rill henceforth write $\vec{R} = \vec{r}_♗+\vec{\Delta}$.

This force is stochastic; both its direction and magnitude are random.  If $q_o$ and $q(\vec{r}')$ are not both $+1$ or $-1$, then $(+1)(-1) = -1$, and hence the force will be zero.  We will call a zero force a rejective force - the piece is not able to move to it.  This happens when a ♗ is acted on by an opposite-colored tile.  If the two charges are the same, then the terms inside the brackets and the $\tfrac{1}{2}$ will go to 1.  This happens when a ♗ is acted on by a same-colored tile. These tiles that act on the particle are only selected from the 3X3 grid around the particle.  Each turn, one of these is selected at random, along with the integer $F$, and then we move the particle according to Aristotle's equation.  If the force is rejective, then $\vec{F} = 0 = m\vec{v}$ and the particle does not move.  If the force is acceptive, then $\vec{F} = (\pm F, \pm F) = m\vec{v}$ and the ♗-particle moves some number of squares along a diagonal.

Next we move to ♖-particles.  Here the charge depends on where the ♖ is located; that is, $q_♖ = q(\vec{r}_♖)$.  Aside from that, not much has changed.  The force felt here is
$$\vec{F}_♖(\vec{r}_♖) = \frac{1}{2}\left[1 - q(\vec{r}_♖)q(\vec{R})\right] F \vec{\Delta}$$ where $\vec{\Delta}$ and $F$ are as above and similarly $\vec{R} = \vec{r}_♖ + \vec{\Delta}$.

In this case, the force is acceptive when the tile is the opposite charge and rejective for same charges.  Other than that, nothing fundamentally different has occured.  This force will constrain the ♖-particle to only move in ranks or columns.

Having defined thee two, we can now define the ♕-particle.

It should be noted, as an aside and just for interest, that the influence of a Queen on a chess board most closely mirrors that of classical particles in physics, being essentially radial and long-reaching.  A ♕-particle in the real world might be described as producing a classical vector field something like $\vec{E} = k \hat{r}$, a field equal in all directions.  At least one study has been done treating particles acting in a 2D lattice as chess Queens.

Anyway, in the game of chess, a Queen combines the moves of a Rook and a Bishop.  So it is very good to note that a chess-world ♕-particle combines the tile forces for ♖-particles and ♗-particles.  Basically, a ♕ will feel the force
$$\vec{F}_♕(\vec{r}_♕) = F \vec{\Delta}.$$ But note that
$$\vec{F}_♖+\vec{F}_♗ = \frac{1}{2}\left[1 + q(\vec{r})q(\vec{R}) + 1 - q(\vec{r})q(\vec{R}\right] F\vec{\Delta} = F\vec{\Delta} = \vec{F}_♕.$$This is a good consistency check and granted me some relief.  I was beginning to fear I was totally crazy and off-the-hinge with all of this.

This force equation just means that the ♕ can move any distance in any of the directions in the 3X3 grid surrounding it.

And of course, a ♔-particle is just a ♕ where the force is constrained to unit magnitude:
$$\vec{F}_♔ = \vec{\Delta}$$ with $F = 1$. Which of course means that the ♔ can only move one space in any direction.

To show how this works, below is a diagram of rook and bishop movements generated in a simple computer program using random numbers in R.  I allowed the ♗ (left) and the ♖ (right) to move through ten moves - they did not always move, as sometimes the tile picked rejected it.  Colored lines show moves from first (red) to last (green), and the spaces are numbered with very small numbers, showing for which turns the piece was there.  For simplicity, I assumed periodic boundary conditions (common in physical models using a lattice) which effectively means I was playing torus chess.

In full disclosure, I ran this process several times to get a "good-looking" tour.

The two particles not yet presented are the ♘ and the ♙.

The ♙ provides a free dynamics that is almost so trivial as to be unnecessary, $\vec{r}_♙(t_n) = (x_o, 1+ak)$ where $k$ is the number of times the ♙ moved.  A ♙-particle does not interact with the background tile charge, as do the other pieces.  However, the dynamics of a ♙ in the presence of other pieces will be extremely complicated - I have not yet worked them out, but considering the number of strange exceptions that hold for Pawns in the game, it seems modeling this behavior will take a good deal of thought.

A Knight's moves are on edge of circle
The ♘-particle can be thought as moving freely to a tile located on a circle of radius $a\sqrt{5}$.  These are the only spaces that it can see.  I likewise have not yet determined a model for this movement.  Near as I can tell, ♘ do not interact with opposing particles.

Thus far much has been said just about the free dynamics of the simplest particles in the chess world, whose dynamical equations produce the usual movements of these pieces in the game of chess.  Opposing pieces would introduce other forces that behave according to a different force with a different charge.  This charge would be team charge, which is rejective for same-charged pieces and acceptive for opposite-charged pieces; you can only move to an occupied tile if the piece belongs to an opponent - that is, if you capture.  Also not considered has been the boundaries, the simulation being done on a torus.  The boundaries will effect the "mass", which drops it to zero if the particle hits a wall, rendering all forces ineffective.

This all will be saved, perhaps, for a later post.

I intend to eventually write a paper that may or may not be published in a real journal.  If you enjoyed this idea and want to develop it further, please email me.

I would like to thank my brilliant cousin, T. Jay Harrison, the nuclear engineer, for bringing up this idea and helping me work through it.

7 comments:

Anonymous said...

http://newsroom.ucla.edu/portal/ucla/is-space-like-a-chessboard-199015.aspx

goethe@justice.com

Reece said...

Thanks! I downloaded the original article and intend to read it once I get a chance.

Reece said...

So, anonymous, I don't know if you're keeping track of comments here or not, but I have in fact read the article you linked about a month ago, stewed it over, read it again, and have written this post sort of about it. Thanks again for posting it! It was a really neat look in to the nature of quantum spin. Hope my response post is interesting at all.

Tim Goodrich said...

Does this have anything to do with why the rituals in masonic lodges are performed on a black and white checkered floor?

Reece said...

I'm afraid I wouldn't know. Masonic rituals and their reasons for existing are far outside of my realm of expertise. But something in me doubts it very strongly :P

Unknown said...

Please share more like that.my hobbies are chess and programming

Unknown said...

Wow, great post.