4. Students $A$ and $B$ each have 3 cards. They play a game by tossing a fair coin, where if the coin lands heads up, $A$ wins a card from $B$, and if it lands tails up, $B$ wins a card from $A$. The game ends when one person has won all the cards. What is the probability that the game ends exactly after 5 coin tosses? $\qquad$
4. $\frac{3}{16}$ Detailed Explanation: Toss a coin 5 times. If $A$ wins, then among the first 3 tosses, there is exactly 1 tail, and the remaining 4 tosses are all heads; if $B$ wins, then among the first 3 tosses, there is exactly 1 head, and the remaining 4 tosses are all tails. Therefore, the required probability is $P=\frac{3+3}{2^{5}}=\frac{3}{16}$.