8

Bus A arrives at a random time between 2pm and 4pm, and Bus B arrives at a random time between 3pm and 5pm. What are the odds that Bus A arrives before Bus B?

My understanding is that since Bus B cannot possibly arrive between 2 and 3, we can only talk about the time between 3 and 4 pm, when there is an equal probability for both buses arriving. But in this case, the probability of Bus A arriving before B is 50%. No? What am I missing here? Or I should look at the entire timeline, 2 pm - 5 pm? But then in this case, it is still 50%. Where is my thinking wrong?

IrinaS
  • 95
  • 1
    Using conditional probability I think it must be. $P(A/B')$ proceeding from here gives us ans $1/22$ is it correct? – Vimath Mar 23 '19 at 04:10
  • Yes, the arrival of buses is independent events. – IrinaS Mar 23 '19 at 04:45
  • As a nitpick, the words "probability" and "odds" are not interchangeable. They are related, yes, but they do not mean the same thing. The probability of picking an ace from a well shuffled standard deck is $\frac{1}{13}$. The odds however are $1:12$ for, or equivalently $12:1$ against. If you only ever want to talk about probabilities, then only use the word probability and avoid using the word odds. Also, @Vimath conditional probabilities are written with a vertical bar, not a slanted bar. It should be $P(A\mid B')$, not $P(A/B')$ – JMoravitz Mar 23 '19 at 13:59
  • @JMoravitz I missed the syntax there , I'll try not to repeat it. – Vimath Mar 23 '19 at 14:53

7 Answers7

15

Guide:

1) Draw rectangle $2\le x\le 4,$ $3\le y\le 5$.

2) The area of the rectangle is $4$, so pdf is $1/4$.

3) Draw line $y=x$.

4) Find area of the rectangle above the line, which is $7/2$.

5) Finally, the required probability is $7/2\cdot 1/4=7/8$.

Here is the graph:

$\hspace{2cm}$ enter image description here

Bus $A$ arriving before bus $B$: $$A(2.5,4.5),B(3.5,4.5),C(2.5,3.5),D(3.4,3.7).$$ Bus $A$ arriving after bus $B$: $$E(3.7,3.3).$$

David K
  • 98,388
farruhota
  • 31,482
  • do we need the area above the x=y line, or below the line? I believe - under the line. Can you please clarify? – IrinaS Mar 23 '19 at 05:15
  • The graph is a good idea but you need to get rid of the block F/G. Obviously the intersection is 2 hrs by 2 hrs - a square. – Craig Hicks Mar 23 '19 at 08:18
  • Thanks, I rolled back to my first answer. – farruhota Mar 23 '19 at 08:29
  • But the graph was great! Bring back the graph! – Craig Hicks Mar 23 '19 at 08:32
  • my first correct answer was from the phone, then I spoiled by drawing the graph on computer! Just kidding, I will. – farruhota Mar 23 '19 at 08:35
  • $\int_{s=2}^4 \int_{t=3}^5 p(a=s) p(b=t) \delta(s<t) $ -- I've added this equation as an answer below. It's a 2-d continuous integral to calculate the green area. – Craig Hicks Mar 23 '19 at 08:54
  • nice, there was a deleted yet correct answer (not visible to users with reputation less than 10K) that used integration too. I voted to undelete it (but it will be visible when 16 votes are cast). Cheers. – farruhota Mar 23 '19 at 09:02
  • Can someone tell me what main pdf, please? – Tom Ryddle Mar 23 '19 at 17:39
  • I think this geometric interpretation is one of the best ways of solving the problem but using the name "A" for both a bus and a square, and referring to squares by their midpoints is just confusing. I think you should remove the coordinates and rename squares A and B as F and G. – Jam Mar 23 '19 at 20:45
  • @TomRyddle, it is probability density function. Check out uniform distribution – farruhota Mar 24 '19 at 05:09
  • @Jam, I've been there... I am afraid someone may ask not to use letters at all as they are implicitly reserved for buses $C,D,...$. How not to confuse? As we distinguish "Sir Washington", "Washington city", "Washington post", etc, here "bus A" is different from "point A". Good luck. – farruhota Mar 24 '19 at 05:11
14

First, I’ll assume that the probability distribution of each bus’s arrival time is uniform in its range and independent. I think that’s implicit in the question but you don’t actually say so.

You’re mistaken when you say that if you know Bus A is arriving between $3$ and $4$, then there is an equal probability of either bus arriving first. There is a $50$% probability that Bus B arrives after $4$. The probabilities are equal only if you know that Bus A arrives between $3$ and $4$ and also that Bus B arrives between $3$ and $4$. That parlay occurs only $25$% of the time.

So $75$% of the time, you know that Bus A arrives first, and Bus A still arrives first half of the remaining $25$% of the time. Thus, the probability that Bus A arrives first is $87.5$%.

Robert Shore
  • 23,332
6

Let $A_e$ ($A$ early) be the event that bus $A$ arrives before $3$pm.

Let $B_\ell$ ($B$ late) be the event that bus $B$ arrives after $4$pm.

Let $C$ be the union : $C=A_e \cup B_\ell$. Hence $$P(C)=P(A_e)+P(B_\ell)-P(A_e \cap B_\ell)=P(A_e)+P(B_\ell)-P(A_e)P(B_\ell)$$

Let $X$ be the event of interest ( bus $A$ arrives before bus $B$).

