The bag contains 2+4+2=8 marbles in total.
We are going to find a probability of the opposite event: drawing marbles of same color.
There are three possibilities:
1. Drawing both green marbles
2. Drawing both yellow marbles
3. Drawing both red marbles
The probability of drawing both green marbles:
[tex]P_1=\frac{2}{8}\cdot \frac{1}{7} = \frac{1}{4}\cdot \frac{1}{7}=\frac{1}{28}[/tex]
The probability of drawing both yellow marbles:
[tex]P_2=\frac{4}{8}\cdot \frac{3}{7} = \frac{1}{2}\cdot \frac{3}{7}=\frac{3}{14}[/tex]
The probability of drawing both red marbles:
[tex]P_3=\frac{2}{8}\cdot \frac{1}{7} = \frac{1}{4}\cdot \frac{1}{7}=\frac{1}{28}[/tex]
So, the probability of drawing marbles of the same color is:
[tex]P=P_1+P_2+P_3=\frac{1}{28}+\frac{3}{14}+\frac{1}{28}=\frac{2}{28}+\frac{3}{14}=\frac{1}{14}+\frac{3}{14}=\frac{4}{14}=\frac{2}{7}[/tex]
Now, the probability of drawing marbles of different colors is:
[tex]1-\frac{2}{7}=\frac{5}{7}=0.7142[/tex]