# 【Puzzle】双骰子赌博

|

【对算法，数学，计算机感兴趣的同学，欢迎关注我哈，阅读更多原创文章】

# 问题描述

## Craps

The game of craps, played with two dice, is one of America’s fastest and most popular gambling games

Calculating the odds associated with it is an instructive exercise

The rules are these:

Only totals for the two dice count
The player throws the dice and wins at once if the total for the first throw is 7 or 11, loses at once if it is 2, 3, or 12
Any other throw is called his “point”
If the first throw is a point, the player throws the dice repeatedly until he either wins by throwing his point again, or loses by throwing 7
What is the player’s chance to win?

# 思路参考

## 首先考虑第一次投掷

(1) 直接输的情况是两枚骰子的和为 2、3、12，两个骰子各自的点数情况有 (1, 1), (2, 1), (1, 2), (6, 6) 这 4 中可能性。而两个骰子各自点数共有 6 * 6 = 36 种可能性，因此第一次投掷直接输的概率为 1/9。

(2) 直接赢的情况是两枚骰子的和为 7, 11，两个骰子各自的点数情况有 (1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1), (5, 6), (6, 5) 共 8 种可能性，概率 2/9。

(3) 剩下 2/3 概率的情况，需要继续投掷，我们记此前的第 1 次投掷的点数和为 x。

## 考虑第二次以及后续可能的投掷

(1) 输的情况是投掷出 7，两个骰子各自的点数情况共有 (1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1) 共 6 种情况，概率 q = 1 / 6。

(2) 赢的情况是投掷出 x。两个骰子各自的点数情况需要看 x 具体的值才能确定。下面我们对每个 x 的可能取值(4, 5, 6, 8, 9, 10)分别考虑:

x = 4: (1, 3), (2, 2), (3, 1), 概率 1/12
x = 5: (1, 4), (2, 3), (3, 2), (4, 1), 概率 1/9
x = 6: (1, 5), (2, 4), (3, 3), (2, 4), (1, 5), 概率 5/36
x = 8: (2, 6), (3, 5), (4, 4), (5, 3), (6, 2), 概率 5/36
x = 9: (3, 6), (4, 5), (5, 4), (6, 3), 概率 1/9
x = 10: (4, 6), (5, 5), (6, 4), 概率 1/12

(3) 剩下的情况是需要继续投掷的，概率为 (1 - p(x) - q)

Share