---
title: "Math 151 - Probability Theory - Homework 11"
author: "your name here"
date: "Due: Monday, November 9, 2020, midnight PDT"
output: pdf_document
---
## Important Note:
You should work to turn in assignments that are clear, communicative, and concise. Part of what you need to do is not print pages and pages of output. Additionally, you should remove these exact sentences and the information about HW scoring below.
Click on the *Knit to PDF* icon at the top of R Studio to run the R code and create a PDF document simultaneously. [PDF will only work if either (1) you are using R on the network, or (2) you have LaTeX installed on your computer. Lightweight LaTeX installation here: https://yihui.name/tinytex/]
> Either use the college's RStudio server (https://rstudio.pomona.edu/)
or install R and R Studio on to your personal computer.
See: https://research.pomona.edu/johardin/math151f20/ for resources.
```{r warning=FALSE, comment=FALSE, message=FALSE, echo = FALSE}
knitr::opts_chunk$set(message=FALSE, warning=FALSE, fig.height=3, fig.width=5,
fig.align = "center")
```
### Assignment
#### 1: PodQ
Describe one thing you learned from someone in your pod this week (it could be: content, logistical help, background material, R information, etc.) 1-3 sentences.
#### 2: 6.2.2
Suppose that $X$ is a random variable for which $P(X \geq 0) = 1$ and $Pr(X \geq 10) = 1/5.$ Prove that $E(X) \geq 2.$
#### 3: 6.2.3
Suppose that $X$ is a random variable for which $E(X) = 10$, $P(X \leq 7) = 0.2$, and $P(X \geq 13) = 0.3$. Prove that $Var(X) \geq 9/2.$
#### 4: 6.2.5
How large a random sample must be taken from a given distribution in order for the probability to be at least 0.99 that the sample mean will be within 2 standard deviations of the mean of the distribution?
#### 5: 5.2.1
Suppose that X is a random variable such that $E(X^k)= 1/3, k=1,2,\ldots$. Assuming that there cannot be more than one distribution with this same sequence of moments, determine the distribution of X.
#### 6: 5.4.7
Suppose that on the average, a certain store serves 15 customers per hour. What is the probability that the store will serve more than 20 customers in a particular two-hour period?
Hint: can you justify anything about how the customers arrive at the store?
Feel free to use `ppois()` (the cdf) or `dpois()` (the pf) in R.
#### 7: 5.4.14
An airline sells 200 tickets for a certain flight on an airplane that has only 198 seats because, on average, 1 percent of purchasers of airline tickets do not appear for the departure of their flight. Determine the probability that everyone who appears for the departure of this flight will have a seat. (Find both the Binomial and the Poisson probabilities.)
#### 8: 5.4.15
Suppose that internet users access a particular website according to a Poisson process with rate $\lambda$ per hour, but $\lambda$ is unknown. The website manager believes that $\lambda$ has a continuous distribution with pdf
$$ f(\lambda) = 2e^{-2\lambda} \lambda > 0$$
Let X be the number of users who access the website during a one hour period. If X=1 is observed, find the conditional pdf of $\lambda$ given X=1.
#### 9: R -- comparing Poisson and Binomial
Using the functions `dbinom()` and `dpois()` (the pf functions), come up with two different pairs of values for $(n,p)$, the first where the Poisson distribution accurately approximates the binomial distribution and the second where the Poisson does not accurately approximate the binomial distribution.
For *each* setting, provide:
a. the values of $(n,p)$
b. A table of the relevant probabilities (hint: you might not need to report *every* probability)
c. a plot showing both the Poisson and the binomial probabilities. (hint: you might not need to plot *every* probability)
For example, if one wanted to show that the hypergeometric distribution and binomial distributions gave very different probabilities (they don't always, sometimes they give very similar probabilities), one might do the following.
Do you understand the code below? If not, which line doesn't make sense? Ask me if you don't understand!!
```{r}
n=5
p=.4
hyperprobs = dhyper(0:n, 4, 5, n)
binomprobs = dbinom(0:n, n, p)
#rbind BINDS rows together
options(digits=3)
rbind(n=c(0:n), hyperprobs, binomprobs)
plot(0:n,hyperprobs, type="l", col="red", ylab="probability")
lines(0:n,binomprobs, col="blue")
legend("topright", legend=c("hyper", "binom"), col=c("red", "blue"), lty=1, bty="n")
```