Final answer:
The magnitude of the vertical displacement of the ant is 7 cm.
Step-by-step explanation:
The vertical displacement of the ant can be found by adding the northward and southward displacements and then taking their difference.
The ant travels north for 12 cm, so its displacement in the northward direction is +12 cm.
Then the ant turns south and travels 5 cm, so its displacement in the southward direction is -5 cm.
To find the vertical displacement, we subtract the southward displacement from the northward displacement: 12 cm - 5 cm = 7 cm.
Therefore, the magnitude of the vertical displacement of the ant is 7 cm.