Let I(a,b) denote the integral from a to b. It is obvious that f(x)=0 for x<1.
It is obvious that f(x)=1 for 1<=x<2.
If 2<=x<=3 then f(x)=1+2*(x-2)/(x-1). This can be found by using simple geometry which is left for you to do.
Now lets solve x=4. The first car will divide the rest of the street into a small and a large portion, lets call them s and l. s is equally likely to range from 0 to 3/2. l is equally likely to range from 3/2 to 3. The probability that the smaller portion is less than 1 is 2/3. Likewise the probability that smaller portion is greater than 1 is 1/3. If the smaller portion is greater than 1 then exactly 3 cars will be able to park. If the smaller portion is less than one the number than will be able to park is 1+f(l).
f(x) = 1/3*3 + 2/3*(1+f(l), where l goes from 2 to 3)
= 1 + 2/3*(1 + I(2,3) 1+2*(x-2)/(x-1) dx)
= 1 + 2/3 + 2/3 + 4/3*I(2,3) (x-2)/(x-1) dx, next let y=x-1
= 1 + 4/3 * 4/3 * I(1,2) (y-1)/y dy
= 7/3 + 4/3 * I(1,2) 1 - 1/y dy
= 7/3 + 4/3 * (y-ln(y) for y from 1 to 2)
= 7/3 + 4/3 * (2-ln(2)-1+ln(1))
= 7/3 + 4/3 - 4/3*ln(2)
= 11/3 - 4/3*ln(2)
=~ 2.7425
Michael Shackleford, A.S.A.