Conservation of momentum using impulse equations There is an inclined plane on a frictionless surface. A ball strikes the inclined plane horizontally with velocity $v_o$ and moves vertically after collision with velocity $v$ (see figure) mass of ball=$m$, mass of inclined plane=$M$

Now we have to find the velocity of the ball after collision.
Here's what I did,

Now,
$$mv_o-J\sin(\theta) = 0$$
$$J\cos(\theta)=mv$$
Therefore,
$$v=v_o \cot (\theta)$$
The question also asks for the velocity of the inclined plane after collision.
So I did,
$$J\sin (\theta) = Mv'$$
$$v'=mvo/M$$
All my answers are apparently correct according to the book but
the momentum along y-direction remains unconserved even though there is no external force on the system in the y-direction. Why is this so?
 A: Sorry but what I see in the y-direction, the sum of all forces is not zero, so it is not conserved.
$$F_M=N\hat y-Mg\hat y=0$$
$$F_m=-mg\hat y$$
where $$\frac{dp}{dt}=\sum F=F_M+F_m=-mg\hat y \neq0$$
A: You've ignored that the inclined plane is in contact with the ground. And this being an impulsive interaction would provide some kind of an impulsive force and thus conservation of momentum would not be valid along the y-axis
A: Yes, it's because of the normal force between the floor and the wedge, which increases by the $y$ component of the normal force between the ball and the plane during the collision.
If the wedge and the ball collide in free fall, the system is the ball and the plane. We conserve momentum by tracking the velocity of the ball and the plane.
If the wedge and the ball collide in contact with the planet, the system is the ball, the wedge, and the planet. We conserve momentum by tracking the velocity of the ball, the wedge, and the planet. There's no planet in the x direction (and no friction), so in the x direction we don't need the planet's mass or $\Delta v_x$ to solve the x part.
In the y direction, there is a planet, so in the y direction we would conserve momentum by
$P_{y_{ball}}+P_{y_{wedge}}+P_{y_{planet}} = 0$
That is, the ball's temporary vertical speed is paid for by the planet+wedge very, very, very slightly moving downward.
A: The "system" with no external forces (ignoring gravity) for which momentum is conserved is the ball, wedge, and planet.  The momentum of the wedge/planet after the collision is very small but is not zero.  See the answer by @gs.
The ball itself does experience an external force: the impulsive force of the wedge on the ball during the collision, so the momentum of the ball alone is not conserved.  Note momentum is a vector; if the ball has initial momentum in the horizontal direction and final momentum in the vertical direction, you can see that the angular momentum of the ball alone is not conserved, it changes due to the impulsive force from the wedge during the collision.
The force of gravity can be ignored if the collision is of very short duration, since the impulsive force is very large compared to the force of gravity in this case.
A: I get those equations:
$$mv_{{{\it my}}}={\it dp}\cos \left( \theta \right)\\
Mv_{{{\it Mx}}}=-{\it dp}\sin \left( \theta \right)
$$
and the relative velocity towards the normal vector equal zero
$$\left( v_{{0}}-v_{{{\it Mx}}} \right) \sin \left( \theta \right) +v_{
{{\it my}}}\cos \left( \theta \right)=0$$
where $~v~$ is the velocity and dp is the impulse.
you obtain 3 equations with 3 unknowns $~v_{my}~,v_{Mx}~,dp$
the conservation of momentum is:
$$m \left( v_{{{\it my}}}+v_{{mx}} \right) +Mv_{{{\it Mx}}}-mv_{{0}}=0$$
where $v_{mx}=v_0$
substitute the results $~v_{my}~,v_{Mx}~$ of the equations :
$$ {\frac {mv_{{0}}M\sin \left( \theta \right)  \left( -\cos \left( 
\theta \right) +\sin \left( \theta \right)  \right) }{ \left( \cos
 \left( \theta \right)  \right) ^{2}M+m-m \left( \cos \left( \theta
 \right)  \right) ^{2}}}
$$
thus the momentum is only conserved for $~\theta=\pi/4$
