Let A and B = the initial number of students in rooms A and B respectively.
- 10 students are sent from A to B then number of students in each room is the same:
A-10 = B + 10
So, A = B + 20
So, A = B + 20
- If 20 candidates are sent from B to A then the number of students in A is double the number of students in B:
(A-10)+20 = 2*(B+10-20)
A+10 = 2*(B-10)
A+10 = 2*(B-10)
Since A = B+20, let's substitute B+20 in place of A in the second equation:
A+10 = 2*(B-10)
(B+20) + 10 = 2B - 20
B + 30 = 2B -20
50 = B
Now find A:
A = B + 20
A = 50 + 20
A = 70
Check:
A-10 = B + 10
70-10 = 50+10
60 = 60
A+10 = 2*(B-10)
70+10 = 2(50-10)
80 = 2(40)
80 = 80
Check!