Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Discrete Uniform Expected Value Calculator

How to use Discrete Uniform Expected Value Calculator
  1. Set a (minimum) and b (maximum) with the sliders or the number boxes; Number of outcomes and Probability each update at once. Learn more about the range
  2. If bb is below aa, a red message appears and the results wait; click Reset to return to 11–66. Learn more about messages and Reset
  3. The panel on the right shows E(X)E(X) with its formula, examples in context, and Additional Statistics (variance, standard deviation, range) behind a toggle. Learn more about the panel
  4. Click Compare with Different Values to set an alternative aa and bb and see the two expected values side by side. Learn more about comparing
  5. Use the tabs E(X) Visualization, How E(X) is Calculated and Individual Contributions for a chart, the steps, or each value's share. Learn more about the tabs
  6. The box under the calculator explains what E(X)E(X) means and why it is the midpoint. Learn more about the box


Expected Value Calculators

Calculate the expected value (average outcome) for a discrete uniform distribution where all outcomes are equally likely. Perfect for fair dice, random integer selection, or any scenario with equal probabilities.

💡
Key Insight: E(X) = 3.50 means on average you get 3.50 per trial. Over many trials, your outcomes will average to this value.

Parameters

Number of outcomes:6
Probability each:1/6

Contribution to E(X)

ValueProbabilityContribution
10.16670.1667
20.16670.3333
30.16670.5000
40.16670.6667
50.16670.8333
60.16671.0000
E(X) =3.5000
Expected Value
E(X) = 3.5000
Formula: (a + b) / 2 = (1 + 6) / 2
Interpretation: On average, you can expect an outcome of 3.50
📊E(X) in Context: Fair 6-sided die
  • Rolling once? Expect 3.5 on average
  • Rolling 100 times? Expect total ≈ 350 (3.5 × 100)
  • Rolling 1000 times? Expect total ≈ 3500
Probability Distribution with E(X) = 3.50
Probability
E(X) = 3.50
0.167
1
0.167
2
0.167
3
0.167
4
0.167
5
0.167
6
Outcome Value

Understanding Expected Value for Discrete Uniform Distribution

What Does E(X) Mean? The expected value E(X) represents the average outcome you would get if you repeated this random experiment many times. For a discrete uniform distribution with equally likely outcomes, E(X) is simply the midpoint between the minimum and maximum values.

Interpreting Your Result. Over many trials, the outcomes average to E(X); it is the centre of the distribution; all values are equally likely, so E(X) is the midpoint.

Real-World Examples. Fair die (1-6): E(X) = 3.5 average per roll. Random selection (1-100): E(X) = 50.5 on average. Lottery numbers (10-20): E(X) = 15 expected value.

Why E(X) = (a + b) / 2. Because every outcome has equal probability (1/n), the expected value calculation simplifies to the arithmetic mean of all values. The sum of the integers from a to b equals n(a + b)/2, and dividing by n gives (a + b)/2. Learn more about the discrete uniform distribution




Calculate Expected Value

Use the calculator below to compute the expected value with step-by-step solutions and detailed explanations.



Setting the Range a to b

Demo1 to 10, an invalid b, 1 to 100, Reset
Step 0 of 4
Under Parameters, set a (Minimum Value) and b (Maximum Value) with the sliders or by typing whole numbers in the boxes; the slider for aa runs from −50-50 to 5050 and the one for bb from −50-50 to 100100, while the boxes take any integers. Decimals are cut to integers. As soon as b≥ab \ge a, the box reports Number of outcomes n=b−a+1n = b - a + 1 and Probability each 1/n1/n, the Key Insight line above the calculator restates E(X)E(X), and, for n≤20n \le 20, a Contribution to E(X) table lists every value with its probability and its product, ending in the sum.

If bb is below aa, both boxes turn red, the message "⚠ Maximum value (b) must be ≥ minimum value (a)" appears and the right panel shows a placeholder until the range is fixed. For a=1a = 1 and b=10b = 10 the outcomes number 1010, each with probability 0.10.1, and E(X)=5.5000E(X) = 5.5000; for 11 to 100100 the table is replaced by a note, because 100100 values are too many to list. There is no Calculate button; everything recomputes as you type.

Reset, at the top right of the parameter box, returns to the fair die, a=1a = 1 and b=6b = 6, closes the comparison and the extra statistics, and selects the first tab. Why all nn values share one probability is explained in the discrete uniform distribution.

Reading the Expected Value Panel

