Probability of A happening = P(A) = 5/(3+5+4) = 5/12
Probability of B happening = P(B) = 4/(3+5+4) = 4/12
Probability of either happening = P(A) + P(B) = 5/12 + 4/12 = 7/12
The key word in their question is red OR green and that is why we add the two probabilities. If they ask the probability of them both happening (if they said red AND green), you would multiply P(A)*P(B).