The given system of two masses and a pulley can be represented as shown in the following figure:

Smaller mass, m1 = 8 kg
Larger mass, m2 = 12 kg
Tension in the string = T
Mass m2, owing to its weight, moves downward with acceleration a, and mass m1 moves upward.
Applying Newton’s second law of motion to the system of each mass:
For mass m1: The equation of motion can be written as:
T – m1g = ma …………………… (i)
For mass m2: The equation of motion can be written as:
m2g – T = m2a ………………….… (ii)
Adding equations (i) and (ii), we get:

Therefore, the acceleration of the masses is 2 m/s2.
Substituting the value ofa in equation (ii), we get:
