2.3 Continuous Probability Distributions ======================================== :bolditalic:`Key Terms` :bolditalic:`Probability density function(機率密度函數)` A function whose area over an interval gives probability. :bolditalic:`PDF(機率密度函數)` Short form of probability density function. :bolditalic:`Density(密度)` Probability concentration represented by height; probability itself is represented by area. :bolditalic:`Cumulative distribution function(累積分配函數)` A function that gives the probability that a random variable is less than or equal to a given value. :bolditalic:`CDF(累積分配函數)` Short form of cumulative distribution function. :bolditalic:`Interval probability(區間機率)` Probability that a continuous random variable falls within an interval. 2.3.2 Learning Outcomes ----------------------- After completing this section, students should be able to: - explain why continuous probability is described by a PDF rather than a PMF; - explain why :math:`P(X=x)=0` for a continuous random variable; - interpret probability as area under a density curve; - identify the conditions of a valid PDF; - calculate simple interval probabilities from a PDF; - construct a CDF from a simple continuous PDF; - use :math:`F(x)` to calculate interval probabilities; - explain the relationship between a PDF and a CDF; - explain why including or excluding interval endpoints does not change a continuous probability. 2.3.3 From PMF to PDF --------------------- In the previous section, a discrete random variable was described by a **probability mass function**: .. math:: p(x)=P(X=x). A discrete random variable can place positive probability at individual values. A continuous random variable is different. Its possible values fill an interval, so probability is not assigned to individual points. Instead, a continuous distribution is described by a **probability density function**, or PDF. .. image:: ../_static/figures/random_variables/figure_2_3_1_pmf_vs_pdf.png :width: 78% :align: center :alt: Comparison of probability mass at discrete points with probability density spread continuously across an interval. For a continuous random variable, .. math:: P(X=x)=0 for every individual value :math:`x`. This does not mean that :math:`x` is impossible. A single point has zero width, so it contributes zero area under the density curve. .. note:: **PMF versus PDF** For a discrete random variable, .. math:: p(x)=P(X=x). For a continuous random variable, .. math:: f(x)\neq P(X=x). Probability is obtained from **area**, not from the density height at one point. 2.3.4 A Single Example: Bus Waiting Time ---------------------------------------- Let :math:`X` be the waiting time, in minutes, for the next bus. Suppose the waiting time can be anywhere from 0 to 10 minutes and is modeled with the constant density .. math:: f(x)= \begin{cases} \frac{1}{10}, & 0\leq x\leq10,\\ 0, & \text{otherwise}. \end{cases} This one example will be used to introduce both the PDF and the CDF. 2.3.5 Probability Density Function ---------------------------------- A valid PDF must satisfy two conditions: .. math:: f(x)\geq0 for all :math:`x`, and .. math:: \int_{-\infty}^{\infty}f(x)\,dx=1. For the waiting-time example, the total area is .. math:: 10\left(\frac{1}{10}\right)=1, so the density is valid. Probability over an interval is the area under the PDF: .. math:: P(a10. \end{cases} Thus, .. math:: F(2)=0.20, \qquad F(6)=0.60. The CDF is shown below. .. image:: ../_static/figures/random_variables/figure_2_3_3_continuous_cdf.png :width: 62% :align: center :alt: Continuous cumulative distribution function for a waiting time uniformly distributed between zero and ten minutes. Unlike the discrete CDF, this CDF increases continuously rather than by jumps. 2.3.9 Finding Probabilities from the CDF ----------------------------------------- The CDF provides accumulated probability from the left. For example, .. math:: P(X\leq6)=F(6)=0.60. For an interval, .. math:: P(ax)=1-F(x). For example, .. math:: P(X>6)=1-F(6)=0.40. 2.3.10 Relationship Between PDF and CDF --------------------------------------- The PDF and CDF describe the same continuous distribution in different ways. The CDF accumulates the PDF: .. math:: F(x)=\int_{-\infty}^{x}f(t)\,dt. When :math:`F` is differentiable, the PDF can be recovered from the slope of the CDF: .. math:: f(x)=F'(x). For the waiting-time example, between 0 and 10, .. math:: F(x)=\frac{x}{10}, so .. math:: F'(x)=\frac{1}{10}=f(x). Thus: PDF -> density and interval area CDF -> accumulated probability 2.3.11 Properties of a Continuous CDF ------------------------------------- A CDF satisfies .. math:: 0\leq F(x)\leq1. It never decreases. Also, .. math:: F(x)\rightarrow0 \quad\text{as}\quad x\rightarrow-\infty, and .. math:: F(x)\rightarrow1 \quad\text{as}\quad x\rightarrow\infty. For a continuous distribution with a continuous density, the CDF changes smoothly rather than jumping at isolated values. 2.3.12 Discrete Versus Continuous Probability --------------------------------------------- .. list-table:: :header-rows: 1 :widths: 30 35 35 * - Idea - Discrete - Continuous * - Possible values - Countable - Any value in an interval * - Main probability function - PMF :math:`p(x)` - PDF :math:`f(x)` * - Probability at one value - May be positive - 0 * - Probability over several values - Add PMF values - Find area under PDF * - CDF - Accumulates PMF values - Accumulates PDF area * - Typical CDF shape - Step function - Continuous curve 2.3.13 A Simple Method ---------------------- For a continuous probability distribution: 1. Identify the possible range of :math:`X`. 2. Identify the PDF :math:`f(x)`. 3. Check that :math:`f(x)\geq0` and the total area is 1. 4. Find probabilities as areas under the PDF. 5. Obtain the CDF by accumulating area from the left. 6. Use :math:`F(b)-F(a)` for interval probabilities when convenient. 7. Remember that individual points have probability 0. 2.3.14 Common Mistakes ---------------------- Do not write :math:`f(x)=P(X=x)` for a continuous random variable. Do not interpret :math:`P(X=x)=0` as meaning that :math:`x` cannot occur. Do not use density height alone as probability; probability is area. Do not worry about whether interval endpoints are included. Do not confuse the PDF :math:`f(x)` with the CDF :math:`F(x)`. 2.3.15 Summary -------------- A continuous probability distribution is described by a PDF :math:`f(x)`. A valid PDF satisfies .. math:: f(x)\geq0 and .. math:: \int_{-\infty}^{\infty}f(x)\,dx=1. Probability is area: .. math:: P(a