Conditional probability: If the red light is on, what is the prob. that...?

pkbgamma

New member
Joined
Feb 21, 2016
Messages
7
Hello everybody,

I am learning conditional probability and have a problem with the following exercise:
The machine works this way: if a red light is on, pressing of a button changes it to a green light with a probability of 7/8 and with a probability of 1/8 it stays red. But if a green light is on, pressing of a button changes it to a red light with a probability of 3/4 and with a probability of 1/4 it stays green. The question is: if red light is on, what is a probability too see green light after second and after third press?

So if there is a red, a probability to change to green is 7/8 and 1/4 that not change, after first press. In second press I calculate conditional probability i.e.: a probability to see green equals 7/8 * 1/4 + 1/8 * 7/8
But I am not sure what about third press: should I multiply like this:
7/8 * 1/4 * 1/4 +
7/8 * 3/4 * 7/8 +
1/8 * 7/8 * 1/4 +
1/8 * 1/8 * 7/8

Is it correct?
 
Well, let's think about how we might end up with a red light on after two (or three) presses of the button. Since we always start with a red light, there are only two ways we can end up with a red light on after two presses.

Red -> Green -> Red
Red -> Red -> Red

Let's look at that first case. There's a 7/8 chance it will change on the first press. If it changes, there's a 3/4 chance it will change back on the second press. What do you think the probability of the light changing twice would be? Similarly, for the second case, we need it to stay red, which happens with a 1/8 chance, and then stay red again on the second press, also a 1/8 chance.

Now that we know the chances of having a red light after two presses, we also then know the chance of having a green light after two presses. Because we know these chances already, we don't have to bother listing out every way we can end up with a red light after three presses. If we have a red light after two presses, we need it to stay red, which is still a 1/8 chance. Or if it's green after two presses, we need it to change to red, a 3/4 chance. Hopefully this shines some light on a method you can use to solve the problem.
 
So if there is a red, a probability to change to green is 7/8 and 1/4 that not change... - of course I had on my mind 1/8, not 1/4.

Thank you for your explanation. I have performed calculations according to your words and received this:

Red -> Green -> Red
Red -> Red -> Red
What do you think the probability of the light changing twice would be?

It will be: P(G|R)*P(R|G) = 7/8 * 3/4 = 21/64
and for the second case: P(R|R)*P(R|R) = 1/8 * 1/8 = 1/64

On the other hand for a green light after second press:

Red -> Green -> Green
Red -> Red -> Green

It will be: P(G|R)*P(G|G) = 7/8 * 1/4 = 14/64
and for the second case: P(R|R)*P(G|R) = 1/8 * 7/8 = 7/64

So, exactly as I have written earlier.

Using this analogy I calculate a probability for a green light at the end after third press:

Red -> Green -> Red -> Green__________P(G|R)*P(R|G)*P(G|R) = 7/8 * 3/4 * 7/8 = 294/512
Red -> Green -> Green -> Green________P(G|R)*P(G|G)*P(G|G) = 7/8 * 1/4 * 1/4 = 28/512
Red -> Red -> Green -> Green__________P(R|R)*P(G|R)*P(G|G) = 1/8 * 7/8 * 1/4 = 14/512
Red -> Red -> Red -> Green____________P(R|R)*P(R|R)*P(G|R) = 1/8 * 1/8 * 7/8 = 7/512

So, the probability equals 343/512

I am not sure if I understand you correctly in your last words.
Do you sugest this?

If there is a red light after two presses, P(Rx2) = 22/64, it will switch to green with a probability:
P(Rx2)*P(G|R) = 22/64 * 7/8 = 77/256

and if there is a green light after two presses, P(Gx2) = 21/64, it will switch to green with a probability:
P(Gx2)*P(G|G) = 21/64 * 1/4 = 21/256

and finally in this case we have 98/256, which is different than in the first case. Still, I vote for the first solution but still I am not entirely convinced of the correctness of it. Please, comment it.
 
