Example 4 Given $S=\{1,2,3,4\}$. Let $a_{1}, a_{2}, \cdots, a_{k}$ be a sequence of numbers from $S$, and it includes all permutations of $(1,2,3,4)$ that do not end with 1, i.e., if $\left(b_{1}, b_{2}, b_{3}, b_{4}\right)$ is a permutation of $(1,2,3,4)$ and $b_{4} \neq 1$, then there exist $1 \leqslant i_{1}<i_{2}<i_{3}<i_{4} \leqslant k$, such that
$\left(a_{i_{1}}, a_{i_{2}}, a_{i_{3}}, a_{i_{4}}\right)=\left(b_{1}, b_{2}, b_{3}, b_{4}\right)$. Find the minimum value of the number of terms $k$ in such a sequence.
Since $a_{1}, a_{2}, \cdots, a_{k}$ includes all permutations of $(1,2,3,4)$ where the second number is 1, there exists
$$
1 \leqslant i_{1}<i_{2}<i_{3}<i_{4}<i_{5}<\cdots<i_{m} \leqslant k,
$$

such that $\left(a_{i_{1}}, a_{i_{2}}, a_{i_{3}}\right)$ is a permutation of $(2,3,4)$, $a_{i_{4}}=1$, and $a_{i_{5}}, \cdots, a_{i_{m}}$ is a sequence composed of elements from $\{2,3,4\}$, and includes all permutations of any two elements from $\{2,3,4\}$. It is easy to see that $a_{i_{5}}, \cdots, a_{i_{m}}$ must have at least 5 terms, i.e., $m \geqslant 9$.
Clearly, adding any term to the sequence $a_{i_{1}}, \cdots, a_{i_{m}}$ would not satisfy the required property, so $k \geqslant$
11.

On the other hand, it is easy to verify that the sequence $1,3,2,4,1,2,3,1,4,3,2$ includes all permutations of $(1,2,3,4)$ that do not end with 1. Therefore, the minimum value of the number of terms $k$ is 11.