Zero-mean random variable for the number of descents Let $S_i$ be the symmetric group defined over $i$ elements. $D_i$  is the random variable counting the number of descents of a random permutation in $S_i$. As an example for the set $\{1,2,3,4\}$, the permutation $\{2,1,4,3\}$ would have 2 descents, $2,1$ and $4,3$. We can create a martingale out of $D_n$ by scaling and subtracting the mean. $Z_n=n(D_n-\frac{n-1}{2})$ is this martingale with filtration $F_n$.
Now let $X_{n,i}$ be defined as $$X_{n,i}= \frac{Z_i-Z_{i-1}}{s_n}$$
where $s_n=\sqrt{Var(Z_n)}=n\sqrt{\frac{n+1}{12}}$.
With this one can get
$$X_{n,i}= \frac{\sqrt{12}}{n\sqrt{n+1}}(iD_i-(i-1)D_{i-1}-(i-1)).$$
Let $Wi:=D_i - \frac{i-1}{2}$ be the zero-mean random variable for the number of descents. How do I show that
$$X_{n,i}|F_{i-1}= \frac{\sqrt{12}}{n\sqrt{n+1}}\begin{cases} W_{i-1}-\frac{i}{2},& \text{with prob.} \frac{1}{2}+\frac{W_{i-1}}{i}. \\
W_{i-1}+\frac{i}{2},& \text{with prob.} \frac{1}{2}-\frac{W_{i-1}}{i}.
\end{cases}?$$
While it is clear for me that the part before then cases is just from the constant $s_n$, I'm not sure how to get the cases and their respective probabilities
 A: Let $(a_1, \ldots, a_{i-1}, a_i)$ be a random permutation of $(1, \ldots, i-1, i)$. Then, by removing the element $i$ from $(a_1, \ldots, a_{i-1}, a_i)$, we get a random permutation $(b_1, \ldots, b_{i-1})$ of $(1, \ldots, i-1)$. $D_i$ is the number of descents in $(a_1, \ldots, a_{i-1}, a_i)$ while $D_{i-1}$ is the number of descents in $(b_1, \ldots, b_{i-1})$.
Now, thinking the other way, notice that the element $i$ can be introduced into the arrangement $(b_1, \ldots, b_{i-1})$ in $i$ ways: either in one of the $(i-2)$ gaps between the consecutive elements of $(b_1, \ldots, b_{i-1})$ or in one of the two ends. Also notice that a descent is formed by two consecutive elements: if the first element is larger than the following element, it counts as a descent, otherwise it is not. This way, the $D_{i-1}$ descents can be viewed to correspond to $D_{i-1}$ of the $(i-2)$ gaps in the arrangement $(b_1, \ldots, b_{i-1})$. Suppose the element $i$ is placed in the gap between the consecutive elements $b_k$ and $b_{k+1}$, where $b_k$ and $b_{k+1}$ constitute a descent, i.e., $b_k > b_{k+1}$. Then, since $i > b_k, b_{k+1}$, the number of descents $D_i$ in the resulting arrangement $(a_1, \ldots, a_{i-1}, a_i)$ will be the same as the number of descends $D_{i-1}$ in the previous arrangement $(b_1, \ldots, b_{i-1})$, because placing the element $i$ in this way removes the previous descent $(b_k, b_{k+1})$ but adds the new descent $(i, b_{k+1})$, and all other descents remain intact. Also, if $i$ is placed after $b_{i-1}$, the number of descents does not change. So, the number of descents does not change if the element $i$ is placed in any of the $(D_{i-1} + 1)$ places. On the other hand, if the element $i$ is placed in any of the remaining $(i - (D_{i-1} + 1))$ places, the number of descents increases by $1$ as $i > b_l$ for $l = 1, \ldots, i-1$. Since the placement of $i$ in any of these $i$ places is equally likely, we have, given $D_{i-1}$,
\begin{align}
D_i =
\begin{cases}
& D_{i-1} &&\text{with probability } \frac{D_{i-1} + 1}{i} ,\\\\
& D_{i-1} + 1 &&\text{with probability } \frac{i - (D_{i-1} + 1)}{i} .
\end{cases}
\end{align}
Note that the conditional distribution of $D_i$ given $D_{i-1}, \ldots, D_1$ is the same as the conditional distribution of $D_i$ given $D_{i-1}$, for all $i$.
So, from the definition of $X_{n,i}$, we have
\begin{align}
X_{n,i} | F_{i-1} = \frac{\sqrt{12}}{n \sqrt{n+1}}
\begin{cases}
& (D_{i-1} + 1 - i) &&\text{with probability } \frac{D_{i-1} + 1}{i} ,\\\\
& (D_{i-1} + 1) &&\text{with probability } \frac{i - (D_{i-1} + 1)}{i} .
\end{cases}
\end{align}
Since $W_{i-1} = D_{i-1} + 1 - \frac{i}{2}$ from the definition, we have
\begin{align}
X_{n,i} | F_{i-1} = \frac{\sqrt{12}}{n \sqrt{n+1}}
\begin{cases}
& W_{i-1} - \frac{i}{2} &&\text{with probability } \frac{1}{2} + \frac{W_{i-1}}{i} ,\\\\
& W_{i-1} + \frac{i}{2} &&\text{with probability } \frac{1}{2} - \frac{W_{i-1}}{i} .
\end{cases}
\end{align}
