If your friend taps the hose to the left of center while you are listening with both ears, the sound will reach your left ear slightly before it reaches your right ear. For example, if your friend taps the hose 3 inches (7.6 cm) to the left of center, the sound will reach your left ear 1/2,000 of a second before it reaches your right ear.
Sound travels at about 1,000 feet/second (350 m/s) in air. When your friend moves the pencil by 3 inches (7.6 cm), the path to your left ear becomes 3 inches (7.6 cm) shorter and the path to your right ear becomes 3 inches (7.6 cm) longer. The difference in path length is 6 inches (15.2 cm), or half a foot, which sound covers in half a millisecond. Your brain uses this difference in arrival time to determine whether the sound source is closer to your right ear or your left ear.
With two ears, you're able to compare differences in the properties of intensity (volume), arrival time, phase, and frequency of a sound. If both ears hear a sound equally, you perceive a sound source as being directly in front of you or directly behind you. Your ears and brain use relative differences in the sound to locate it at some point away from center.
If you listen to the tube with only one ear, you will not be able to detect whether the tapping is slightly to one side or the other of the middle of the tube. However, you may be able to detect when the tapping is close to your ear and when it is far away.
Using one ear to locate a sound source is comparable to using one eye to locate an object. You can locate an object using one eye, but not as readily, and your view lacks depth. In the case of the ear, some direction can be detected by a single human ear because of its pinna—the cup-shaped, fleshy part of your outer ear. But, compared to our sophisticated ability to locate a sound source in space using two ears, the ability to locate a sound source using only one ear is very limited.