3. Person A has a box, inside there are 4 balls in total, red and white; Person B has a box, inside there are 2 red balls, 1 white ball, and 1 yellow ball. Now, A randomly takes 2 balls from his box, B randomly takes 1 ball from his box. If the 3 balls drawn are all of different colors, then A wins. To ensure A has the highest probability of winning, the number of red balls in A's box should be
3.2.

Suppose box A contains $n(n \geqslant 1)$ red balls, then it has $4-n$ white balls.
Therefore, the probability of A winning is
$$
P=\frac{\mathrm{C}_{n}^{1} \mathrm{C}_{4-n}^{1}}{\mathrm{C}_{4}^{2} \mathrm{C}_{4}^{1}}=\frac{1}{24} n(4-n) \text {. }
$$

Since $\sqrt{n(4-n)} \leqslant \frac{n+4-n}{2}=2$, that is,
$$
n(4-n) \leqslant 4 \text {, }
$$

the equality holds if and only if $n=2$, at which $P$ is maximized.