# Basic probability problem!

"A boss plans a business meeting at Starbucks with the two engineers below him. However, he fails to set a time, and all three arrive at Starbucks at a random time between $2:00$ and $4:00$ p.m. When the boss shows up, if both engineers are not already there, he storms out and cancels the meeting. Each engineer is willing to stay at Starbucks alone for an hour, but if the other engineer has not arrived by that time, he will leave. What is the probability that the meeting takes place?"

What answer did you get? Thanks!

-
What answer did I get? It is your homework, you should tell us what you got. – Chris K Dec 17 '13 at 21:57
Is this a homework question? If so, please mark as such. Either way, please show us that you've at least tried to solve this problem. – user76844 Dec 17 '13 at 21:57
It is not my homework, I'm trying to solve this for fun. I used geometric probability to find that the probability that both engineers will meet is 3/4. Also the probability that an engineer comes before the boss is 3/8. Then I got (3/8)(3/8)(3/4) = 27/256. Is it correct? – Fernando Dec 17 '13 at 21:58
That's all we were looking for; that is you had made an attempt at the problem. – Chris K Dec 17 '13 at 22:02
Oh this is not homework ? What about math.stackexchange.com/questions/611009/… – Euler....IS_ALIVE Dec 17 '13 at 22:40

Without the "waiting for an hour" caveat, in a $2\times2\times2$ cube, you are asked to find the proportion of volume with $z\geq x,y$. If you can picture this shape, it's a pyramid with a square base with a right angle at one corner. Two of its walls are right triangles meeting at the right angle, and the other two walls are right triangles at a $45^\circ$ incline.

Adding on the "waiting for an hour" caveat, you also require $\left|x-y\right|<1$, which shaves off two smaller pyramids from this shape, each with a triangular base.

If you can picture the problem this way, then you can use simple geometry formulas to arrive at a result without integration. The volume of a pyramid whose base is $B$ and height is $h$ is $\frac{1}{3}Bh$.

Here is a picture:

I leave the explicit calculations alone since this may be homework.

-
With your method I found $p=\frac{7}{24}$. From $\frac{1}{3}-2.\frac{1}{3}\frac{1}{8}\frac{1}{2}$ – Xoff Dec 17 '13 at 22:57
@TimRatigan You don't need calculus to derive a pyramid's volume. Start by decomposing a square into six equal pyramids. Then apply Cavalieri's principle to change the base from a square to whatever shape you like. Then apply the principle that scaling in one direction by $k$ scales volume by $k$ (a one-dimensional Cavalieri principle) to make the height whatever you like. – alex.jordan Dec 17 '13 at 23:06
This is the right and simplest method, and I confirm this is the right solution : $\frac{7}{24}$ – Xoff Dec 17 '13 at 23:07
+1. I'm a sucker for visual proofs. – baudolino Dec 17 '13 at 23:09
@baudolino Me too. – alex.jordan Dec 17 '13 at 23:24

Consider when the first engineer (call him $E_1$) arrives. If $E_1$ arrives at time $t_1$, the chance that $E_2$ will arrive at a time at which they will see each other is $1-\frac{|t_1-(3:00)|}{2}$, where the difference between $t_1$ and $3$ is in hours.

Case $1$: $t_1<3:00$

Here, we have a $1/2$ chance $E_2$ arrives after $E_1$ and they see each other, and $\frac{t_1-(2:00)}{2}$ that $E_2$ arrives before, and so the probability of the boss arriving after both engineers in the first case is $$\frac12\left(\frac12\frac{(4:00)-t_2}{2}+\frac{t_1-(2:00)}{2}\frac{(4:00)-t_1}{2}\right)$$

On average, we have \begin{align} &\int_2^3\int_{t_1}^{t_1+1}\frac12\left(\frac12\frac{(4:00)-t_2}{2}\right)\text dt_2\text dt_1+\int_2^3\frac{\int_2^{t_1}\frac12\left(\frac{t_1-(2:00)}{2}\frac{(4:00)-t_1}{2}\right)\text dt_2}{t_1-(2:00)}\text dt_1\\ =&\frac18\int_2^3\int_{t_1}^{t_1+1}(4-t_2)\text dt_2\text dt_1+\frac18\int_2^3\frac{\int_2^{t_1}(t_1-2)(4-t_1)\text dt_2}{t_1-2}\text dt_1\\ =&\frac18\int_2^3(4-(t_1+\frac12))\text dt_1+\frac18\int_2^3(t_1-2)(4-t_1)\text dt_1\\ =&\frac18+\frac1{12}=\frac{5}{24} \end{align}

Case $2$: $t_1\ge 3:00$

