Rolls of die

Two friends Alex and Xela play a game of dice, where the main objective for Alex is to score as much as possible and for Xela is to get Alex out.

Each player has 1 (fair 6-sided) die in their hand, and roll it each round, the score is calculated by adding the highest number on the two dice rolled to the previous score. The score starts from zero for the first round.

Xela can get Alex out if both die rolled have the same number [ Example : (1,1),(3,3) ] and the number is not added to the score. After getting out the game stops and they switch roles.

If the expected score of the game can be represented as a b \frac{a}{b} , where a and b are coprime positive integers, enter a + b a+b .


The answer is 73.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Jason Gomez
Feb 7, 2021

All outcomes of the die are listed in black and the score added (or out) is shown in red

The average score added per round of a game if not out is 2 × 2 + 3 × 4 + 4 × 6 + 5 × 8 + 6 × 10 30 = 70 15 \frac{2 × 2+3 × 4+4 × 6+5 × 8+6 × 10}{30}=\frac{70}{15}

The chance of getting out is 6 36 = 1 6 \frac{6}{36}=\frac{1}{6}

Let the expected score be Y Y

Let’s assume one round is over, there would be a 1 6 \frac{1}{6} chance that Alex got out, and a 5 6 \frac{5}{6} chance he scored an average of 70 15 \frac{70}{15} and then went on to play the game with an expected score of Y Y again.

So we have the equation: Y = 1 6 × 0 + 5 6 × ( 70 15 + Y ) Y=\frac{1}{6} × 0 + \frac{5}{6} × ( \frac{70}{15} + Y )

Solving we get: Y = 70 3 Y=\frac{70}{3}


Here’s a program where a computer plays the game with itself and prints the average score after every 100,000 games

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
from random import *
score=0
game=0
while True:
    game+=1
    while True:
        die1=randint(1,6)
        die2=randint(1,6)
        if die1<die2:
            score+=die2
        elif die1>die2:
            score+=die1
        elif die1==die2:
            break
    if game%100000==0:
        print(score/game)
#It converges very slowly to the value of 23.33… 
#first two decimals are stable (staying at 23.33 and third decimal varying) 
#only after ten million games 

nice code. shorter than mine.

num IC - 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...