PROBABILITY WORKSHEETS

Checking cumulative probability outside a uniform interval

A continuous uniform model puts all its probability on one interval, so the cumulative probability is 0 to the left of it and 1 to the right. This guide checks thresholds at minus 1, 0.25 and 1 on the interval from 0 to 0.5.

What the uniform model says

A continuous uniform distribution on the interval from a to b spreads probability evenly across that interval and puts none anywhere else. Its density is constant, 1 divided by (b − a), between the endpoints and zero outside them. The cumulative distribution function, usually written CDF, answers a different question: how much probability lies at or below a given threshold x. For this model it is 0 for thresholds below a, rises in a straight line from 0 to 1 across the interval, and stays at 1 for thresholds above b. The calculator reports both numbers, the density and the cumulative probability, for a chosen a, b and x. This guide fixes the support at a = 0 and b = 0.5 and varies only x.

A threshold below the support

Set x = −1. Nothing in the model lies below −1, because every possible value is between 0 and 0.5. The cumulative probability is therefore 0, and the density at that point is also 0. The calculator returns pdf 0 and cdf 0, matching the first case below the article. The formula expresses this with a clamp: the cumulative value is the larger of 0 and the smaller of 1 and (x − a) / (b − a). For x = −1 the fraction is (−1 − 0) / 0.5 = −2, and clamping to the range from 0 to 1 gives 0. Without that clamp the formula would report a negative probability, which is meaningless. The clamp is what keeps the output a valid probability for every threshold.

A threshold above the support

Now set x = 1. The fraction is (1 − 0) / 0.5 = 2, and the clamp reduces it to 1. All of the modeled probability lies at or below the threshold, so the cumulative probability is 1. The density is 0, because the model assigns no density beyond 0.5. These two outputs, pdf 0 and cdf 1, can look contradictory at first. A zero density does not mean zero cumulative probability. The CDF accumulates everything to the left, so once the threshold has passed the whole support, it stays at its maximum no matter how far right x goes. The density only describes how thickly probability sits at a single point, and past the end of the interval nothing sits there.

The interior point

In the middle of the interval the numbers change character. At x = 0.25 the fraction is 0.25 / 0.5 = 0.5, so the cumulative probability is 0.5, and the density is 1 / 0.5 = 2. Half of the interval lies below 0.25, which matches the intuition that 0.25 is the midpoint of the support. The density of 2 deserves a comment. A density can be greater than 1 without any problem, because it is not a probability. Probability comes from area under the density. The rectangle has height 2 and width 0.5, so its area is 1, as required. Narrower intervals give taller densities. A reader who sees pdf 2 and expects a probability bound of 1 has confused height with area.

Endpoints and the density rule

The boundaries are worth testing directly. At x = 0 the cumulative probability is 0 and the density is 2, since the rule gives zero density only when x is below a or above b. At x = 0.5 the cumulative probability is 1 and the density is still 2 under the same rule. The density is zero strictly outside the interval, and the cumulative function reaches 1 exactly at b. For a continuous model a single point carries no probability, so whether the endpoints themselves belong to the support makes no difference to the cumulative values. The density at a single point is only a height on a curve, and its value at the edge depends on the convention that the formula adopts, which includes both endpoints. If you need the probability that the value lies between two thresholds, subtract the two cumulative values. The probability between 0.1 and 0.4 on this interval is 0.8 minus 0.2, which is 0.6, and it does not depend on how the endpoint convention treats single points.

Reading a non-trivial threshold

To see the straight-line rise in numbers, choose x = 0.1. The fraction is 0.1 / 0.5 = 0.2, so the cumulative probability is 0.2 and the density is still 2. At x = 0.4 the cumulative probability would be 0.8. Because the CDF is linear across the support, equal steps in x add equal probability: each 0.05 step adds 0.1. That linearity is the defining feature of the uniform model and is what distinguishes it from bell-shaped models. The median is the midpoint 0.25, the mean is also (0 + 0.5) / 2 = 0.25, and the interval from 0.1 to 0.4 holds a probability of 0.8 − 0.2 = 0.6. These facts all follow from areas of rectangles. Spot values like these double as test inputs. If a tool disagrees with the straight-line rule at 0.1, 0.25 or 0.4, the parameters entered are probably not the ones you intended, often because a and b were swapped or typed with the wrong decimal.

Changing x versus changing the model

