Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Find a Discrete Uniform Probability

When every whole number from aa to bb is equally likely, a probability is a count: the number of values in the event divided by the number of values, b−a+1b - a + 1.

Recognize the task

A value is picked at random from a list of consecutive whole numbers, each with the same chance: "a fair die", "a random integer from 11 to 100100", "a ticket number from 1010 to 5050". Test: the outcomes are a finite list and nothing makes one value more likely than another. A sum of two dice fails the test. Then XX is discrete uniform on {a,…,b}\{a, \ldots, b\}.
The model is defined in the discrete uniform lesson.

Steps

StepOn a fair die, P(X≥5)P(X \ge 5)
1Name aa and bb and count the values. The list a,a+1,…,ba, a + 1, \ldots, b holds b−a+1b - a + 1 values, not b−ab - a.a=1a = 1, b=6b = 6: 66 values
2Write the event as a list of values. Turn the inequality into the whole numbers it allows. A strict inequality drops its endpoint.X≥5X \ge 5: {5,6}\{5, 6\}
3Count the values in the event. For c≤X≤dc \le X \le d inside the range there are d−c+1d - c + 1 values. For a condition such as "divisible by 77", count the multiples.22 values
4Divide. Favorable count over total count, simplified.P(X≥5)=26=13P(X \ge 5) = \frac{2}{6} = \frac{1}{3}

Worked examples

Example 1 · a range on a die

inclusive
fair die, P(2≤X≤4)P(2 \le X \le 4)
values 2,3,42, 3, 4
4−2+16=36\frac{4 - 2 + 1}{6} = \frac{3}{6}
d−c+1d - c + 1 over 66
P(2≤X≤4)=12P(2 \le X \le 4) = \frac{1}{2}

Example 2 · a strict inequality

endpoint out
random integer from 1010 to 5050; P(X>42)P(X > 42)
50−10+1=4150 - 10 + 1 = 41 values
X>42X > 42: {43,…,50}\{43, \ldots, 50\}, 88 values
4242 itself is excluded
P(X>42)=841≈0.1951P(X > 42) = \frac{8}{41} \approx 0.1951

Example 3 · a counting condition

multiples
random integer from 11 to 100100; P(7 divides X)P(7 \text{ divides } X)
7,14,…,987, 14, \ldots, 98: ⌊100/7⌋=14\lfloor 100/7 \rfloor = 14 values
largest multiple 7⋅14=987 \cdot 14 = 98
P=14100=750P = \frac{14}{100} = \frac{7}{50}
Check the counts in the discrete distributions calculator.

See it happen

The PMF is a row of equal bars, one per value, each of height 1b−a+1\frac{1}{b - a + 1}. A probability is the number of bars in the event times that common height, so only counting is needed. Step through it in the discrete uniform visualizer.

Common mistakes

Counting b - a values

✗ integers from 1010 to 5050: 4040 values
✓ both ends count: 50−10+1=4150 - 10 + 1 = 41

Keeping the endpoint of a strict inequality

✗ fair die, P(X<4)=46P(X < 4) = \frac{4}{6}
✓ X<4X < 4 is {1,2,3}\{1, 2, 3\}: 36=12\frac{3}{6} = \frac{1}{2}

Calling any finite list uniform

✗ sum of two dice: P(sum=7)=111P(\text{sum} = 7) = \frac{1}{11}
✓ the 1111 sums are not equally likely; count the 3636 ordered pairs: 636\frac{6}{36}