4. Two players, A and B, are playing a game that is a best-of-seven series, where the first to win four games is declared the winner, and the series ends. If in each game, both players have a $\frac{1}{2}$ probability of winning, then the expected value of the number of games by which the winner exceeds the loser is $\qquad$
4. $\frac{35}{16}$.

For $i=4,5,6,7$, if the game ends after the $i$-th round, then in the first $i-1$ rounds, exactly three rounds are won by the winner of the $i$-th round, and the corresponding probability is $\frac{\mathrm{C}_{i-1}^{3}}{2^{i-1}}$. At this point, the winner has won $4-(i-4)=8-i$ more rounds than the loser, so the expected value is
$$
\begin{array}{l}
\quad \sum_{i=4}^{7} \frac{C_{i-1}^{3}}{2^{i-1}}(8-i) \\
\quad=\frac{1}{8} \times 4+\frac{4}{16} \times 3+\frac{10}{32} \times 2+\frac{20}{64} \times 1 \\
=\frac{35}{16} .
\end{array}
$$