Question 526482
We must assume that there only ghosts, vampires, and witches at the costume party.
Or we must assume the given total is only ghosts, vampires, and witches.
.
g = number of ghosts
v = number of vampires
w = number of witches
.
g + v + w = 335
.
v + 31 = w
or
v = w - 31
.
g = 4*(v+w)
.
substitute for v
.
g = 4*(w-31 +w)
.
g = 4w - 124 +4w
.
g = 8w -124
.
we now have all three variables defined in terms of 'w' so we can substitute these into the total equation
.
(8w-124) + (w-31) + w = 335
.
collect terms
.
10w -155 = 335 
.
10w = 490
.
w = 49
.
v = w -31
.
v = 49-31
.
v = 18
.
g = 4*(49+18)
.
g = 268
.
Check the total
18 + 49 + 268 = 335
.
Answer:  The party was attended by 268 ghosts, 18 vampires, and 49 witches.
.
Done.