Given,
A bag contains six balls of different colours, two balls are drawn in succession with replacement,
The probability that both the balls are of the same colour will be p=366
Now Next four balls are drawn in succession with replacement and the probability that exactly three balls are of the same colours is q,
So, probability will be q=64C16×C15×C14=1296120=545
Now the ratio of p&q will be qp=59
Now, on comparing with qp=nm⇒m+n=14