Alright, lets get started.
Suppose the initial number of girls = x
Suppose the initial number of boys = y
The ratio of the number of girls to the number of boys is 3:1 (given in question)
x/y = 3/1
Cross multiply
x = 3 y ...............................equation (1)
one girl drops the class and three more boys sign up means new number of gilrs = x - 1
New number of boys = y + 3
the ratio of the number of girls to the number of boys becomes 5:2
(x-1) / (y+3) = 5/2
Cross multiplying
2 (x-1) = 5 (y+3)
2 x - 2 = 5 y + 15
Adding 2 in both sides
2 x - 2 + 2 = 5 y + 15 + 2
2 x = 5 y + 17 ..........................equation (2)
Putting value of x from equation 1 in equation 2
2 (3 y) = 5 y + 17
6 y = 5 y + 17
Subtracting 5 y in both sides
6 y - 5 y = 5 y + 17 - 5 y
y = 17
Putting the value of y in equation 1
x = 3 * 17 = 51
x = 51
After the changes, 1 girl drops : 51 - 1 = 50 new numbers of girls
After the changes, 3 more boys sign up : 17 + 3 = 20 new number of boys
So, total students in the class after changes : 50 + 20 = 70 students : Answer
Hope it will help :)