Problem: $(\text{a})$ Let $k, n \geq 1$. Find the number of sequences $\emptyset=S_0, S_1, \ldots, S_k$ of subsets of $[n]$ if for all $1 \leq i \leq k$ we have either $(\text{i}) \ S_{i-1} \subset S_i$ and $\left|S_i-S_{i-1}\right|=1$, or $(\text{ii}) \ S_i \subset S_{i-1}$ and $\left|S_{i-1}-S_i\right|=1$.
$(\text{b})$ Suppose that we add the additional condition that $S_k=\emptyset$. Show that now the number $f_k(n)$ of sequences is given by \begin{align*} f_k(n)=\frac{1}{2^n} \sum_{i=0}^n\binom{n}{i}(n-2 i)^k. \end{align*} Note that $f_k(n)=0$ if $k$ is odd.
For $(\text{a})$, let the number of elements in $S_i$ be $s$. There are two ways to obtain $S_{i+1}$. The first is to choose one element from the remaining $n-s$ elements and add it to $S_i$; the second is to remove one element from the $s$ elements. Therefore, there are $n$ choices at each step, so the number of sequences that satisfy the condition is $n^k$.
However, I don't have many ideas for $(\text{b})$. I believe it is related to Dyck paths or Catalan numbers. The difference from Dyck paths is that here, each step has a weight associated with it. When $k$ is odd, it is easy to understand why $f_k(n)=0$, because an odd number of steps will always change the parity of the number of elements. Perhaps this problem can be solved by using a recurrence relation similar to $D_n=\sum_{a=1}^n D_{a-1} D_{n-a}$ and generating function.