Ganeshan set up an experiment using two bar magnets one of which is marked N (North pole) and S (South pole) as shown in the figure. He noticed that the upper magnet is suspended in air.
Identify X and Y poles of the upper magnet.
X is the north pole, Y is the south pole
When there is no magnet below, the magnet would fall freely and come to rest on the ground. Since the magnet is floating in the air, there must be some force which is trying to stop the magnet from falling down. We know that like poles repel. The magnet present below is repulsing the magnet above so as to make it float in the air! Hence the end X is the North pole and the end Y is the south pole.