A wedge of mass $M$ rests on a rough horizontal surface with coefficient of static friction $\mu$. The face of the wedge is a smooth plane inclined at an angle $ \alpha$ to the horizontal. A mass $m_1$ hangs from a light string which passes over a smooth peg at the upper end of the wedge and attaches to a mass $m_2$ which slides without friction on the face of the wedge.
A) Find the accelerations of $ m_1, m_2 $ and the tension in the string when $ \mu $ is very large.
B)Find the smallest coefficient of friction such that the wedge will remain at rest.
No specification on whether or not any of the masses $m_i$ are bigger than the others, so let us assume that $m_1$ goes down and $m_2$ goes up the slope. Then A) is fine. (a minus error in the final answer for A) is introduced if I assume the other orientation)
As for B) if we consider the wedge+masses as a system, then to conserve linear momentum if the masses move as above, then the wedge must move rightwards. So the frictional force acts leftwards until the wedge slips. The only other force acting on the wedge is via the normal contact force from $m_2$. A component of this force acts to accelerate the wedge horizontally. Let's write this relative to some fixed inertial frame of reference with $x$ rightwards. Then the above recast into symbols gives $$-\mu (M+m_1+m_2)g - m_2 g \cos \alpha \sin \alpha = 0 $$ at the point of slip of the wedge. However, solving this for $\mu$ gives a negative result. Where did I go wrong?