In Figure (A), mass m is lifted up by attaching a mass 2m to the other end of the string while in Figure (B), m is lifted by pulling the other end of the string with a constant force F = 2mg,then:
For (A), acceleration =
For (B), for motion of block,2mg - mg = ma = a = g