1

For each $n \in \mathbb{N}$, let the sequence $m_n$ be defined by \begin{equation} m_n(x) = |\{(a_1, \ldots, a_{x+1}) \in \{1, \ldots, n\}^{x + 1} \mid a_1 = a_{n + 1}, \hspace{1mm} a_i \neq a_{i+1} \text{ for all } i\}| \end{equation}

That is, $m_n(x)$ is the cardinality of the set of all lists of length $x+1$ of numbers in $\{1, \ldots, n\}$, such that the first and last numbers in the list are equal, and such that no two consecutive elements in the list are equal. I want to show that $m_n(x) = tr((B - I)^n)$, where $B$ is the $n \times n$ matrix will all entries equal to $1$.

Here are my observations:

  • The trace of a matrix $A$, by definition, is the sum of the eigenvalues of the matrix $A$, counting multiplicities.
  • If $\lambda_1, \ldots, \lambda_n$ are the eigenvalues of a matrix $A$, then the eigenvalues of the matrix $A^k$ are exactly $\lambda_1^k, \ldots, \lambda_n^k$ (from here).
  • $B - I$ is the matrix with main diagonal $0$ and all other entries $1$. From my work, it seems that row-reducing $B - I$ always leads to $I$ itself, and always involves an odd number of row swaps. Thus, I believe the determinant of $B - I$ is always $-1$, but I'm not sure about the trace.
  • I also tried to combinatorically compute the size of $m_n(x)$. If we let

\begin{equation} D^K_{ij}(x) = |\{(a_1, \ldots, a_{x + 1}) \in \{1, \ldots, K\}^{x + 1} \mid a_y \neq a_{y+1} \text{ for all } y, \text{ and } a_1 = i, a_{x+1}=j\}| \end{equation}

  • ...then we have the recurrence $D^K_{ij}(x) =$ the sum of all $D^K_{ib}(x - 1)$ such that $b \neq j$.

Could someone give hints/provide a solution to this problem?

1 Answers1

2

I believe you meant to write $m_n(x)=\operatorname{tr}((B-I)^x)$ and also $a_1=a_{x+1}$ in the definition of $m_n(x).$

There is a very nice solution to this problem using adjacency matrix. The matrix $B-I$ is adjacency matrix of the complete graph on $n$ vertices. A property of adjacency matrix is that the entry $(i,j)$ in the $x$-th power of the matrix equal the number of walk of length $x$ from vertex $i$ to vertex $j$ in the corresponding graph, so each diagonal entry of $(B-I)^x$ is the number of walks of length $x$ of a vertex to itself in the complete graph. Thus, the number $\operatorname{tr}(B-I)^x$ is the total number of walks of this form. The equality easily comes from the fact that each walk corresponds to a list in the definition of $m_n(x).$

duck
  • 583
  • 2
  • 7