I just had my last physics lesson before my exam, but I have one question where I disagree with my teacher.

My teacher said use F = ma where F = 2(9.8) and m = 5kg. Which yields the answer 3.92 m/sēA dynamics Trolley A of mass 5kg is placed on a horizontal board. It is connected to block B (a hanging mass) of mass 2kg by a light, inextensible string over a frictionless pulley.

Assuming no friction force on the trolley, calculate the magnitude of the acceleration of the trolley.

I decided that the acceleration on the trolley and the hanging mass should be the same. So:

Trolley: (1)where is the mass of the trolley, T is tension

Hanging mass: where is the mass of the hanging mass.

where g is acceleration due to gravity.

= (2)

Equating equations (1) and (2), I get 2.8 m/sē. I'm also aware that using the formula F = ma where m = 7, F = 2g also gives me this answer, but I don't know why. Is my teacher wrong, or am I just over complicating things? Can someone clarify this problem for me?