  We begin our analysis with the study of two collections of lattice paths in
the plane, denoted $\mathcal{D}_{[n,i,j]}$ and $\mathcal{P}_{[n,i,j]}$. These
paths consist of sequences of $n$ steps, where each step allows movement in
three directions: upward (with a maximum displacement of $q$ units), rightward
(exactly one unit), or downward (with a maximum displacement of $p$ units). The
paths start from the point $(0,i)$ and end at the point $(n,j)$. In the
collection $\mathcal{D}_{[n,i,j]}$, it is a crucial constraint that paths never
go below the $x$-axis, while in the collection $\mathcal{P}_{[n,i,j]}$, paths
have no such restriction. We assign weights to each path in both collections
and introduce weight polynomials and generating series for them. Our main
results demonstrate that certain matrices of size $q\times p$ associated with
these generating series can be expressed as matrix continued fractions. These
results extend the notable contributions previously made by P. Flajolet and G.
Viennot in the scalar case $p=q=1$. The generating series can also be
interpreted as resolvents of one-sided or two-sided difference operators of
finite order. Additionally, we analyze a class of random banded matrices $H$,
which have $p+q+1$ diagonals with entries that are independent and bounded
random variables. These random variables have identical distributions along
diagonals. We investigate the asymptotic behavior of the expected values of
eigenvalue moments for the principal $n\times n$ truncation of $H$ as $n$ tends
to infinity.
