Let number of red only balls be \(a\) and green only ball be \(b\) and both red and green be \(c\).
So we can say \(a+b+c=87\).
2/7 of the balls that have red color also have green color
So \(\frac{c}{(a+c)}= \frac{2}{7}\).
3/7 of the balls that have green color also have red color
So \(\frac{c}{(b+c)}=\frac{3}{7}\).
Inverting both fractions and adding them
\(\frac{(a+c)}{c}+\frac{(b+c)}{c}=\frac{7}{3}+\frac{7}{2}\)
Subtracting 1 from both sides
\(\frac{a+b+2c}{c}-1= \frac{35}{6}-1\).
\(\frac{a+b+c}{c}=\frac{29}{6}\)
Inverting again
\(\frac{c}{a+b+c}=\frac{6}{29}\).
Our objective was always to find \(\frac{c}{a+b+c}\).
Hence option D is correct.
_________________