Present age of Selma = s
Present age of Joyce = j
Selma is now 3 times as old as joyce
s=3j........(1)
Four years ago,
s-4=j-4
then
Selma was 4 times as old as joyce
s-4=4(j-4)
s-4=4j-16
s=4j-16+4
s=4j-12.............(2)
Put the value of s in (2) from (1)
3j=4j-12
3j-4j=-12
-j=-12
Multiply by -1 both sides
j=12
Put the value of j in (1)
s=3j
s=3(12)
s=36
Present age of Selma = s = 36 years old
Present age of Joyce = j = 12 years old