recategorized by
990 views
4 votes
4 votes
Let $\text{T}_{n}$ be the number of ways to arrange cars in a row with $n$ parking spaces if we can use sedans, SUVs, trucks to park such that a truck requires two spaces, whereas a sedan or SUV requires just one space each, and No two trucks are consecutively parked. (Assume that all trucks are identical, all sedans are identical, all SUVs are identical)
What is the value of $\text{T}_{7}?$
(Use the following data: $\text{T}_{1}=2 ; \text{T}_{2}=5 ; \text{T}_{3}=12$ i.e. initial conditions are already given, hence no need to compute them)
recategorized by

2 Answers

3 votes
3 votes

The recurrence relation for $\text{T}_{n}$ will be:
$$
\text{T}_{n}=2 \text{T}_{n-1}+2 \text{T}_{n-3}
$$
So, Since initial conditions are already given,
$$
\text{T}_{4}=28 ; \text{T}_{5}=66 ; \text{T}_{6}=156 ; \text{T}_{7}=368.
$$

Watch Complete Recurrence Relations in Discrete Mathematics  Complete Playlist to understand the concept:

https://youtube.com/playlist?list=PLIPZ2_p3RNHhhTH0o1JBMgscMUvxs4E_4

edited by
0 votes
0 votes

Let me try to explain this : 

_ _ _ _ nth: this is what we want to find.


T(n) → Truck at nth place: 

                    → Now we don't want a truck to be there at n-2th place because (n -2, n - 1) will be occupied by that truck

                    → So, we have 2 options: ………. SUV(n-2) (Truck at nth & n-1th place) or ………………….sedan(n-2) (Truck at nth & n - 1th place) that’s why we say { 2* T(n – 3)}

       → No truck at nth place: Whatever be the arrangement of everything beyond the nth place 

                     → …...sedan (SUV) or …….SUV (sedan) that’s we say { 2 * T(n-1)

Which will result in total of T(n) = 2*T(n-1) + 2*T(n-3).

edited by
Answer:

Related questions

3 votes
3 votes
1 answer
4