Step 1: Let the initial average weights be \( W_1 \), \( W_2 \), and \( W_3 \) for M1, M2, and M3 respectively.
The total weight for each group can be written as:
- Total weight of M1 = \( 20W_1 \)
- Total weight of M2 = \( 30W_2 \)
- Total weight of M3 = \( 40W_3 \)
When one student each leaves M1 and M3 and joins M2:
- The total weight of M1 becomes \( 20W_1 - 2 \)
- The total weight of M3 becomes \( 40W_3 - 2 \)
- The total weight of M2 becomes \( 30W_2 + 3 \)
Step 2: Set up the equation using the new weights.
The new average weights can be written as:
- New average weight of M1 = \( \frac{20W_1 - 2}{20} \)
- New average weight of M3 = \( \frac{40W_3 - 2}{40} \)
- New average weight of M2 = \( \frac{30W_2 + 3}{30} \)
Step 3: Determine the required difference.
We need to find how much twice the average weight of M2 differs from the sum of the average weights of M1 and M3:
\[
2 \times \left( \frac{30W_2 + 3}{30} \right) - \left( \frac{20W_1 - 2}{20} + \frac{40W_3 - 2}{40} \right)
\]
After solving, the difference is 20 kg.
Step 4: Conclusion.
Thus, the answer is 20 kg, and the correct answer is (A).