Continuous Random Variables: PDFs, CDFs, Expected Value, and Variance

Continuous Random Variables and Probability Density Functions (PDFs)

  • Definition of a Continuous Random Variable: A random variable that can take on any value within a given range in the real number system, often an interval [a,b][a, b] (where aa or bb can be infinite).

  • Probability Density Function (PDF), denoted fX(x)f_X(x):

    • It's analogous to density in physics (e.g., mass density). If you integrate the density of an object, you get its total mass. In probability, integrating a PDF gives the total probability.

    • Properties:

      • The PDF must be non-negative: fX(x)0f_X(x) \ge 0 for all xx.

      • The total area under the curve of the PDF over its entire range of possible values must equal one: <em>f</em>X(x)dx=1\int<em>{-\infty}^{\infty} f</em>X(x) dx = 1.

      • For a defined range [a,b][a, b], this becomes <em>abf</em>X(x)dx=1\int<em>a^b f</em>X(x) dx = 1.

    • Computing Probability: To find the probability that a continuous random variable XX falls within a certain subset (or interval) AA of its range, you integrate the PDF over that subset:
      P(XA)=<em>Af</em>X(x)dxP(X \in A) = \int<em>A f</em>X(x) dx
      For an interval [c,d][c, d] within the range: P(cXd)=<em>cdf</em>X(x)dxP(c \le X \le d) = \int<em>c^d f</em>X(x) dx

Cumulative Distribution Function (CDF)

  • Definition, denoted FX(x)F_X(x): The cumulative distribution function gives the probability that the random variable XX takes on a value less than or equal to a specific value xx.

    • It represents the area under the PDF curve up to a point xx.

    • Formula: F<em>X(x)=P(Xx)=</em>xfX(t)dtF<em>X(x) = P(X \le x) = \int</em>{-\infty}^{x} f_X(t) dt
      (A dummy variable tt is often used for the integration to avoid confusion with the upper limit xx).

  • Relationship between PDF and CDF: By the Fundamental Theorem of Calculus, the derivative of the CDF gives the PDF:
    f<em>X(x)=ddxF</em>X(x)f<em>X(x) = \frac{d}{dx} F</em>X(x)

Expected Value and Variance for Continuous Random Variables

  • Expected Value (Mean), denoted E[X]E[X] or μX\mu_X:

    • It represents the long-term average value of the random variable.

    • Formula: E[X]=<em>xf</em>X(x)dxE[X] = \int<em>{-\infty}^{\infty} x \cdot f</em>X(x) dx
      This is a weighted average where each value of xx is weighted by its probability density.

  • Expected Value of a Function of X, denoted E[g(X)]E[g(X)]:

    • For any function g(x)g(x), its expected value is:
      E[g(X)]=<em>g(x)f</em>X(x)dxE[g(X)] = \int<em>{-\infty}^{\infty} g(x) \cdot f</em>X(x) dx

  • Variance, denoted Var(X)Var(X) or σX2\sigma_X^2:

    • Measures the spread or dispersion of the data around the mean.

    • Formula: Var(X)=E[(Xμ<em>X)2]=</em>(xμ<em>X)2f</em>X(x)dxVar(X) = E[(X - \mu<em>X)^2] = \int</em>{-\infty}^{\infty} (x - \mu<em>X)^2 f</em>X(x) dx

    • Alternative and often easier formula: Var(X)=E[X2](E[X])2Var(X) = E[X^2] - (E[X])^2
      Where E[X2]=<em>x2f</em>X(x)dxE[X^2] = \int<em>{-\infty}^{\infty} x^2 f</em>X(x) dx.

Example: Finding Constant 'c', Probability, Expected Value, and Variance

Let the PDF be fX(x)=cx2f_X(x) = c \cdot x^2 for x[0,3]x \in [0, 3] and 00 otherwise.

1. Find the constant 'c'
  • Condition: The total probability over the range must be 1.
    03cx2dx=1\int_0^3 c x^2 dx = 1

  • Integration:
    c[x33]03=1c \left[ \frac{x^3}{3} \right]_0^3 = 1
    c(333033)=1c \left( \frac{3^3}{3} - \frac{0^3}{3} \right) = 1
    c(273)=1c \left( \frac{27}{3} \right) = 1
    c9=1c \cdot 9 = 1
    c=19c = \frac{1}{9}

  • Result: The PDF is fX(x)=19x2f_X(x) = \frac{1}{9} x^2 for x[0,3]x \in [0, 3] and 00 otherwise.

    • Visualization: This function represents the right half of a parabola between 0 and 3. The total area under this curve is 1.

2. Compute the probability P(1X2)P(1 \le X \le 2)
  • Formula: <em>12f</em>X(x)dx\int<em>1^2 f</em>X(x) dx

  • Calculation:
    P(1X2)=<em>1219x2dxP(1 \le X \le 2) = \int<em>1^2 \frac{1}{9} x^2 dx =19[x33]</em>12= \frac{1}{9} \left[ \frac{x^3}{3} \right]</em>1^2
    =19(233133)= \frac{1}{9} \left( \frac{2^3}{3} - \frac{1^3}{3} \right)
    =19(8313)= \frac{1}{9} \left( \frac{8}{3} - \frac{1}{3} \right)
    =19(73)=727= \frac{1}{9} \left( \frac{7}{3} \right) = \frac{7}{27}

