?How to use Discrete Uniform Expected Value Calculator▶
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
The panel on the right shows E(X) with its formula, examples in context, and Additional Statistics (variance, standard deviation, range) behind a toggle. Learn more about the panel
Click Compare with Different Values to set an alternative a and b and see the two expected values side by side. Learn more about comparing
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
The box under the calculator explains what E(X) means and why it is the midpoint. Learn more about the box
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
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 a runs from −50 to 50 and the one for b from −50 to 100, while the boxes take any integers. Decimals are cut to integers. As soon as b≥a, the box reports Number of outcomesn=b−a+1 and Probability each1/n, the Key Insight line above the calculator restates E(X), and, for n≤20, a Contribution to E(X) table lists every value with its probability and its product, ending in the sum.
If b is below a, 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=1 and b=10 the outcomes number 10, each with probability 0.1, and E(X)=5.5000; for 1 to 100 the table is replaced by a note, because 100 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=1 and b=6, closes the comparison and the extra statistics, and selects the first tab. Why all n 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 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 100 or 1000 rolls; for a range such as 10 to 20 it reads "Random selection" and shows the value in dollars; other ranges get a general reading. Click ▶ Additional Statistics to open the variance 12n2−1, the standard deviation and the range: for 10 to 20, n=11, the variance is 10.0000 and the standard deviation 3.1623; widening to 10 to 30 gives n=21, variance 36.6667 and standard deviation 6.0553.
The box under the calculator, Understanding Expected Value for Discrete Uniform Distribution, explains what 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), the alternative range with its E(X), and the difference as a percentage of the current value, marked higher or lower with an arrow. The alternative opens as 2 to 10: against the die that is E(X)=6.00, which is 71.4% higher than 3.50. Change the alternative b to 4 and the alternative E(X) becomes 3.00, 14.3% lower; make the alternative 3 to 4 and the two ranges have the same expected value, 3.5, which the panel says in words.
The comparison uses only the midpoints, so two ranges of very different width can tie, as 1 to 6 and 3 to 4 do; their variances, 2.9167 and 0.25, tell them apart. An alternative with b below a shows nothing. Why the midpoint alone fixes 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/n, and marks the expected value in the middle; for more than 30 values the chart gives way to a note that repeats the range, the probability 1/n and the midpoint. How E(X) is Calculated writes the formula and three steps: identify a and b, apply (a+b)/2, and compute, for the die 7/2=3.5000, followed by a sentence on why the midpoint is the mean. Individual Contributions, shown only for n≤20, draws each value's product k⋅n1 as a bar, so the bars rise in a straight line from a to b.
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 a to b. There are n=b−a+1 possible values, each with probability n1. A fair six-sided die is the standard example: the values 1 to 6 each have probability 61.
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 a and b, even when that midpoint is not itself a possible value.
For a discrete uniform distribution on the integers a,a+1,…,b:
E[X]=2a+b
Example: for a fair die, a=1 and b=6, so
E[X]=21+6=3.5
The same value comes from the definition: 61+2+3+4+5+6=621=3.5. No single roll gives 3.5; it is the long-run average of many rolls. The variance is 12n2−1, which for the die is 1235≈2.92.
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.5, that is evidence the die is not fair.