Situation 1:
\(\frac{g}{b}=2\rightarrow g=2b\)
Situation 2:
\(\frac{g+24}{b}=5\\
\\
g+24=5b\)
Replacing g in the second equation:
\(2b+24=5b\\
\\
3b=24\\
\\
b=8\\
\\
g=2b\\
\\
g=16\)
In the Situation 1 there was 16 girls and 8 boys = 24 persons
In the Situation 2 there are 40 girs + 8 boys = 48 persons