Here's my thoughts, but it might be wrong:
I. Solve the probability of getting one red ball with stars and one blue ball with stars for exact 5 times.
1.1 Number of all possible ways of selecting 10 pairs of red/blue balls are
C(20,10)*C(20,10).
1.2 Number of ways to select 5 red-star balls is
P_5r = C(12,5)*C(20-12,5)
1.3 Number of ways to select 5 blue-star balls is
P_5b = C(7,5)*C(20-7,5)
1.4 Number of ways to select 5 pairs of red/blue balls with at least one ball has star in each pair:
P_5r*P_5b -----anything wrong in this step?
1.5 Number of ways to select 5 pairs of red/blue balls with only one ball has star in each pair:
P_5r*C(20-7,10)+C(20-12,5)*P_5b
1.6 Number of ways to select 5 pairs of red-star/blue-star balls is
P_5r*P_5b - P_5r*C(20-7,10) - C(20-12,5)*P_5b
The probability of getting exact 5 pairs of red-star/blue-star balls is
[P_5r*P_5b - P_5r*C(20-7,10) + C(20-12,5)*P_5b]/[C(20,10)*C(20,10)]
II. To get solution for "at least 5 times", just use 1 - probability of
exact 0 time - probability of exact 1 time ... probability of exact
4 time