Problem in wedge constraint 
My teacher told all this (u can see in picture)
Here both accelerations have component in -j direction, then why do we say that they cancel out?
[X-axis is surface of wedge]
I have problem in photo 2

Nobody answered so I have to ask it again...
 A: The answer is quite simple. In the constrained motion problems given above, the main constraint is that both surfaces must be in contact with each other. This is possible only if the component of acceleration of the two bodies in the direction perpendicular to that of motion is equal both in magnitude and direction i.e. the relative acceleration of the two bodies in the direction perpendicular to motion must be zero.

Here both accelerations have component in -j direction, then why do we say that they cancel out? [X-axis is surface of wedge]

The discussion here is on the relative acceleration of the two bodies in the direction perpendicular to that of motion.
Relative acceleration is given by:-$$\vec{a_{2/1}}=\vec{a_{2}}-\vec{a_{1}}$$
So, if the component of acceleration of the two bodies in the direction perpendicular to motion is equal both in magnitude and direction, we can expect their difference to be zero which is exactly your relative acceleration of the two bodies in the direction perpendicular to motion. Of course, the two accelerations do not cancel out each other as they are in the same direction!!
Hope it helps you.
