Uniform Distribution Calculator (Continuous on [a, b])

This free uniform distribution calculator finds P(X < x), P(X > x) or a probability between two values for a continuous uniform random variable on an interval [a, b], plus the constant density f(x) = 1/(b − a), the mean, the variance, the standard deviation and the median. It shows the step-by-step working with your numbers, a shaded density rectangle and the exact TI-84 arithmetic. The TI-84, TI-84 Plus CE and TI-83 Plus have no built-in unifpdf or unifcdf command, so the calculator writes the length-over-length formula you type on the home screen, and it also shows how to simulate draws with rand. A percentile mode solves for the value x with a given cumulative probability.

Contents

How to Use the Uniform Distribution Calculator

  1. Enter the interval. a is the left endpoint and b is the right endpoint, with b greater than a. Every value between a and b is equally likely, in the continuous sense: probability is length, not a point mass.
  2. Pick the probability you need: P(X < x), P(X > x), P(c < X < d), or Find x (percentile) to solve for a cutoff from an area.
  3. Type x (or c and d, or the area p). Because the distribution is continuous, P(X < x) and P(X ≤ x) are the same, and P(X = x) is 0.
  4. Read the answer in the purple box, with the mean, standard deviation and density beside it. Open the step-by-step working and the TI-84 keys written for your numbers.

Results update as you type. Copy share link saves your inputs in the URL. The Example button loads a classic random-arrival question: a bus every 30 minutes, P(wait between 10 and 20 minutes) = 1/3. For a waiting time with a constant event rate rather than a flat interval, use the exponential distribution calculator. For a bell-shaped model use the normal distribution calculator.

What Is the Continuous Uniform Distribution?

The continuous uniform distribution on [a, b] is the “flat” probability model: X is equally likely to fall in any sub-interval of the same length inside [a, b], and it cannot fall outside that interval. We write X ~ Uniform(a, b) or X ~ U(a, b). Picking a random time in a 10-minute window, a random point on a stick, or a spinner that is fair around a circle (unrolled onto an interval) are standard examples.

Four things set this model apart:

  • A finite interval [a, b] with b > a. The length b − a is the only scale in the problem.
  • A constant density f(x) = 1/(b − a) on the interval, and 0 outside it. The graph is a rectangle of area 1.
  • Probability equals relative length. P(c < X < d) is the length of the overlap of (c, d) with [a, b], divided by b − a.
  • A continuous variable. Individual points have probability 0, so “at most x” and “less than x” are the same number.

The mean of this distribution is the midpoint (a + b)/2. That is also the median, and it is a special case of the expected value E(X) = ∫ x f(x) dx over [a, b].

Uniform Distribution Formulas

f(x) = 1/(b − a) for a ≤ x ≤ b, and 0 otherwise

F(x) = P(X ≤ x) = 0 if x ≤ a, (x − a)/(b − a) if a ≤ x ≤ b, 1 if x ≥ b

P(X > x) = (b − x)/(b − a) (when a ≤ x ≤ b)    P(c < X < d) = (overlap length)/(b − a)

μ = (a + b)/2    Var(X) = (b − a)² / 12    σ = (b − a)/√12    median = μ

The percentile formula is the inverse of the cdf: x = a + p(b − a). The 50th percentile is the midpoint. On a TI-84 there is no dedicated uniform command, so you type these quotients directly; √ is 2nd x².

Worked Example: Uniform on [0, 10], P(X < 4)

The calculator opens with this question: A random number is drawn uniformly from 0 to 10. What is the probability that it is less than 4? So a = 0, b = 10 and x = 4.

  1. Density: f(x) = 1/(10 − 0) = 0.1 on [0, 10].
  2. Less than 4: P(X < 4) = (4 − 0)/(10 − 0) = 4/10 = 0.4.
  3. More than 4: P(X > 4) = (10 − 4)/10 = 0.6. The two answers add to 1.
  4. Between 2 and 7: P(2 < X < 7) = (7 − 2)/10 = 0.5.
  5. Mean, SD and median: μ = (0 + 10)/2 = 5, which is also the median. The variance is 10² / 12 = 100/12 ≈ 8.3333, and σ = 10/√12 ≈ 2.8868.

On the TI-84, type (4-0)/(10-0) and press ENTER to get .4. The Example button loads a buses question: a bus every 30 minutes, you arrive at a random time, P(wait between 10 and 20 minutes) = (20 − 10)/(30 − 0) = 1/3 ≈ 0.3333, with mean 15 and σ = 30/√12 ≈ 8.6603. The 50th percentile of the default interval is the midpoint 5, which you can also get from the Find x mode with p = 0.5.

Continuous vs Discrete Uniform

This page computes the continuous model. There is a related discrete uniform distribution on the integers a, a+1, …, b (for example a fair die, or randInt on a TI-84). In that model each integer has probability 1/n with n = b − a + 1, the mean is still (a + b)/2, but the variance is (n² − 1)/12, not (b − a)²/12, and P(X = k) is not 0.

On a TI-84, rand (MATH PRB 1) produces a continuous Uniform(0, 1) number; a+(b-a)rand scales it to [a, b]. randInt(a,b) (MATH PRB 5) produces an integer from a to b inclusive. Use the continuous formulas on this page when the variable can be any real number in the interval; use 1/(b − a + 1) when it can only be a whole number.

Uniform vs Normal and Exponential

