Fog Creek Software
Discussion Board




cars on the road

I was wondering if a solution for this problem had been posted--I didn't see one. I think that the answer is .6. I can justify this if it is desired.

James Kloberdance
Sunday, November 09, 2003

I will clarify my answer. I used a binomial series to model the problem. Let a eqaul the probabillity that a car will be found in a 5 minute interval and b the probabillity that no car will be found in this time period. Obviously, (a+b=1) and (a+b)^4= a^4 + 4*a^3*b +6*a^2*b^2+4*a*b^3+b^4. The probabillity of at least one car being seen in 20 minutes is (a^4+4*a^3*b+6*a^2*b^2 +4*a*b^3) = 609/625; the probabillity of a car not being seen in this interval is b^4=(1-609/625)=16/625=>b=2/5=>>a=3/5, since a+b=1.

James Kloberdance
Sunday, November 09, 2003

Shouldn't this be a Poisson distribution? I see in my textbook "If an event is randomly scattered in time with expectation lambda in a given length of time and X is '# of occurences in given interval' then X~Po(lambda)..." So here, lambda is 609/625 for 20 minutes, and quarter that for 5 minutes, giving probability of one car in 5 minutes P(1) = e^-(lambda/4) * ((lambda/4)^1 / 1!) = 0.19. Only a savant could pull this off in an interview without a calculator...

DW
Sunday, November 16, 2003

I thought about using a Poisson distribution but decided against it because the expectation was not given in this problem--only the odds of seeing at least one car in a 20 minute interval. I believe that the expectation would be the average number of cars in a given interval--not the odds of seeing any cars at all. I may be wrong, however, so I will have to think about it some more.

James Kloberdance
Sunday, November 16, 2003

I got your email James, and I think you and I are disagreeing on whether "the probability of observing a car in 20 minutes..." means "at least one car" or "exactly one car". I agree with your other approach *if* it's car(s).... but I don't think this is anything to lose a job offer over. :-)

My email won't work any more - I let spamgourmet destroy it.

DW
Tuesday, November 18, 2003

The probability is specified to be constant default. Now this probability distribution has the property that it is constant over an interval, and zero over the rest. Let the length of interval over which the probability is constant is t. Then the probability of observing the car in time t is 1, certain event. Going by this, the probability of observing the car in any other duration < t is proportional to the duration. So, the required probability is 609x5/(625x20) = 609/2500.

Ramashish Baranwal
Friday, November 21, 2003

Ok, if your answer is right, what would the chances be of observing a car in an hour?

james
Friday, November 21, 2003

James, you're right, but the calculations are much simpler. There's no need to sum all possible scenarios, consider just the worst -- "no cars appeared within 20 minutes, which means no cars appeared in all four 5-minute intervals"
609/625 = 1 - (1-p)^4 =>
16/625 = (1-p)^4 =>
2/5 = 1-p =>
p = 3/5 = 0.6
Regards,
Dmitri

Dmitri Krylov
Tuesday, November 25, 2003

Ooops... sorry, I didn't notice the line
"b^4=(1-609/625)=16/625=>b=2/5=>>a=3/5, since a+b=1" in the original posting. Please disregard my previous comment.

Dmitri Krylov
Tuesday, November 25, 2003

Dmitri's answer is nice and straightforward (and correct).  But James' notion of using the Poisson is certainly on track.  You don't have to know the mean of the Poisson in order to apply it.  Assuming that the author of the problem meant the probability of AT LEAST ONE car in a 20-minute period is 609/625, we can ask:  If this is being governed by a Poisson process, what would the mean of the process have to be in order to make the probability of seeing at least one car in a 20-minute period equal to 609/625?  Trial and error (or better yet Excel) can be use to see that the mean of the relevant Poisson distribution is 3.66515.  Therefore, the mean of the Poisson distribution governing things for a 5-minute interval is 3.66515/4 = .9162875.  We can now use this mean to get the probability of no (Poisson) arrivals of cars in a five-minute interval.  This turns out to be .59999, just about the same number Dmitri gets using the "binomial" approach.

Phil Rogers
Wednesday, January 21, 2004

*  Recent Topics

*  Fog Creek Home