So if there is a red, a probability to change to green is 7/8 and 1/4 that not change... - of course I had on my mind 1/8, not 1/4.

Thank you for your explanation. I have performed calculations according to your words and received this:

Red -> Green -> Red
Red -> Red -> Red
What do you think the probability of the light changing twice would be?

It will be: P(G|R)*P(R|G) = 7/8 * 3/4 = 21/64
and for the second case: P(R|R)*P(R|R) = 1/8 * 1/8 = 1/64

On the other hand for a green light after second press:

Red -> Green -> Green
Red -> Red -> Green

It will be: P(G|R)*P(G|G) = 7/8 * 1/4 = 14/64
and for the second case: P(R|R)*P(G|R) = 1/8 * 7/8 = 7/64
So, exactly as I wrote earlier.

Using this analogy I calculate a probability for a green light at the end after third press:

Red -> Green -> Red -> Green__________P(G|R)*P(R|G)*P(G|R) = 7/8 * 3/4 * 7/8 = 294/512
Red -> Green -> Green -> Green________P(G|R)*P(G|G)*P(G|G) = 7/8 * 1/4 * 1/4 = 28/512
Red -> Red -> Green -> Green__________P(R|R)*P(G|R)*P(G|G) = 1/8 * 7/8 * 1/4 = 14/512
Red -> Red -> Red -> Green____________P(R|R)*P(R|R)*P(G|R) = 1/8 * 1/8 * 7/8 = 7/512

So, the probability equals 343/512

I am not sure if I understand you correctly in your last words.
Do you sugest this?

If there is a red light after two presses, P(Rx2) = 22/64, it will switch to green with a probability:
P(Rx2)*P(G|R) = 22/64 * 7/8 = 77/256

and if there is a green light after two presses, P(Gx2) = 21/64, it will switch to green with a probability:
P(Gx2)*P(G|G) = 21/64 * 1/4 = 21/256

and finally in this case we have 98/256, which is different than in the first case. Still, I vote for the first solution but still I am not entirely convinced of the correctness of it. Please, comment it.
 
conditional probability

So if there is a red, a probability to change to green is 7/8 and 1/4 that not change... - of course I had on my mind 1/8, not 1/4.

Thank you for your explanation. I have performed calculations according to your words and received this:

Red -> Green -> Red
Red -> Red -> Red
What do you think the probability of the light changing twice would be?

It will be: P(G|R)*P(R|G) = 7/8 * 3/4 = 21/64
and for the second case: P(R|R)*P(R|R) = 1/8 * 1/8 = 1/64

On the other hand for a green light after second press:

Red -> Green -> Green
Red -> Red -> Green

It will be: P(G|R)*P(G|G) = 7/8 * 1/4 = 14/64
and for the second case: P(R|R)*P(G|R) = 1/8 * 7/8 = 7/64
So, exactly as I wrote earlier.

Using this analogy I calculate a probability for a green light at the end after third press:

Red -> Green -> Red -> Green__________P(G|R)*P(R|G)*P(G|R) = 7/8 * 3/4 * 7/8 = 294/512
Red -> Green -> Green -> Green________P(G|R)*P(G|G)*P(G|G) = 7/8 * 1/4 * 1/4 = 28/512
Red -> Red -> Green -> Green__________P(R|R)*P(G|R)*P(G|G) = 1/8 * 7/8 * 1/4 = 14/512
Red -> Red -> Red -> Green____________P(R|R)*P(R|R)*P(G|R) = 1/8 * 1/8 * 7/8 = 7/512

So, the probability equals 343/512

I am not sure if I understand you correctly in your last words.
Do you suggest this?

If there is a red light after two presses, P(Rx2) = 22/64, it will switch to green with a probability:
P(Rx2)*P(G|R) = 22/64 * 7/8 = 77/256

and if there is a green light after two presses, P(Gx2) = 21/64, it will switch to green with a probability:
P(Gx2)*P(G|G) = 21/64 * 1/4 = 21/256

