Back to Practice
#0161

Probability of Sum Greater Than 9

MediumAptitude25 min20 XP

Problem

Two fair dice are rolled. What is the probability that the sum is greater than 9?

Why This Matters

Dice probability questions teach sample-space thinking, which is the foundation for more serious probability problems.

Examples

Example 1
Inputtwo dice
Output1/6

Sums 10, 11, 12 have 3 + 2 + 1 = 6 outcomes out of 36.

Constraints

  • Return the exact requested value.
  • Handle empty or small inputs when the prompt allows them.
  • Keep the code readable and deterministic.
CodeReasoning
Two fair dice are rolled. What is the probability that the sum is greater than 9?
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core example
Inputtwo dice
Expected1/6

Sums 10, 11, 12 have 3 + 2 + 1 = 6 outcomes out of 36.

Hidden Test Categories
empty or smallest inputduplicates or repeated valueslarger realistic input