Here, we have a $1/2$ chance $E_1$ arrives after $E_2$ and they see each other, and $\frac{(4:00)-t_1}{2}$ that $E_2$ arrives after $E_1$, so the probability of both of them seeing the boss is $$\frac12\left(\frac12\frac{(4:00)-t_1}{2}+\frac{(4:00)-t_1}{2}\frac{(4:00)-t_2}{2}\right)$$ On average, we have: \begin{align}&\int_3^4\int_{t_1-1}^{t_1}\frac12\left(\frac12\frac{4-t_1}{2}\right)\text dt_2\text dt_1+\int_3^4\frac{\int_{t_1}^4\frac12\left(\frac{4-t_1}{2}\frac{4-t_2}{2}\right)\text dt_2}{4-t_1}\text dt_1\\ =&\frac18\int_3^4\int_{t_1-1}^{t_1}\left(4-t_1\right)\text dt_2\text dt_1+\frac18\int_3^4\frac{\int_{t_1}^4(4-t_1)(4-t_2)\text dt_2}{4-t_1}\text dt_1\\ =&\frac18\int_3^4(4-t_1)\text dt_1+\frac18\int_3^4\frac12(4-t_2)^2\text dt_1\\ =&\frac18\frac12+\frac18\frac16\\ =&\frac1{12} \end{align}

So, overall, we have the probability of the boss arriving to see both engineers sitting at the table to be $$\frac{5}{24}+\frac{1}{12}=\frac{7}{24}$$

Disclaimer: I did a lot of this in my head with some referencing to Mathematica, so there might be some mistakes.

-
+1 This was a 'whale' of a proof. I applaud you for finishing it up. I got tired of typesetting and conveniently didn't have paper handy. – Chris K Dec 17 '13 at 22:46
Thanks. It was kind of tedious but I enjoy TeXing so I don't mind. – Tim Ratigan Dec 17 '13 at 22:48
At the very last step, you have $\frac{1}{16}+\frac{1}{48}$. That's $\frac{2}{24}$, so the answer is really $\frac{7}{24}$. A nitpick, but more importantly, it makes your analytic solution agree with the geometrical proof given by someone else. – baudolino Dec 17 '13 at 23:08
@baudolino thanks! I had noticed the difference too, and figured it was probably an error somewhere in my calculations. – Tim Ratigan Dec 17 '13 at 23:59

DISCLAIMER: Please note that this is meant to be a sketch of how you would do a problem like this. I could've made a computational mistake along the way.

We have a continuous probability distribution function. The probability a given engineer is there at $2$ or $5$ is $0$ and it is equally likely that he'll be there at any time between $3$ and $4$. We know that the area under this function must be normalized and so $k=1/2$ where $k$ is the probability that an engineer will be there at any point in time in between $3$ and $4$. Why? So, we have:

$$P(\text{engineer 1 is at Starbucks at time t}) = \begin{Bmatrix} \frac{t-2}{2}, 2 \leq t \leq 3\\ \frac{1}{2}, 3 \leq t \leq 4 \\ \frac{5-t}{2} 4 \leq t \leq 5 \end{Bmatrix}.$$

So, $$P(\text{engineer 1 is at Starbucks when engineer 2 arrives}) = \begin{Bmatrix} \int_{2}^{t} \frac{t-2}{2} = 1/4\cdot t^2 - t + 1, 2 \leq t \leq 3\\ \int_{t-1}^{3} \frac{t-2}{2} + \int_{3}^{t} \frac{1}{2} = \frac{3}{4} - (t-1)^2 + t - 1 + \frac{t-3}{2} = -t^2 + 7/2\cdot t - 11/4, 3 \leq t \leq 4 \\ \int_{t-1}^{4} \frac{1}{2} + \int_{4}^{t} \frac{5-t}{2} = 1/2\cdot (5-t) + 5/2\cdot t - 1/4\cdot t^2 - 6 = -1/4\cdot t^2 + 2\cdot t - 7/2 , 4 \leq t \leq 5 \end{Bmatrix}.$$

Now, $$P(\text{boss arrives after engineer 2}) = \begin{Bmatrix} 1-\frac{(t-2)^2}{4}, 2 \leq t \leq 3\\ 3/4-\frac{(t-3)}{2}, 3 \leq t \leq 4 \\ \frac{(5-t)^2}{4}, 4 \leq t \leq 5 \end{Bmatrix}.$$

Now, you want to evaluate $P(\text{engineer 1 at Starbucks when engineer 2 arrives})\cdot P(\text{boss arrives after engineer 2})$. Then integrate over $t \in [2,5]$ and you should get the probability desired. However, this is by no means a trivial problem; I would not call it 'basic'!

-

I think the solution from alex.jordan should be accepted, but I just give an advice to the OP.

When you have such a problem, you can easily verify your result with a small program, that simulates the experience a large number of times, a compute the proportion of successes. For example (this is python):

import random
def f() :
x=random.uniform(0,2)
y=random.uniform(0,2)
z=random.uniform(0,2)
if z>x and z> y and (x-y)<1 and (y-x)<1 : return 1
return 0
a=0
for i in range(10000000) : a+=f()
print(a/10000000)


You can obtain something like : 0.2918696 and you know this must be really close to the right answer. So this can't be for example $\frac{27}{256}$

-