Moving x poses a different question to the same model. Moving a or b creates a different model. If you want to see how the CDF behaves at a threshold, keep a and b fixed and vary x only. If you change b from 0.5 to 1 while leaving x at 0.25, the cumulative probability drops from 0.5 to 0.25 and the density from 2 to 1, but the cause is a new distribution, not the same one evaluated somewhere else. Mixing the two kinds of change in one test makes the output hard to interpret. A boundary check works best when only one thing changes between runs, so that every difference in the output has a single explanation. A related slip is entering the threshold in different units from the endpoints, for example the endpoints in hours and the threshold in minutes. The tool cannot detect it, and the output will look like a valid probability while answering a different question.

A model with a different interval

Use illustrative parameters a = 2 and b = 10, so the interval has width 8. The density inside is 1 / 8 = 0.125. At x = 5 the fraction is (5 − 2) / 8 = 0.375, so the cumulative probability is 0.375, and the density is 0.125. At x = 12 the cumulative probability is 1 and the density is 0. At x = 0 the cumulative probability is 0 and the density is 0. Here the density is below 1, in contrast with the earlier model where it was 2. The same three regimes appear, though, and the same clamp does the work. Any uniform model has a flat middle and two saturated tails, and only the numbers move with a and b.

Mean, spread and the median

The summary values of a uniform model follow from its endpoints. The mean is the midpoint (a + b) / 2, which is 0.25 for the interval from 0 to 0.5. The median is the same value, because the density is symmetric. The variance is (b − a)² divided by 12, so here it is 0.25 / 12, about 0.0208, and the standard deviation is its square root, about 0.144. None of these appear in the threshold outputs, but they help set expectations. A uniform model on a short interval has a small spread simply because the interval is short. Comparing a threshold with the mean and the half-width tells you at once whether the cumulative probability is likely to be near 0, near 1 or somewhere in the middle, which is a quick plausibility check before reading the result.

Rescaling the interval

Stretching the interval stretches the density the opposite way. Multiply the support from 0 to 0.5 by 4 and it becomes the interval from 0 to 2. The density drops from 2 to 0.5, because the same total probability of 1 now spreads over a width four times larger. Evaluate the stretched model at x = 1, which corresponds to the original 0.25, and the cumulative probability is still 0.5. The CDF depends only on the position of the threshold within the interval, while the density depends on the unit of measurement. Changing from hours to minutes, for instance, divides the density by 60 and leaves every cumulative probability unchanged. This is why a density quoted without its unit is incomplete.

Generating values from the model

Software random number generators commonly produce values uniform on the interval from 0 up to but not including 1. Any uniform model on a to b can be generated from such a value u by computing a + (b − a) × u. For the interval from 0 to 0.5, a draw of u = 0.5 maps to 0.25, and u = 0.8 maps to 0.4. The CDF reverses the relation: the cumulative probability at a point equals the draw that would map to it. This connection explains why the CDF of a uniform model is a straight line. It also underlies the more general inverse-transform method for sampling other distributions. The worksheet generates no values. It reports the same two quantities, position within the interval and cumulative probability.

Where this behavior matters

Saturation at 0 and 1 matters whenever a threshold is chosen without regard to the support. A tolerance model that treats a measured value as uniform between two limits will report a probability of exactly 1 for any limit above the top and exactly 0 for any limit below the bottom. That is correct as arithmetic, but it also signals that the threshold carries no information about the model. If a result is 0 or 1 unexpectedly, check that the threshold and the interval use the same units and the same scale. The worksheet is limited to the stated model and the supplied parameters. It does not judge whether a uniform assumption suits a real quantity, which depends on the situation being modeled.

Reproduce the checks

Threshold below the interval

Open the Continuous Uniform Distribution Calculator and enter:

Lower bound
0
Upper bound
0.5
Threshold
-1

Expected output:

Probability density

0

Cumulative probability

0

No support has accumulated at this threshold.

Threshold above the interval

Open the Continuous Uniform Distribution Calculator and enter:

Lower bound
0
Upper bound
0.5
Threshold
1

Expected output:

Probability density

0

Cumulative probability

1

All support lies below the threshold.

Interior midpoint

Open the Continuous Uniform Distribution Calculator and enter:

Lower bound
0
Upper bound
0.5
Threshold
0.25

Expected output:

Probability density

2

Cumulative probability

0.5

Half the interval is included.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks