You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求两枚骰子点数绝对差≤2的概率(非枚举公式法)

Formulaic Approach to Calculate P(|Dice1 - Dice2| ≤ 2)

Great question! Let’s solve this without listing every possible outcome—here’s a clean, formula-driven breakdown:

1. Total Possible Outcomes

When rolling two 6-sided dice, the total number of unique outcomes is 6 * 6 = 36—this will be our denominator for the probability calculation.

2. Use Complementary Probability (The Simpler Path)

Instead of counting valid outcomes directly, let’s first calculate the probability of the opposite event: |X-Y| > 2 (i.e., the absolute difference is 3, 4, or 5). We’ll subtract this from 1 to get our desired result.

Derive the count of invalid outcomes (|X-Y| > 2)

For two dice with values X (1-6) and Y (1-6):

  • When X=1, Y must be 4, 5, 6 → 3 outcomes
  • When X=2, Y must be 5, 6 → 2 outcomes
  • When X=3, Y must be 6 → 1 outcome
  • By symmetry, X=4 mirrors X=3 (Y=1 → 1 outcome), X=5 mirrors X=2 (Y=1, 2 → 2 outcomes), X=6 mirrors X=1 (Y=1, 2, 3 → 3 outcomes)

Summing these: 3+2+1+1+2+3 = 12 invalid outcomes.

Calculate the desired probability

The number of valid outcomes (where |X-Y| ≤2) is total outcomes minus invalid ones: 36 - 12 = 24.

Probability = 24/36 = 2/3.

3. Generalized Formula (For Any n-sided Die and t ≤ n-1)

If you want to apply this to an n-sided die and find P(|X-Y| ≤ t):

  1. Total outcomes: n²
  2. Invalid outcomes (|X-Y| >t) = (n-t-1)(n-t) (derived from summing symmetric invalid cases and simplifying the arithmetic series)
  3. Valid outcomes = n² - (n-t-1)(n-t)
  4. Probability = [n² - (n-t-1)(n-t)] / n²

For our problem, plug in n=6, t=2:
[36 - (6-2-1)(6-2)] / 36 = [36 - 3*4]/36 = 24/36 = 2/3

This formula works for any n and t, so you never have to list out sample spaces again!

内容的提问来源于stack exchange,提问作者Syk

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:46:19