What we know (don't we?) is that $P(X | C)=1$ and $P(X | \overline{C})=0.5$

Then we can write (total probability) $$P(X) = P(X \cap C) + P(X \cap\overline{C})=P(X | C) P(C) + P(X \mid \overline{C})P(\overline{C})$$

Can you go on from here ?

leonbloy
  • 63,430
  • Sorry for the question. I am confused with (|)=1. Here is why - A has already arrived before 4 pm, before ℓ happens, right? Yes, B can arrive after 4 pm, but it does not make any difference for the question we are asking which is - the probability of A arriving before B, before 4 pm, because A arrive between 2 and 4. – IrinaS Mar 23 '19 at 05:26
  • 3
    @IrinaS - "A has already arrived before $B_\ell$ happens" -- that would be $P(B_\ell | A_\ell)$. And you're right -- if $A_\ell$ happens, then A arrives before B no matter what. But leonbloy is talking about the union of $A_\ell$ and $B_\ell$ -- A arrives before 3, OR B arrives after 4, OR both. In any of these cases, A arrives before B for sure, hence $P(X | A \cup B)$ = 1 – cag51 Mar 23 '19 at 07:23
  • @IrinaS What cag51 says above. – leonbloy Mar 23 '19 at 14:01
1

Define a new variable $Z = A-B = A+ (-B)$.

Whenever $Z<0 \Rightarrow A<B$ (A arrives before B)

Since A and (-B) are independent, the pdf of Z is the convolution of the pdfs of A and (-B): $f_Z(z) = f_A(a)*f_{-B}(b)$.

Solving the convolution graphically you get that: $$f_Z(z) = \cases{ \frac{z+3}{4}, -3 \leq z < -1 \\ \frac{1-z}{4}, -1 \leq z < 1}$$

Convolution between A and -B

Now compute $P(Z<0)$

maz
  • 133
  • What I like about this answer - (1) short description to get to computeable equation (2) the graph shows immediately the average, maximum, and minimum times that A arrives before B: 1 hr, 3hr, -1hr respectively, so the result is easy to check. – Craig Hicks Mar 23 '19 at 22:37
1

What you missed in your approach to the question is that there is nothing in the problem statement that prevents bus $B$ from arriving after $4$ pm, and in fact (assuming uniform, independent distributions of the arrival times) half the time bus $B$ will arrive after $4$ pm, and in that case bus $A$ will have arrived first.

Likewise, there is nothing that requires bus $A$ to arrive after $3$ pm so that bus $B$ has a chance to arrive first. Bus $A$ can just as likely arrive before $3$ pm.

Let's take a frequentist approach. Suppose that these two buses run on this random schedule seven days a week, every day of the year. Let's watch them arrive for a few days and see what happens. Here's one possible way this might unfold:

  • On Monday, bus $A$ arrived at $2{:}38$ and bus $B$ arrived at $3{:}02$. Although bus $B$ arrived almost as quickly as it possibly can, bus $A$ still arrived first.

  • On Tuesday, bus $A$ arrived at $3{:}05$ and bus $B$ arrived at $3{:}42$. Bus $A$ arrived first.

  • On Wednesday, bus $A$ arrived at $2{:}50$ and bus $B$ arrived at $4{:}11$. Bus $A$ arrived first.

  • On Thursday, bus $A$ arrived at $3{:}57$ and bus $B$ arrived at $4{:}30$. Bus $A$ arrived first even though it was almost as late as it can be.

  • On Friday, bus $A$ arrived at $2{:}05$ and bus $B$ arrived at $4{:}56$. Bus $A$ arrived first.

  • On Saturday, bus $A$ arrived at $3{:}19$ and bus $B$ arrived at $3{:}17$. Finally we have observed an event in which bus $B$ arrived first!

In the long run, if we keep track of the relative frequency of days like Monday (when bus $A$ arrives before $3$ pm and bus $B$ arrives between $3$ and $4$ pm), we'll find that the relative frequency approaches $1/4$ of all the days. To put it simply, in the long run $1/4$ of the days will be like Monday.

Similarly, in the long run $1/4$ of the days will be like Wednesday and Friday, when bus $A$ arrived before $3$ pm and bus $B$ arrived after $4$ pm. Another $1/4$ of the days will be like Thursday, when bus $A$ arrived between $3$ and $4$ pm but bus $B$ arrives after $4$ pm.

That leaves just $1/4$ of the days in the long run when bus $A$ and bus $B$ both arrive between $3$ and $4$ pm. One half of those days ($1/8$ of all days in the long run) will be like Tuesday, when bus $A$ arrived first, and the other half of those days ($1/8$ of all days in the long run) will be like Saturday, when bus $B$ arrived first.

And that accounts for all possibilities. In one case, which happens $1/8$ of the time, bus $B$ arrives first. In all other cases bus $A$ arrives first.

David K
  • 98,388
0

$$\int_{s=2}^4 \int_{t=3}^5 p(a=s) p(b=t) \delta(s<t) $$

is the 2-d continuous integral equation. $\delta(s<t)$ is 1 when $s<t$ and 0 otherwise. $\delta(s<t)$ bisects the total area into two parts, the sum of which is 1.

It is easily visualized and solved with a 2 x 2 hours block of time with a diagonal line $\delta(s<t)$ cutting through one corner.

The graph in farruhota's answer shows it.

0

The joint distribution for arrival times of A and B is $$P(A,B)d\!Ad\!B = \frac{1}{4}d\!Ad\!B\qquad 2<A<4\, \mathrm{and} \,3<B<5$$

We need the probability that A is less than B $$P(A<B) = \int_3^5 d\!B \int_2^{\min(B,4)}d\!A = \frac{7}{8}$$