the triangles are similar so that means there is a constant ratio for each side length. so comparing the ratios from the bigger triangle to the smaller triangle, leaves us with 9/3 and 15/5. if you take those and divide them you get 3 for both of them which is the constant. so then in order to find the length of AB just take the side length of XY (6) and divide it by 3 (the constant ratio) and there you have your answer!
First you make both fractions into 5 becomes 25/5. 2 4/5 becomes 14/5. Then you would just subtract 25/5 - 14/5 = 11/5 then make it a mixed number 2 1/5.