Content uploaded by Diego J. Raposo
Author content
All content in this area was uploaded by Diego J. Raposo on Oct 22, 2023
Content may be subject to copyright.
Available via license: CC BY-NC-ND 4.0
Content may be subject to copyright.
Mathematical analysis of the Royal
Game of Ur
Diego J. Raposo (0000-0002-8100-8463)
diegoraposo@hotmail.com
Padraig X. Lamont (0000-0002-1330-9790)
padraiglamont@gmail.com
Abstract: Despite many discoveries and proposals for rules for the ancient board game
known as the Royal Game of Ur (RGU), no mathematical analysis has yet been per-
formed investigating those rules. In an attempt to ll that gap, this paper presents an
initial mathematical analysis of the RGU from an introductory point of view. The pa-
per deduces the overall complexity of the RGU using a state-space and game-tree com-
plexity analysis, allowing the RGU to be compared to the popular games Checkers,
Backgammon, Ludo, Chess, and Go. The paper builds upon the fundamental laws of
combinatorics and probability to improve the understanding of the game: what pat-
terns should you expect, what moves increase your chance to win, and what moves
should you avoid. The paper also presents theorems to predict the probability of fu-
ture dice rolls and piece movements within the game, allowing basic inferences to be
made about strategy in the RGU. The game is further examined by analysing three dif-
ferent inuences when determining the best move: advancement and attack (benecial
to the player), and captures (detrimental to the player). These inuences are used to
deduce explicit equations for the advantage gained by playing each possible move from
a position, which allows the formalization of a strategic algorithm to play the RGU.
1 Introduction
The Royal Game of Ur (RGU) is an ancient race board game for two players.
Researchers have been studying the RGU since the 1920s when Sir Leonard Woolley
found ve game boards in a royal tomb in Ur, Mesopotamia (“Woolley’s Excavations”,
2021). This discovery led to the modern naming of the game as the Royal Game of
Ur. However, the game is also commonly referred to as the game of twenty squares
©2023 Diego J. Raposo and Padraig X. Lamont. This is an open access article licensed under the
Creative Commons Attribution-NonCommercial-NoDerivs License (https://creativecommons.org/
licenses/by-nc-nd/4.0/).
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
2Mathematical analysis of the Royal Game of Ur
(de Voogt et al., 2013). The Mesopotamian variation (c. 3,000 BCE) uses the board
represented in Figure 1(a), with seven pieces for each player (Becker, 2007). An Egyp-
tian variation also exists named Aseb (c. 1,700 BCE), which has a slightly dierent
board conguration as represented in Figure 1(b). Each player receives ve pieces in
Aseb instead of 7, and Aseb has fewer safe tiles than the Mesopotamian variation (de
Voogt et al., 2013; Finkel, 2007). Researchers have proposed several possible rule-sets
for the RGU, each formulated to match historical evidence and make the game more
enjoyable (Becker, 2007; Bell, 1979; Finkel, 2007; Masters, 2021; Murray, 1952; Skiriuk,
2021). A mathematical analysis of these proposed rule-sets is desirable for both aca-
demic and educational purposes, as the strategy/chance nature of the game makes it
useful as an example to study basic elements of combinatorics, probability, and com-
puter algorithms. This analysis will also give insights into the intricacies of strategy in
the RGU and how to design ecient computer programs to play it.
(a)
Mesopotamian
variation
(3,000 BCE).
(b)
Egyptian
variation,
Aseb (1,700
BCE).
Figure 1: RGU boards, with the safe and war zones indicated by light and dark grey,
respectively (Finkel, 2007).
The conclusions of this paper will be built assuming only basic knowledge of com-
binatorics and probability. After an introduction to the mechanics of the RGU (sec-
tion 2), the paper analyses the game from a combinatory perspective (section 3), a prob-
abilistic perspective (section 4), and nally using a combination of the two (section 5).
The combinatorial analysis allows the complexity of the RGU to be calculated and
compared between dierent proposed rule-sets, and with other similar games. The
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 3
game’s probabilistic analysis allows players to make predictions about future moves,
allowing the most benecial move from a position to be predicted. However, this
probabilistic analysis only considers the next few moves in the game. The combina-
tion of both combinatorics and probability enables further analysis to be performed
over whole games. This broad analysis is carried out by combining the long-term view
gained from the combinatory analysis with the short-term view gained from the prob-
abilistic analysis.
Whilst the complexity analysis will be performed for many rule sets, all other anal-
yses will focus on the rules proposed by Bell (Bell, 1979), which have been further anal-
ysed by Andrea Beaker and Irving Finkel from the British Museum (BM) in the light
of new evidence in 2007 (Becker, 2007; Finkel, 2007). The British Museum used these
rules in the video Tom Scott vs. Irving Finkel on Youtube (“Tom Scott vs Irving Finkel:
The Royal Game of Ur — PLAYTHROUGH — International Tabletop Day 2017”,
2017), which increased the popularity of the RGU. However, the section analysing the
complexity of the game (section 3) will also explore dierent board layouts and rule-
sets, with each adjusting the number of pieces and the path taken around the board
(“Royal Game of Ur”, 2021; “The Rules of Royal Game of Ur”, 2021). The nal sec-
tion (section 6) summarizes the implications of the analysis on the optimal strategy
and decision-making processes to use when playing the RGU to improve your chance
of winning. Further discussion, arguments, and derivations of the results of this paper
can be found in the appendices (section 8).
2 Basics of the game
This section describes the basic rules of the game as proposed by Bell and further
rened by Andrea Beaker and Irving Finkel (Becker, 2007; Botermans, 2008; Finkel,
2007), which are:
1. Each player has 7 pieces, and the main goal of the RGU is for players to advance
all their pieces along a certain path around and o the board to score them. The
player who scores all their pieces rst wins the game.
2. The path for one player follows the numbers in Figure 2, while their opponent’s
path is a mirror image of it. The initial and nal tiles for pieces are given a dashed
outline in Figure 2 (numbered as 0 and 15, respectively). They are not included
on the physical board, but are there implicitly, and can hold any number of the
player’s pieces. The region between tiles 5 and 12 (dark grey in Figure 1a) can be
occupied by pieces of both players, and is called the war zone. The other tiles
make up the safe zones, where only one player’s pieces are allowed (tiles 1, 2, 3, 4,
13 and 14).
3. The number of tiles that players can move one of their pieces in each turn is
determined by the throw of four tetrahedral dice. Each dice has two marked, and
two unmarked vertices. After they are rolled, the number of tiles to be moved
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
4Mathematical analysis of the Royal Game of Ur
is determined by the number of dice with their marked vertices up. Therefore,
after each throw of the four dice a piece can be moved 0, 1, 2, 3 or 4 tiles. The
player can choose any of their pieces to move, as long as the move of the piece is
legal.
4. Excluding the “virtual” initial and nal tiles that exist o of the board, only one
piece can occupy a tile at a time. It is illegal for a player to move one of their
pieces onto a tile that is already occupied by another of their own pieces. How-
ever, in the war zone it is legal for the player to capture an opponent’s piece by
moving their piece to the same tile. After capture, the opponent’s piece is moved
back to the initial tile to start its advancement from the beginning. There is one
exception to this rule; pieces on rosette tiles cannot be captured. Therefore, in
Bell’s path, pieces on tile 8 cannot be captured.
5. If a piece is moved to occupy a rosette tile (represented by stars in the tiles in
Figure 1), the player is given another turn. The dice are thrown again, and unless
a 0 is rolled, another one of their pieces can be moved (including the one on the
rosette). This can be repeated several times, as long as there remain legal moves
to play, and each piece is moved onto another rosette tile.
6. If there are legal moves available, the players cannot refuse to move on their turn.
However, if there are no legal moves available, the player must pass the turn to
their opponent.
7. In order to move a piece o the board, the piece must be moved exactly to the
nal tile. In Bell’s path, the nal tile is tile 15. Therefore, if the piece occupies tile
14, the player must roll a 1 to move it o the board; if it occupies tile 13, they must
get a 2, and so on. If the player rolls any number higher than the exact number
needed, it is illegal to move the piece o the board. Once all of a player’s pieces
are moved o the board to the nal tile, they win the game.
The path along which the pieces must be advanced diers between rule-sets. This
paper will analyse Bell’s path (the same as in the British Museum proposal) (Becker,
2007; Bell, 1979; Finkel, 2007), Masters’ (Masters, 2021), Skiriuk’s path (Skiriuk, 2021)
(for the description in English, consult Eli, 2021), and Murray’s path (Murray, 1952).
These paths are shown in Figure 3, alongside the path through the Aseb board (Crist
et al., 2016).
3 Quantifying the game’s complexity using combinations
The state-space and game-tree complexity metrics can be used to compare the dif-
ferent RGU rule-sets between one another, and to compare the RGU with the pop-
ular games Checkers, Backgammon, Ludo, Chess, and Go. These complexity metrics
provide a quantitative means of comparing games that have dierent rules. The state-
space complexity provides a measure of the number of positions that are possible in a
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 5
0
15
1
2
3
45
6
7
8
9
10
11
12
13
14
Figure 2: Numbering of the tiles following the Bell/BM path.
(a)
Bell/BM (Bell,
1979)
(b)
Masters
(Masters, 2021)
(c)
Skiriuk
(Skiriuk, 2021)
(d)
Murray
(Murray, 1952)
(e)
Aseb (Crist
et al., 2016)
Figure 3: Path for the piece’s of one player from dierent proposed rule-sets (the
opponent’s path is the horizontal mirror image of the paths shown).
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
6Mathematical analysis of the Royal Game of Ur
game. We compare the state-space complexity of dierent rule-sets of the RGU to de-
duce how the piece count and the path taken across the board aect the complexity of
the game. This metric also provides one perspective to compare the RGU with other
games. However, the state-space complexity metric does not consider the strategic im-
portance of game positions nor the impact of the random dice on the game. Therefore,
the game-tree complexity metric is also calculated as it includes these considerations,
therefore allowing more nuanced comparisons to be made between the RGU and other
games.
3.1 State-Space Complexity
The state-space complexity (SSC) represents the total number of possible legal
states that can be reached in a game. Each state counted in this measure consists of
one possible arrangement of both players’ pieces, on and o the board. The state-space
complexity on the board of the RGU was rst introduced by Ger´
ald P. Michon (Mi-
chon, 2021). The analysis presented here will be similar, but improves the original idea
to include more general cases, with comparisons and corrections.
In any position in the RGU, ppieces for each player can be placed in t′safe tiles
(independent for each player), or in twar tiles (shared by both players). The safe zone
of each player includes the “virtual” initial and nal tiles (tiles 0 and 15 respectively for
Bell’s path). The initial and nal tiles may contain any number of each player’s pieces
o the board. Every other tile on the board can be empty or contain a single piece. The
nal state-space complexity value can therefore be calculated by counting the number
of possible arrangements of all 2ppieces in the 2t′safe tiles and the twar tiles.
If there are enough war tiles to accommodate all of both player’s pieces (i.e. t≥
2p), then Eq. 1 can be used to calculate all possible arrangements of pieces on the board:
ξ(p) =
p
X
ig=0
p
X
ib=0
p−ig
X
ig′=0
α(ig′)
p−ib
X
ib′=0
α(ib′)
β(ib, ig)(1)
If there are more pieces than war tiles (i.e. 2p > t), then Eq. 2 must be used to
calculate all the possible arrangements of pieces on the board instead:
ξ(p) =
p
X
ig=0
t−p
X
ib=0
p−ig
X
ig′=0
α(ig′)
p−ib
X
ib′=0
α(ib′)
β(ib, ig)(2)
+
t−p
X
ig=0
p
X
ib=t−p+1
p−ig
X
ig′=0
α(ig′)
p−ib
X
ib′=0
α(ib′)
β(ib, ig)
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 7
These equations use the fundamental law of counting to count all possible states
that could be reached in the RGU by splitting the board up into three sections: the
grey player’s safe zone, the black player’s safe zone, and the war zone. The function
α(i′)counts the number of arrangements of i′pieces within one player’s safe zone, and
β(ig, ib)counts the number of possible arrangements of both player’s pieces in the war
zone. The equations are deduced in Appendix A, alongside a more in-depth descrip-
tion of their derivation.
They can be applied to all RGU rule-sets where (a) the path has one entry and one
exit for each player, (b) there is at least one safe tile per player (t′= 0), and (c) there are
more war tiles than pieces per player (t≥p). In paths where there are no safe tiles (such
as in Murray’s path), or there are tiles that the player must cross two times (such as in
Murray’s and Skiriuk’s paths), the equations are dierent and more complicated. The
exact equations for these cases will not be presented here, but a lower-bound approxi-
mation can be made by ignoring the direction of pieces on the paths. This approxima-
tion reduces Skiriuk’s to Masters’ path (both have t′= 4 and t= 16), and Murray’s
path to a simple combination problem of ibblack pieces and iggrey pieces in a full war
board (t= 0 and t′= 20). The approximated equation for Murray’s path is:
ξ(p) =
p
X
ig=0
p
X
ib=0
(p−ib+ 1)(p−ig+ 1)β(ib, ig)(3)
The equations presented above are too complicated to be calculated manually. There-
fore, a computer program was created using the Fortran programming language to
make the calculations, with its results shown in Figure 4 and Tab. 1. The source code
of the program used to make these calculations is shown in Appendix B.
We can compare the dierent rule-sets for playing the RGU using their state-space
complexities. This will allow us to identify the eect that the game path and the num-
ber of pieces has on the complexity of the RGU (Michon, 2021). The results of our
calculations are presented in Figure 4, where the vertical axis represents the base-10
logarithm of the complexity, and the horizontal axis represents the number of pieces
assigned to each player.
In Figure 4 it can be seen that Murray’s and Masters/Skiriuk’s paths both have the
highest state-space complexity of all the rule-sets presented. This is despite the simpli-
ed calculations of the complexity of Murray’s and Skiriuk’s paths that underestimate
their true SSC. Murray’s and Skiriuk’s paths have a signicantly higher SSC than Aseb
and Bell’s paths, due to their longer length and their increased number of war zone
tiles. The similarity between Murray’s and Masters’ results also indicate that the four
safe tiles introduced in Masters’ path have little impact on the state-space complexity
of the game.
The curve in the results in Figure 4 is a common trend when counting the possible
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
8Mathematical analysis of the Royal Game of Ur
0 2 4 6 8 10 12 14 16
2
4
6
8
10
Number of pieces, p
State-space complexity, log ξ
Bell/BM
Aseb
Murray
Masters
p= 5
p= 7
Figure 4: SSC for RGU rule-sets. The result for Murray’s path is an approximation.
The data ranges from p= 1 to p=t−1for each case.
arrangements (combinations) of items: the combinations rise to a maximum and then
decrease. This occurs due to the symmetry of the binomial and multinomial func-
tions that are used to calculate the combinations of pieces in the safe and war zones.
However, the summations that are used to count the possible states also introduce a
quadratic growth component to the complexity of the RGU as the number of pieces,
p, is increased. These two growth characteristics act in unison to give the results above.
Additionally, among the RGU paths tested, the order of SSC is: Bell <Aseb <
Masters ⪅Murray. As a matter of comparison, the data presented by G´
erald P. Michon
(Michon, 2021) for the SSC of RGU in Bell’s and Master’s path are ∼
=1.4·108and
∼
=5.0·109, respectively. Therefore Michon’s analysis led to an order of magnitude
overestimation of the SSC of Bell’s path, but only a ∼15% overestimate of the SSC of
Master’s path. This indicates that Michon’s analysis provides practical results, despite
its many approximations, with a more straightforward derivation.
However, the SSC is not an all-inclusive metric for the complexity of games. Herik
et al. argued that the game-tree complexity has a higher value in measuring the com-
plexity of games than the state-space complexity (van den Herik et al., 2002). For ex-
ample, the distribution of safe tiles at the start and end of the board in the RGU signif-
icantly changes the optimal strategy, despite the SSC remaining the same. The SSC is
only one factor that can indicate the complexity of a game, and including other metrics
will give a better picture of a game’s complexity.
3.2 Game-Tree Complexity
The game-tree complexity (GTC) represents all possible sequences of turns from
each player until the game is complete (Eklov, 2021a). It counts all possible dice rolls
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 9
and move choices of one RGU player throughout their possible games. In the RGU,
most game states can be reached from several dierent series of dice rolls and chosen
moves, and therefore GTC ≫SSC.
Heyden’s equation can be applied to estimate the GTC using statistics measured
about the game: GTC = (b·c)N(Eklov, 2021a, 2021b; Heyden, 2009). In this equation,
brepresents the average number of choices a player must pick between each turn, called
the decision branching factor. Similarly, crepresents the number of options selected
between by random chance each turn, called the chance branching factor. In the RGU,
the chance branching factor is 5, as there are ve possible dice rolls: 0, 1, 2, 3, or 4. The
nal value, N, is an estimate for the average number of moves that each player is given in
a typical game. The values of band Nused for our calculations of the GTC of the RGU
were derived by simulating 2000 games between two RGU articial intelligence agents.
The agents decided their moves using the expectimax algorithm with a search depth of
7 (Lamont, 2021). An average decision branching factor of b= 2.45 and an average
number of turns per player of N= 106.35 were measured using these simulations1.
Using these results, we can make an estimate of the RGU’s GTC for games between
two players using the Bell/BM rules would be (2.45 ·5)106.35 =5.3·10115.
3.3 Comparisons to other games
The state-space complexity of the RGU is shown alongside estimates for the SSC
of other popular games in Tab. 1. All rule-sets of the RGU have orders of magnitude
smaller state-space complexities than Backgammon and Ludo, despite both Backgam-
mon and Ludo being considered low-state complex games (Schaeer et al., 2007). The
games of Checkers, Chess, and Go all have much higher SSC than the RGU, despite
Chess and Go being considered high-state complex games (Schaeer et al., 2007). This
demonstrates that the RGU is much less complex than other popular games in terms
of the number of possible positions that can be reached.
The comparison between the GTC of the RGU with other games is also presented
in Tab. 1. Interestingly, despite the RGU having a much smaller SSC than Checkers
and Ludo, its GTC is much higher. This inconsistency supports the idea that any single
complexity metric is insucient to capture the complexity of board games. The GTC
of the RGU is most similar to that of Chess. However, Chess does not contain ele-
ments of chance, and therefore players are given many more decisions to make in Chess
than in the RGU. Due to this disparity, the GTC comparison between games with
random elements (e.g., the RGU) and games without it (e.g., Chess) is contentious.
However, the GTC of the RGU remains smaller than Backgammon, another game
with randomness: 10115 ≪10150 (Heyden, 2009; van den Herik et al., 2002)2. As the
1These numbers apply only to the BM set of rules. Other rule-sets (and paths) would lead to dierent
averages.
2A more detailed calculation assumes b= 16 (Papahristou & Refanidis, 2012) and c= 20 (Tesauro,
2002) for Backgammon, so for an average number of turns of N= 55 (Papahristou & Refanidis, 2012),
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
10 Mathematical analysis of the Royal Game of Ur
Table 1: State-space complexity (SSC) and game-tree
complexity (GTC) of RGU rule-sets, and other popular
games.
Game SSC GTC
RGUa
Bell (with p= 7)∼
=1.2·107∼
=5.3·10115
Aseb (with p= 5)∼
=1.9·108
Masters (with p= 7)∼
=4.3·109
Murray (with p= 7)∼
=5.9·109
Backgammonb∼
=1020 ∼
=10144
Ludoc∼
=1022 ∼
=1091
Checkersd∼
=1021 ∼
=1031
Chessd∼
=1046 ∼
=10123
Go (19 ×19)d∼
=10172 ∼
=10360
aThis work.
bReference (Tesauro, 2002).
cReference (Alvi & Ahmed, 2011). The SSC is an upper bound
(the lower bound is one order of magnitude below it). The GTC
is calculated assuming a mixed (aggressive/defensive/fast) strategy.
dReference (van den Herik et al., 2002).
RGU and Backgammon are similar games, and the GTC of the RGU is much smaller
than the GTC of Backgammon, we can infer that the RGU involves less skill to play
than Backgammon. This conclusion aligns with anecdotal accounts of the RGU be-
ing a more casual and less competitive game than Backgammon. However, the calcu-
lated GTC of 10115 is still high compared to Checkers and Ludo, which are both games
known to contain strategy. This comparison implies that it is likely that strategy will
be important in the RGU as well. The following section will delve deeper into this
strategy through the application of probability to the RGU.
4 Making strategy predictions using probability
4.1 Analysis of a single roll of the dice
In the RGU, players must start their turn by throwing their dice to see how far they
can move one of their pieces. Therefore, the probabilities of each dice roll are a critical
consideration for strategy in the RGU. The rolls 0, 1, 2, 3, and 4 are all possible when
rolling the game’s four tetrahedral dice, with their two marked and two unmarked cor-
ners. However, each of these rolls is not equally likely. Rolling a two is much more
likely than rolling a zero or a four. This is due to the dice each having a 50% chance
of having their marked side land upwards, which together with all four dice forms a
the GTC for Backgammon would be (16 ·20)55 ∼
=6.1·10137, approximately.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 11
binomial distribution (Rozanov, 2013).
The outcome of each dice can be formalized as having the value 1if its marked side
is upwards, or 0otherwise. A roll of four dice can then be described by a four-digit
‘event’, with the outcome of each dice encoded as one digit (e.g., 1010, 0111, or 0100 are
all possible events). As the outcome of each individual dice has a 50% chance of being
a 1, and a 50% chance of being a 0, then the total probability of each possible event
is P(event)=0.54=1
16 = 6.25%. As these events are also mutually exclusive3, the
binomial distribution arises as there are more ways to roll a 2than there are to roll a 1
or a 3, and there is only one way to roll 0or 4. A roll of 0 will always have the event
0000. Conversely, a roll of 1 can have all the following events: 1000, 0100, 0010, 0001.
Therefore, rolling a 1is four times more likely than rolling a zero:
P(1000 or 0100 or 0010 or 0001) = P(1000) + P(0100) + P(0010) + P(0001)
= 6.25% + 6.25% + 6.25% + 6.25%
= 25%
The same approach can be used to calculate the probability, P(roll), of rolling a 0,
2,3, or 4. This leads to the probabilities P(0) = P(4) = 6.25%,P(1) = P(3) = 25%
and P(2) = 37.5%. These results are shown in Figure 5.
0 1 2 3 4
0.1
0.2
0.3
0.4
Number
Probability of selecting a number in a throw
Figure 5: Probability mass function of one throw of four tetrahedral dice in the RGU.
3Only one of the events can ever occur in each throw of the dice.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
12 Mathematical analysis of the Royal Game of Ur
We can also use this concept to calculate the chance of rolling one of a set of rolls
by adding their probabilities. For example, the chance of rolling a 1 or a 3, P(1 or 3), is
simply the sum of P(1) and P(3) (as they are mutually exclusive),
P(1 or 3) = P(1) + P(3)
= 25% + 25%
= 50%
Therefore, while rolling a 2is the most common roll, it is more likely that you will
roll a 1or a 3. These probability calculations can help players to predict the most likely
moves that may appear in the future. They may be used, for example, to select moves
that increase the odds of performing or avoiding captures in future moves. A com-
mon situation that can arise in the RGU that requires these considerations is shown in
Figure 6.
Figure 6: An example position in the RGU where the correct move to make is
contentious. The player with the black pieces has rolled a 2and must decide which black
piece to move.
In the position in Figure 6, the player with the black pieces has rolled a 2and must
decide which piece to move. They must decide whether to move their piece in tile 3
to tile 5, or move their piece from tile 4 to tile 6. If they chose to move their piece
from tile 3, their opponent has a 50% chance of rolling a 1or a 3to capture their piece.
Conversely, if they move their piece from tile 4, their opponent has a 44% chance of
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 13
rolling a 2or a 4to capture their piece. Therefore, the second option has a 6% lower
likelihood of their opponent capturing their piece in the next turn. Additionally, the
second option frees the rosette tile for their other piece and improves the chance of
getting to the center rosette. Therefore, the second move from tile 4 is likely better,
despite the two moves appearing similar at rst glance.
4.2 Analysis of a series of rolls of the dice
We can analyse more complex positions in the RGU by considering the probabil-
ities of throwing multiple specic dice rolls in a row. Each throw of the dice is in-
dependent from previous rolls, and therefore the throws of the dice are considered
statistically independent4. Therefore, the probability of rolling a specic sequence of
numbers can be calculated as the product of all their individual probabilities,
P(roll1then roll2then ... then rollN)=
N
Y
i=1
P(rolli)(4)
This method can be applied to calculate the chance of any sequence of rolls. Sim-
ilar to our notation for the rolls of individual dice, we can represent one sequence of
rolls as an ‘event’ consisting of one digit per outcome (e.g., 23 would represent a roll of
2 followed by a roll of 3). The probability of rolling a 1followed by 4would then be
represented by P(14), which would equal P(1) ·P(4). Since multiplication is commu-
tative, the order of the sequence does not aect the probability (e.g., P(14) = P(41)).
Additionally, since P(0) = P(4) and P(1) = P(3), they can be interchanged without
aecting the probability of the sequence (e.g., P(14) = P(30)). The probabilities of
many common sequences are listed in Tab. 2.
The equation to calculate the probability of longer sequences may be generalized to
consider only the number of each roll in the sequence (e.g. the sequence 14114 contains
three 1’s and two 4’s). This simplication of the equation can be made as the order of
a sequence does not aect its likelihood. The general equation for the probability of
a sequence is shown in Eq. 5. The variable Nirefers to the number of times the roll i
appears in the sequence of Nrolls overall.
PSequence=P(0)N0P(1)N1P(2)N2P(3)N3P(4)N4=6N24N1+N3
16N(5)
For example, we can use this equation to calculate the probability of rushing a piece
through the entire board in a single play. This is not possible with Bell’s path, but
4The term “statistically independent” is used with the meaning of “mutually independent”, not just
“pairwise independent”. This requires that there is no intersection between any possible sets of events.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
14 Mathematical analysis of the Royal Game of Ur
Table 2: Probabilities for sequences of dice throws in the RGU, as percentage values.
P(Sequence)Probability (%)
P(22) 14
P(12) = P(23) 9.4
P(11) = P(13) = P(33) 6.2
P(222) 5.3
P(122) = P(223) 3.5
P(112) = P(123) = P(233) 2.4
P(02) = P(24) 2.3
P(01) = P(03) = P(14) = P(34) 1.6
P(111) = P(113) = P(133) = P(333) 1.6
P(022) = P(224) 0.89
P(012) = P(124) = P(023) = P(234) 0.59
P(00) = P(04) = P(44) 0.39
P(011) = P(013) = P(033) = P(114) = P(134) = P(334) 0.39
P(002) = P(024) = P(244) 0.15
P(001) = P(003) = P(014) = P(144) = P(034) = P(344) 0.10
P(000) = P(004) = P(044) = P(444) 0.024
theoretically can happen in Masters’ path (sequence of four 4’s and a 1), Skiriuk’s path
(sequence of six 4’s), Murray’s path (sequence of seven 4’s), and in Aseb (equivalent to
Masters’). The probabilities are 0.00038%,0.0015% and 0.00000037%, respectively.
Therefore, in Murray’s path (the most likely path where this could occur), according
to the reasoning fully developed in section 5, it would be expected that a piece could
be rushed through the entire board once in every 800 games.
We can also use the probabilities of sequences of rolls to inform strategical decision
making in the RGU. Consider the board presented in Figure 7.
Here the question is: what are the estimated odds of the black piece reaching tile 6
and taking out the grey piece before it can escape? This would require the player with
the grey pieces to roll either a 0 or a 1. The player with the black pieces would then need
to roll a 3 followed by a 2 if the grey player rolled a 0, or two 3’s if the grey player rolled
a 1. Therefore, the two most likely sequences of rolls that would lead to the capture of
the grey piece are 032 and 133. These two sequences have the probabilities 0.59% and
1.6%, respectively (see Tab. 2). Therefore, the chance that grey’s piece will be captured
in the next few moves is low, despite its placement in a vulnerable position in the war
zone.
The exact chance that the player with the black piece can take out the grey piece
is dicult to calculate due to the exponential branching of possibilities in the game
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 15
Figure 7: Example RGU board where the probability of a sequence of rolls can be
applied to estimate odds for decision making. It is the grey player’s turn, and they have no
pieces left to play.
tree of the RGU. For example, an arbitrary number of 0 rolls could precede the two se-
quences above. However, if players limit their calculation to the most common shorter
sequences, they can eectively estimate the odds of dierent outcomes to inform their
move choices.
4.3 Assigning value to moves
While the probabilities of rolls underpin strategy in the RGU, they are insucient
on their own to determine the best move from a position. To determine the best move,
one must consider which move gives them the most advantage. We will quantify this
advantage by considering the value of moves, which measures the loss or gain to your
chance of winning after playing a move. This expected value can give a much better
indication of the best move to make from a position than just probabilities by consid-
ering the degree of gain from each move. For example, capturing an opponent’s piece
at the end of the war zone is more benecial than capturing it at the start of the war
zone.
The true value of any move is the amount that it increases your chance to win the
game. However, this value is computationally intractable to calculate directly. There-
fore, this paper proposes a method to calculate an approximation of the true value,
called the expected value. This expected value is calculated using piece movement as
a substitute for winning chance. This substitution assumes that you are more likely
to win if you can move your pieces toward the end of the board faster than your op-
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
16 Mathematical analysis of the Royal Game of Ur
ponent. The use of piece movement as a substitute for winning chance simplies the
calculation of the value of moves signicantly by decoupling the estimated value from
the game’s outcome.
Therefore, by this expected value metric, advancing your pieces is benecial as it
brings you closer to victory. Similarly, capturing an opponent’s piece is advantageous
as it reverses all of that piece’s advancement. Conversely, if one of your own pieces is
captured, it is detrimental to your progress. This expected value metric can be calcu-
lated for a move as the following:
Eadvance(r) = r
Ecapture(r,c) = r+c(6)
In the above equation, rrepresents the amount that a player’s own piece was ad-
vanced (i.e. the player’s roll), and crepresents the position of the captured piece on the
board (i.e. the number of tiles it was advanced before it was captured). The expected
value of this move for the opposing player is the negation of the expected value for the
player who made the move.
4.4 Rening move values using decision trees
The expected value metric described in the previous section is too simplistic to
facilitate high levels of play when used on its own. However, by expanding a decision
tree based upon possible future sequences of moves, accumulating the expected values
of each move, and aggregating the results, more accurate estimates can be made. These
‘rened’ estimates are termed the gain, G, of a move. Similar methods of decision tree
expansion and aggregation to determine value have been widely used for games with
mixed chance and skill aspects in the past, such as Backgammon (Packel, 2006).
An ecient algorithm to aggregate the expected values of outcomes in decision
trees with the presence of chance was proposed by Bruce W. Ballard in 1983 (Ballard,
1983). Ballard proposed calculating a weighted average, whereby the expected value
of sequences are weighted by their probability, and players are expected to choose the
move that maximizes their value. This method is very eective for articial intelligence
agents. However, it is very demanding for human players to perform during games.
Therefore, this paper explores a dierent aggregation method.
Instead, this paper aggregates the decision trees by independently analysing three
dierent strategy considerations in the RGU: advancement and attack (benecial to
the player), and capture (detrimental to the player). This approach of separating the
strategy of the RGU into distinct components helps to simplify the calculations of the
gain. This allows us to understand and analyse strategy more easily from positions in
the RGU.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 17
Additionally, this paper does not assume that the roll that was made is known.
Ignoring the roll that the player made allows this paper to gain insights into positional
strategy in the RGU. However, this assumption diminishes the eectiveness of this
method while playing games. When playing games, the roll that was made should be
considered. The roll that was made can be considered by ignoring the weighted sum
over all possible rolls when calculating W,A, and Cbelow.
4.4.1 Calculation of Gain
The gain is calculated based upon a single turn of a player, and a possible counter-
attack from the opponent. Multiple rolls in a single turn are also considered, as when a
piece lands on rosette tiles, another roll of the dice is granted. The gain is then adjusted
based upon the sequence of moves of the chosen piece after it has landed on rosette tiles.
The piece to be moved is represented by the parameter A. The gain of the sequence of
moves can then be calculated by evaluating the following expression for the gain, G:
G(A) = W+A+C(7)
The three contributions to G(A)represent the gain for walking the pieces forward
on the board (W), the gain for capturing a piece of the opponent (A), and the loss due
to the player’s piece being captured in the next turn (C). While Wand Aincrease the
gain of a move, Cdecreases it. These contributions are further divided into separate
terms for each move in the sequence (e.g. W0for the rst move, W1for the second
move, W2for the third move, etc...). The full expressions for W,A, and Care deduced
in the Appendix C, and are presented and interpreted as:
•Walking (W): The walking term, W, measures the expected value of advancing
a piece in a single turn. It is the sum of the contributions of all legal moves of the
chosen piece in a single turn. The contribution from each move is the expected
value of advancement for the move, from Eq. 6, multiplied by the probability
of that move, P(r). Without rosettes, the total walking term is given by the fol-
lowing sum over all rolls that lead to legal moves:
W0=X
r0
r0·P(r0)(8)
However, for every rosette tile the piece can legally reach in the turn, a new term
is added to include the probability of reaching that rosette:
Wn=Wn−1·P(rn)
=W0·
n
Y
i=1
P(ri)(9)
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
18 Mathematical analysis of the Royal Game of Ur
The equation above is repeated for every new rosette that can be reached by mov-
ing the piece, resulting in the following expression for Wwhere nrepresents the
number of rosette tiles that can be reached by the piece,
W=W0+X
n
Wn(10)
•Attack (A): A player can only ever capture one of the opponent’s pieces in a
single turn. This arises as only a single piece can occupy a tile at a time, and
player’s cannot capture pieces on rosette tiles. Therefore, player’s cannot gain
an additional move and capture a piece in a single turn. The attack contribution
depends on the number of the war zone tile reached by the piece, na, and the
probability it can be reached by the piece, P(AB . . .). The probability of a piece
reaching a given tile is the product of the probabilities of the numbers that must
be selected for that last move to be possible, P(AB . . .)for a sequence AB . . .
(including cases where A=B=. . .). If, within this sequence, the pieces can
attack the opponents pieces in multiple war zone tiles, the resulting value of A
encloses all pieces that can reach all these tiles, and all sequences sinside. For
instance, a sequence ABC includes the value of attacks on the rst (sequence
A), second (AB), and third (ABC) moves. Therefore, this calculation requires
a triple summation over the pieces on the board (p), the tiles in the war zone (a),
and possible sequences to capture those pieces (s):
A=X
pX
aX
s
naPa=X
pX
a
naX
s
Pa(11)
If there are more possible paths, more pieces that can be captured, or more pieces
that are within range to attack a piece, then the value of Awill be higher. Also,
since nais the number of the tile containing the captured piece, captures at the
end of the war zone have a higher gain than captures at the start of the war zone
(more than twice as much, in some cases). The probability Pamay include the
chance of many rolls in the same turn. Therefore, Pacan be calculated as the
product of the probability of all the rolls in the turn.
•Capture (C): the same way the player can reach the opponent’s pieces in the
war zone, it can be attacked by the opponent on the next turn. The gain of
the opponent is ncPc, if the player’s piece is on tile ncand can be reached by
the adversary with the probability Pc. From the player’s perspective, this is a
potential loss of ncPcfor each sequence that could lead to a capture of their piece
in the next turn. The resulting loss for the player is:
C=−X
pX
cX
s
ncPc=−X
pX
c
ncX
s
Pc(12)
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 19
A
B
Figure 8: Board example for the determination of which move to make in the RGU
based on expected values determinations. The black pieces are labeled by letters A and B.
The same considerations from the attack contribution (A) are valid for captures
(C), which is simply an attack from the opponent’s point of view. Therefore,
the loss to the player upon capture is the negation of the opponent’s potential
gain from an attack.
4.4.2 Application of Gain
Let’s apply the decision tree approach just described in order to make a choice in
a RGU puzzle. Consider the example presented in Figure 8. The possible sequences
of moves in this case are AA,AB,BA and BB. This arises as A and B are the only
two pieces available to move for the black player, and both can reach the rosette on tile
4. If either piece is moved onto the rosette tile, then the black player could choose to
use their next roll to move the same piece again, or move their other piece. Therefore,
the rosette leads to a branching in the decision tree of possible moves in the player’s
turn, as shown in Figure 9. The single-piece moves here do not need to be considered
explicitly, as the gain from subsets of moves are included implicitly (e.g. AA and AB
together represent the gain of the sequence A). This arises as if AA and AB have high
gain values, then Ais implicitly more likely to be chosen as the rst move.
The analysis of this decision tree to calculate the gain of each sequence of moves can
be used to evaluate the best move from the position. The gain of each of the possible
sequences are compared in Tab. 3. The details of the calculations of these values can be
found in Appendix C.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
20 Mathematical analysis of the Royal Game of Ur
Move
A
B
with rosette
no rosette
with rosette
no rosette
A
B
A
B
Figure 9: Ramication of possible paths the player of black pieces may choose,
moving the pieces A or B and, if the rosette is reached, having to decide to move A or B with
the new selected throw.
Table 3: Contribution from dierent sources to the decision tree evaluation of which
sequence of pieces to move on the board of Figure 8.
Sequence Walking (W) Attack (A) Capture (C) Total (G)
AA 1.35 0.14 −5.13 −3.64
AB 1.24 0.02 −4.25 −2.99
BA 2.61 0.38 −4.25 −1.27
BB 2.61 0.84 −9.38 −5.92
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 21
The inspection of this table allows us to quickly discover that the gain, G, of all
possible sequences are negative. This indicates that all possible move sequences will
likely end in loss to the player instead of gain. However, the least negative value is
given by the BA sequence, indicating that it is considered the best sequence to move
according to our model. The small value of Ain all sequences arises as there is only
one piece of the opponents that can be reached to attack, and the sequences of moves
required to attack it are unlikely (either the sequence 4 or 22 are required). Conversely,
the Wcontribution is signicant, as in sequences where Bis moved rst the walking
contribution is over 1 tile greater than in sequences where Ais moved rst. However,
the most signicant contribution from this position is C, as the chance of capture of
any pieces that are moved into the war zone is high. Therefore, the reduced chance of
capture and increased chance of piece movement from the sequence BA make it the
best sequence to play according to our model.
5 Combining combinations and probability
The original combinatorics analysis of the RGU gave us insight into the game’s
complexity, and the probability analysis gave us insight into decision-making strategies
for specic moves. However, we can also gain more broad insight into strategy in the
RGU by combining both combinatorics and probability.
5.1 Expected number of dice rolls in each game
In any match of the RGU, there are a limited number of turns for each player. In
the combinatorics section we used the estimate of N= 106 turns per player, which
we will use again in this section. Using this estimation, we can calculate the expected
number of times that players will roll each value of the dice using the equation Nr=
N·P(r), where ris the value of the dice (i.e. 0, 1, 2, 3, or 4)5. Consequently, in a typical
match, players should expect seven 0’s, twenty-seven 1’s, forty 2’s, twenty-seven 3’s, and
seven 4’s (the same distribution as the probabilities shown in Figure 5). However, there
are several limiting factors that should be considered when using these predictions to
make any inferences about strategy:
•Players cannot use these numbers to predict future rolls of the dice. If a player
has rolled ve 1’s in a row, it is not less likely that they will roll a 1in the next
throw of the dice. This is the gambler’s fallacy (Rabin, 2002; Rabin & Vayanos,
2010);
•The number of rolls of each number that players will receive is not guaranteed.
Although unlikely, you could roll twenty 0’s in a game of the RGU (the chance
of rolling twenty 0’s in a game is 0.00062%, as will be derived soon);
5This result arises from basic probability theory.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
22 Mathematical analysis of the Royal Game of Ur
•The value of Nis an approximation. Games of the RGU can be quick or long,
depending on chance and the strategy of each player.
A possible approach to gain more insight towards the numbers of each roll for
several matches is to observe the condence interval around Nr. In order to do so, it is
useful to calculate the order-independent probability of getting N0zeros, N1ones, N2
twos, and so on. This probability follows a multinomial distribution, and can therefore
be calculated as follows:
P(Frequency) = P(Sequence)N
N0, N1, N2, N3, N4
=P(0)N0P(1)N1P(2)N2P(3)N3P(4)N4N!
N0!N1!N2!N3!N4!(13)
This equation is equivalent to the product of the probability of any specic se-
quence with those numbers of rolls, and the number of possible sequences. For exam-
ple, the probability of rolling one 1 and one 2 is 9.375%, and there are two sequences
that contain one 1 and one 2 (12 and 21). Therefore, P(one 1, one 2) is 2·9.375% =
18.75%.
However, condence intervals in multidimensional functions are harder to evalu-
ate. Luckily, we can make a simplication to treat this problem as a binomial problem.
Instead, let’s redene the ‘event’ whose probability we are interested in. We will con-
sider an ‘event’ only in relation to the occurrence of a single number rin a sequence of
rolls. This changes the problem into a binomial problem, as we are only interested in
whether a roll was r, or was not r. In this case, the probability of rolling rexactly Nr
times in a sequence of Nrolls follows the following binomial distribution:
P(Nr) = P(r)Nr[1 −P(r)]N−NrN
Nr(14)
For instance, the chances of getting N0= 20 zeros in N= 106 turns is:
P(N0= 20) = P(0)20 [1 −P(0)]106−20 106
20 = 6.25 ·10−6= 0.000625%
When Nand Nr/N are large, the condence intervals of binomial functions ap-
proximately follow a normal distribution (Lawrence D. Brown & DasGrupta, 2001).
Using this approximation, we can estimate how probable it is that Nrlies between
Nr−ΔNrand Nr+ ΔNr, with a certain condence level. The value of ΔNris given
by:
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 23
ΔNr=z·NrP(r) [1 −P(r)]
N(15)
In this equation, zdepends on the condence level, and represents the number of
standard deviations away from the mean of the normal distribution. For example, for a
90% condence level, z= 1.645. This represents that for normal distributions, 90% of
samples fall within 1.645 standard deviations of the mean. This gives the results that in
90% of games, the number of 0’s and 4’s will fall between 3 and 11 (each), the number
of 1’s and 3’s will fall between 19 and 34 (each), and the number of 2’s will fall between
32 and 48. This demonstrates that there is a large variation in the expected number of
rolls observed in games of the RGU, which reinforces that the number of rolls within
games of the RGU is unpredictable.
5.2 Expected number of turns to move pieces
In games of the RGU, the expected number of dice rolls to advance a piece by S
tiles is S/2. This arises due to the expected mean dice roll of 2, leading to an average of 2
tiles moved per dice roll. Therefore, the most probable sequences of dice rolls to move
a piece by Stiles will be S/2moves in length. Additionally, when players encounter
a rosette tile, they are granted an extra move, leading the average number of turns to
move a piece Stiles to be less than S/2. However, when moves of a piece are blocked
by other pieces, the number of turns required will increase.
For example, taking control of the centre rosette is commonly considered strategi-
cally advantageous by players. To move a piece from the start of the board to the centre
rosette, players must advance a piece by S= 8 tiles. Therefore, it should most often
take S/2=4moves to get to the centre rosette. Additionally, due to the rosette on tile
4, players will likely be granted an extra move and take only 3turns to get to the centre
rosette. This result shows that the player who goes rst will have a signicant edge in
getting to the central rosette rst. However, this advantage is not without risk, as 3 of
the tiles that must be advanced past to get to the central rosette are in the war zone.
Therefore, often players will opt for the safer option of moving more of their pieces
onto the board instead of risking their opponent capturing their piece early, without
retribution.
Another example is to consider all of the possible sequences to advance a piece by
S= 4 tiles. We would expect that most often this would take players S/2=2moves.
To verify this, we calculate the probabilities of all length-1, length-2, and length-3 se-
quences of moves to advance a piece by 4tiles in Tab. 4. We must also consider all the
sequence combinations, which is accomplished by the multiplications in the probabil-
ity columns (e.g. the sequences 004, 040, and 400 all have the same probability, so we
only list 004 once). This is a direct application of Eq. 13.
In these results, the length-2 sequences are the most likely to allow the movement of
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
24 Mathematical analysis of the Royal Game of Ur
Table 4: Probabilities for sequences of dice rolls with sum four from M= 1 to M= 3
dice rolls. The multiplication within the probability columns is a factor to consider all
combinations of each sequence.
Length-1 Length-2 Length-3
Sequence Probability (%) Sequence Probability (%) Sequence Probability (%)
(4) 6.25 (04) 0.39 ·2=0.78 (004) 0.024 ·3=0.073
− − (13) 6.25 ·2 = 12.50 (013) 0.39 ·6=2.34
− − (22) 14.06 (022) 0.88 ·3=2.64
− − − − (112) 2.34 ·3=7.03
a piece by 4tiles. However, the overall probability of moving your piece exactly 4tiles
in 1, 2, or 3 moves is still only 45.7%. This low probability is due to these calculations
ignoring the possibility of selecting the pieces you wish to move. Sequences such as 232
still allow you to move one of your pieces by exactly 4tiles, as long as you can use the
dice roll of 3on another one of your pieces. Therefore, despite moving a piece by 4tiles
taking approximately 2moves, those moves may not be in order. Thus, in real games,
it may take more turns to move your pieces to precise locations, as you will likely have
to distribute your dice rolls between your pieces to do so.
6 Conclusion
The mathematical proofs and arguments presented in this paper can be used for
teaching, as a basis for further research, and to improve the tactics of players.
In section 3.1 we found that the state-space complexity of the Royal Game of Ur
(RGU) is small when compared with similar games such as Backgammon or Ludo, and
much smaller than Chess or Checkers. Conversely, the game-tree complexity of the
RGU calculated in section 3.2 was much higher due to the inclusion of chance in the
calculation. The game-tree complexity of the RGU was estimated to be much larger
than the game-tree complexity of Checkers and Ludo. This suggests that even though
the RGU has a small number of possible game states compared to other games, its
high game-tree complexity suggests that strategy is present. This matches the anecdotal
accounts of the presence of strategy in the RGU.
In section 3.1 the state-space complexity (SSC) of the RGU was also compared be-
tween the rule-sets proposed for the game. It was found that the SSC was much larger
for the rule-sets with the longest paths. Therefore, both Murray’s and Masters’ paths
lead to the most possible outcomes. Conversely, one of the most popular paths played
today, Bell’s path, is the least complex in terms of state-space complexity of all the rule-
sets analysed here. Perhaps then, the simplicity and approachability of the rule-set pop-
ularised by Irving Finkel has played into its widespread adoption.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 25
The inuence of the number of starting pieces on the SSC of the RGU was also
calculated for many dierent RGU rule-sets. It was observed that the SSC was highest
when the number of starting pieces was slightly smaller than the number of war-zone
tiles in the rule-set’s path. For Bell’s path, it was found that 7 starting pieces led to
the highest SSC, which is the same number of starting pieces as used by the rule-set
popularised by Irving Finkel.
The probabilities of individual dice rolls and sequences of dice rolls were derived in
section 4. It was shown that rolling a 2 was most likely with a 37.5% chance, followed by
1 and 3 with a 25% chance each, and then 0 and 4 with only a 6.25% chance each. These
chances were used to analyse an example position that showed that while rolling a 2 is
the most likely, rolling 1 or 3 is more likely. Therefore, while a piece that is 2 tiles ahead
of an opponent’s piece is very vulnerable, a piece that is 1 tile ahead of one opponent’s
piece, and 3 tiles ahead of another, is more vulnerable. This basic probabilistic analysis
is too simplistic to describe more complex positions however, especially in the presence
of rosette tiles.
When rosette tiles are available, sequences of dice rolls must be considered to cal-
culate the chance of capturing a piece in a single turn. In section 4.2, the probabilities
of sequences of moves were derived. It was observed that all sequences of two dice rolls
that included at least one roll of 2 were more likely to occur than rolling a single 0 or
4. For example, if a piece is 4 tiles behind an opponent’s piece and 2 tiles behind an
empty rosette tile, then they could roll either one 4 or two 2’s to capture that piece.
The chance of rolling one 4 is 6.25%, while the chance of rolling two 2’s is 14%, higher
than the chance of rolling one 4. Therefore, considering the probability of sequences
of moves is key to analysing more complex positions in the RGU. However, these prob-
abilistic analyses overlook one key aspect of selecting the best move in the RGU: some
moves are more benecial than others.
In section 4.3 we argued that an eective metric for estimating move value was piece
movement. If one move advanced your pieces further than another, then it is more
benecial. Similarly, if you capture an opponent’s piece it loses its advancement, which
is detrimental to your opponent and thus benecial to you. This metric improves the
analysis of positions even further, although it lacks consideration of counter-attacks
from your opponent.
In section 4.4 we introduced the concept of expanding decision trees of the possible
future moves and aggregating the results to calculate more accurate estimates of move
value. We proposed a simplied method for this process in 4.4.2 that analysed move-
ments based upon three considerations: walking and attack (benecial to the player),
and capture (detrimental to the player). The sum of these three considerations gives
our proposed gain for a move. Moves with higher gain are considered to be more ad-
vantageous to play. The walking consideration is calculated based upon the number of
tiles that pieces may be advanced when a piece is moved, and it is increased through the
presence of rosette tiles. The attack consideration is calculated based upon the value of
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
26 Mathematical analysis of the Royal Game of Ur
capturing an opponent’s piece, and it is increased when there are more pieces that may
be captured, or when they are further along in the war-zone. The capture consideration
is the inverse of attack, and it represents the opportunity of any possible counter-attack
from the opponent after you have moved your piece. These considerations are easier to
calculate on-the-y than traditional approaches of rening the values of moves using
decision trees, and therefore we believe this is a good approach for human players to
emulate to improve their game.
In section 5 we combined the use of probability theory and combinatory theory to
calculate the frequencies of dice rolls expected within typical games of the RGU, and
to estimate the number of turns required to move pieces to specic tiles. We found
that the expected frequency of each value of dice rolls in any given match can uctuate
widely by calculating the 90% condence interval for the frequency of each dice roll
value in a typical game. This suggests that in any given game, luck could play a signi-
cant factor in determining if one player gets more benecial rolls than their adversary.
We also showed that it can be expected that N/2turns will be required to move a single
piece Ntiles, due to the mean expected dice roll of 2. This implies that sequences to
move a piece Ntiles that are not N/2moves long will be less probable to occur. Anal-
yses such as these have a great potential to provide new insights into the RGU, and it
is the current subject of further research.
7 Future Work
While this study addresses several key elements of the RGU, many remain unex-
plored, including game balance, game length, and the impact of luck on the outcome
of games. Future studies could consider establishing formal methods to measure these
attributes, facilitating comparisons to be made between rule sets, and potentially be-
tween games. However, these features may be complex to calculate directly. Therefore,
a promising future avenue of research could be the simulation of games with AI agents.
This could allow statistical measurements to be made of these features of the RGU.
Additionally, further computer analysis could allow the calculation of the game-tree
complexity metric for each RGU rule set, extending beyond the current focus on Bell’s
path.
Acknowledgments
The authors thank James Masters, Thiago A. Nascimento, George Pollard, and
other colleagues from the Royal Game of Ur community on Discord for their support
in the preparation of this manuscript. You have all helped greatly through corrections,
suggestions, relevant and interesting discussions, and encouragement.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 27
Disclosure statement
No potential conict of interest was reported by the authors.
References
Alvi, F., & Ahmed, M. (2011). Complexity analysis and playing strategies for ludo and its variant race
games. 2011 IEEE Conference on Computational Intelligence and Games(CIG’11), 134–141. https:
//doi.org/10.1109/CIG.2011.6031999
Ballard, B. W. (1983). The *-minimax search procedure for trees containing chance nodes. Artificial In-
telligence,21(3). https://doi.org/https://doi.org/10.1016/S0004-3702(83)80015-0
Becker, A. (2007). The royal game of ur. In I. L. Finkel (Ed.), Ancient board games in perspective: Papers
from the 1990 british museum colloquium (pp. 11–15). British Museum Press.
Bell, R. C. (1979). Board and Table Games From Many Civilizations (Revised, Vol. 1 and 2). Dover
Publications, Inc.
Botermans, J. (2008). The book of games: Strategy, tatics & history. Sterling.
Crist, W., Dunn-Vaturi, A.-E., & de Voogt, A. (2016). Ancient Egyptians at Play: Board Games Across
Borders. Bloomsbury Academic.
de Voogt, A., Dunn-Vaturi, A.-E., & Eerkens, J. W. (2013). Cultural transmission in the ancient Near
East: Twenty squares and fty-eight holes. Journal of Archaeological Science,40, 1715–1730.
Eklov, E. (2021a). Game Complexity I: State-Space & Game-Tree Complexities. https://www.pipmodern.
com/post/complexity-state-space-game-tree
Eklov, E. (2021b). Game Complexity II: Modern Board Game Analysis. https://www.pipmodern.com/
post/complexity-modern-board-game-analysis
Eli. (2021). Royal game of ur - game of 20 squares. https://www.ancientgames. org /royal- game- ur -
game-20-squares/
Finkel, I. L. (2007). On the rules for the royal game of ur. In I. L. Finkel (Ed.), Ancient board games in
perspective: Papers from the 1990 british museum colloquium (pp. 16–32). British Museum Press.
Heyden, C. (2009). Implementing a Computer Player for Carcassonne [Master thesis]. Maastricht Uni-
versity. https://project.dke.maastrichtuniversity.nl/games/les/msc/MasterThesisCarcassonne.
pdf
Lamont, P. (2021). The Royal Game of Ur Analysis. https://github.com/Sothatsit/RoyalUrAnalysis/
blob/main/docs/Agents.md
Lawrence D. Brown, T. T. C., & DasGrupta, A. (2001). Interval Estimation for a Binomial Proportion.
Statistical Science,16(2), 101–133.
Masters, J. (2021). The Royal Game of Ur & The Game of 20 Squares. https://www.tradgames.org.uk/
games/Royal-Game-Ur.htm
Michon, G. P. (2021). Royal game of ur (game of twenty squares). http: / / www. numericana . com/
answer/ur.htm
Murray, H. J. R. (1952). A History of Board-games Other Than Chess. Oxford University Press.
Packel, E. W. (2006). The mathematics of games and gambling. The Mathematical Association of Amer-
ica.
Papahristou,N., & Refanidis, I. (2012). Improving temporal dierence learning performancein backgam-
mon variants. In H. J. van den Herik & A. Plaat (Eds.), Advances in computer games (2011)
(pp. 134–145). Springer Science + Business Media. https: / /www. academia.edu/ 2569666 /
Improving Temporal Dierence Learning Performance in Backgammon Variants
Rabin, M. (2002). Inference by Believers in the Law of Small Numbers. The Quarterly Journal of Eco-
nomics,117(3), 775–816.
Rabin, M., & Vayanos, D. (2010). The Gambler’s and Hot-Hand Fallacies: Theory and Applications.
The Review of Economic Studies,77, 730–778.
Royal game of ur. (2021). https://gameofuronline.com/
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
28 Mathematical analysis of the Royal Game of Ur
Rozanov, Y. A. (2013). Probability theory: A concise course. Dover Publications.
The rules of royal game of ur. (2021). https://www.mastersofgames.com/rules/royal-ur-rules.htm
Schaeer, J., Burch, N., Bj¨
ornsson, Y., & Kishimoto, A. (2007). Checkers Is Solved. Science,317(5844),
1518–1522.
Skiriuk, D. (2021). The rules of royal game of ur. https://skyruk.livejournal.com/231444.html
Tesauro, G. (2002). Programming backgammon using self-teaching neural nets. Artificial Intelligence,
134, 181–199.
Tom Scott vs Irving Finkel: The Royal Game of Ur — PLAYTHROUGH — International Tabletop
Day 2017. (2017). https://www.youtube.com/watch?v=WZskjLq040I&t=6s
van den Herik, H. J., Uiterwijk, J. W., & van Rijswijck, J. (2002). Games solved: Now and in the future.
Artificial Intelligence,134, 277–311.
Woolley’s excavations. (2021). http://www.ur-online.org/about/woolleys-excavations/
8 Appendices
A Deducing the state-space complexity equations for the RGU
The number of possible arrangements of each player’s pieces within the war zone
can be calculated using the multinomial equation. This can be done by considering
the tiles in the war zone as having three possible states: (1) they can be empty, (2) they
can contain a grey piece, or (3) they can contain a black piece. The number of arrange-
ments (i.e. combinations) of each player’s pieces can therefore be calculated using the
multinomial equation by counting the possible arrangements of states of each tile.
The multinomial equation calculates the combinations of a sequence of N1ele-
ments of type 1, N2elements of type 2, N3elements of type 3, and so on, in a sequence
of N=N1+N2+N3+. . . numbers:
Z=N!
Qk
i=1 Ni!=N
N1, N2, . . . , Nk(16)
For example, the number of sequences of the 3 letters a,b, and c, is 6 (N= 3,
N1=N2=N3= 1):
abc bac cab
acb bca cba
If ais repeated instead of adding the third letter c, then the combinations reduces
to Z= 3 (N= 3,N1= 2, and N2= 1):
aab aba baa
If there are only two types, as in the two letter case, then the multinomial equation
simplies to the binomial equation. The binomial equation is often expressed as the
combinations of N=N1+N2elements, with i=N1elements of type 1:
Z(i) = N!
i!(N−i)! =N
i(17)
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 29
In the RGU context, we can use Eq. 16 for the calculation of the state-space com-
plexity (SSC) of the game. The SSC is just the number of possible legal arrangements
of the pieces on the board, for all possible games. It can be directly obtained for some
simple games, but for most games only the order of magnitude is available through
mathematical derivation or brute force (using computer algorithms). Our exact calcu-
lations will depend upon the multinomial equation (Eq. 16), its binomial special case
(Eq. 17), and on the fundamental principle of counting. This principle states that if
we want to determine the number of possible outcomes of sets of independent events
(each with ξinumber of events for each case i), one must multiply them all:
ξ=
k
Y
i=1
ξi(18)
This allows us to separate the problem of counting the number of combinations of
black and grey pieces into two cases: (1) counting pieces in safe tiles that can be occupied
by only one player’s pieces, and (2) counting pieces in war tiles that can be occupied by
both grey and black pieces.
For the rst case, one must consider the tiles where only one kind of piece can
occupy, t′, and the departure and arrival tiles, where any number of pieces can stay.
In the t′houses (tband tgfor black and grey pieces, respectively), only two states are
allowed: the house is occupied or not. Therefore, the number of combinations of i′
pieces in the t′tiles is just:
t′
i′=t′!
i′!(t′−i′)! =t′
t′−i′(19)
Related to that number is the amount of pieces that are left in the departure and
arrival tiles (d, a). If one is on the board, for instance, the t′−1pieces can be separated
between t′−1on one side and 0on the other: (t′−1,0). But other arrangements
are equally possible (as long as the sum of pieces is t′−1): (t′−2,1),(t′−3,2), ...,
(0, t′−1). There are, therefore, t′−1+1of such cases, if 1 piece is on the board; if
i′pieces are on the board, the number of possible arrangements outside the board is
t′−i′+ 1. The product of this number with the combinations inside the board leads
to:
α(i′≤t′)=(t′−i′+ 1)t′
i′(20)
Eq. 20 is valid, as indicated, when i′≤t′. When it is not the case, however, all tiles
are occupied (number of combinations is 1) and there are only i′−t′+ 1 possibilities
outside the board.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
30 Mathematical analysis of the Royal Game of Ur
α(i′) =
(t′−i′+ 1)t
i′for i′≤t′
i′−t′+ 1 for i′> t′
(21)
A way to put it in a single equation is:
α(i′)=(|δ|+ 1)t′
(δ− |δ|)/2 + t′(22)
where:
δ=i′−t′(23)
Therefore, when i′< t′,i′−t′<0,|δ|=−(i′−t′) = t′−i′and (δ− |δ|)/2 + t′=
2(i′−t′)/2 + t′=i′. Otherwise, if i′≥t′, then i′−t′≥0,|δ|=i′−t′and
(δ− |δ|)/2 + t′= 2(i′−t′−i′+t′)/2 + t′=t′, and the combinatorial becomes 1.
Given that the number of pieces can range from i′= 0 to i′=p′, the number of
combinations given p′is:
γ(p′) =
p′
X
i′=0
α(i′)(24)
Eq. 24 is not absolute, however. It implicitly assumes there are both pieces in the
board and outside it, unless there are too much pieces to be on the board, and only ex-
changes between the pieces outside (between departure and arrival tiles) counts. How-
ever, when there are no pieces on the board (i′= 0), the number of combinations is
just p′+ 1. In order to consider it, one can count this case outside the summation:
γ(p′)=(p′+ 1) +
p′
X
i′=1
α(i′)(25)
Another thing is, if i′< t′and all the pieces are on the board (i′=p′), no other
outside (in cases where p′< t′), the equation has to be changed, and the number of
combinations is just t′!/(p′!(t′−p′)!). Therefore, the equations so far apply only to
p′> t′, which is usually the case in RGU rules. Also, the equation is based on the
transformation Pb
i′=0 f(i′) = f(0) + Pb
i′=1 f(i′)for a function f(i′), which implies
that if b= 0, there is no summation at all, and f(i′) = f(0). In our case:
γ(p′= 0) = (p′+ 1) = 1 (26)
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 31
These considerations and equations holds for a player only, and the possible out-
comes when both players are considered is the product of the number of events of each
(Eq. 18), and for a specic pg′of grey pieces and a pb′of black pieces:
γ(pg′)γ(pb′) =
pg′
X
ig′=0
α(ig′)
pb
′
X
ib′=0
α(ib′)
(27)
What about the pieces on the shared places? Well, in this case there are three types
of state for each tile: unoccupied, occupied by grey pieces and occupied by black pieces.
According the multinomial equation (Eq. 16), the number of possibilities for iggrey
pieces and ibblack pieces (the remaining will be in the exclusive tiles or in departure/arrival
tiles) in ttiles is:
β(ig, ib) = t!
ib!ig!(t−ib−ig)! =t
ib, ig(28)
Eq. 28 remains valid if ib+ig≤t, otherwise the limits on the variations of igand
ibmust be reconsidered to account the fact. This will be addressed soon.
Now, considering the three independent events (black and grey in secure places,
and black and grey at war), we must divide the pieces which are on the shared places (ib
black pieces plus iggrey pieces) and the ones that must go to the secure tiles or outside
the board. The number of these is determined by setting p′=p−i, where pis the total
number of pieces (independent of the place they are). For black or grey pieces, then:
γ(p′) = γ(p−i) =
p−i
X
i′=0
α(i′)(29)
Therefore, when we consider, for a xed number of pbblack pieces and pggrey
pieces on the board (ibblack pieces and iggrey pieces on the war zone) we have γ(pg−
ig)γ(pb−ib)β(ig, ib)combinations. Since the number of pieces on the war zone can
range from i= 0 to i=p, the total number when we consider them all is:
ξ(pg, pb) =
pg
X
ig=0
pb
X
ib=0
γ(pg−ig)γ(pb−ib)β(ig, ib)(30)
ξ(pg, pb) =
pg
X
ig=0
pb
X
ib=0
pg−ig
X
ig′=0
α(ig′)
pb−ib
X
ib′=0
α(ib′)
β(ib, ig)(31)
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
32 Mathematical analysis of the Royal Game of Ur
where iband igpieces are on the shared tiles, and ib′=pb−iband ig′=pg−igare on
the rest of the board (or outside).
Notice that this equation is quite general: it is valid for a board with two kinds of
pieces, two kinds of places (the individual and shared ones), any number of pieces for
each and any number places of each case. In the RGU historical possibilities, and the
equality among players (both must have the same opportunities and limitations!), it
should be assumed that tg=tb=tand pg=pb=p. That implies:
ξ(p) =
p
X
ig=0
p
X
ib=0
p−ig
X
ig′=0
α(ig′)
p−ib
X
ib′=0
α(ib′)
β(ib, ig)(32)
The equation is valid for 2p < t. If is not the case, the pieces can ll the war zone
completely, and the multinomial term can no longer be used (since it will lead to nega-
tive factorials). A way to bypass that limitation is, while assuming p<t, to choose one
kind of piece to ll as much as it can the war zone (say, summing up igfrom 0 to p),
and gradually lling the gaps with the other kind of pieces, until t−p(in the example,
ibwould range from 0 to t−p). Then, another summation must be made, with the
opposite case, the kind of piece that previously lled the war zone ranging from 0 to
t−pand the other kind (previously limited), ranging from t−p+ 1 to p. Therefore,
for cases where t/2< p < t (cases were p < t/2are covered by Eq. 32):
ξ(p) =
p
X
ig=0
t−p
X
ib=0
p−ig
X
ig′=0
α(ig′)
p−ib
X
ib′=0
α(ib′)
β(ib, ig)
+
t−p
X
ig=0
p
X
ib=t−p+1
p−ig
X
ig′=0
α(ig′)
p−ib
X
ib′=0
α(ib′)
β(ib, ig)
(33)
We emphasize that Eq. 33 do not hold when 2p<t, since it was deduced assuming
we can ll the war zone with all pieces of one type and complete the other tiles with the
pieces of the adversary. Therefore, in these cases the Eq. 32 should be used instead. In
contraposition, the use of Eq. 32 to cases where 2p>tleads to the problems discussed
before. Each equation has its domain of validity. And both assumes that p < t (which
are the cases that concerns us).
Among the dierent paths suggested for the RGU, the simplest one concerns a
board with no separation between safe and war zones among pieces (t′= 0), which
is Murray’s path. If we neglect the pieces direction when crossing the same tiles twice,
the number of combinations can be approximated to an exact, though underestimated,
value. The number of possible scenarios in this case, for ppieces for each player, is:
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 33
ξ(p) =
p
X
ig=0
p
X
ib=0
(p−ib+ 1)(p−ig+ 1)β(ib, ig)(34)
We nish this appendix with the detailing of a small model, a mini-RGU example,
which assumes p=t′= 1 and t= 2. Since 2p≤t, we should use Eq. 32:
ξ(1) =
1
X
ig=0
1
X
ib=0
1−ig+1+
1−ig
X
ig′=1
(1 −ig′+ 1)1
ig′
·
1−ib+1+
1−ib
X
ib′=1
(1 −ib′+ 1)1
ib′
2
ib, ig
This implies, when each term of the summations is properly accounted for:
ξ(1) = 1−0 + 1 + (1 −1 + 1)1
1·1−0 + 1 + (1 −1 + 1)1
1·2!
0!0!2!
+ [1 −1 + 1 + 0] ·1−0 + 1 + (1 −1 + 1)1
1·2!
1!0!1!
+1−0 + 1 + (1 −1 + 1)1
1·[1 −1 + 1 + 0] ·2!
0!1!1!
+1−1 + 1 + (1 −1 + 1)1
1·1−1 + 1 + (1 −1 + 1)1
1·2!
1!1!0!
ξ(1) = 3 ·3·1+1·3·2+3·1·2+1·1·2 = 9 + 6 + 6 + 2 = 23
The possible 23 board dispositions are listed on Figure 10.
B Algorithm to calculate the combinations in the dierent versions of the
RGU
The algorithm is written in Fortran 95, but the logic is quite simple and expressed
in the documentation reproduced along the code presented in Figure 11. The code is
valid for p<t, and assumes pand t′are the same for both players.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
34 Mathematical analysis of the Royal Game of Ur
1
0
1
0
0
1
1
0
1
0
0
1
0
1
0
1
1
0
1
0
1
0
0
1
0
1
0
1
1
0
1
0
1
0
0
1
0
1
0
1
Figure 10: Congurations of a mini-RGU with p=t′= 1 and t= 2.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 35
program rgu_program
implicit none
!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx!
!-------------- This program calculate the space-state complexity of the Royal Game of Ur ----------------!
!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx!
integer, parameter :: ikind=selected_real_kind(p=15)
real(kind=ikind) :: p,t_safe,t_war,ig_safe,ib_safe,ig_war,ib_war,fact
real(kind=ikind) :: delta_gray,delta_black,a_gray,a_black,sum1,sum2,sum3
real(kind=ikind) :: cont,top1,top2,top3,total
print *,’---------------------------------------------------------------------------’
print *,’ The program rgu calculates the number of combinations of p stones ’
print *,’ in t_safe houses and t_war houses in the Royal Game of Ur ’
print *,’---------------------------------------------------------------------------’
print *,’ Any issue, contact the developer Diego J. Raposo ’
print *,’ (email: diegoraposo@hotmail.com) ’
print *,’---------------------------------------------------------------------------’
print *,’Reading input file:’
open(10,file=’rgu_input.txt’) !Opening the input file!
read(10,*) p,t_safe,t_war !Reading variables in the input file!
print *,’---------------------------------------------------------------------------’
print *, ’The value of p is’,p
print *,’---------------------------------------------------------------------------’
print *, ’The value of t_safe is’,t_safe
print *,’---------------------------------------------------------------------------’
print *, ’The value of t_war is’,t_war
print *,’---------------------------------------------------------------------------’
open(12,file=’rgu_output.txt’) !Open a file where the output will be stored!
!do p=1.0_ikind,t_war-1 !Setting a cycle, changing p!
if (2*p <= t_war) then !There will be one external cycle if 2p <= t_war!
top1 = p !Establishing the limits of the sums!
top2 = 0.0_ikind
top3 = p
cont = 2.0_ikind !This allows one external cycle!
total=0.0_ikind !’total’ will be added up at each internal cycle!
else !There will by two external cycles if 2p > t_war!
top1 = p !Establishing the limits of the sums!
top2 = 0.0_ikind
top3 = t_war - p
cont = 1.0_ikind !This allows two external cycles!
total=0.0_ikind !’total’ will be added up at each internal cycle!
end if
do while (cont < 3) !’cont’ will limit to one or two cycles, depending on previous value!
do ig_war=0,top1 !sumations on gray stones inside the war zone!
do ib_war=top2,top3 !sumations on black stones inside the war zone!
sum1=0.0_ikind !’sum1’ will be added up!
if (p-ig_war == 0.0_ikind) then !if there is no stone left to safe zone or outside de board!
sum1 = 0.0_ikind
else
if (p-ig_war <= t_safe) then !there is not enough stones to fill the safe place!
do ig_safe=1.0_ikind,p-ig_war
sum1=sum1+fact(t_safe)/(fact(ig_safe)*fact(t_safe-ig_safe)) !
end do
else
do ig_safe=1.0_ikind,p-ig_war !enough to fill the safe place, and deltas if pass it!
delta_gray=ig_safe-t_safe
a_gray=(delta_gray-abs(delta_gray))/2.0_ikind+t_safe
sum1=sum1+fact(t_safe)*(abs(delta_gray)+1)/(fact(a_gray)*fact(t_safe-a_gray))
end do
end if
end if
sum1=sum1+p-ig_war+1 !adding the case when all pieces are outside the board!
sum2=0.0_ikind !’sum2’ will be added up!
if (p-ib_war == 0.0_ikind) then !the same for the black pieces!
sum2 = 0.0_ikind
else
if (p-ib_war <= t_safe) then
do ib_safe=1.0_ikind,p-ib_war
sum2=sum2+fact(t_safe)/(fact(ib_safe)*fact(t_safe-ib_safe))
end do
else
do ib_safe=1.0_ikind,p-ib_war
delta_black=ib_safe-t_safe
a_black=(delta_black-abs(delta_black))/2.0_ikind+t_safe
sum2=sum2+fact(t_safe)*(abs(delta_black)+1)/(fact(a_black)*fact(t_safe-a_black))
end do
end if
end if
sum2=sum2+p-ib_war+1
sum3 = fact(t_war)/(fact(ib_war)*fact(ig_war)*fact(t_war-ib_war-ig_war))!combinations inside war zone!
total=total+sum1*sum2*sum3 !total sum, given one choice of ib_war and ig_war!
end do
end do !first or only double sum finishes here!
cont = cont + 1.0_ikind !one or two double cycles, depending on earlier value!
top1 = t_war - p !if there are two external cycles, new limits!
top2 = t_war - p + 1
top3 = p
end do
print *,’---------------------------------------------------------------------------’
print *, ’The state-space complexity number is’,p, total
!write (12,*) p,total !to write the results in a output textfile!
!end do !cycle with variable p values!
print *,’---------------------------------------------------------------------------’
print *, ’Thank you for using this program!’
end program rgu_program
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! Defining factorial function
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function fact(number)
integer,parameter :: ikind=selected_real_kind(p=15)
real (kind=ikind) :: fact, number, z
z=1
do i = 1, number
z=z*i
end do
fact = z
end function fact
Figure 11: Fortran code used to calculate SSC of dierent paths in RGU.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
36 Mathematical analysis of the Royal Game of Ur
C Simple decision tree algorithm for RGU
A decision tree is a scheme/algorithm/model that provides quantitative tools to
make decisions in situations where the statistical element is present. It is composed
by decision nodes (where the choices are splitted into branches, whose consequences
need to be analysed), chance nodes (whose branches amounts the possible outcomes
and the respective probabilities) and end nodes (associated with some numerical value,
which one aim to maximize or minimize). Usually the decision, chance and end nodes
are represented by tiles, circles and triangles, respectively. A typical and simple decision
tree is presented in Figure 12(a).
B
b′
b
A
a′
a
g(b′)
g(b)
g(a′)
g(a)
(a) Decision tree scheme for deciding
between A and B
B
A
G(B) = bg(b) + b′g(b′)
G(A) = ag(a) + a′g(a′)
(b) Reduction of the decision tree by
simplifying the chance nodes.
Figure 12: Simple decision tree with two options, A and B, both of which have
random events attached to them. The calculation of the gain function for each is also
presented.
This three represents a choice between A or B, depending on the events that fol-
low them. Choosing A, for instance, leads to two possible events, with probabilities a
and a′, respectively. For each possible path there is an outcome, a prot, for instance.
The event with probability aimplies a prot of g(a), while the alternative event, with
probability a′, gives a prot of g(a′). The same reasoning applies to the paths along
B. In order to decide between the two choices considering the probabilities and prof-
its, the expected value of gfor each node is calculated and compared. Such expected
value, which also may be referred as a gain function, G, is calculated for a chance node,
considering all possible branches in this path, according to Eq. 35:
G(chance node) = X
branches
P(branch)g(branch)(35)
Since Gis an expected value, the branches in the chance node must obey a normal-
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 37
ization condition. In our example, a+a′= 1 and b+b′= 1.
With Eq. 35 the statistical elements of the decision can be wrapped up in numeric
values that can be compared. For instance, the path A has a expected value of G(A) =
ag(a) + a′g(a′), that can be compared with the same function of the alternative path,
G(B) = bg(b) + b′g(b′). If the objective is to maximize G, then G(A)> G(B)implies
A is the path that must be chosen; and B is the best one if G(A)< G(B). Graphically,
this reduces the tree to decision elements only, such as displayed in Figure 12(b).
Decision trees can have nested chance nodes, one inside (or branching from) the
other. One of such cases is exemplied in Figure 13(a), where the path A has a splitting
on the event with probability a′, which is divided into two new events, one with prob-
ability cand other with probability c′(and their respective gains). The simplication
of this case is performed by considering the two sequences, event with a′followed by
the event with c, and the event with a′followed by the event with c′. Giving the statis-
tical independence, the rst sequence has the probability a′c; the second, a′c′. The g
function of these branches are the sum of each contribution, and the resulting tree is
shown in Figure 13(b). Notice that this new tree branch departing from A must obey
the normalization conditions just the same. The original tree imposed that a+a′= 1
and c+c′= 1. The new one must have a+a′c+a′c′= 1, which can be proved:
a+a′c+a′c′=a+a′(c+c′) = a+a′= 1.
The nal result of the “adding gains and multiplying probabilities” is presented on
Figure 13(c), after the calculation of Gin the respective chancenodes. Once again G(A)
and G(B)are compared to make an informed decision.
The simplest decision tree one can see while playing a match of RGU is presented
in Figure 14(a). While the values of P(i)for a given iare known, we have not dened
g(i)yet. It encloses several contributions, but it is helpful consider them explicitly af-
terwards (namely, attacks and captures). The walking contribution (W) is just how
many tiles the piece walk after iis selected. Therefore, g(i) = iin such case. The tree
in 14(a) has, by that denition, a walking contribution Wto the gain Gof 2:
G=W=
4
X
i=1
iP(i)=0·1
16 + 1 ·4
16 + 2 ·6
16 + 3 ·4
16 + 4 ·1
16 = 2
This case considers all moves legal or possible. If one or more forbidden moves are
present, we can either do not count them while doing the summation for Wor include
a subtractive term due to forbidden moves, F, that compensates the over counting on
Wcalculation. The gain is, then, G=W−F. For instance, in Figure 14(b) the
selection of 1 leads to a forbidden move, so we can calculate the gain by subtracting
F= 1 ·(4/16) from W= 2, leading to G= 7/4. For simplicity, the former approach
will be adopted, and only legal moves will be included on the walking summation.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
38 Mathematical analysis of the Royal Game of Ur
B
b′
b
A
a′
c′
c
a
g(b′)
g(b)
g(c′)
g(c)
g(a)
(a) Decision tree with entangled nodes.
B
b′
b
A
a′c′
a′c
a
g(b′)
g(b)
g(a′) + g(c′)
g(a′) + g(c)
g(a)
(b) Simplication of the entangled node.
B
A
G(B) = bg(b) + b′g(b′)
G(A) = ag(a) + a′{c[g(a′) + g(c)] + c′[g(a′) + g(c′)]}
(c) Simplication of all nodes of the tree.
Figure 13: Simple decision tree with entangled chance nodes, and further
simplications.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 39
A
P(4)
P(3)
P(2)
P(1)
P(0)
g(4)
g(3)
g(2)
g(1)
g(0)
(a) Decision tree that describes the possible
moves A can make in RGU board.
A
P(4)
P(3)
P(2)
P(0)
g(4)
g(3)
g(2)
g(0)
(b) Decision tree of RGU board, with an
illegal move of the piece A if 1 is the selected number
in the roll of the dice.
Figure 14: Decision trees for the rst move on the RGU, considering only a single
piece A.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
40 Mathematical analysis of the Royal Game of Ur
Hence, the walking is expressed as a sum of the product of the legal numbers r0and
the respective probabilities, P(r0):
W0=X
r0
r0·P(r0)(36)
This analysis is based on a single move (zero rosettes). One particular characteris-
tics of RGU is the possibility that one of the pieces reaches a rosette, giving the player
another throw on his turn. In such a case the next bonus throw can be used to move
that very piece again, or any of the other pieces (this choice is the essential strategy el-
ement of the game, hence the need for algorithms to do this kind of decision). This
situation is illustrated in Figure 15(a), with the rst move being centered on the deci-
sion of moving A or B and, if the rosette can be reached by either A or B, the second
move decision involves the same piece or the alternative. This leads to four possible
sequences that can be separated and compared in terms of gain, such as represented in
Figure 15(b)
B
A
B
A
B
A
BA
BB
AB
AA
(a) Chain of events while choosing the
movements of the pieces A and B.
BB
BA
AB
AA
(b) Sequence of
movements of pieces A and B,
individually isolated.
Figure 15: Sequence of two moves in a single turn, by using two pieces, A and B.
Inside each of these sequences of pieces there are chance nodes, including nested
chance nodes for more than one allowed movement. Now we will generalize the treat-
ment using some examples to facilitate the comprehension. Let’s say, for instance, that
the selection of r1= 2 leads the rst piece to a rosette. The next move will lead to the
ve possible numbers (some of them possibly tied to illegal moves) inside the chance
node of the rst move. This is illustrated in Figure 16:
Using the simplication method for reducing the entangled chance nodes into one,
the simplied tree looks like the one presented in Figure 17.
Calculating the expected value in the chance node we can estimate the gain associ-
ated with the sequence AB:
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 41
g(2)
AB
P(4)
P(3)
P(2)
P(4)
P(3)
P(2)
P(1)
P(0)
P(1)
P(0)
g(4)
g(3)
g(4)
g(3)
g(2)
g(1)
g(0)
g(1)
g(0)
Figure 16: Example of a decision tree with two moves in a RGU turn.
AB
P(4)
P(3)
P(2)P(4)
P(2)P(3)
P(2)P(2)
P(2)P(1)
P(2)P(0)
P(1)
P(0)
g(4)
g(3)
g(2) + g(4)
g(2) + g(3)
g(2) + g(2)
g(2) + g(1)
g(2) + g(0)
g(1)
g(0)
Figure 17: Simplication of the decision tree of Figure 16.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
42 Mathematical analysis of the Royal Game of Ur
G=X
i=2
g(i)P(i) +
4
X
i=0 g(2) + g(i)P(2)P(i)
=X
i=2
g(i)P(i) +
4
X
i=0
g(2)P(2)P(i) +
4
X
i=0
g(i)P(2)P(i)
=X
i=2
g(i)P(i) + g(2)P(2)
4
X
i=0
P(i) + P(2)
4
X
i=0
g(i)P(i)
=X
i=2
g(i)P(i) + g(2)P(2) + P(2)
4
X
i=0
g(i)P(i)(37)
=
4
X
i=0
g(i)P(i) + P(2)
4
X
i=0
g(i)P(i)
= [1 + P(2)]
4
X
i=0
g(i)P(i)
= [1 + P(2)] W0
(38)
Where the normalization condition (P4
i=0 P(i)=1) and the previous calculation
for W0were used. Notice that the rst term is just W0, while W0P(2) is a term due
to the rosette the rst piece can reach if 2 is the result of the roll of the dice. More
generally, the walking contribution when two movements are allowed is the sum of W0
and W1=W0P(r1), considering a rosette reachable by the selection of the number r1:
W=W0+W1=W0+P(r1)W0=W0[1 + P(r1)] (39)
Following the same steps, it is easy to prove that the possibility of reaching a new
rosette, hence allowing a second move if the number r2with probability P(r2)is se-
lected, increase the equation for Wby a factor W2=W0P(r1)P(r2) = W1P(r2):
W=W0+W1+W2=W0{1 + P(r1) [1 + P(r2)]}(40)
The W3can be calculated in the same way, but for simplicity we will reduce the
analysis to three moves only. The general formula is given by:
W=W0[1 + P(r1) + P(r1)P(r2) + . . .] = W0"1 + X
n>0
n
Y
k=1
P(rk)#(41)
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 43
which can be applied in a recursive manner:
W=W0+X
n>0
Wn(42)
where:
Wn=Wn−1P(rn) = W0
n
Y
k=1
P(rk)(43)
Notice that two or even three dierent rosettes can be reached in a single row of
the dice only if all possible pieces for each throw are considered. Once the sequence is
dened, there is only one rosette selected by move, for a single piece can reach a specic
rosette in a single way. The dierent sequences, including the ones that reach the same
rosette through dierent pieces, are compared in terms of the gain function.
The attacks contribution to the gain, either from the player or the future possible
attacks of the opponent in the next turn, expressed as a capture degree, are calculated
separately (for convenience) and must consider that:
•Dierent pieces can attack the same opponent’s piece in the same tile;
•The same piece can attack dierent pieces in dierent tiles;
•The same piece can attack another in a xed tile through distinct sequence of
steps.
These variables, tile number (n), sequence of selected numbers in the throws in a
single turn (s) and which piece moves (p), can change independently, which implies a
mathematical representation that express the summation over the three variables. In
other words, for a specic piece one must consider which tiles it can attack, and ac-
cording which sequences of numbers each. Then the sum is performed for all pieces.
The gain in this case is still the same: number of tiles the piece walk. In a attack, the
player takes a piece of the opponent back to the beginning, then the opponent loses n
tiles in the run, which puts the player ntiles ahead (gain). If the player is attacked, the
opponent gain ntiles of advantage at the cost of the equivalent player’s loss. Given the
probability of the attack of the player, Pa, or a attack of the opponent, Pc, the player
gains naPaor loses ncPcaccordingly. Considering the variables just mentioned, the
total attack value, A, or capture value (tendency to the adversary’s attack in the next
turn), C, for the player can be written as:
A=X
pX
aX
s
naPa=X
pX
a
naX
s
Pa(44)
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
44 Mathematical analysis of the Royal Game of Ur
C=−X
pX
cX
s
ncPc=−X
pX
c
ncX
s
Pc(45)
These concepts, in particular, are more understandable through an example, which
will be, in our case, the board described in Figure 8. The detailed calculations are rep-
resented in two tables: Tab. 5 displays the values of Wfor the possible sequences of
moves (forbidden moves properly subtracted), and Tab. 6 lists the values used to cal-
culate Aand C. The comparison among sequences and the main results are presented
in section 4.3.
Table 5: The contribution Wfor the decision making algorithm proposed, applied to
the specic example of Figure 8.
Sequence Walking
AA 2−2·6
16+ 2 ·1
16−(4 + 4) ·1
16·1
16
AB 2−2·6
16+ 2 ·1
16−(4 + 2) ·1
16·6
16
BA 2−0+2·6
16−(2 + 4) ·6
16·1
16
BB 2−0+2·6
16−(2 + 4) ·6
16·1
16
Notice that the contributions of Aand Ccan be tracked down to each term, piece,
sequence, tile number, in a organized way, and calculated accordingly. The attacks
of the player, or possible attacks of the opponent in the next turn, are determined by
the number of the tile where the attack occurs (always in the war zone). For instance,
consider that B can, in a rst throw, to occupy the tile 6 where a grey piece is, by rolling 4
on the dice. That leads to a gain for the player of 6(number of tiles that the opponent
has to retrocede) times 1/16 (the probability of taking 4). The opponent can reach
the player in the next turn, however: it must select either 3 or the sequence 12 (going
through his own rosette). These are possible losses for the player, in the form of −6·4
16
(if 3) plus −6·4
16 ·6
16 (if 12). Including all attacks of the player and of the opponent
(A+C), for all pieces in all sequences in the route AA, for instance:
+6 ·1
16 ·6
16
black
tile 6
sequence 42
−56
16 +4
16 ·4
16
grey
tile 5
sequence 2
sequence 11
−64
16 +4
16 ·6
16
grey
tile 6
sequence 3
sequence 12
−71
16 +4
16 ·4
16
grey
tile 7
sequence 4
sequence 13
=−4.98
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
Diego J. Raposo and Padraig X. Lamont 45
Table 6: The contributions Aand Cfor the decision making algorithm proposed,
applied to the specic example of Figure 8.
Sequence Attack Capture
AA
•A:0
•A:
–Tile 6:
*Seq. 42: 6·1
16 ·6
16
•A:0
•A:
–Tile 5:
*Seq. 2: −5·6
16
*Seq. 11: −5·4
16 ·4
16
–Tile 6:
*Seq. 3: −6·4
16
*Seq. 12: −6·4
16 ·6
16
–Tile 7:
*Seq. 4: −7·1
16
*Seq. 13: −7·4
16 ·4
16
AB
•A:0
•B:
–Tile 6:
*Seq. 44: 6·1
16 ·1
16
•A:0
•B:
–Tile 5:
*Seq. 2: −5·6
16
*Seq. 11: −5·4
16 ·4
16
–Tile 6:
*Seq. 3: −6·4
16
*Seq. 12: −6·4
16 ·6
16
BA
•B:
–Tile 6:
*Seq. 4: 6·1
16
•A:0
•B:
–Tile 5:
*Seq. 2: −5·6
16
*Seq. 11: −5·4
16 ·4
16
–Tile 6:
*Seq. 3: −6·4
16
*Seq. 12: −6·4
16 ·6
16
•A:0
BB
•B:
–Tile 6:
*Seq. 4: 6·1
16
•B:
–Tile 6:
*Seq. 22: 6·6
16 ·6
16
•B:
–Tile 5:
*Seq. 2: −5·6
16
*Seq. 11: −5·4
16 ·4
16
–Tile 6:
*Seq. 3: −6·4
16
*Seq. 12: −6·4
16 ·6
16
•B:
–Tile 5:
*Seq. 2: −5·6
16
*Seq. 11: −5·4
16 ·4
16
–Tile 6:
*Seq. 3: −6·4
16
*Seq. 12: −6·4
16 ·6
16
–Tile 7:
*Seq. 4: −7·1
16
*Seq. 13: −7·4
16 ·4
16
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001
46 Mathematical analysis of the Royal Game of Ur
While it is possible to design an algorithm that implement such equations and, ul-
timately, can play against a silicon or human opponent, that is not necessary, for much
better algorithms are already available, and some of them are very good. Paddy Lam-
ont’s Expectimax algorithm, for instance, is based on the search of possible scenarios
on the board, the distance between the player and the opponent in the run of RGU,
the probability of reaching that situation, and the choice of the move that leads to the
maximum of the product of those quantities (Lamont, 2021). While the approach pre-
sented in this paper has a depth of one turn plus a part of the next turn (the part related
to the gain of the opponent), those algorithms can evaluate until seven turns or moves
ahead, without the need of the separation in dierent contributions. The presented
results, however, have an alternative intent: to give insight of how dierent contribu-
tions come at play in a RGU match, and how the mathematics behind it allows the
improvement of the player’s decision making while playing, all while presenting the
content in a step by step manner.
Board Game Studies Journal Volume 17, pp. 1-46
DOI: 10.2478/bgs-2023-0001