Puzzle
5 minute read

Ponder This Challenge - February 2024 - A Dice Game

This problem is based on a suggestion by Frank Mayer - thanks Frank!

Alice and Bob play the following weird dice game using a standard set of 6 D&D dice, i.e., dice with values

1,,41,\ldots,4

1,,61,\ldots,6

1,,81,\ldots,8

0,,90,\ldots,9

1,,121,\ldots,12

1,,201,\ldots,20

At each round, they throw the dice and sum their values. All six dice need to be rolled once each round, and it doesn’t matter who rolls the dice. What matters in deciding who wins is the sum.

Alice wins if the result is a prime number, and Bob wins if the result is a nonprime even number. Otherwise, the result of the round is a draw.

The winner of the game is the first player to reach NN consecutive wins.

Your goal: For N=13N=13, find the probability that Alice wins the game.

A Bonus "*" will be given for finding the probability that Alice wins given that N=300N=300 but the rules have changed and Bob now wins if the result is a nonprime odd number.


We will post the names of those who submit a correct, original solution! If you don't want your name posted then please include such a statement in your submission!

We invite visitors to our website to submit an elegant solution. Send your submission to the ponder@il.ibm.com.

If you have any problems you think we might enjoy, please send them in. All replies should be sent to: ponder@il.ibm.com

