Through the toll plaza vehicles pass each other. Mirko keeps a record order of passing vehicles according to the following types: motorcycle, bus and truck. How many possible sequence of passage of vehicles through the toll on a given day if it is known that there were 250 vehicles, motorcycles were even numbers, buses odd and trucks were exactly 5 and no two trucks were not adjacent?
My work:
I try first solve problem without no two trucks were not adjacent.
Idea is to use generating function.
$$(1+x^2+x^4+...)*(x^1+x^3+...)*x^5$$ and we are looking for the coefficient $<x^{250}>$. If we rewrite a little ...
$$(1+x^2+x^4+...)^2$$ and we are looking for the coefficient $<x^{244}>$.
$$\frac{1}{(1-x^2)^2}=(1-x^2)^{-2}$$
We know $$-2+122-1\choose{2}$$$$=<x^{244}>.$$
What about the othere part of task?
2026-04-03 13:32:53.1775223173
On
Generating functions - combinatorics problem of Mirko couting vehicles through the toll
85 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
2
On
We can treat the trucks up until the very end.
First lets solve the problem in which we have an even number of motorcycles, an even number of buses and $245$ vehicles. We just have to select the positions occupied by the motorcycles.
The number of possibilities is $\sum\limits_{i=0}^{122}\binom{245}{2i}=2^{245-1}$.
After this notice that there are going to be $246$ positions where we can select to insert one of the trucks. So we have to multiply this by $\binom{246}{5}$.
Hence the final answer is $2^{244}\binom{246}{5}$.
Here is an answer based upon generating functions. We can reformulate the problem as follows.
In order to obtain a generating function which respects that no two consecutive $t$'s occur, we consider Smirnov words built from $V$. These are words with no consecutive equal letters at all. See e.g. example III.24 in Analytic Combinatorics by P. Flajolet and R. Sedgewick. So,
\begin{align*} mtbmtmtmbtbt \end{align*} is a Smirnov word, while $mmt$ is not a Smirnov word.
Replacing $m$ with one or more $m$'s means to substitute \begin{align*} m\rightarrow m+m^2+m^3+\cdots=\frac{m}{1-m} \end{align*} and the same holds for $b$. We also need later to count the number of $m$'s and $b$'s and so we tag them with $z$.
Comment:
In (2) we apply the linearity of the coefficient of operator and use the rule $$[z^p]z^qA(z)=[z^{p-q}]A(z)$$
In (3) we use the binomial series expansion.
In (4) we use the binomial identity $$\binom{-p}{q}=\binom{p+q-1}{q}(-1)^q$$
In (5) we select the coefficient of $z^{241}$.