Probability of getting a sum of 5 = P(A)=4/36=1/9
Probability of getting a sum of 7 = P(B)=6/36=1/6
Probability that neither happens = P(N)=(1-10/36)=26/36
P(A happens before B) = P(A) + neither happen then A happens i.e.P(N)P(A)+ neither happens then neither happen then A happens i.e.P(N)P(N)P(A) + so on
It is an infinite Geometric Progression.
p =(1/9)/(1−(13/18))
p = 2/5