Demo10 to 20, the extra statistics, 10 to 30
Step 0 of 3
The right panel is built around one number: E(X) in large type, with the formula (a+b)/2(a + b) / 2 filled in and an interpretation line. Below it, E(X) in Context turns the number into a scenario: for the die, the average per roll and the expected total of 100100 or 10001000 rolls; for a range such as 1010 to 2020 it reads "Random selection" and shows the value in dollars; other ranges get a general reading. Click ▶ Additional Statistics to open the variance n2−112\frac{n^2 - 1}{12}, the standard deviation and the range: for 1010 to 2020, n=11n = 11, the variance is 10.000010.0000 and the standard deviation 3.16233.1623; widening to 1010 to 3030 gives n=21n = 21, variance 36.666736.6667 and standard deviation 6.05536.0553.

The box under the calculator, Understanding Expected Value for Discrete Uniform Distribution, explains what E(X)E(X) means, how to read it, gives three stock examples and shows why the formula is the midpoint; its link opens the first section below. The derivation of the midpoint from the definition is in formula and worked example.

Comparing Two Ranges

DemoThe die against 2 to 10, 2 to 4, 3 to 4
Step 0 of 3
Click ▶ Compare with Different Values under the parameter box to open an Alternative a and Alternative b. The panel then shows the current range with its E(X)E(X), the alternative range with its E(X)E(X), and the difference as a percentage of the current value, marked higher or lower with an arrow. The alternative opens as 22 to 1010: against the die that is E(X)=6.00E(X) = 6.00, which is 71.4%71.4\% higher than 3.503.50. Change the alternative bb to 44 and the alternative E(X)E(X) becomes 3.003.00, 14.3%14.3\% lower; make the alternative 33 to 44 and the two ranges have the same expected value, 3.53.5, which the panel says in words.

The comparison uses only the midpoints, so two ranges of very different width can tie, as 11 to 66 and 33 to 44 do; their variances, 2.91672.9167 and 0.250.25, tell them apart. An alternative with bb below aa shows nothing. Why the midpoint alone fixes E(X)E(X) is explained in the discrete uniform distribution.

The Three Tabs

DemoCalculation, contributions, visualization
Step 0 of 3
Under the statistics are three tabs; they change what is drawn, not the numbers. E(X) Visualization (the default) draws one bar per value, all of the same height 1/n1/n, and marks the expected value in the middle; for more than 3030 values the chart gives way to a note that repeats the range, the probability 1/n1/n and the midpoint. How E(X) is Calculated writes the formula and three steps: identify aa and bb, apply (a+b)/2(a + b) / 2, and compute, for the die 7/2=3.50007 / 2 = 3.5000, followed by a sentence on why the midpoint is the mean. Individual Contributions, shown only for n≤20n \le 20, draws each value's product k⋅1nk \cdot \frac{1}{n} as a bar, so the bars rise in a straight line from aa to bb.

Use the calculation tab to check a homework answer, the visualization to see the flat shape, and the contributions to see how the larger values weigh more. Reset returns to the visualization tab. The steps of the calculation tab are the ones written out in formula and worked example.

The Discrete Uniform Distribution

A discrete uniform distribution gives equal probability to every integer from aa to bb. There are n=b−a+1n = b - a + 1 possible values, each with probability 1n\frac{1}{n}. A fair six-sided die is the standard example: the values 11 to 66 each have probability 16\frac{1}{6}.

Because the values are evenly spaced and equally likely, the distribution is symmetric about the middle of the range. The expected value is therefore the midpoint of aa and bb, even when that midpoint is not itself a possible value.

The two numbers that fix the distribution are described in parameters, the equal probabilities in probability mass function and support, and the midpoint result in expected value (mean).

Formula and Worked Example

For a discrete uniform distribution on the integers a,a+1,…,ba, a + 1, \ldots, b:

E[X]=a+b2E[X] = \frac{a + b}{2}


Example: for a fair die, a=1a = 1 and b=6b = 6, so

E[X]=1+62=3.5E[X] = \frac{1 + 6}{2} = 3.5


The same value comes from the definition: 1+2+3+4+5+66=216=3.5\frac{1 + 2 + 3 + 4 + 5 + 6}{6} = \frac{21}{6} = 3.5. No single roll gives 3.53.5; it is the long-run average of many rolls. The variance is n2−112\frac{n^2 - 1}{12}, which for the die is 3512≈2.92\frac{35}{12} \approx 2.92.

The variance formula is derived in variance and standard deviation, and the mean formula sits with those of the other named distributions in expected value formulas for specific distributions.

Where This Is Used

The discrete uniform distribution models any choice where all options are equally likely: rolling a fair die, drawing a ticket from a well-mixed set of numbered tickets, or a random number generator that picks an integer in a range.

It is also a starting point for checking fairness. If a die is rolled many times and the average is far from 3.53.5, that is evidence the die is not fair.

More uses are listed in applications and examples; why a long run of rolls settles near 3.53.5 is the law of large numbers.