Answer
Please see the work below.
Work Step by Step
We know that when we drive a nail farther into a piece of wood, the part that vibrates becomes shorter and shorter. As a result, the frequency increases with the decrease of the length of the nail, leading to a higher tone/pitch.