4. Let $1 \leqslant k<n$, consider all finite sequences of positive integers that sum to $n$, find the number of sequences with $k$ terms, denoted as $T(n, k)$.
4. Let $\left\{x_{1}, x_{2}, \cdots, x_{k}\right\}$ be a sequence of positive integers, satisfying $x_{1}+x_{2}+\cdots+x_{k}=n$. Let
$$
y_{i}=x_{1}+x_{2}+\cdots+x_{i}, i=1,2, \cdots, k \text {. }
$$

Then we have $0<y_{1}<y_{2}<\cdots<y_{k}=n$. Thus, $\left\{y_{1}, y_{2}, \cdots, y_{k-1}\right\}$ is a $(k-1)$-element subset of the set $\{1,2, \cdots, n-1\}$, and the correspondence $\left\{x_{1}, x_{2}, \cdots, x_{k}\right\} \longrightarrow\left\{y_{1}, y_{2}, \cdots, y_{k-1}\right\}$ is a bijection, i.e., a one-to-one correspondence. Therefore, we get $T(n, k)=$ $C_{n-1}^{k-1}$.