Mary is 24 years old.  
Let Ann be A years old. 
Mary is twice as old as Ann was x years ago, which was (A - x). 
Also x years ago, Mary was (24 - x), and that is how old Ann is now,
which is A. 
x years ago, Mary was 24 - x
x years ago, Ann was A - x
So the equations comes from:
         
 = 2·
and
         
 = 
So the system of equations is
                24 = 2(A - x)
                24 - x = A
Solve that system and get x = 6 and A = 18.
So 6 years ago Ann was 12 and Mary is twice that now.
Edwin