4.2 Continuous Uniform Distribution =================================== 4.2.1 From Discrete to Continuous Uniform ------------------------------------------ The **uniform** idea means that probability is spread evenly across the possible range. For a discrete uniform random variable, individual values can have positive probability. If there are :math:`n` equally likely values, .. math:: P(X=x_i)=\frac1n. For a continuous uniform random variable, there are infinitely many possible values in an interval. An individual point therefore has probability zero: .. math:: P(X=x)=0. Instead of assigning probability to individual points, a continuous model assigns probability through **area under a probability density function**. Equal-length subintervals have equal probability. .. image:: ../_static/figures/continuous_distributions/figure_4_2_1_discrete_vs_continuous_uniform.png :width: 92% :align: center The figure shows the conceptual transition. The discrete model places equal probability masses at separate values, whereas the continuous model spreads density uniformly across an entire interval. 4.2.2 Probability Density Function ---------------------------------- Let .. math:: X\sim U(a,b), \qquad ac`, the relevant interval has been reduced from :math:`[a,b]` to :math:`(c,b]`. Therefore, .. math:: \begin{aligned} P(X>d\mid X>c) &=\frac{P(X>d)}{P(X>c)}\\ &=\frac{(b-d)/(b-a)}{(b-c)/(b-a)}\\ &=\frac{b-d}{b-c}. \end{aligned} So after conditioning on :math:`X>c`, probability is again proportional to length within the reduced interval. 4.2.10 Discrete Uniform Versus Continuous Uniform -------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 28 36 36 * - Feature - Discrete Uniform - Continuous Uniform * - Possible outcomes - Finite or countable values - All real values in an interval * - Probability model - PMF :math:`p(x)` - PDF :math:`f(x)` * - Probability at one value - Can be positive - :math:`P(X=x)=0` * - Probability over a range - Sum of probability masses - Area under the density * - Graph - Equal-height bars or spikes - Rectangle * - Uniform idea - Equal probability for each value - Equal probability for equal-length intervals The phrase ``equally likely`` must therefore be interpreted differently in the two settings. In a continuous interval, it means equal **lengths** have equal probability; it does not mean that each exact real number has positive probability. 4.2.11 When Is a Continuous Uniform Model Appropriate? ------------------------------------------------------- Use a continuous uniform model when: 1. the variable is continuous; 2. values are restricted to a finite interval :math:`[a,b]`; 3. no part of the interval is more likely than another; 4. equal-length subintervals should have equal probability. Examples can include randomized waiting times, measurement values known only to lie uniformly inside a tolerance interval, or a random location along a fixed line segment. Do not use a uniform model if values near the center, near an endpoint, or in some other part of the interval are systematically more likely. 4.2.12 Quick Practice --------------------- Suppose a service time is uniformly distributed between 11 and 21 minutes. Let .. math:: X\sim U(11,21). Find: (a) :math:`P(X>19)`; (b) the 50th percentile; (c) :math:`E(X)`; and (d) :math:`\sigma`. **Answer** The full interval has width .. math:: 21-11=10. For part (a), .. math:: P(X>19) =\frac{21-19}{10} =0.20. For part (b), .. math:: k =11+0.50(10) =16. The mean is .. math:: E(X) =\frac{11+21}{2} =16. The standard deviation is .. math:: \sigma =\frac{10}{\sqrt{12}} \approx2.887\text{ minutes}. 4.2.13 Common Mistakes ---------------------- Do not interpret :math:`f(x)` as :math:`P(X=x)`. A continuous point has zero probability. Do not divide by :math:`b`. The total interval length is :math:`b-a`. Do not forget to rescale the density if the interval changes. The total area must always remain 1. Do not treat endpoints as extra probability masses. For continuous probabilities, including or excluding a finite number of endpoints does not change the probability. Do not use the uniform model merely because the variable is bounded. The model also requires a constant density across the interval. 4.2.14 Summary -------------- For .. math:: X\sim U(a,b), its PDF is .. math:: f(x) = \frac1{b-a}, \qquad a\leq x\leq b. For :math:`a\leq c