To solve the problem, we start by defining variables: let the total weight of persons A, B, and C be denoted as \( S \) and their average weight as \( \frac{S}{3} \).
If person D joins the group, the new average weight becomes \( \frac{S + w_D}{4} \), where \( w_D \) is the weight of person D. We are told this average is reduced by \( x \) kg:
\(\frac{S}{3} - x = \frac{S + w_D}{4}\)
Multiplying through by 12 to clear denominators gives:
\(4S - 12x = 3S + 3w_D\)
Simplifying, we get:
\(S = 12x + 3w_D\)
Similarly, if person E joins instead, the average weight increases by \( 2x \) kg:
\(\frac{S}{3} + 2x = \frac{S + w_E}{4}\)
Clearing denominators by multiplying through by 12 yields:
\(4S + 24x = 3S + 3w_E\)
After simplification:
\(S = 24x + 3w_E\)
Equating both expressions for \( S \), we have:
\(12x + 3w_D = 24x + 3w_E\)
Dividing through by 3 to simplify gives:
\(4x + w_D = 8x + w_E\)
Since \( w_E = w_D + 12 \), substitute into the equation:
\(4x + w_D = 8x + w_D + 12\)
Simplify to find \( x \):
\(-4x = 12\)
Solving for \( x \) yields:
\(x = 1\)
Thus, the value of \( x \) is 1.