4. Suppose Bag A contains 4 white balls, 5 red balls, and 6 black balls; Bag B contains 7 white balls, 6 red balls, and 2 black balls. If one ball is drawn from each bag, then the probability that the two balls are of different colors is
(use the simplest fraction as the answer).
4. $\frac{31}{45}$.

The probability that the two balls have the same color is
$$
P=\frac{4 \times 7+5 \times 6+6 \times 2}{15 \times 15}=\frac{14}{45},
$$

Therefore, the probability that the two balls have different colors is $1-\frac{14}{45}=\frac{31}{45}$.