The acceleration of block B in the figure will be
When block m2 moves downward with acceleration a, the acceleration of mass rn I will be 2a because it covers double distance in the same time in comparison to m2.
Let T be the tension in the string. By drawing the free body diagram of A and B,
By solving (i) and (ii),