The probability of obtaining the final state $| c' \rangle$ from an initial state $| a' \rangle$ is given by:
$${|\langle c' | b' \rangle|}^2 {|\langle b' | a' \rangle|}^2$$
Consider the first experiment where the $B$ filter is present. Let's say the orthonormal eigenstates $| b' \rangle$ are $| 0 \rangle, | 1 \rangle, | 2 \rangle, \cdots$. The $B$ filter selects one eigenstate $| b' \rangle$ per experiment. We wish to know what the probability will be when any $| b' \rangle$ is selected. 680
Then, the probability of measuring any $| b' \rangle$ with the $B$ filter amounts to:
\begin{equation} \begin{aligned} \text{Measuring any $| b' \rangle$} =& \text{ Measuring $| 0 \rangle$ or Measuring $| 1 \rangle$ or Measuring $| 2 \rangle$ or} \cdots\ =& \ {|\langle c' | 0 \rangle|}^2 {|\langle 0 | a' \rangle|}^2 + {|\langle c' | 1 \rangle|}^2 {|\langle 1 | a' \rangle|}^2 + {|\langle c' | 2 \rangle|}^2 {|\langle 2 | a' \rangle|}^2 + \cdots\ =& \ \sum_{b'} {|\langle c' | b' \rangle|}^2 {|\langle b' | a' \rangle|}^2\ =& \ \sum_{b'} \langle c' | b' \rangle \langle b' | a' \rangle \langle a' | b' \rangle \langle b' | c' \rangle \qquad ---(1) \end{aligned} \end{equation}
Note that there is a single summation over the eigenstates $| b' \rangle$.
When there is no $B$ filter present, the probability is simply:
\begin{equation} \begin{aligned} \text{Measuring no $| b' \rangle$} =& \ |\langle c' | a' \rangle|^2\ =& \ \sum_{b'} \sum_{b''} \langle c' | b' \rangle \langle b' | a' \rangle \langle a' | b'' \rangle \langle b'' | c' \rangle \qquad ---(2) \end{aligned} \end{equation}
where the completeness relation $\displaystyle \sum_{b'} |b' \rangle \langle b' |$ has been inserted twice.
Say:
$$A | a' \rangle = a' |a' \rangle$$
$$B | b' \rangle = b' |b' \rangle$$
$$C | c' \rangle = c' |c' \rangle$$
Now, assume that $A$ and $B$ are compatible observables: $[A,B] = 0$. (We also assume absence of any degeneracy.) Then $A$ and $B$ have simultaneous eigenkets. We rewrite $(2)$ in the following way:
\begin{equation} \begin{aligned} \sum_{b'} \langle c' | b' \rangle \langle b' | a' \rangle \sum_{b''} \langle a' | b'' \rangle \langle b'' | c' \rangle \end{aligned} \end{equation}
Since the eigenkets of $A$ and $B$ are simultaneous, $| a' \rangle$ and $| b' \rangle$ span the same eigenspace, and only one of the inner products $\langle b' | a' \rangle$ in the first sum over $b'$ will be nonzero. Let's assume that the nonzero inner product occurs for $b' = e$. In the second sum over $b''$, the inner product $\langle a' | b'' \rangle$ will be nonzero only for $b'' = e$. 66