The object of the dice game is to be the first player to reach a score of at least 100 points.
Each player’s turn consists of repeatedly rolling a die.
After each roll, the player has two choices: roll again, or stop.
- If the player rolls 1, nothing is scored in that turn and it becomes the opponent’s
turn.
- If the player rolls a number other than 1, the number is added to the player’s turn total and the player’s turn continues.
- If the player stops, the turn total (the sum of the rolls during the turn), is added to the player’s score, and it becomes the opponent’s turn.
What's your strategy?
(In reply to
re(2): a wiser approach by armando)
Since the die doesn't have a memory, if a person has a round score of 18, it doesn't matter how it got that way, whether from 3 rolls of a six or 9 rolls of a two, so one expects the best strategy to depend on how many points one is risking rather than how many times one has already rolled the die. But as armando points out, a simulation helps prove the point in some ways. The following program simulates someone quitting at 20 playing against someone rolling 5 times regardless, per round. In either instance, end-game strategies are not used, such as continuing to go when the opponent has 99 points already.
DEFDBL A-Z
DO
p1 = 0: p2 = 0
DO
rTot = 0
DO
toss = INT(6 * RND(1) + 1)
IF toss = 1 THEN
rTot = 0
EXIT DO
ELSE
rTot = rTot + toss
END IF
LOOP UNTIL rTot > 19 OR rTot = 0
p1 = p1 + rTot
IF p1 > 99 THEN EXIT DO
rTot = 0
FOR i = 1 TO 5
toss = INT(6 * RND(1) + 1)
IF toss = 1 THEN
rTot = 0
EXIT FOR
ELSE
rTot = rTot + toss
END IF
NEXT
p2 = p2 + rTot
IF p2 > 99 THEN EXIT DO
LOOP
IF p1 > 99 THEN p1Win = p1Win + 1: ELSE p2Win = p2Win + 1
PRINT p1Win, p2Win
LOOP
At the point at which it was stopped, player 1, who stopped on 20, won 13,961 games to 11,133 won by player 2.
If the first player's strategy was changed to stopping on 21, stopping at a similar point produced 13396 vs 12492.
If the first stopped on 20 and the second always went 6 times, it was 13996 vs 11007.
And stopping on 21 vs going 6 always, produced 13401 vs 12004.
|
Posted by Charlie
on 2005-04-25 00:48:47 |