Hard probability question

Maths and statistics discussion, revision, exam and homework help.

Announcements Posted on
Please change your TSR password 23-05-2013
IMPORTANT: You must wait until midnight (morning exams)/4.30AM (afternoon exams) to discuss Edexcel exams and until 1pm/6pm the following day for STEP and IB exams. Please read before posting, including for rules for practical and oral exams. 28-04-2013
Sign in to Reply
  1. smalltalk's Avatar
    • Junior Member
    • Posts: 28
    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 p_2 = \frac{117}{200}.
    Therefore E[X_2] = \frac{1}{p_2} = \frac{200}{117} \approx 1.709.

    But I've simulated the experiment and I get that E[X_2] \approx 1.745.

    Where have I gone wrong? I didn't even try to find p3.
    Last edited by smalltalk; 21-07-2012 at 22:15.
  2. BabyMaths's Avatar
    • Peer Of The TSR Realm
    • Posts: 1,576
    Re: Hard probability question
    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.
  3. smalltalk's Avatar
    • Junior Member
    • Posts: 28
    Re: Hard probability question
    (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.
    You mean this?
    YG, YYG, YYYG... \sum_{i=1}^{\infty} Y^i G -> probability = \frac{1}{20}
    GY, GGY, GGGY... \sum_{i=1}^{\infty} G^i Y -> probability = \frac{9}{110}
    RG, RRG, RRRG... \sum_{i=1}^{\infty} R^i G -> probability = \frac{81}{220}
    GR, GGR, GGGR... \sum_{i=1}^{\infty} G^i R -> probability = \frac{81}{220}
    RY, RRY, RRRY.... \sum_{i=1}^{\infty} R^i Y -> probability = \frac{9}{110}
    YR, YYR, YYYR... \sum_{i=1}^{\infty} Y^i R -> probability = \frac{1}{20}

    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)
    = 0.1 * \frac{1}{10} + 0.45 * \frac{9}{20} + 0.45 * \frac{9}{20}
    =  \frac{83}{200}

    But this can't bee correct, since with that value of p2, E[X_{2}] = \frac{200}{83} \approx 2.409 and that is nowhere near 2.74 (the correct value) :confused:
    Last edited by smalltalk; 22-07-2012 at 01:13. Reason: added my working
  4. ghostwalker's Avatar
    • Outcast of Imrryr
    • Location: CA13
    Re: Hard probability question
    (Original post by smalltalk)
    Where have I gone wrong?
    I 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.

    However, assuming it is, then by the law of total expectation (easier to Google than ask me):

    E(X_2)= E_Y( E(X_2|Y))

    \displaystyle \sum_y E(X_2|Y=y)P(Y=y)

    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 E(X_2)=1.\dot{7}\dot{4}
    Last edited by ghostwalker; 22-07-2012 at 12:31. Reason: clarity
  5. BabyMaths's Avatar
    • Peer Of The TSR Realm
    • Posts: 1,576
    Re: Hard probability question
    (Original post by smalltalk)

    So p_2 = \frac{117}{200}.
    Therefore E[X_2] = \frac{1}{p_2} = \frac{200}{117} \approx 1.709.

    But I've simulated the experiment and I get that E[X_2] \approx 1.745.

    Where have I gone wrong?
    You only considered the case where the second light is a new colour. Instead you might have RRG or RRRRRRRY or whatever.

    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.
  6. smalltalk's Avatar
    • Junior Member
    • Posts: 28
    Re: Hard probability question
    (Original post by smalltalk)
    You mean this?

    RG, RRG, RRRG... \sum_{i=1}^{\infty} R^i G -> probability = \frac{81}{220}

    (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.
    Sorry I don't understand what you mean
  7. BabyMaths's Avatar
    • Peer Of The TSR Realm
    • Posts: 1,576
    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:

    0.1 \displaystyle \sum_{n=3}^{\infty} 0.45^{n-1}(2^{n-1}-2)n=\frac{243}{25}-\frac{1701}{6050}

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

    2\times 0.45 \displaystyle \sum_{n=3}^{\infty}  \sum_{r=1}^{n-2} n \binom{n-1 }{r} 0.45^r 0.1^{n-r-1}=\frac{4567}{3630}

    Adding these together gives the result \frac{353}{33}

    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?
  8. BabyMaths's Avatar
    • Peer Of The TSR Realm
    • Posts: 1,576
    Re: Hard probability question
    (Original post by smalltalk)
    ...
    (Original post by ghostwalker)
    ...
    In case anyone is interested here's much nicer way to solve it.

    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.
  9. ghostwalker's Avatar
    • Outcast of Imrryr
    • Location: CA13
    Re: Hard probability question
    (Original post by BabyMaths)
    In case anyone is interested here's much nicer way to solve it.
    Very elegant - PRSOM.

    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.
  10. BabyMaths's Avatar
    • Peer Of The TSR Realm
    • Posts: 1,576
    Re: Hard probability question
    (Original post by ghostwalker)
    Very elegant - PRSOM.
    Thanks.

    (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.
    Not at all. Thank you. I'll fix it now.
Sign in to Reply
Share this discussion:  
Article updates
Moderators

We have a brilliant team of more than 60 volunteers looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Reputation gems:
The Reputation gems seen here indicate how well reputed the user is, red gem indicate negative reputation and green indicates a good rep.
Post rating score:
These scores show if a post has been positively or negatively rated by our members.