What's the probability that the teacher teaches her class?

Hi, thanks for reading! I really need help with this question. I'll post all my progress below - I tried really hard being as thorough as possible, but if I don't meet the guidelines for how a homework question should be asked, please tell me and I'll edit my question!

Progress so far:

Here is what I'm thinking.

Let $$P(A)$$ be the probability that the professor teaches the class.

Let $$P(B)$$ be the probability that the weather is bad

Let $$P(S)$$ be the probability that an individual student shows up, for any student.

Let $$P(G)=P(B^C)=(1-P(B))$$ be the probability that the weather is good. The weather being good is the complement of the weather being bad.

Let $$p_b$$ be the probability that the student shows up given that the weather is bad.

Let $$p_g$$ be the probability that the student shows up given that the weather is bad.

The probability that the weather was bad and a student shows up would be $$(p_{b})P(B)$$

The probability that the weather was bad and a student shows up would be $$(p_g)(1-p(B))$$

Let $$n$$ be the number of students in the class.

Let $$k$$ be the minimum number of students for the teacher to teach.

For a student, the probability that they show up on any given day is equal to the probability that they show up and the weather was bad or they show up and weather was good.

Since the weather being good and the weather being bad are disjoint events, that means the probability that a student shows up on any given day is the sum of the two probabilities.

$$P(S)=P(S \cap B)+P(S \cap B^C) = p_{b}P(B) + p_{g}(1-P(B))$$

Let's say we want to calculate the total probability that $$j$$ students show up.

Then, we would need to calculate the number of ways that $$j$$ students CAN show up, which would be $$n\choose{j}$$, and multiply it by the probability of one of the specific outcomes where $$j$$ out of the $$n$$ students showed up, which would be: $$(p_{b}P(B) + p_{g}(1-P(B)))^j *(1-p_{b}P(B) - p_{g}(1-P(B)))^{n-j}$$

So, the total probability that $$j$$ of the $$n$$ students show up is:

$${n \choose j} (p_{b}P(B) + p_{g}(1-P(B)))^j *(1-p_{b}P(B) - p_{g}(1-P(B)))^{n-j}$$

Okay. Almost done. The professor will teach if at least $$k$$ of the $$n$$ students show up. That means she'll teach if $$k$$ of them show up, or $$k+1$$ of them show up...etc...up to if all $$n$$ of them show up.

Each of the events: $$1$$ student shows up, $$2$$ students show up, $$3$$ students show up...etc...are disjoint. So, the total probability one or the other or the other or the other or....etc....of them happening is the sum of their individual probabilities.

Therefore, the probability of the teacher teaching would be given by the probability that $$k$$ students show up + the probability that $$k+1$$ students show up plus the probability that $$k+2$$ students show up plus.....plus the probability that all $$n$$ students show up.

$$P(A) = \sum_{j=k}^{n} {n \choose j} (p_{b}P(B) + p_{g}(1-P(B)))^j *(1-p_{b}P(B) - p_{g}(1-P(B)))^{n-j}$$

WHEW. That was a lot of writing! If you've followed me so far, thank you so much.

Now, the correct answer makes sense to me. However, so does mine...I can't see where I went wrong.

I thought perhaps we were both saying the same thing, but writing it differently. But then I tested it out in Wolfram Alpha, and alas, the two equations give different answers.

$$n=10, \: k=3, \: p_b=0.4, \: p_g = 0.7, \: P(B)=0.8, \: (1-P(B))=0.2$$

You say that the probability that a given student shows up and the weather is bad is $$\Pr(B)p_b$$. This is correct. However, you go on to say, that the probability that $$j$$ given students show up and the weather is bad is $$(\Pr(B)p_b)^j$$. This is incorrect when $$j>1.$$ The correct value is $$\Pr(B)p_b^j$$. After all, the weather is only bad on one day, not on $$j$$ days. We have $$j+1$$ events: the weather is bad, and $$j$$ students show up.

I would break it up a little differently. Let's use the law of total probability:

$$P\left(\text{teaches}\right) = P\left(\text{teaches}~|~\text{good weather}\right)P\left(\text{good weather}\right) + P\left(\text{teaches}~|~\text{bad weather}\right)P\left(\text{bad weather}\right)$$

$$P\left(\text{teaches}\right) = P\left(\text{teaches}~|~\text{good weather}\right)\left(1 - P\left(B\right)\right) + P\left(\text{teaches}~|~\text{bad weather}\right)P\left(B\right)$$

Now we only need to calculate two things:

$$P\left(\text{teaches}~|~\text{good weather}\right)$$ is, conceptually the "probability k or more students show up in good weather", which is given by the binomial formula:

$$\displaystyle\sum_{i=k}^{n}{n \choose i}p_g^i(1-p_g)^{n-i}$$

And the same for "bad weather", but with $$p_b$$.

• Yep, thanks! +1! That's the way the author broke it up in the book. I was just confused as to what I was doing wrong - I was multiplying by the probability of it being a bad day more than once, while it was only a bad day once. – Joshua Ronis May 20 '19 at 15:48

OP here - Thank you to @saulspatz above!

His is the accepted answer - I just want to write this (mostly for me) to explain to myself what he was saying with another example, since I was a bit confused at first (still a beginner here).

We're going to toss a biased coin 2 times. We have two biased coins to chose from: $$A$$ or $$B$$.

The probability that we choose coin $$A$$ is $$P(A)$$, and the probability that we choose coin $$B$$ is $$P(B)$$.

$$P(B)=1-P(A)$$ - since we only have two coins to choose from, the two choices are complements of one another.

Now, if we toss coin $$A$$, the probability of getting heads is $$P(H|A)$$, and if we toss coin $$B$$, the probability of getting heads $$P(H|B)$$.

Coin tosses are independent of one another.

First question: What's the probability of getting two heads if we toss coin $$A$$?

Well, since each toss is independent of previous ones, its the product of the probabilities: $$P(H|A)^2$$

Second question: What's the probability of choosing $$A$$, tossing it twice, and getting two heads?

Here's where I would've messed up in my answer. Even though the probability of $$H$$ depends on wether we chose coin $$A$$ or coin $$B$$, the actual choosing of the coin is independent on the toss.

So, the choosing and the tossing should be treated as two independent events. In total, we have $$2+1$$ events (this is analogous to how up above @saulspatz said we had $$j+1$$ events).

We don't have $$4$$ events, since the coin was only chosen once.

Therefor, the probability of choosing coin $$A$$ and then getting two heads is: $$P(A)P(H|A)^2$$

Notice that we only multiplied by $$P(A)$$ once, even though we tossed the coin twice, since we only had to choose $$A$$ once. In the same way, in the question above we only need to multiply by the probability of it being a bad day once, since it was only a bad day once.

The tree is the following:

Third question: What's the probability of choosing $$A$$, tossing it once, choosing $$A$$ again and getting heads again?

In this case, we have to choose $$A$$ twice. So NOW the probability would be: $$(P(A)P(H|A))^2$$.

We have $$4$$ events!

However, in the question above, the day was only bad once per day.

If, for some magical reason, when EACH of the students woke up and had to decide whether or not to go to class, the weather suddenly changed sporadically between good and bad, THEN my calculation would be correct.

But that's not what happened. No magical weather - it was either good or bad on a given day, and was the same for all the students.

In this case, the tree would look like this:

Final Question: Given that we only choose a coin once, and then proceed to toss it $$n$$ times, what's the probability of getting at least $$k$$ heads?

And, now it should make sense that it would be...(leave it to you!)