The number of people who went to the movies is X
Half went to a restaurant -> X/2
Of those who did not go to the restaurant (X/2) -> half went for a walk (X/4) + 4 returned to their houses. There were 5 left
with that information, we can write the following equation:
[tex]\frac{x}{2}=\frac{x}{4}+4+5[/tex]now, we just need to solve for x, as follows
[tex]\begin{gathered} \frac{x}{2}=\frac{x}{4}+4+5 \\ \frac{x}{2}=\frac{x}{4}+9 \\ \frac{x}{2}-\frac{x}{4}=9 \\ x(\frac{1}{2}-\frac{1}{4})=9 \\ x(\frac{2}{4}-\frac{1}{4})=9 \\ x(\frac{2-1}{4})=9 \\ x\cdot(\frac{1}{4})=9 \\ x=4\cdot9 \\ x=36 \end{gathered}[/tex]in conclusion, 36 people went to the movies