2018-09-30 23:01:58 +01:00
---
id: 5900f4e51000cf542c50fff7
title: 'Problem 376: Nontransitive sets of dice'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 302038
2021-01-13 03:31:00 +01:00
dashedName: problem-376-nontransitive-sets-of-dice
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
Consider the following set of dice with nonstandard pips:
2018-09-30 23:01:58 +01:00
2021-07-29 21:48:17 +02:00
$$\begin{array}{}
\text{Die A: } & 1 & 4 & 4 & 4 & 4 & 4 \\\\
\text{Die B: } & 2 & 2 & 2 & 5 & 5 & 5 \\\\
\text{Die C: } & 3 & 3 & 3 & 3 & 3 & 6 \\\\
\end{array}$$
2018-09-30 23:01:58 +01:00
A game is played by two players picking a die in turn and rolling it. The player who rolls the highest value wins.
2021-07-29 21:48:17 +02:00
If the first player picks die $A$ and the second player picks die $B$ we get
2018-09-30 23:01:58 +01:00
2021-07-29 21:48:17 +02:00
$P(\text{second player wins}) = \frac{7}{12} > \frac{1}{2}$
2018-09-30 23:01:58 +01:00
2021-07-29 21:48:17 +02:00
If the first player picks die $B$ and the second player picks die $C$ we get
$P(\text{second player wins}) = \frac{7}{12} > \frac{1}{2}$
If the first player picks die $C$ and the second player picks die $A$ we get
$P(\text{second player wins}) = \frac{25}{36} > \frac{1}{2}$
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
So whatever die the first player picks, the second player can pick another die and have a larger than 50% chance of winning. A set of dice having this property is called a nontransitive set of dice.
2018-09-30 23:01:58 +01:00
2021-07-29 21:48:17 +02:00
We wish to investigate how many sets of nontransitive dice exist. We will assume the following conditions:
- There are three six-sided dice with each side having between 1 and $N$ pips, inclusive.
- Dice with the same set of pips are equal, regardless of which side on the die the pips are located.
- The same pip value may appear on multiple dice; if both players roll the same value neither player wins.
- The sets of dice $\\{A, B, C\\}$, $\\{B, C, A\\}$ and $\\{C, A, B\\}$ are the same set.
For $N = 7$ we find there are 9780 such sets.
2018-09-30 23:01:58 +01:00
2021-07-29 21:48:17 +02:00
How many are there for $N = 30$?
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
# --hints--
2018-09-30 23:01:58 +01:00
2021-07-29 21:48:17 +02:00
`nontransitiveSetsOfDice()` should return `973059630185670` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
2021-07-29 21:48:17 +02:00
assert.strictEqual(nontransitiveSetsOfDice(), 973059630185670);
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --seed--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
## --seed-contents--
2018-09-30 23:01:58 +01:00
```js
2021-07-29 21:48:17 +02:00
function nontransitiveSetsOfDice() {
2020-09-15 09:57:40 -07:00
2018-09-30 23:01:58 +01:00
return true;
}
2021-07-29 21:48:17 +02:00
nontransitiveSetsOfDice();
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
// solution required
```