[1 point] A probability mass function must give a positive number for each element in the sample space and $\underline{\hspace{0.5in}}$?
[1 point] Which of these are invalid sample spaces and which are valid: $\{1,3,-2\}$, $\{A, B\}$, $\{\textrm{Ace of hearts}, \textrm{king of diamonds}\}$, all real numbers.
[1 point] What rule allows me to rewrite $P(x \,|\,y)P(y)$ as $P(x, y)$?
[2 points] If there is a 10% chance of rain for 3 days in a row, what's the probability of there being rain at least once within those days?
[2 points] Harry says that expected value is like an average, so you can compute two ways: $ E[X] = \sum_i^N \frac{x_i}{N} $ and the way we learned in class: $E[X] = \sum_i P(x) \cdot x$. Is Harry correct or is there an issue with his logic?
[1 point] How many elements will I have in my list if I create it using list(range(5,8))
?
[2 points] In the binomial distribution, we only consider number of successes. Let's try considering each permutation as unique. For example, if $N = 3$ and $n = 1$, you could have $100$, $010$, and $001$. If $N = 10$, how many unique permutations are possible for all numbers of successes? Review your HW 5, questions 1.2-1.5.
You are a baby being carried in a stork to your parents. Your parents live in either:
The probability of your birth location is proportional to the populations. As a baby, you are concerned with your career options, which are
Answer the following using $B$ as the random variable for birthplace and $J$ as the random variable for job. We have the following information:
$$P(J = r \,|\, B = c) = 0.05$$$$P(J = d \,|\, B = c) = 0.5$$$$P(J = r \,|\, B = u) = 0.8$$$$P(J = p\,|\, B = u) = 0.01$$$$P(J = p\,|\, B = g) = 0.75$$$$P(J = d \,|\, B = g) = 0.2$$Label your axes, add a title, and use LaTeX in your labels when necessary. Use dots connected by lines for discrete and lines for continuous.
[6 points] Plot three different parameter of the geometric distribution: $p = 0.2, p = 0.5, p = 0.8$. Add vertical lines at their means. Extra credit: accomplish the plot of the three lines using a for
loop.
[4 points] Plot the binomial distribution for $N = 25, p = 0.7$. Recall that the Poisson is an approximation to the Binomial. Plot the Poisson approximation to this Binomial distribution on the same plot.
[2 points] Make a second plot with the binomial and Poisson, but use $N = 25, p = 0.10$. How good is the approximation?
[6 points] The command plt.fill_between
can be used to plot an area under a curve. For example, fill_between(x, 0, y)
will fill the area between 0 and y
, where y
could be a numpy
array. Using fill_between
, show the cumulative probability function for the exponential distribution from $t = 0$ to $t = 5$ with $\lambda = 0.25$. Ensure that there are two lines on your plot: one that is the exponential pdf and one that is the fill_between
. The pdf should extend further than your fill_between
line. Add a vertical line at $t=5$. No legend necessary.
[1 point] "The 95% prediction interval for a geometric probability distribution" can be described with what mathematical equation? Answer as a $\LaTeX$ equation.
[6 points] Using a for
loop, compute a lower (starting at 0) 90% prediction interval for the binomial distribution with $N = 12, p = 0.3$.
[6 points] Using a for
loop, compute an upper (ending at N) 95% prediction interval for the binomial distribution with $N = 20, p = 0.6$.
[6 points] Using a for
loop, compute a 80% prediction interval for the geomemtric distribution for $p = 0.02$. Just pick a large number for the upper-bound of the for
loop.
[12 Extra Credit Points]. Repeat 4.3 using a while
loop.
Use scipy.stats here as needed. Except for 5.1 and 5.3, answer in Python.
scipy.stats
to answer this one.[2 points] Given that $\mu = 2$, $\sigma = 1.2$, what is the probability of observing a sample between -2 and 0? Answer using a $Z$-score.
[2 points] Given that $\mu = 2$, $\sigma = 1.2$, what is the probability of observing a sample between -2 and 0? Answer without using a $Z$-score.
Answer in 1-2 sentences. No correct answer, just give an honest, meaningful answer to receive credit.
Why is probability important to know as a chemical engineer?
Do you feel confident in understanding probability expressions, like conditionals and marginals?
Can you imagine yourself using Python in your fluid mechanics or other courses?
What topic are you most confident in?
Do you have any feedback for the course?