If you sum the amounts of each ingredient, you have a total of

So, the whole cocktail is 50ml. Of these, 10 are coconut milk. So, the ratio coconut : total is

X-(4.5+1.5+1+3)= 8
x-10=8
+10. +10
x= 18
He took $18 to the fair. You take his original amount and subtract the things he paid for/bought to get what he came home with. I hope it helps!
16x + 9 = 9y-2x Add 2x to both sides
18x + 9 = 9y Divide both sides by 9
2x + 1 = y Switch the sides to make it easier to read
y = 2x + 1