?How to use Continuous Uniform Expected Value Calculator▶
Set a (minimum) and b (maximum) with the sliders or the number boxes; decimals are allowed, and the box reports the formula and the Rangeb−a. Learn more about the interval
The Percentiles box under the parameters lists the minimum, the quartiles, the median and the maximum of the interval. Learn more about the percentiles
The panel on the right shows E(X) as the midpoint, with Additional Statistics (variance, standard deviation, interquartile range) behind a toggle and examples in context below the chart. Learn more about the panel
Click Compare to set an alternative interval and see the two expected values side by side. Learn more about comparing
Use the tabs Visualization and Calculation for the flat density with its mean, or the steps and the integral; the box under the calculator explains the formula. Learn more about the tabs
Expected Value Calculator - Continuous Uniform Distribution
Calculate the expected value (average value) for a continuous uniform distribution. Perfect for modeling scenarios where all values in a range are equally likely: random numbers, waiting times, or any situation with equal probability across an interval.
💡
Key Insight: E(X) = 5.00 is simply the midpoint of your range [0, 10]. For uniform distributions, the expected value is always the average of the endpoints: (a + b) / 2.
Parameters
Formula:E(X) = (a + b) / 2
Range:10.00
Percentiles
Min:0.00
Q1:2.50
Median:5.00
Q3:7.50
Max:10.00
Expected Value
E(X) = 5.000
(0 + 10) / 2
The midpoint of [0, 10]
Probability Density Function with E(X) = 5.00
Density
E(X) = 5.00
a = 0.00E(X) = 5.00b = 10.00
Note: The PDF is constant at height 0.1000 across [0, 10]. Total area under the curve = 1. Shaded region shows E(X) ± σ (≈57.7% of distribution).
📊Small uniform range
Values uniformly distributed from 0 to 10? Expect 5.00 on average
Over 100 samples? Expect total ≈ 500
Middle value 5.00 is both mean and median
Understanding Expected Value for Continuous Uniform Distribution
What Does E(X) Mean? The expected value E(X) represents the average value of the distribution, the centre of mass of the density. For uniform distributions, this is simply the midpoint of the interval [a, b].
Interpreting Your Result. The average value across the distribution is E(X); it equals the median and the mode, which are all the same for a uniform interval; the values are evenly distributed around this centre point.
Real-World Examples.Random number [0, 1]: E(X) = 0.5. Arrival time [0, 60] min: E(X) = 30 minutes. Temperature [20, 30] °C: E(X) = 25 °C. Duration [5, 15] s: E(X) = 10 seconds.
Use the calculator below to compute the expected value with step-by-step solutions and detailed explanations.
Setting a and b
DemoThe bus wait, a bad order, [0, 1], Reset
Step 0 of 4
Under Parameters, set a (Minimum) and b (Maximum) with the sliders, which run from −50 to 50 and from −50 to 100 in steps of 0.5, or by typing any numbers, decimals included, in the boxes. The interval is valid when a<b; otherwise both boxes turn red and the right panel shows "Enter valid: a < b" until the order is fixed. While valid, the box reports the formula E(X)=(a+b)/2 and the Rangeb−a to two decimals, and the Key Insight line above the calculator restates E(X) as the midpoint of [a,b].
For the bus of the worked example, a=0 and b=20, the range is 20.00 and E(X)=10.000. Typing a=25 with b=20 is rejected. The interval [0,1] of a random number generator gives E(X)=0.500, and the context box below the chart then reads "Uniform random number (0 to 1)". There is no Calculate button; everything recomputes as you type.
Reset, at the top right of the parameter box, returns to [0,10] with E(X)=5.000, closes the comparison and the extra statistics, and selects the first tab. Why a flat density balances at the midpoint is explained in the continuous uniform distribution.
Reading the Panel and the Percentiles
Demo[20, 30], the extra statistics, [20, 60]
Step 0 of 3
The right panel is built around one number: E(X), the midpoint, to three decimals, with the formula (a+b)/2 filled in. Click ▶ Additional Statistics to open the variance (b−a)2/12, the standard deviation and the IQR, the interquartile range, which is half the length of the interval. Below the tabs, a context box turns the numbers into a scenario chosen from the interval: [0,b] with b≤1 reads "Uniform random number (0 to 1)", a range up to 10 "Small uniform range", up to 100 "Moderate uniform range", and anything wider "Wide uniform range", each with three lines such as the expected total over 100 samples or the middle 50% of the values.
On the left, under the parameters, the Percentiles box lists the minimum, the first quartile Q1 at a quarter of the way along the interval, the Median, which for a uniform interval equals the mean, the third quartile Q3 and the maximum. For [20,30] they read 20.00, 22.50, 25.00, 27.50 and 30.00, with E(X)=25.000, variance 8.3333, standard deviation 2.8868 and IQR 5.0000. Widen to [20,60] and the mean moves to 40.000, the variance to 133.3333, the standard deviation to 11.5470 and the IQR to 20.0000; the context then says that 50% of the values fall between 30.0 and 50.0. The box under the calculator, Understanding Expected Value for Continuous Uniform Distribution, explains what E(X) means, gives four stock examples and shows why the formula is the midpoint; its link opens the first section below. The formula is worked through in formula and worked example.
Comparing Two Intervals
Demo[0, 10] against [5, 15], [5, 5], [-5, 5]
Step 0 of 3
Click ▶ Compare under the parameter box to open an Alt a and Alt b. The panel then shows the current interval with its E(X), the alternative interval with its E(X), and the difference as a percentage of the current value, marked with an arrow. The alternative opens as [5,15]: against [0,10] that is E(X)=10.00, 100.0% higher than 5.00. Set the alternative b to 5 and the alternative is no longer an interval, so its result disappears; set the alternative a to −5 and the alternative [−5,5] has E(X)=0.00, 100.0% lower. When the two midpoints agree the panel says "Same".
The comparison uses only the midpoints, so intervals of different width tie whenever they share a centre, as [0,10] and [−5,15] do; their variances, 8.3333 and 33.3333, tell them apart. A current interval centred on 0 makes the percentage undefined, so the panel then shows the plain difference of the two midpoints with the note "no percentage: E(X) is 0". Why the midpoint alone fixes E(X) is explained in the continuous uniform distribution.
The Two Tabs
DemoA wider rectangle, the calculation, the chart
Step 0 of 3
Under the statistics are two tabs; they change what is drawn, not the numbers. Visualization (the default) draws the flat density, a rectangle of height 1/(b−a) over [a,b], and marks the mean in its middle, with the standard deviation shown around it; for [0,10] the height is 0.1 and the mark sits at 5, and widening to [0,20] halves the height to 0.05 and moves the mark to 10. Calculation writes the formula and three steps: read off a and b, write (a+b)/2 with the values, and compute, for [0,10] giving 5.0000; below the steps an Integration block shows the same result as ∫abx⋅f(x)dx with f(x)=1/(b−a), and a one-line reason: a constant density puts the centre of mass at the midpoint.
Use the calculation tab to check a homework answer and the visualization to see the flat shape and how the height trades off against the width. Reset returns to the visualization tab. The integral of the calculation tab is the one evaluated in formula and worked example.
The Continuous Uniform Distribution
A continuous uniform distribution spreads probability evenly over an interval [a,b]. Every subinterval of the same length has the same probability, and the density is constant at b−a1.
Because the density is flat, the distribution balances at the middle of the interval. The expected value is the midpoint 2a+b, the same formula as for the discrete uniform case, though here every real number in the interval is possible.
The continuous uniform distribution models a quantity that is equally likely to fall anywhere in a range: a random arrival time within a window, the position of a break along a rod, or rounding errors, which are roughly uniform between −0.5 and 0.5 units.
Random number generators produce uniform values on [0,1], and these are the basis for simulating other distributions.