Solution

  • February 2024 Solution:

    This problem turned out to be more challanging than expected, due both for the (non intentional) tricky phrasing and the nontrivial mathematical structure involved.

    Some of you interpreted "NN consecutive wins" of Alice to be "a sequence of at least NN rounds in which NN are Alice wins and the rest are draws". This was not the intention - a draw certainly interrupts a sequence of wins.

    Others correctly calculated Alice's chance to win a round (0.24826171875, can be found by straightforward enumeration of all cases) and raised it to the power of N; this is wrong, since it answers the different question "If Alice and Bob play exactly NN rounds, what is the chance of Alice winning all of them?" whereas the real question is "given that Alice and Bob play indefintely, what is the chance that at one point of the game Alice will have NN consecutive wins?"

    The natural way to solve such a question is by using Markov chains. In this formulation, we consider all the states the game can reach; here the states are of the form "Alice has kk consecutive wins" and "Bob has kk consecutive wins". This can be modeled using a single integer kk (e.g. k=2k=-2 means "Bob has 2 consecutive wins"). We have a simple transition matrix, with each row having at most three nonzero entries corresponding to Alice win, Bob win and draw.

    We are interested in the hitting probability for the state hNh_N representing Alice's win; a standard result in the theory of Markov chains is that the hitting probability vector hiXh^X_i for a set XX of states is the minimal nonnegative solution to the system of linear equations

    {hiX=1iXhiX=jpijhjAiX\begin{cases}h_{i}^{X}=1 & i\in X\\h_{i}^{X}=\sum_{j}p_{ij}h_{j}^{A} & i\notin X\end{cases}

    Solving this system yields the winning probability for Alice (where AA is Alice's probability for winning a round and BB is Bob's)

    AN(1BN)1BAN(1BN)1B+BN(1AN)1A\frac{\frac{A^N(1-B^N)}{1-B}}{\frac{A^N(1-B^N)}{1-B}+\frac{B^N(1-A^N)}{1-A}}

    Plugging

    A=0.24826171875,B=0.5,N=13A=0.24826171875, B=0.5, N=13

    yields

    0.00016756668015708520.0001675666801570852

    and plugging

    A=0.24826171875,B=0.25173828125,N=300A=0.24826171875, B=0.25173828125, N=300

    yields

    0.0152575329367947220.015257532936794722

Solvers

  • *Lazar Ilic (1/2/2024 4:59 PM IDT)
  • Lorenz Reichel (1/2/2024 5:07 PM IDT)
  • *Andrew Gauld (1/2/2024 8:49 PM IDT)
  • *Dan Dima (1/2/2024 9:48 PM IDT)
  • *Bert Dobbelaere (1/2/2024 10:30 PM IDT)
  • *Paul Shaw (2/2/2024 12:12 AM IDT)
  • Blaine Hill (2/2/2024 1:11 AM IDT)
  • *Yi Jiang (2/2/2024 3:08 AM IDT)
  • *Sanandan Swaminathan (2/2/2024 4:01 AM IDT)
  • *Yan-Wu He (2/2/2024 5:50 AM IDT)
  • *Alper Halbutogullari (2/2/2024 6:54 AM IDT)
  • *Paul Revenant (2/2/2024 10:59 AM IDT)
  • Richard Gosiorovsky (2/2/2024 1:23 PM IDT)
  • *Latchezar Christov (2/2/2024 3:19 PM IDT)
  • *John Tromp (2/2/2024 5:00 PM IDT)
  • *Kennedy (3/2/2024 2:22 AM IDT)
  • *Vladimir Volevich (3/2/2024 3:20 AM IDT)
  • *Victor Chang (3/2/2024 7:00 AM IDT)
  • *Harald Bögeholz (3/2/2024 8:03 PM IDT)
  • *John Spurgeon (3/2/2024 10:31 PM IDT)
  • Clive Tong (3/2/2024 10:56 PM IDT)
  • *Andrea Andenna (3/2/2024 10:59 PM IDT)
  • Shirish Chinchalkar (4/2/2024 4:37 AM IDT)
  • Shelby Doolittle (4/2/2024 7:40 AM IDT)
  • *Talupula Vamsi (4/2/2024 9:54 AM IDT)
  • Christoph Baumgarten (4/2/2024 11:08 AM IDT)
  • *Avi Levin (4/2/2024 2:02 PM IDT)
  • *Bertram Felgenhauer (4/2/2024 2:18 PM IDT)
  • *Phil Proudman (4/2/2024 5:08 PM IDT)
  • *Christoph Schmidt (4/2/2024 5:44 PM IDT)
  • Karl D’Souza (4/2/2024 11:10 PM IDT)
  • Yu Ka (5/2/2024 4:17 AM IDT)
  • *Aks Kotian (5/2/2024 1:17 PM IDT)
  • *Guglielmo Sanchini (5/2/2024 2:56 PM IDT)
  • Joram Meron (6/2/2024 2:01 AM IDT)
  • *Cameron Ritson (6/2/2024 4:34 AM IDT)
  • *Balakrishnan V (6/2/2024 9:00 AM IDT)
  • *Arthur Vause (6/2/2024 12:21 PM IDT)
  • Sri Mallikarjun J (6/2/2024 5:16 PM IDT)
  • *Ashfaque Shaikh (6/2/2024 7:29 PM IDT)
  • Arnold Yim (6/2/2024 9:06 PM IDT)
  • *Hugo Pfoertner (7/2/2024 12:25 AM IDT)
  • *Alexander Daryin (7/2/2024 5:57 PM IDT)
  • Michael Liepelt (7/2/2024 11:50 PM IDT)
  • Rudy Cortembert (8/2/2024 2:33 AM IDT)
  • *Daniel Chong Jyh Tar (8/2/2024 9:12 AM IDT)
  • *Wu Hao (8/2/2024 10:20 AM IDT)
  • *Dario Filatrella (8/2/2024 6:13 PM IDT)
  • *Julian Bayerl (9/2/2024 2:25 PM IDT)
  • *José Eduardo Gaboardi de Carvalho (9/2/2024 3:51 PM IDT)
  • *Laurence Warne (9/2/2024 3:58 PM IDT)
  • *Daniel Bitin (9/2/2024 4:42 PM IDT)
  • *Hakan Summakoğlu (9/2/2024 8:19 PM IDT)
  • Kang Jin Cho (9/2/2024 8:26 PM IDT)
  • Paul Lupascu (9/2/2024 8:31 PM IDT)
  • *Dominik Reichl (9/2/2024 11:17 PM IDT)
  • Joaquim Neves Carrapa (10/2/2024 4:40 AM IDT)
  • *Martin Thorne (10/2/2024 10:14 PM IDT)
  • Gary M. Gerken (11/2/2024 4:57 AM IDT)
  • *David Greer (11/2/2024 2:21 PM IDT)
  • Frédéric Bossens (11/2/2024 5:38 PM IDT)
  • Stefan Wirth (11/2/2024 6:01 PM IDT)
  • Michael Branicky (11/2/2024 9:06 PM IDT)
  • *Nadav Rubinstein & Eden Saig (11/2/2024 9:26 PM IDT)
  • Evan Semet (12/2/2024 8:18 AM IDT)
  • Julien Vincent Pradier (12/2/2024 12:48 PM IDT)
  • Shouky Dan & Tamir Ganor (12/2/2024 8:20 PM IDT)
  • *Li Li (12/2/2024 11:46 PM IDT)
  • *Nyles Heise (13/2/2024 4:47 AM IDT)
  • *Jean-Marie Madiot (13/2/2024 8:34 AM IDT)
  • *Alfred Reich (13/2/2024 11:47 AM IDT)
  • *Mark Pervovskiy (13/2/2024 6:40 PM IDT)
  • *Wolfgang Kais (14/2/2024 12:25 AM IDT)
  • *Albert Stadler (19/2/2024 7:50 AM IDT)
  • Pavel Stoimenov (19/2/2024 7:08 PM IDT)
  • *Serge Thill (20/2/2024 7:34 PM IDT)
  • *Reiner Martin (21/2/2024 10:58 PM IDT)
  • *Marco Bellocchi (22/2/2024 1:42 AM IDT)
  • *Tim Walters (23/2/2024 2:50 AM IDT)
  • *Prashant Wankhede (23/2/2024 7:31 AM IDT)
  • *Hansraj Nahata (25/2/2024 5:25 AM IDT)
  • *Erik Hostens (25/2/2024 3:34 PM IDT)
  • *David F.H. Dunkley (25/2/2024 11:45 PM IDT)
  • *Chris Shannon (26/2/2024 9:33 PM IDT)
  • *Karl Mahlburg (27/2/2024 3:44 AM IDT)
  • Jim Clare (27/2/2024 10:35 PM IDT)
  • *Govind Jujare (28/2/2024 6:05 PM IDT)
  • Hans-Peter Schrei (29/2/2024 1:01 AM IDT)
  • *Dillon Davis (29/2/2024 3:44 AM IDT)
  • Daniel Lincke (29/2/2024 5:47 PM IDT)
  • *Daniel Copeland (29/2/2024 6:41 PM IDT)
  • *Elena Pavlova (29/2/2024 9:09 PM IDT)
  • Robin Guilliou (29/2/2024 10:01 PM IDT)
  • Armin Krauss (29/2/2024 10:42 PM IDT)
  • Ethan EJ Watkins (1/3/2024 3:58 AM IDT)
  • Jeffrey Curtis (1/3/2024 6:19 AM IDT)
  • *Alex Izvalov (2/3/2024 1:49 PM IDT)
  • *Motty Porat (2/3/2024 11:01 PM IDT)
  • Radu-Alexandru Todor (3/3/2024 12:25 PM IDT)
  • Arvind Venkatesan (3/3/2024 2:49 PM IDT)
  • Diana Gornea (5/3/2024 3:11 AM IDT)

Related posts