[Math] There are 12 spaces in a parking lot, occupied by 8 cars.

combinatoricsproblem solving

There are 12 spaces in a parking lot, occupied by 8 cars. A garbage truck shows up, what is the probability that it will be able to park given the garbage truck takes up 2 spaces?

My solution
There are 12C4 possible combinations of cars and spaces. If there are two spaces together then to count them group two of the empty spaces together and count them as one. There are now 11C8 possible combinations of these spaces plus cars, so the probability is (11C3/12C4). Is this correct?

Best Answer

It’s not quite that simple. Consider the case in which the first $4$ spaces are free. You’ve counted this combination $3$ times, once with the first $2$ free spaces as your linked pair, once with the middle $2$ free spaces as your linked pair, and once with the last $2$ free spaces as your linked pair. Cases with a block of $3$ free spaces and an isolated free space are counted twice each, as are cases with two disjoint blocks of $2$ free spaces.

It’s easier to count the arrangements in which there is no place for the garbage truck to park. These are the arrangements in which there is at least one car between any two free spaces. Think of the $4$ free spaces as markers between $5$ possible blocks of cars: cars can go before the first marker, between any two adjacent markers, or after the last marker. we want to know how many ways there are to put $8$ cars into those $5$ blocks so that there is at least one car in each of the $3$ internal blocks.

If we imagine putting one car into each of those blocks, we’re left with $5$ cars that can go into any of the $5$ blocks. Counting the ways to do this is a standard stars and bars problem: there are

$$\binom{5+5-1}{5-1}=\binom94=126$$

ways. (There is a reasonably clear explanation of this result at the link.) Since there are, as you say, $\binom{12}4=495$ possible arrangements altogether, the answer to the problem is

$$1-\frac{126}{495}=1-\frac{42}{165}=\frac{123}{165}=0.7454545\ldots\;.$$

Related Question