# Chapter 3 ### Example Suppose there are 30 resistors, 7 of them do not work. You randomly choose 3 of them. Let $X$ be the number of defective resistors. Find the probability distribution of $X$. $$ X = [0,3]$$ $$P(X=0) = { {7 \choose 0} {23 \choose 3} \over {30 \choose 3} } = 0.436$$ $$P(X=1) = { {7 \choose 1} {23 \choose 2} \over {30 \choose 3} } = 0.436$$ $$P(X=2) = { {7 \choose 2} {23 \choose 1} \over {30 \choose 3} } = 0.119$$ $$P(X=3) = { {7 \choose 3} {23 \choose 0} \over {30 \choose 3} } = 0.009$$ Probability distribution: $$P(X = x) = \begin{cases} 0.436 & x=0 \\ 0.436 & x=1 \\ 0.119 & x=2 \\ 0.009 & x=3 \end{cases} $$ ## The Cumulative Distribution Function The cumulative distribution function (CDF), $F(x)$, of a discrete random variable, $x$, with probability distribution, $f(x)$, is: $$F(x) = P(X \le x)$$ Find CDF for the example above: $$F(0) = P(X \le 0) = P(X = 0) = 0.436$$ $$F(1) = P(X \le 1) = P((X = 0) \cup (X=1)) = 0.872$$ $$F(2) = P(X \le 2) = P((X=0) \cup (X=1) \cup (X=2)) = 0.991$$ Since 3 is the largest possible value for $x$: $$F(3) = P(X \le 3) = 1$$ As a piecewise function: $$F(x) = \begin{cases} 0 & x < 0 \\ 0.436 & 0 \le x < 1 \\ 0.872 & 1 \le x < 2 \\ 0.991 & 2 \le x < 3 \\ 1 & x \ge 3 \end{cases}$$ ### Exercise Suppose that a days production of 850 manufactured parts contains 50 parts that to not conform to customer requirements. 2 parts are selected at random from the batch. Let $X$ be the number of non-conforming parts. #### a) Find the probability distribution for $X$ $$P(X = 0) = { {50 \choose 0} {800 \choose 2} \over {850 \choose 2 }} = 0.8857$$ $$P(X = 1) = { {50 \choose 1} {800 \choose 1} \over {850 \choose 2 }} = 0.1109$$ $$P(X = 2) = { {50 \choose 2} {800 \choose 0} \over {850 \choose 2 }} = 0.0034$$ $$P(X = x) = \begin{cases} 0.8857 & x=0 \\ 0.1109 & x=1 \\ 0.0034 & x=2 \end{cases} $$ #### b) Find the CDF $F(x)$ $$F(x) = \begin{cases} 0 & x < 0 \\ 0.8857 & 0 \le x < 1 \\ 0.9966 & 1 \le x < 2 \\ 1 & x \ge 2 \end{cases}$$ #### c) Plot $F(x)$: ## Continuous Probability Distributions A continuous random variable is a variable that can take on any value within a range. It takes on infinitely many possible value within the range. ![](NormalDistribution.png) For a continuous distribution, $f(x)$: $$P(X = x) = 0$$ $$P(x_0 \le X \le x_1) = \int\limits_{x_0}^{x_1} f(x) dx$$ $$P(X \ge x_0) = \int\limits_{x_0}^{\infty} f(x) dx$$ ### Definition The function, $f(x)$, is a probability density function fo the continuous random variable, $X$, defined over $\Reals$ if: 1. $$f(x) \ge 0, \forall x \in \Reals$$ 2. $$\int\limits_{-\infty}^{\infty} f(x) dx = 1$$ 3. $$P(x_0 \le X \le x_1) = P(x_0 < X < x_1)$$ $$= P(x_0 \le X < x_1)$$ $$= P(x_0 < X \le x_1)$$ ### Example Suppose that the error in the reaction temperature in $^\circ \text{C}$ for a controlled lab experiment is a continuous random variable, $X$, having PDF: $$f(x) = \begin{cases} {x^2 \over 3} & -1 < x < 2 \\ 0 & elsewhere \end{cases}$$ #### a) Verify that $f(x)$ is a PDF. $$\int\limits_{-1}^{2} {x^2 \over 3} dx \stackrel{?}{=} 1$$ $${1 \over 3} \left[{1 \over 3} x^3 \Big\vert_{-1}^{2}\right] = {1\over9}[8- (-1)] = 1$$ #### b) Find $P(0 < X < 0.5)$: $$P(0 < X < 0.5) = \int\limits_0^{0.5} {x^2 \over 3}dx$$ $${1\over9}\left[x^3 \Big|_0^{0.5}\right] = {1\over9}[0.125] = 0.01389$$ ### Definition The CDF, $F(x)$ of a continuous random variabl, $X$, with probability density function $f(x)$ is: $$F(x) = P(X \le x) = \int\limits_{-\infty}^x f(t) dt$$ **Note:** 1. $$P(a < X < b) = F(b) - F(a)$$ 2. $$f(x) = {d\over dx}F(x)$$ ### Example Find the CDF of the previous example $$f(x) = \begin{cases} {x^2 \over 3} & -1 < x < 2 \\ 0 & elsewhere \end{cases}$$ $$F(x) = \int\limits_{-1}^x {t^2 \over 3} dt$$ $${1/over 9}\left[t^3\Big|_{-1}^x\right] = {1\over 9}\left[x^3 + 1\right]$$ $$F(x) = \begin{cases} 0 & t < -1 \\ {1\over 9} \left[x^3 + 1\right] & -1 \le x \le 2 \\ 1 & elsewhere \end{cases}$$ ### Example The proportion of the budget for a certain type of industrial copany that is allotted to environmential and pollution control is coming under scrutiny. A data collection project determines that the distribution of these proportions is given by: $$f(y) = \begin{cases} k(1-y)^4 & 0 \le y \le 1 \\ 0 & elsewhere \end{cases}$$ Find $k$ that renders $f(y) a valid density function: $$\int\limits_0^1 k(1-y)^4dy = 1$$ $${k\over5} = 1$$ $$\therefore k = 5$$