class: middle, title-slide # Probability Distributions and the Central Limit Theorem ## Discrete Probability Distributions ### Dennis A. V. Dittrich ### 2021 --- layout: true <div class="my-footer"> <span><img src="img/tcb-logo.png" height="40px"></span> </div> --- ## Random Variables .row[.col-7[ A **random variable** is a function or rule that assigns a number to each outcome of an experiment / a probability distribution. A **probability distribution** is a table, formula, or graph that describes the values of a random variable and the probability associated with these values. `$$P(X = x) \text{ or } P(x)$$` A random variable is (often) denoted by `\(x\)` .tip[Examples * `\(x\)` = Number of sales calls a salesperson makes in one day. * `\(x\)` = Hours spent on sales calls in one day. ] ]] --- ## Random Variables .row[.col-7[ **Discrete Random Variable** Has a finite or countable number of possible outcomes that can be listed. .tip[Example: `\(x\)` = Number of sales calls a salesperson makes in one day.] **Continuous Random Variable** Has an uncountable number of possible outcomes, represented by an interval on the number line. .tip[Example: `\(x\)` = Hours spent on sales calls in one day.] ]] ??? .your-turn[ ## Your turn! .row[.col-7[ Determine whether each random variable x is discrete or continuous. Explain your reasoning. Let `\(x\)` represent the number of Fortune 500 companies that lost money in the previous year. ]]] ?? .row[.col-7[ Solution: Discrete random variable: The number of companies that lost money in the previous year can be counted. ]] ??? .your-turn[ ## Your turn! .row[.col-7[ Determine whether each random variable x is discrete or continuous. Explain your reasoning. Let `\(x\)` represent the volume of gasoline in a 21-gallon tank. ]]] ?? .row[.col-7[ Solution: Continuous random variable: The amount of gasoline in the tank can be any volume between 0 gallons and 21 gallons, including fractions of a gallon. ]] --- ## Discrete Probability Distributions .row[.col-7[ List each possible value the random variable can assume, together with its probability. Must satisfy the following conditions: 1. The probability of each value of the discrete random variable is between 0 and 1, inclusive. `$$0 \leq P(x) \leq 1$$` 2. The sum of all the probabilities is 1. `$$\sum P(x) = 1$$` ]] --- ## Constructing a Discrete Probability Distribution .row[.col-7[ Let `\(x\)` be a discrete random variable with possible outcomes `\(x_1, x_2, \ldots, x_n\)`. 1. Make a frequency distribution for the possible outcomes. 2. Find the sum of the frequencies. 3. Find the probability of each possible outcome by dividing its frequency by the sum of the frequencies. 4. Check that each probability is between 0 and 1, inclusive, and that the sum of all the probabilities is 1. ]] --- .tip[## Example 1 .row[.col-7[ An industrial psychologist administered a personality inventory test for passive-aggressive traits to 150 employees. Each individual was given a whole number score from 1 to 5, where 1 is extremely passive and 5 is extremely aggressive. A score of 3 indicated neither trait. The results are shown. Construct a probability distribution for the random variable x. Then graph the distribution using a histogram. ] .col-5[ <table> <thead> <tr> <th style="text-align:left;"> Score </th> <th style="text-align:right;"> 1 </th> <th style="text-align:right;"> 2 </th> <th style="text-align:right;"> 3 </th> <th style="text-align:right;"> 4 </th> <th style="text-align:right;"> 5 </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Count </td> <td style="text-align:right;"> 24 </td> <td style="text-align:right;"> 33 </td> <td style="text-align:right;"> 42 </td> <td style="text-align:right;"> 30 </td> <td style="text-align:right;"> 21 </td> </tr> </tbody> </table> ]]] --- .tip[ .row[.col-7[ Divide the frequency of each score by the total number of individuals in the study to find the probability for each value of the random variable. ]] .row[.col-8[ ```r # compute relative frequencies, i.e. probabilities d.xf %>% group_by(score) %>% count() %>% ungroup() %>% mutate(p = n/sum(n)) %>% # select only the score and the probability, # "rotate" the table select(score,p) %>% pivot_wider(names_from = score, values_from = p) %>% add_column( "Score" = "Probability", .before=T) %>% kbl() ``` <table> <thead> <tr> <th style="text-align:left;"> Score </th> <th style="text-align:right;"> 1 </th> <th style="text-align:right;"> 2 </th> <th style="text-align:right;"> 3 </th> <th style="text-align:right;"> 4 </th> <th style="text-align:right;"> 5 </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Probability </td> <td style="text-align:right;"> 0.16 </td> <td style="text-align:right;"> 0.22 </td> <td style="text-align:right;"> 0.28 </td> <td style="text-align:right;"> 0.2 </td> <td style="text-align:right;"> 0.14 </td> </tr> </tbody> </table> ]] .row[.col-7[ This is a valid discrete probability distribution since 1. Each probability is between 0 and 1, inclusive, `\(0 \leq P(x) \leq 1\)`. 2. The sum of the probabilities equals 1, `\(\sum P(x) = 0.16 + 0.22 + 0.28 + 0.20 + 0.14 = 1.\)` ]]] --- .row[.col-7[ ```r d.xf %>% ggplot() + geom_histogram(aes(x=score,y=..density..), bins=5) + theme_minimal() ``` <img src="06.pdf_files/figure-html/hist1-1.png" width="100%" style="display: block; margin: auto;" /> ] .col-5[ Because the width of each bar is one, the area of each bar is equal to the probability of a particular outcome. Also, the probability of an event corresponds to the sum of the areas of the outcomes included in the event. You can see that the distribution is approximately symmetric. ]] --- ## Verifying a Probability Distribution .row[.col-7[ Verify that the distribution for the three-day forecast and the number of days of rain is a probability distribution. Days of rain `\(x\)` | 0 | 1 | 2 | 3 ------------------|-------------- Probability `\(P(x)\)` | 0.216 | 0.432 | 0.288 | 0.064 ]] -- <br/> .row[.col-7[ Solution: If the distribution is a probability distribution, then (1) each probability is between 0 and 1, inclusive, and (2) the sum of all the probabilities equals 1. 1. Each probability is between 0 and 1. 2. `\(\sum P(x) = 0.216 + 0.432 + 0.288 + 0.064 = 1\)` Because both conditions are met, the distribution is a probability distribution. ]] --- ## Mean of a discrete probability distribution .row[.col-7[ Each value of x is multiplied by its corresponding probability and the products are added. `$$\mu = \sum xP(x)$$` ]] .tip[ .row[.col-6[ Example: The probability distribution for the personality inventory test for passive-aggressive traits is given. Find the mean score. `\(x\)` | 1.00 | 2.00 | 3.00 | 4.0 | 5.00 ----|---- `\(P(x)\)` | 0.16 | 0.22 | 0.28 | 0.2 | 0.14 ] .col-6[ ```r d.xf %>% summarise(mean=mean(score)) ``` ``` ## # A tibble: 1 x 1 ## mean ## <dbl> ## 1 2.94 ``` `$$\mu = \sum xP(x) = 2.94$$` ]]] --- ## Variance and Standard Deviation .row[.col-6[ Variance of a discrete probability distribution `$$\sigma^2 = \sum (x-\mu)^2 P(x)$$` Standard deviation of a discrete probability distribution `$$\sigma = \sqrt{\sigma^2} = \sqrt{\sum (x-\mu)^2 P(x)}$$` ] .col-6[ .tip[ Finding the Variance and Standard Deviation `\(x\)` | 1.00 | 2.00 | 3.00 | 4.0 | 5.00 ----|---- `\(P(x)\)` | 0.16 | 0.22 | 0.28 | 0.2 | 0.14 ```r d.xf %>% summarise(V=var(score), SD=sd(score)) ``` ``` ## # A tibble: 1 x 2 ## V SD ## <dbl> <dbl> ## 1 1.63 1.28 ``` ]]] --- ## Expected value of a discrete random variable .row[.col-7[ Equal to the mean of the random variable. $$E(x) = \mu = \sum xP(x) $$ Laws of Expected Value 1. `\(E(c) = c\)` 2. `\(E(X + c) = E(X) + c\)` 3. `\(E(cX) = cE(X)\)` Laws of Variance 1. `\(V(c) = 0\)` 2. `\(V(X + c) = V(X)\)` 3. `\(V(cX) = c^2 V(X)\)` ]] --- ## Bivariate Distributions .row[.col-7[ A Bivariate distribution provides probabilities of combinations of two variables. Requirements: 1. `\(0 \leq P(x, y) \leq 1\)` for all pairs of values `\((x, y)\)` 2. `\(\sum_x\sum_y P(x, y) = 1\)` ]] <br/> .row[.col-5[ | `\(B_1\)` | `\(B_2\)` | `\(P(A_i)\)` ---|--- `\(A_1\)` | 0.11 | 0.29 | 0.40 `\(A_2\)` | 0.06 | 0.54 | 0.60 `\(P(B_i)\)` | 0.17 | 0.83 | 1.00 ] .col-7[ The marginal probabilities are obtained by summing across rows or down columns. Notice that both marginal probability distributions meet the requirements; the probabilities are between 0 and 1, and they add to 1. ]] --- ## Describing a Bivariate Distribution .row[.col-7[ We describe the bivariate distribution by computing the mean, variance, and standard deviation of each variable by utilizing the marginal probabilities. **Covariance** The covariance of two discrete variables is defined as $$ COV(X, Y) = \sigma_{xy} = \sum_x\sum_y (x − \mu_x )(y − \mu_y )P(x, y)$$ **Coefficient of Correlation** $$ \rho = \frac{\sigma_{xy}}{\sigma_x\sigma_y}$$ `$$-1 \leq \rho \leq 1$$` ]] --- ## Laws of Expected Value and Variance of the Sum of Two Variables .row[.col-7[ 1. `\(E(X + Y ) = E(X ) + E(Y )\)` 2. `\(V(X + Y ) = V(X ) + V(Y ) + 2COV(X, Y )\)` If `\(X\)` and `\(Y\)` are independent, `\(COV(X, Y ) = 0\)` and thus `\(V(X + Y ) = V(X ) + V(Y )\)`. ]] --- ## Binomial Experiments .row[.col-7[ 1. The experiment is repeated for a fixed number of trials, where each trial is independent of other trials. 2. There are only two possible outcomes of interest for each trial, ie. each trial is a Bernoulli process. The outcomes can be classified as a success (S) or as a failure (F). 3. The probability of a success, P(S), is the same for each trial, ie. the trials are independent. 4. The random variable x counts the number of successful trials. ]] --- ## Notation for Binomial Experiments .row[.col-7[ ** `\(n\)` ** The number of times a trial is repeated ** `\(p\)` ** The probability of success in a single trial ** `\(q\)` ** The probability of failure in a single trial: `\(q = 1 – p\)` ** `\(x\)`** The random variable represents a count of the number of successes in `\(n\)` trials: `$$x = 0, 1, 2, 3, \ldots, n.$$` ]] --- ## Identifying and Understanding Binomial Experiments .row[.col-7[ Decide whether each experiment is a binomial experiment. If it is, specify the values of `\(n\)`, `\(p\)`, and `\(q\)`, and list the possible values of the random variable `\(x\)`. If it is not, explain why. A certain surgical procedure has an 85% chance of success. A doctor performs the procedure on eight patients. The random variable represents the number of successful surgeries. ]] --- ## Identifying and Understanding Binomial Experiments .row[.col-7[ A certain surgical procedure has an 85% chance of success. A doctor performs the procedure on eight patients. The random variable represents the number of successful surgeries. 1. Each surgery represents a trial. There are eight surgeries, and each one is independent of the others. 2. There are only two possible outcomes of interest for each surgery: a success (S) or a failure (F). 3. The probability of a success, P(S), is 0.85 for each surgery. 4. The random variable x counts the number of successful surgeries. ]] --- ## Binomial Experiment .row[.col-7[ A certain surgical procedure has an 85% chance of success. A doctor performs the procedure on eight patients. The random variable represents the number of successful surgeries. * `\(n = 8\)` (number of trials) * `\(p = 0.85\)` (probability of success) * `\(q = 1 – p = 1 – 0.85 = 0.15\)` (probability of failure) * `\(x = 0, 1, 2, 3, 4, 5, 6, 7, 8\)` (number of successful surgeries) ]] --- ## Identifying and Understanding Binomial Experiments .row[.col-7[ Decide whether each experiment is a binomial experiment. If it is, specify the values of `\(n\)`, `\(p\)`, and `\(q\)`, and list the possible values of the random variable `\(x.\)` If it is not, explain why. A jar contains five red marbles, nine blue marbles, and six green marbles. You randomly select three marbles from the jar, without replacement. The random variable represents the number of red marbles. ]] --- ## Identifying and Understanding Binomial Experiments .row[.col-7[ A jar contains five red marbles, nine blue marbles, and six green marbles. You randomly select three marbles from the jar, without replacement. The random variable represents the number of red marbles. Not a Binomial Experiment * The probability of selecting a red marble on the first trial is 5/20. * Because the marble is not replaced, the probability of success (red) for subsequent trials is no longer 5/20. * The trials are not independent and the probability of a success is not the same for each trial. ]] --- ## Binomial Probability Formula .row[.col-7[ The probability of exactly x successes in n trials is `$$P(x)= \binom{n}{x}p^xq^{n-x}= \frac{n!}{x!(n-x)!}p^xq^{n-x}$$` ** `\(n\)` ** number of trials ** `\(p\)` ** probability of success ** `\(q =1 – p\)` ** probability of failure ** `\(x\)` ** number of successes in `\(n\)` trials * Note: number of failures is `\(n − x\)` ** `\((^n_x)\)` ** binomial coefficient ]] --- ## Binomial coefficient .row[.col-7[ Number of ways to choose an (unordered) subset of x elements from a fixed set of n elements How many unsorted combinations are there for picking 2 out of 3 numbers? ```r choose(3,2) ``` ``` ## [1] 3 ``` `$$\binom{3}{2} = \frac{3!}{2!(3-2)!} = \frac{1\times 2\times 3}{1\times\ 2\times(1)}=3$$` ]] --- ## Finding a Binomial Probability .row[.col-7[ Rotator cuff surgery has a 90% chance of success. The surgery is performed on three patients. Find the probability of the surgery being successful on exactly two patients. Solution: Draw a tree diagram and use the Multiplication Rule. ]] .col-8[ ![](img/tree.png) ] --- ## Finding a Binomial Probability .row[.col-7[ Rotator cuff surgery has a 90% chance of success. The surgery is performed on three patients. Find the probability of the surgery being successful on exactly two patients. ]] .row[.col-7[ Solution: Use the binomial probability formula. `$$n=3, p=\frac{9}{10}, q=\frac{1}{10}, x=2$$` `\begin{align*} P(2) &= \frac{3!}{2!(3-2)!}\left(\frac{9}{10}\right)^2\left(\frac{1}{10}\right)^1\\ &= 3 \frac{81}{100}\frac{1}{10}\\ &= 3 \frac{81}{1000} = 0.243 \end{align*}` ] .col-5[ ```r dbinom(2,3,0.9) ``` ``` ## [1] 0.243 ``` ]] --- ## Binomial Probability Distribution .row[.col-7[ ```r dbinom(x,n,p) ``` The binomial probability density function gives the probability to get exactly `\(x\)` successes with `\(n\)` trials, each having a success probability of `\(p\)`. * List the possible values of x with the corresponding probability of each. .tip[Example: Binomial probability distribution for Microfacture knee surgery: `\(n = 3\)`, `\(p = 3/4\)` ```r dbinom(0:3,3,3/4) ``` ``` ## [1] 0.015625 0.140625 0.421875 0.421875 ``` ]]] --- ### Constructing a Binomial Distribution .row[.col-6[ In a survey, U.S. adults were asked to identify which social media platforms they use. The results are shown in the figure. Six adults who participated in the survey are randomly selected and asked whether they use the social media platform Facebook. Construct a binomial probability distribution for the number of adults who respond yes. ] .col-6[ ![](img/smedia.png) ]] --- .row[.col-7[ **Probability density function** `\(x\)` | 0 | 1 | 2 | 3 | 4 | 5 | 6 ---|--- `\(P(x)\)` | 0.001 | 0.014 | 0.073 | 0.206 | 0.328 | 0.279 | 0.099 <br/> Notice in the table that all the probabilities are between 0 and 1 and that the sum of the probabilities is 1. ] ] .row[.col-7[ **The cumulative probability density function** `\(x\)` | 0 | 1 | 2 | 3 | 4 | 5 | 6 ---|--- `\(P(X \leq x)\)` | 0.001 | 0.015 | 0.087 | 0.294 | 0.622 | 0.901 | 1.000 ```r pbinom(x,n,p) ``` The cumulative binomial probability distribution function gives the probability to get at most `\(x\)` successes with `\(n\)` trials, each having a success probability of `\(p\)`. ] ] --- ## Finding a Binomial Probability .row[.col-7[ A survey found that 26% of U.S. adults believe there is no difference between secured and unsecured wireless networks. (A secured network uses barriers, such as firewalls and passwords, to protect information; an unsecured network does not.) You randomly select 100 adults. What is the probability that exactly 35 adults believe there is no difference between secured and unsecured networks? ]] --- ## Finding a Binomial Probability .row[.col-7[ ```r dbinom(35,100,0.26) %>% round(digits=3) ``` ``` ## [1] 0.012 ``` The probability that exactly 35 adults believe there is no difference between secured and unsecured networks is about 0.012. Because 0.012 is less than 0.05, this can be considered an unusual event. ]] --- ## Finding Binomial Probabilities .row[.col-7[ A survey found that 17% of U.S. adults say that Google News is a major source of news for them. You randomly select four adults and ask them whether Google News is a major source of news for them. Find the probability that 1. exactly two of them respond yes, 2. at least two of them respond yes, and 3. fewer than two of them respond yes. ]] --- ## Finding Binomial Probabilities .row[.col-7[ `$$p=0.17, n=4$$` 1. exactly two of them respond yes, ```r dbinom(2,4,0.17) %>% round(digits=3) ``` ``` ## [1] 0.119 ``` 2. at least two of them respond yes, and ```r dbinom(2:4,4,0.17) %>% sum() %>% round(digits=3) ``` ``` ## [1] 0.137 ``` ```r 1-pbinom(1,4,0.17) %>% round(digits=3) ``` ``` ## [1] 0.137 ``` 3. fewer than two of them respond yes. ```r dbinom(0:1,4,0.17) %>% sum() %>% round(digits=3) ``` ``` ## [1] 0.863 ``` ```r pbinom(1,4,0.17) %>% round(digits=3) ``` ``` ## [1] 0.863 ``` ]] --- ## Graphing a Binomial Distribution .row[.col-7[ Sixty-two percent of cancer survivors are ages 65 years or older. You randomly select six cancer survivors and ask them whether they are 65 years of age or older. Construct a probability distribution for the random variable x. Then graph the distribution. Solution: * `\(n = 6\)`, `\(p = 0.62\)`, `\(q = 0.38\)` * Find the probability for each value of `\(x\)` ]] --- .row[.col-7[ From the histogram, you can see that it would be unusual for none or only one of the survivors to be age 65 years or older because both probabilities are less than 0.05. ]] .panelset[ .panel[.panel-name[Plot] <img src="06.pdf_files/figure-html/unnamed-chunk-15-1.png" width="60%" style="display: block; margin: auto;" /> ] .panel[.panel-name[Code] ```r tibble(x=0:6, p=dbinom(0:6,6,0.62)) %>% ggplot() + geom_col(aes(x=x,y=p),width=1) + labs(title = "Cancer Survivers 65 Years of Age or Older", subtitle = "Histogram", x = "Survivors", y = "Probability") + theme_economist() ``` ] ] --- ## Mean, Variance, and Standard Deviation .row[.col-7[ **Mean**: `$$\mu= np$$` **Variance**: `$$\sigma^2 = npq$$` **Standard Deviation**: `$$\sigma = \sqrt{npq}$$` ]] --- ## Mean, Variance, and Standard Deviation .row[.col-7[ In Pittsburgh, Pennsylvania, about 56% of the days in a year are cloudy. Find the mean, variance, and standard deviation for the number of cloudy days during the month of June. Interpret the results and determine any unusual values. ] .col-5[ `$$n = 30, p = 0.56, q = 0.44$$` ]] Mean: `$$\mu = np = 30 \times 0.56 = 16.8$$` Variance: `$$\sigma^2 = npq = 30\times 0.56\times 0.44 \approx 7.4$$` Standard Deviation: `$$\sigma = \sqrt{npq} = \sqrt{30\times 0.56\times 0.44} \approx 2.7$$` --- .row[.col-7[ `$$\mu = 16.8, \sigma^2 \approx 7.4, \sigma \approx 2.7$$` * On average, there are 16.8 cloudy days during the month of June. * The standard deviation is about 2.7 days. * Values that are more than two standard deviations from the mean are considered unusual. * `\(16.8 - 2(2.7) =11.4\)`; A June with 11 cloudy days or less would be unusual. * `\(16.8 + 2(2.7) = 22.2\)`; A June with 23 cloudy days or more would also be unusual. ]] --- ## Geometric Distribution .pink[is a discrete probability distribution.] .row[.col-6[ It satisfies the following conditions 1. A trial is repeated until a success occurs. 2. The repeated trials are independent of each other. 3. The probability of success p is constant for each trial. 4. The random variable x represents the number of the trial in which the first success occurs. ] .col-6[ **The geometric density function** The probability that the first success will occur on trial `\(x\)` is `\(P(x) = pq^{x - 1}\)` , where `\(q = 1 - p\)`. ```r dgeom(x,p) ``` The geometric density function in `R` gives the probability to get `\(x\)` failures in a sequence of Bernoulli trials before a success occurs, with each trial having a success probability of `\(p\)`. ]] --- ## Using the Geometric Distribution .row[.col-7[ A study found that the smartphones made by a certain manufacturer had a failure rate of 43%. Four smartphones made by this manufacturer are selected at random. Find the probability that the fourth smartphone is the first one to have a failure. `\(p=0.43, q=0.57, x=4\)` `\begin{align*} P(4) &= 0.43\times 0.57^{4-1}\\ &=0.43\times 0.57^{3}\\ &\approx 0.08 \end{align*}` The probability that the fourth smartphone is the first one to have a failure is about 0.08. ]] --- ## The Poisson Distribution .pink[is discrete probability distribution] .row[.col-7[ It satisfies the following conditions 1. The experiment consists of counting the number of times an event, `\(x\)`, occurs in a given interval. The interval can be an interval of time, area, or volume. 2. The probability of the event occurring is the same for each interval. 3. The number of occurrences in one interval is independent of the number of occurrences in other intervals. 4. The probability of a success in an interval is proportional to the size of the interval. 5. The probability of more than one success in an interval approaches 0 as the interval becomes smaller. ]] --- ## The Poisson Distribution .row[.col-7[ The Poisson random variable is the number of successes that occur in a period of time or an interval of space in a Poisson experiment. ]] .row[.col-7[ **The Poisson density function** The probability of exactly `\(x\)` occurrences in an interval is `$$P(x) = \frac{\mu^xe^{-\mu}}{x!}$$` with `\(\mu\)` being the mean number of occurrences. ] .col-5[ ```r dpois(x,m) ``` The Poisson density function gives the probability to get exactly `\(x\)` successes in a sequence of Bernoulli trials, with an average number `\(m\)` of successes in a given interval. ]] --- ## Using the Poisson Distribution .row[.col-7[ The mean number of accidents per month at a certain intersection is 3. What is the probability that in any given month four accidents will occur at this intersection? Solution: Poisson with `\(x = 4, \mu = 3\)` `$$P(4) = \frac{3^4e^{-3}}{4!} \approx 0.168$$` ]] --- ## Finding a Poisson Probability .row[.col-7[ A population count shows that the average number of rabbits per acre living in a field is 3.6. Find the probability that seven rabbits are found on any given acre of the field. ```r dpois(7,3.6) %>% round(digits=3) ``` ``` ## [1] 0.042 ``` ]] --- ## Finding a Poisson Probability .row[.col-7[ A statistics instructor has observed that the number of typographical errors in new editions of textbooks varies considerably from book to book. After some analysis, he concludes that the number of errors is Poisson distributed with a mean of 1.5 per 100 pages. Suppose that the instructor has just received a copy of a new statistics book. He notices that there are 400 pages. 1. What is the probability that there are no typos? 2. What is the probability that there are five or fewer typos? ]] --- ## Finding a Poisson Probability .row[.col-7[ Suppose that the instructor has just received a copy of a new statistics book. He notices that there are 400 pages. `\(\Rightarrow \mu=1.5\times 4=6\)` 1. What is the probability that there are no typos? `\(P(0) = \frac{6^0e^{-6}}{0!} \approx 0.0025\)` ```r dpois(0,6) %>% round(digits=4) ``` ``` ## [1] 0.0025 ``` 2. What is the probability that there are five or fewer typos? `\(P(X \leq 5) = P(0) + P(1) + P(2) + P(3) + P(4) + P(5)\)` ```r ppois(5,6) %>% round(digits=4) ``` ``` ## [1] 0.4457 ``` ]]