Classes A and B have 35 students each. If seven girls shift from class A to class B, then the number of girls in the classes would interchange. If four girls shift from class B to class A, then the number of girls in class A would be twice the original number of girls in class B. What is the number of boys in class A and class B?

Please help. I'm not able to form a correct equation to solve.

I am assuming that the 2nd shift follows the first shift

now:
let the number of girls in A be x
let the number of girls in B be y

after 1st shift:
A has x-7
B has y+7
"the number of girls in the classes would interchange"
---> y+7 = x

2nd shift
A has x-7 + 4 = x-3
B has y+7 - 4 = y-3
" the number of girls in class A would be twice the original number of girls in class B"
--> x-3 = 2y or x = 2y+3

so 2y+3 = y+7
y = 4
x = 11

so originally, there were 24 boys in A and 31 in B

To solve this problem, let's first define variables for the number of girls in each class.

Let's say the number of girls in class A is G1, and the number of girls in class B is G2.

According to the problem, both classes have an equal number of students, so the number of girls in each class should be the same.

Thus, we have the equation:
G1 = G2 (equation 1)

Now, let's consider the given conditions:

1) If seven girls from class A shift to class B, then the number of girls in the classes would interchange.

After the shift, the number of girls in class A will be (G1 - 7), and the number of girls in class B will be (G2 + 7).

So, we can write the equation:
(G1 - 7) = (G2 + 7) (equation 2)

2) If four girls from class B shift to class A, then the number of girls in class A would be twice the original number of girls in class B.

After the shift, the number of girls in class A will be (G1 + 4), and the number of girls in class B will be (G2 - 4).

So, we can write the equation:
(G1 + 4) = 2(G2 - 4) (equation 3)

To find the number of boys in each class, we need to consider that the total number of students in each class is 35:

Total number of students in class A = number of girls (G1) + number of boys (B1)
Total number of students in class B = number of girls (G2) + number of boys (B2)

Since both classes have an equal number of students, we can write two more equations:

G1 + B1 = 35 (equation 4)
G2 + B2 = 35 (equation 5)

Now, we have a system of five equations (equations 1-5), and we can solve it to find the values of G1, G2, B1, and B2.