A particle in a 3 dimensional space (x, y, z axes) that cannot move in the y direction has 2 degrees of freedom. It can still move freely along the x and z axes.
Degrees of freedom refer to the number of independent displacements (or motions) that a particle can make. Since this particle cannot move along the y axis, it only has 2 independent motions it can make:
Displacement along the x axis
Displacement along the z axis
So it has 2 degrees of freedom, one for each independent motion (displacement along x and z).
In general, for an n-dimensional space where m dimensions have constrained or fixed movement, the degrees of freedom will be:
Degrees of freedom = n - m
In this case:
n = 3 (since it's a 3D space - x, y and z axes)
m = 1 (y dimension has constrained movement)
Therefore:
Degrees of freedom = 3 - 1 = 2
So the final answer is that the particle has 2 degrees of freedom.