Uniform(a, b)NormalExponential
ShapeA rectangle on a finite intervalA symmetric bell curveA one-sided decaying wait
SupportOnly [a, b]All real numbers[0, ∞)
DensityConstant 1/(b − a)Peaks at the meanHighest at 0, then e−λx
Mean vs medianThe same: (a + b)/2The same: μMedian is smaller than the mean
TI-84 commandNo built-in cdf; use arithmetic (and rand)normalcdf and invNorm under DISTRNo built-in cdf; use e^

Use uniform when every value in a finite window is equally plausible. Use normal when a symmetric bell curve is the right shape, and the z-score calculator when you already have μ and σ. Use exponential for the wait until the next event at a constant rate, not for a flat interval.

How to Calculate a Uniform Probability on a TI-84

Texas Instruments does not include unifpdf or unifcdf in the DISTR menu of the TI-84 Plus, TI-84 Plus CE or TI-83 Plus. You type the fraction of the interval on the home screen.

  1. For the default P(X < 4) on [0, 10] you want (4-0)/(10-0).
  2. Type ( 4 − 0 ) ÷ ( 10 − 0 ) and press ENTER. The calculator shows .4.
  3. For P(10 < X < 20) on [0, 30], type (20-10)/(30-0), which returns ≈ .3333.
  4. The mean is (0+10)/2. The standard deviation is (10-0)/√(12); √ is 2nd x².
  5. A percentile is x = a + p(b − a). For the median of [0, 10], type 0+0.5*(10-0) to get 5.
  6. To simulate a draw, type 0+(10-0)rand. rand is MATH → PRB → 1:rand. Press ENTER again for another value. For an integer from 0 to 10, use randInt(0,10) instead.

Try every keystroke on our TI-84 Plus CE calculator online. All of the probability tools live on the math calculators hub.

Common Mistakes

  • Looking for unifcdf on the TI-84. It is not in DISTR. Type (x − a)/(b − a), or the overlap length over b − a for a range.
  • Using 1/(b − a) as a probability. That is the density, a height. A probability is a length divided by b − a.
  • Swapping a and b, or setting them equal. The interval needs b > a. If you typed 10 then 0, swap them.
  • Using the discrete formula on a continuous problem (or the other way around). 1/(b − a + 1) is for integers; (d − c)/(b − a) is for a continuous range.
  • Treating P(X = x) as a useful probability. For a continuous uniform, that probability is 0. Use a range, or read f(x) as a height.
  • Using a normal or exponential model for a flat, bounded interval. The bell curve has tails past a and b; the exponential is skewed and starts at 0 with a decreasing density.

Why This Uniform Calculator Is Different

  • Honest TI-84 keystrokes. The calculator does not invent a unifcdf command. It writes (x − a)/(b − a) or the overlap formula, plus the mean, σ = (b − a)/√12, and a+(b-a)rand for simulation.
  • All three probability types (less than, more than, between) plus a percentile mode, with the constant density, mean, variance and SD on the same screen.
  • A shaded density rectangle marked with the mean, so you can see that probability is just the width of a slice of a flat box of area 1.
  • Clear continuous vs discrete guidance, including when to use rand versus randInt, without mixing the two variances.
  • Checked against exact arithmetic and SciPy on hundreds of random intervals, including the default 0.4 / 0.6 example and the 30-minute bus wait of 1/3. It works in dark mode, makes share links and fits a phone screen.

Uniform Distribution Calculator FAQ

Divide lengths. On [a, b], P(X < x) = (x − a)/(b − a) when x is between a and b, P(X > x) = (b − x)/(b − a), and P(c < X < d) is the length of the overlap with [a, b] divided by b − a. For the default [0, 10] and x = 4 that is 4/10 = 0.4.

No. The TI-84 Plus, TI-84 Plus CE and TI-83 Plus have no built-in uniform command in DISTR. Type (x−a)/(b−a) on the home screen. For the default example, (4-0)/(10-0) returns .4. To simulate a value, use a+(b-a)rand.

The mean and the median are both the midpoint (a + b)/2. The variance is (b − a)² / 12 and the standard deviation is (b − a)/√12. For [0, 10] the mean is 5, the variance is 100/12 ≈ 8.3333 and σ ≈ 2.8868.

Continuous uniform is any real number in [a, b], with density 1/(b − a) and P(X = x) = 0. Discrete uniform is the integers a through b, each with probability 1/(b − a + 1). On a TI-84, rand (scaled) is continuous; randInt(a,b) is discrete. The variances are different: (b − a)²/12 versus (n² − 1)/12.

Type a+(b-a)rand. rand is MATH PRB 1:rand, a Uniform(0, 1) draw. Press ENTER again for another value. For an integer from a to b inclusive, use randInt(a,b) (MATH PRB 5) instead.

Use x = a + p(b − a). For p = 0.5 that is the midpoint, which is both the mean and the median. On a TI-84 type a+p*(b-a). The Find x mode on this calculator does the same for any p between 0 and 1.

f(x) = 1/(b − a) for x between a and b, and 0 outside. It is a height, not a probability: the rectangle has height 1/(b − a) and width b − a, so its area is 1. For [0, 10] the height is 0.1.

Use uniform when every value in a finite interval is equally plausible (a random time in a window, a random point on a segment). Use a normal model for a symmetric bell curve, and exponential for a waiting time with a constant rate.

TI 84 Calc PRO is not affiliated with or endorsed by Texas Instruments. TI-84 Plus CE is a trademark of Texas Instruments.

About this page

Written and maintained by TI 84 Calc PRO Editorial TeamLast updated