Probability of getting a sum of 5 is 436=19=P(A) as favorable cases are {(1,4),(4,1),(2,3),(3,2)}. Similarly, favorable cases of getting a sum of 7 are {(1,6),(6,1),(2,5),(5,2),(3,4).(4,3)}. The total number of such cases is 6. Therefore, the probability of getting a sum of 5 or 7 is 16+19=518(as events are mutually exclusive)
Hence, the probability of geting neither a sum of 5 nor a sum of 7 is 1−518=1318.
Now, we get a sum of 5 before a sum of 7 if either we get a sum of 5, in first chance or we get neither a sum of 5 nor a sum of 7 in first chance and a sum of 5 in second chance and so on.
Therefore the recquired probability is
19+1318×19+1318×1318×19+⋯+∞=1/91−13/18=25