Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Continuous Uniform Expected Value Calculator

How to use Continuous Uniform Expected Value Calculator
  1. Set a (minimum) and b (maximum) with the sliders or the number boxes; decimals are allowed, and the box reports the formula and the Range b−ab - a. Learn more about the interval
  2. If aa is not below bb both boxes turn red and the results wait; click Reset to return to [0,10][0, 10]. Learn more about messages and Reset
  3. The Percentiles box under the parameters lists the minimum, the quartiles, the median and the maximum of the interval. Learn more about the percentiles
  4. The panel on the right shows E(X)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
  5. Click Compare to set an alternative interval and see the two expected values side by side. Learn more about comparing
  6. 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 Calculators

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.

Why E(X) = (a + b) / 2. The continuous uniform distribution has constant probability density across a, b]. When you integrate x · f(x), you are finding the weighted average where all weights are equal. This naturally gives you the midpoint. It is the same as averaging two numbers: (a + b) / 2. [Learn more about the continuous uniform distribution




Calculate Expected Value

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-50 to 5050 and from −50-50 to 100100 in steps of 0.50.5, or by typing any numbers, decimals included, in the boxes. The interval is valid when a<ba < 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)/2E(X) = (a + b) / 2 and the Range b−ab - a to two decimals, and the Key Insight line above the calculator restates E(X)E(X) as the midpoint of [a,b][a, b].

For the bus of the worked example, a=0a = 0 and b=20b = 20, the range is 20.0020.00 and E(X)=10.000E(X) = 10.000. Typing a=25a = 25 with b=20b = 20 is rejected. The interval [0,1][0, 1] of a random number generator gives E(X)=0.500E(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][0, 10] with E(X)=5.000E(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(a + b) / 2 filled in. Click ▶ Additional Statistics to open the variance (b−a)2/12(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][0, b] with b≤1b \le 1 reads "Uniform random number (0 to 1)", a range up to 1010 "Small uniform range", up to 100100 "Moderate uniform range", and anything wider "Wide uniform range", each with three lines such as the expected total over 100100 samples or the middle 50%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][20, 30] they read 20.0020.00, 22.5022.50, 25.0025.00, 27.5027.50 and 30.0030.00, with E(X)=25.000E(X) = 25.000, variance 8.33338.3333, standard deviation 2.88682.8868 and IQR 5.00005.0000. Widen to [20,60][20, 60] and the mean moves to 40.00040.000, the variance to 133.3333133.3333, the standard deviation to 11.547011.5470 and the IQR to 20.000020.0000; the context then says that 50%50\% of the values fall between 30.030.0 and 50.050.0. The box under the calculator, Understanding Expected Value for Continuous Uniform Distribution, explains what E(X)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)E(X), the alternative interval with its E(X)E(X), and the difference as a percentage of the current value, marked with an arrow. The alternative opens as [5,15][5, 15]: against [0,10][0, 10] that is E(X)=10.00E(X) = 10.00, 100.0%100.0\% higher than 5.005.00. Set the alternative bb to 55 and the alternative is no longer an interval, so its result disappears; set the alternative aa to −5-5 and the alternative [−5,5][-5, 5] has E(X)=0.00E(X) = 0.00, 100.0%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][0, 10] and [−5,15][-5, 15] do; their variances, 8.33338.3333 and 33.333333.3333, tell them apart. A current interval centred on 00 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)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)1 / (b - a) over [a,b][a, b], and marks the mean in its middle, with the standard deviation shown around it; for [0,10][0, 10] the height is 0.10.1 and the mark sits at 55, and widening to [0,20][0, 20] halves the height to 0.050.05 and moves the mark to 1010. Calculation writes the formula and three steps: read off aa and bb, write (a+b)/2(a + b) / 2 with the values, and compute, for [0,10][0, 10] giving 5.00005.0000; below the steps an Integration block shows the same result as ∫abx⋅f(x) dx\int_a^b x \cdot f(x)\,dx with f(x)=1/(b−a)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][a, b]. Every subinterval of the same length has the same probability, and the density is constant at 1b−a\frac{1}{b - a}.

Because the density is flat, the distribution balances at the middle of the interval. The expected value is the midpoint a+b2\frac{a + b}{2}, the same formula as for the discrete uniform case, though here every real number in the interval is possible.

The experiment is set out in the probabilistic experiment behind the continuous uniform distribution, the two endpoints in parameters, and the flat density in probability density function and support.

Formula and Worked Example

For a continuous uniform random variable on [a,b][a, b]:

E[X]=a+b2,Var(X)=(b−a)212E[X] = \frac{a + b}{2}, \qquad \text{Var}(X) = \frac{(b - a)^2}{12}


Example: a bus arrives at a random time between 00 and 2020 minutes after you reach the stop. The expected wait is

E[X]=0+202=10 minutesE[X] = \frac{0 + 20}{2} = 10 \text{ minutes}


The variance is 20212≈33.3\frac{20^2}{12} \approx 33.3, so the standard deviation is about 5.85.8 minutes.

The mean is derived by integration in expected value (mean), the variance in variance and standard deviation, and the quartiles the calculator lists in quantiles and percentiles.

Where This Is Used

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-0.5 and 0.50.5 units.

Random number generators produce uniform values on [0,1][0, 1], and these are the basis for simulating other distributions.

More settings are listed in real-world examples and common applications, and the [0,1][0, 1] case among the special cases.