Hard probability question
Maths and statistics discussion, revision, exam and homework help.
-
Hard probability question
A person is driving. The probability of seeing a RED traffic light is 0.45; the probability of seeing a GREEN traffic light is 0.45; the probability of seeing a YELLOW traffic light is 0.1.
The states of the traffic lights are independent. The driver doesn't ever stop driving.
Find the mean amount of traffic lights the driver sees until seeing all three colours.
Here's what I've got so far:
X = amount of traffic lights the driver sees until seeing the 3 colours.
X1 = amount of traffic lights the driver sees until seeing the FIRST colour.
X2 = amount of traffic lights the driver sees until seeing the SECOND colour.
X3 = amount of traffic lights the driver sees until seeing the THIRD colour.
I know that X = X1 + X2 + X3.
So: E[X] = E[X1] + E[X2] + E[X3].
I also know that X1 ~ Geometric (p = 1). So E[X1] = 1.
Likewise:
X2 ~ Geometric (p2)
X3 ~ Geometric (p3)
But I'm having trouble with p2 and p3.
For p2 ("probability of seeing the SECOND colour") I drew this diagram with all the possibilites:
(Assume column 1 is the FIRST colour seen)

So
.
Therefore
.
But I've simulated the experiment and I get that
.
Where have I gone wrong? I didn't even try to find p3.Last edited by smalltalk; 21-07-2012 at 22:15. -
Re: Hard probability questionYou mean this?(Original post by BabyMaths)
I would consider first how the sequence ends.
If it is completed by a red light then before the red light you have a sequence consisting only of yellow and green lights. The probabilities for this are not too hard to work out.
YG, YYG, YYYG...
-> probability = 
GY, GGY, GGGY...
-> probability = 
RG, RRG, RRRG...
-> probability = 
GR, GGR, GGGR...
-> probability = 
RY, RRY, RRRY....
-> probability = 
YR, YYR, YYYR...
-> probability = 
I don't know how to find p2 from that.
EDIT:
p2 = P(Y was 1st)*P(seeing the 2nd | Y was 1st) + P(G was 1st)*P(seeing the 2nd | G was 1st) + P(R was 1st)*P(seeing the 2dn | R was 1st)
=
=
But this can't bee correct, since with that value of p2,
and that is nowhere near 2.74 (the correct value)
Last edited by smalltalk; 22-07-2012 at 01:13. Reason: added my working -
Re: Hard probability questionI don't know if the method you're using in general is the best way to go about this, since I'm stretching myself with this question.(Original post by smalltalk)
Where have I gone wrong?
However, assuming it is, then by the law of total expectation (easier to Google than ask me):


Where Y is the r.v. representing the first colour encountered.
As you can see you need to work out the expectations and sum them, weighted by the probability of the first colour.
What you've done in your original working is to sum the probabilities and use that as the basis for your expectation.
Hope that made sense.
I make it
Last edited by ghostwalker; 22-07-2012 at 12:31. Reason: clarity -
Re: Hard probability questionYou only considered the case where the second light is a new colour. Instead you might have RRG or RRRRRRRY or whatever.(Original post by smalltalk)
So
.
Therefore
.
But I've simulated the experiment and I get that
.
Where have I gone wrong?
Your simulation gave approximately the correct result.
Edit: ghostwalker well ahead of me there. I leave this anyway. It may add a little something.Last edited by BabyMaths; 22-07-2012 at 08:33. -
Re: Hard probability question
Sorry I don't understand what you mean(Original post by BabyMaths)
You only considered the case where the second light is a new colour. Instead you might have RRG or RRRRRRRY or whatever.
-
Re: Hard probability question
I thought my last post was wrong so I deleted it. I now believe it was right so here it is again along with the last bit.
The easier case, sequences ending in yellow:

The harder case, sequences ending in red (and green):

Adding these together gives the result
I hope it's OK to post this. It's not a detailed solution and having done the work I have to put it somewhere don't I? -
Re: Hard probability question(Original post by smalltalk)
...In case anyone is interested here's much nicer way to solve it.(Original post by ghostwalker)
...
Let E(Y) be the expected number of lights to get a yellow light, E(GY) be the expected number of lights to get a green and a yellow and so on.
E(R)=E(G)=1/0.45=20/9
E(Y)=1/0.1=10
E(YR)=0.45(1+E(Y)) + 0.45(1+E(YR))+0.1(1+E(R))
Solve to get E(YR)=1030/99
E(YG) is the same.
E(GR)=0.45(1+E(G))+0.45(1+E(R)) + 0.1(1+E(GR))
Solve to get E(GR) = 10/3
E(YRG) = 0.1(1+10/3)+ 0.9(1+1030/99)=353/33.
That was so much easier.
Last edited by BabyMaths; 10-10-2012 at 21:15. -
Re: Hard probability questionVery elegant - PRSOM.(Original post by BabyMaths)
In case anyone is interested here's much nicer way to solve it.
PS: You have a typo: E(Y)=E(G)=1/0.45=20/9, though it seems almost purile to mention it, after such an eloquent exposition.Last edited by ghostwalker; 10-10-2012 at 19:37. -
Re: Hard probability questionThanks.(Original post by ghostwalker)
Very elegant - PRSOM.
Not at all. Thank you. I'll fix it now.(Original post by ghostwalker)
PS: You have a typo: E(Y)=E(G)=1/0.45=20/9, though it seems almost purile to mention it, after such an eloquent exposition.