3. Compute the Expected Value E[X]E[X]
  • Formula: E[X]=<em>03xf</em>X(x)dxE[X] = \int<em>0^3 x \cdot f</em>X(x) dx

  • Calculation:
    E[X]=<em>03x19x2dx=</em>0319x3dxE[X] = \int<em>0^3 x \cdot \frac{1}{9} x^2 dx = \int</em>0^3 \frac{1}{9} x^3 dx
    =19[x44]03= \frac{1}{9} \left[ \frac{x^4}{4} \right]_0^3
    =19(344044)= \frac{1}{9} \left( \frac{3^4}{4} - \frac{0^4}{4} \right)
    =19(814)=94= \frac{1}{9} \left( \frac{81}{4} \right) = \frac{9}{4}

4. Compute the Variance Var(X)Var(X)
  • First, calculate E[X2]E[X^2]:
    E[X2]=<em>03x2f</em>X(x)dx=<em>03x219x2dx=</em>0319x4dxE[X^2] = \int<em>0^3 x^2 \cdot f</em>X(x) dx = \int<em>0^3 x^2 \cdot \frac{1}{9} x^2 dx = \int</em>0^3 \frac{1}{9} x^4 dx
    =19[x55]03= \frac{1}{9} \left[ \frac{x^5}{5} \right]_0^3
    =19(355055)= \frac{1}{9} \left( \frac{3^5}{5} - \frac{0^5}{5} \right)
    =19(2435)=275= \frac{1}{9} \left( \frac{243}{5} \right) = \frac{27}{5}

  • Now, calculate Var(X)Var(X): Var(X)=E[X2](E[X])2Var(X) = E[X^2] - (E[X])^2 Var(X) = \frac{27}{5} - \left( \frac{9}{4} ight)^2 Var(X)=2758116Var(X) = \frac{27}{5} - \frac{81}{16} Var(X)=271681580=43240580=2780Var(X) = \frac{27 \cdot 16 - 81 \cdot 5}{80} = \frac{432 - 405}{80} = \frac{27}{80}

    • The variance indicates the spread of the data. A higher variance means greater spread.

Example: U-Substitution in Finding 'c'

Let fX(x)=cxcos(x2)f_X(x) = c x \cos(x^2) for x[0,π/2]x \in [0, \sqrt{\pi/2}] and 00 otherwise.

Finding the constant 'c'
  • Condition: 0π/2cxcos(x2)dx=1\int_0^{\sqrt{\pi/2}} c x \cos(x^2) dx = 1

  • U-Substitution: Let u=x2u = x^2. Then du=2xdxdu = 2x dx, so xdx=12dux dx = \frac{1}{2} du.

  • Change Limits of Integration:

    • If x=0x=0, then u=02=0u=0^2=0.

    • If x=π/2x=\sqrt{\pi/2}, then u=(π/2)2=π/2u=(\sqrt{\pi/2})^2=\pi/2.

  • Substitute and Integrate:
    <em>0π/2ccos(u)12du=1\int<em>0^{\pi/2} c \cos(u) \frac{1}{2} du = 1 c2</em>0π/2cos(u)du=1\frac{c}{2} \int</em>0^{\pi/2} \cos(u) du = 1
    c2[sin(u)]0π/2=1\frac{c}{2} \left[ \sin(u) \right]_0^{\pi/2} = 1
    c2(sin(π/2)sin(0))=1\frac{c}{2} (\sin(\pi/2) - \sin(0)) = 1
    c2(10)=1\frac{c}{2} (1 - 0) = 1
    c2=1\frac{c}{2} = 1
    c=2c = 2

  • Result: The PDF is fX(x)=2xcos(x2)f_X(x) = 2x \cos(x^2) for x[0,π/2]x \in [0, \sqrt{\pi/2}] and 00 otherwise.

    • Note on Positivity: It's important to ensure the function is non-negative over its range. For x[0,π/2]x \in [0, \sqrt{\pi/2}], xx is positive, and x2[0,π/2]x^2 \in [0, \pi/2]. In this range, cos(x2)\cos(x^2) is positive, so the entire PDF is positive.

Attempting Expected Value E[X]E[X] for the above PDF
  • Formula: E[X]=<em>0π/2x(2xcos(x2))dx=</em>0π/22x2cos(x2)dxE[X] = \int<em>0^{\sqrt{\pi/2}} x \cdot (2x \cos(x^2)) dx = \int</em>0^{\sqrt{\pi/2}} 2x^2 \cos(x^2) dx

  • This integral is complex and cannot be solved by simple u-substitution or elementary integration by parts directly as presented. It may require advanced techniques like power series expansion (Taylor series) and term-by-term integration for approximation, or might be a type of Fresnel integral. This demonstrates that not all integrals for expected values are straightforward to compute analytically.