In the arrangement shown in the figure, the acceleration of the pulley is, (Ignore friction and mass of the pulley).
Constraint equation
xp + (xp – xM) = L = length of the string ⇒ 2xp - xM = L
differentiating twice with respect to time, we get 2ap – aM = 0