find the cummulative distribution function FX(x) given an image above Suppose we have a street intersection. It consists of a center point and 4 one-mile-long streets from the center. Street 1 points up, street 2 points down, street 3 points to the right and street 4 points to the left. The city assigns an ambulance for this area and assume that the ambulance is equally likely distributed in these 4 streets. When an emergency happens at the very end of street 1, let X denote the distance the ambulance has to travel in order to get to the emergency. a. Find the cummulative distribution function FX(x). 
The textbook  suggests that we design Di to be the event that the ambulance is on the street i ( i=1,2,3,4). Then consider the random variable X given Di (X|Di)
the image of this problem is here
[http://imageshack.us/photo/my-images/694/36205974.jpg/]
 A: There's a neater way of doing it. 
Let $E$ be the event that the ambulance is less than one mile away.
Notice that $E$ is exactly the event that the ambulance is on street one.
So we have
$\mathbb P(E) = \frac 14$.
Now let $Y$ be the distance of the ambulance from the central point (in miles). Notice that:
$\circ\qquad$ $\mathbb P[ Y < y ] = y$ for $0<y<1$
$\circ\qquad$ The random variable $Y$ is independent of which street the ambulance is on. 
Therefore for every $y\in(0,1)$ the events $[Y>y]$ and $E$ are independent.
Notice two more things
$\circ\qquad$ If the ambulance is on street one $X$ is the distance to one end of the street and $Y$ is the distance to the other end. So $X+Y = 1$
$\circ\qquad$ If the ambulance in on another street then it must drive through the central point and then one mile further. So $X = Y+1$.
So for $x<1$ we have
$$\mathbb P[X<x] = \mathbb P\left(\left[Y>1-x\right] \cap E \right) = \left(1-\mathbb P\left[y<1-x\right]\right)\mathbb P(E) = \frac x4.$$
For $1<x<2$ we have 
$$\mathbb P[X<x] = \mathbb P(E) + \mathbb P\left([Y<x-1]\cap E^\complement\right) = \frac 14 + \mathbb P[Y< x-1]\mathbb P(E) = \frac{3x - 2}4. $$
So $F_X(x) = \frac x4$ for $x<1$ and $F_X(x) = \frac {3x-2}4$ for $x>1$.
A: I thought I'd do it the way the book said and keep the other answer up so you can compare the two. 
Let $Y$ be the distance of the ambulance to the central point and let $J$ be the number of the street the ambulance is on.
Fix a value of $y = \frac ab$ for natural numbers $0< a< b$.  We want to know the probability that $Y<y$.
First, it doesn't matter what street the ambulance is on the probability that $Y<y$ doesn't change 
if you know what street the ambulance is on.
Now let's divide the street up into $b$ portions with equal lengths.  As the amblance is equally likely to be anywhere 
in the street the probability that it is in any one of the $b$ parts is $\frac 1b$.
Now there are $a$ of these parts that are closer to the centre than $\frac ab$ and $b-a$ of them that are further away.
So the probability that the ambulance is less than $y$ miles away from the centre is 
$$\mathbb P[Y<\frac ab] = a\times \frac 1b = \frac ab = y$$ 
The probability that the ambulance is more than $\frac ab$ miles away from the centre is
$$\mathbb P[Y>\frac ab] = (b-a)\times \frac 1b = \frac {b-a}b = 1-y$$ 
Now let $D_i$ be the event that $J=i$. 
The events $D_i$ are disjoint, they cannot occur together, so we have
$$ \mathbb P[X < x] = \sum_{i=1}^4 \mathbb P[X< x \cap D_i]$$
$$ \hphantom{\mathbb P[X < x]} = \sum_{i=1}^4 \mathbb P[X< x |D_i] \times \mathbb P[D_i] $$
Now we need to calculate $\mathbb P[X<x | D_i]$ for each $i$.
For $i=1$ The distance to the end of street one is $X = 1-Y$.  So we can say that 
$ \mathbb P[X< x |D_1] = \mathbb P[Y> 1-x] = 1-(1-x)=x$ for $x<1$ and $P[X< x |D_1] = 1$ for $x\geq 1$.
For $i = 2, 3$ or $4$ the distance to the end of street one is $X=Y+1$.
Therefore 
$ \mathbb P[X< x |D_i] = \mathbb P[Y< x-1] = x-1$ for $x>1$ and $P[X< x |D_1] = 0$ for $x\leq 1$.
Now for every $i$ we must have $\mathbb P(D_i) = \frac 14$.
Notice that the last three terms of the sum are all the same so we may write
$$ \mathbb P[X < x] = \sum_{i=1}^4 \mathbb P[X< x \cap D_i]$$
$$ \hphantom{\mathbb P[X < x]} = \mathbb P[X< x | D_1]\mathbb P(D_1) + 3\times\mathbb P[X< x | D_2]\mathbb P(D_2)$$
So for $x<1$ we have
$$ \mathbb P[X < x] = x\times \frac 14 + 3\times 0 \times \frac 14 = \frac x4$$
And for $x>1$ 
$$ \mathbb P[X < x] = 1\times \frac 14 + 3\times (x-1) \times \frac 14 = \frac {3x-2}4$$
I took quite a few shotcuts last time.  Firstly, I combined $D_2$, $D_3$ and $D_4$ into one event $E^\complement$.
This didn't affect the conditional probabilities for $X<x$. All it meant was I had a $\mathbb P(E^\complement)$ insted of 
$3\mathbb P(D_2)$ and I didn't have to use the sum.
Probably the biggest difference is that in my original answer I didn't explicitly use $\mathbb P[x<X|D_i]$.
Instead I introduced $Y$ and talked about the problem in terms of independence. 
I'm sorry if this confused you, there are some technical reasons for doing it that way which really don't matter at this level.
I also didn't make the point that for $x>1$ $\mathbb P[X< x | D_1] = 1$ this is obvious when it's pointed out 
(if the ambulance is on street one it's less than $x$ miles away if $x>1$.)
But it probably wasn't helpful that it just appeared in an equation near the end with no explanation.
