# Parking 2 cars in an empty lot

#### williamrobertsuk

##### New member
Find the problem attached.

Last edited by a moderator:

#### MarkFL

##### Super Moderator
Staff member
I've given all 4 of your threads, which had identical non-descriptive titles, good titles and attached the images inline so they can be read while replying. In each of your 4 threads, please show what you have done so far, so our helpers know where you are stuck and how best to guide you.

#### pka

##### Elite Member
"At most one" means none or one. If they are parked side-by-side that can be done in $$\displaystyle n-1$$ ways. WHY?
If they are parked with exactly one space between them that can be done in $$\displaystyle n-2$$ ways. WHY is that?
What is the total number of ways the two cars can be parked in $$\displaystyle n\ge 2$$ places?

#### williamrobertsuk

##### New member
I've given all 4 of your threads, which had identical non-descriptive titles, good titles and attached the images inline so they can be read while replying. In each of your 4 threads, please show what you have done so far, so our helpers know where you are stuck and how best to guide you.
Thanks Mark, I am new at the forum, I will try to be better! I just try to find some results on those on some hobby I have!

#### williamrobertsuk

##### New member
"At most one" means none or one. If they are parked side-by-side that can be done in $$\displaystyle n-1$$ ways. WHY?
If they are parked with exactly one space between them that can be done in $$\displaystyle n-2$$ ways. WHY is that?
What is the total number of ways the two cars can be parked in $$\displaystyle n\ge 2$$ places?
pka - It doesn't seem to be correct!

#### pka

##### Elite Member
pka - It doesn't seem to be correct!
Why did you ignore my request for reasons for the answers I gave?
If they do not seem to be correct you must tell me why they seem to be incorrect.
Here is the model: Draw n empty boxes a page. Number each box $$\displaystyle 1,2,\cdots,n$$.
If we randomly assign(by a draw, by a computer program ), two of those numbers to the two people. What is the probability their numbers will differ by no more than two? That mean the numbers are consecutive(next to each other) or there is one number between them(one space between them).
If that model is incorrect, then you must correct it. It is what you posted.

#### williamrobertsuk

##### New member
Why did you ignore my request for reasons for the answers I gave?
If they do not seem to be correct you must tell me why they seem to be incorrect.
Here is the model: Draw n empty boxes a page. Number each box $$\displaystyle 1,2,\cdots,n$$.
If we randomly assign(by a draw, by a computer program ), two of those numbers to the two people. What is the probability their numbers will differ by no more than two? That mean the numbers are consecutive(next to each other) or there is one number between them(one space between them).
If that model is incorrect, then you must correct it. It is what you posted.
Therefore, I am also a bit confused with it!

#### pka

##### Elite Member
Therefore, I am also a bit confused with it!
Tell us about your confusion. We cannot help if all you say is "I am confused"
Take the ten digits $$\displaystyle 0,1,2,3,4,5,6,7,8,9$$ on balls as in the lottery. The machine picks two of them at random.
What is the probability the two numbers a consecutive or differ by one?

#### williamrobertsuk

##### New member
(4*n-6)/(n*(n-1))

#### MarkFL

##### Super Moderator
Staff member
Let's first determine how many ways there are for the two cars to be parked. The first car to park has $$n$$ choices and the second has $$n-1$$ choices. Thus, there is a total of $$N_T=n(n-1)$$ ways for the two cars to park. Now, if there can be at most 1 space between them, we can enumerate the spaces from 1 to $$n$$, and given the spaces are in a single row, we can proceed to count the favorable number of arrangements as follows:

The first car has 2 choices of spots where the second car has 2 choices (this is on either end, spots 1 and $$n$$).

The first car has 2 choices of spots where the second car has 3 choices (spots 2 and $$n-1$$).

The first car has $$n-4$$ choices of spots where the second car has 4 choices (spots 3 through $$n-2$$).

Thus, adding these up, we find:

$$\displaystyle N_F=2\cdot2+2\cdot3+(n-4)4=4n-6$$

Hence:

$$\displaystyle P(X)=\frac{N_F}{N_T}=\frac{4n-6}{n(n-1)}\quad\checkmark$$