AB = 7.5
Since the two triangles are similar, the ratio of the lengths of corresponding sides will be constant. So:
BC/YC = AB/XY
We now just need to solve for AB, substitute the known values, and calculate. So:
BC/YC = AB/XY
XY*BC/YC = AB
5*6/4 = AB
30/4 = AB
7.5 = AB
So the length of AB is 7.5