and finally in this case we have 98/256, which is different than in the first case. Still, I vote for the first solution but still I am not entirely convinced of the correctness of it. Please, comment it.
 
So if there is a red, a probability to change to green is 7/8 and 1/4 that not change... - of course I had on my mind 1/8, not 1/4.
Thank you for your explanation. I have performed calculations according to your words and received this:
Red -> Green -> Red
Red -> Red -> Red
What do you think the probability of the light changing twice would be?
It will be: P(G|R)*P(R|G) = 7/8 * 3/4 = 21/64
and for the second case: P(R|R)*P(R|R) = 1/8 * 1/8 = 1/64

On the other hand for a green light after second press:
Red -> Green -> Green
Red -> Red -> Green
It will be: P(G|R)*P(G|G) = 7/8 * 1/4 = 14/64
and for the second case: P(R|R)*P(G|R) = 1/8 * 7/8 = 7/64
So, exactly as I wrote earlier.
Using this analogy I calculate a probability for a green light at the end after third press:
Red -> Green -> Red -> Green__________P(G|R)*P(R|G)*P(G|R) = 7/8 * 3/4 * 7/8 = 294/512
Red -> Green -> Green -> Green________P(G|R)*P(G|G)*P(G|G) = 7/8 * 1/4 * 1/4 = 28/512
Red -> Red -> Green -> Green__________P(R|R)*P(G|R)*P(G|G) = 1/8 * 7/8 * 1/4 = 14/512
Red -> Red -> Red -> Green____________P(R|R)*P(R|R)*P(G|R) = 1/8 * 1/8 * 7/8 = 7/512

So, the probability equals 343/512
I am not sure if I understand you correctly in your last words.
Do you sugest this?
If there is a red light after two presses, P(Rx2) = 22/64, it will switch to green with a probability:
P(Rx2)*P(G|R) = 22/64 * 7/8 = 77/256
and if there is a green light after two presses, P(Gx2) = 21/64, it will switch to green with a probability:
P(Gx2)*P(G|G) = 21/64 * 1/4 = 21/256
and finally in this case we have 98/256, which is different than in the first case. Still, I vote for the first solution but still I am not entirely convinced of the correctness of it. Please, comment it.
 
I am not sure if I understand you correctly in your last words.
Do you sugest this?

If there is a red light after two presses, P(Rx2) = 22/64, it will switch to green with a probability:
P(Rx2)*P(G|R) = 22/64 * 7/8 = 77/256

and if there is a green light after two presses, P(Gx2) = 21/64, it will switch to green with a probability:
P(Gx2)*P(G|G) = 21/64 * 1/4 = 21/256

Your methodology is correct, and that's exactly the way I took on the problem. There's only one minor math error, which accounts for the two methods producing different answers. In the first method, you say:

Red -> Green -> Red
Red -> Red -> Red
What do you think the probability of the light changing twice would be?

It will be: P(G|R)*P(R|G) = 7/8 * 3/4 = 21/64
and for the second case: P(R|R)*P(R|R) = 1/8 * 1/8 = 1/64

I have shown the error in red. Instead of what you wrote, it should be: 7/8 * 3/4 = 21/32 = 42/64. Easy enough to miss :)
 
Hello everybody,

