Let x represent the numbers of ghosts on Friday
y represent the numbers of ghouls on Friday
z represent the numbers of goblins on Friday
Their total is 51, so x+y+z= 51
On Friday, there were half as many ghosts as there was goblins
so x = z/2.
Given: On Saturday, two-thirds of the ghouls each became a ghost.
so the number of ghosts on Saturday is

the number of ghouls is

Given : On Sunday, 11 of the ghosts each became a goblin, and the ratio of ghouls to goblins became 1:3.
On Sunday, the number of ghosts is

the number of ghouls is 1/3y
and the number of goblins is z+11.
Given : The ratio of ghouls to goblins is 1:3, so ...
make a fraction and cross multiply it
y = z+ 11
From the relationship we got
x +y +z = 51

y =z+11
Replace second and third equation in the first equation
multiply the whole equation by 2
z +2z +22 +2z = 102
5z + 22 = 102
Subtract both side by 22
5z= 60 ( divide both sides by 5)
z= 16

Plug in 16 for z
So x= 8
y =z+11
so y = 16+11= 27
x=8 , y=27 and z=16
The number of ghosts on Friday = 8
the number of ghosts on Saturday is
= 8 + 18 = 26
the number of ghosts on Sunday is
= 8 + 18 -11=15