I am learning conditional probability and have a problem with the following exercise:
The machine works this way: if a red light is on, pressing of a button changes it to a green light with a probability of 7/8 and with a probability of 1/8 it stays red. But if a green light is on, pressing of a button changes it to a red light with a probability of 3/4 and with a probability of 1/4 it stays green. The question is: if red light is on, what is a probability too see green light after second and after third press?
I think that I disagree with almost all of this thread.
As I read the question the button is pressed exactly three times.
After the first press the light is red. That is the given, the conditional for the rest of the question.
The overall question is: \(\displaystyle \mathcal{P}(G_3)=~?\) What is the probability that the light is green after the third push given that the light is red after the first push?
Solution:
\(\displaystyle \left\{\begin{array}{l}\mathcal{P}(G_2)=\frac{7}{8}\\\mathcal{P}(R_2)=\frac{1}{8}\\\mathcal{P}(G_3|G_2)=\frac{1}{4}\\\mathcal{P}(G_3|R_2)=\frac{7}{8} \end{array} \right.\)

\(\displaystyle \begin{align*} \mathcal{P}(G_3) &=\mathcal{P}(G_3G_2)+\mathcal{P}(G_3R_2)\\ &=\mathcal{P}(G_3|G_2)\mathcal{P}(G_2) +\mathcal{P}(G_3|R_2) \mathcal{P}(R_2) \\&= \frac{1}{4} \cdot \frac{7}{8} +\frac{7}{8} \cdot\frac{7}{8}\\&=\dfrac{21}{64} \end{align*}\)
 
7/8 * 3/4 = 21/32 = 42/64. Easy enough to miss :)

oh... indeed.
I took a look at it again and really - I would be very concern about mathematics if that both solutions were different:)
Thank you once again. I was not sure about the result because the answer in a book is different, so it is an mistake... that is annoying.
 
I think that I disagree with almost all of this thread.
As I read the question the button is pressed exactly three times.
After the first press the light is red.

Maybe I did not express it precisely enough but the question in this exercise is about that: you see a red light and then you press a button three times - what is a P to see a green at the end?
Btw. I am exploring this matter further and I have found such thing like Markov Chains - in practise - it is powering of matrices. I used wolframalpha to compute that and it gave me the same result as we mentioned above.
 
I am exploring this matter further and I have found such thing like Markov Chains - in practise - it is powering of matrices. I used wolframalpha to compute that and it gave me the same result as we mentioned above.
I absolutely agree with the idea this is best handled as a Markov process.
But then it is not conditional probability question. You titled this conditional probability. Moreover, the actual wording said nothing about the first press, leaving one to assume that the first push becomes the conditioning step. Many do not understand that conditional probability results in cutting down the size of the probability space.
If a family has four children and we know the oldest is a girl then that conditions certain kinds of questions about the children. Such as the probability that the have only one girl.
 
I think that I disagree with almost all of this thread.
As I read the question the button is pressed exactly three times.
After the first press the light is red. That is the given, the conditional for the rest of the question.
The overall question is: \(\displaystyle \mathcal{P}(G_3)=~?\) What is the probability that the light is green after the third push given that the light is red after the first push?
Solution:
\(\displaystyle \left\{\begin{array}{l}\mathcal{P}(G_2)=\frac{7}{8}\\\mathcal{P}(R_2)=\frac{1}{8}\\\mathcal{P}(G_3|G_2)=\frac{1}{4}\\\mathcal{P}(G_3|R_2)=\frac{7}{8} \end{array} \right.\)

\(\displaystyle \begin{align*} \mathcal{P}(G_3) &=\mathcal{P}(G_3G_2)+\mathcal{P}(G_3R_2)\\ &=\mathcal{P}(G_3|G_2)\mathcal{P}(G_2) +\mathcal{P}(G_3|R_2) \mathcal{P}(R_2) \\&= \frac{1}{4} \cdot \frac{7}{8} +\frac{\boldsymbol{\color{red}{7}}}{8} \cdot\frac{7}{8}\\&=\dfrac{21}{64} \end{align*}\)
Although I agree with your formula, I believe you have the wrong numbers
\(\displaystyle \begin{align*} \mathcal{P}(G_3) &=\mathcal{P}(G_3G_2)+\mathcal{P}(G_3R_2)\\ &=\mathcal{P}(G_3|G_2)\mathcal{P}(G_2) +\mathcal{P}(G_3|R_2) \mathcal{P}(R_2) \\&= \frac{1}{4} \cdot \frac{7}{8} +\frac{\boldsymbol{\color{red}{1}}}{8} \cdot\frac{7}{8}\\&=\dfrac{21}{64} \end{align*}\)
 
Top