Let the hiker starts from point A and walks 2 km South to reach B, then he turns West and walks for 4 km, then he turns North and walks for 5 km to point D, then he turns to his right and walks for 4 km to finally stop at E.
⇒ AE = 5 - 2 = 3 km ∴ Now he is 3 km north with respect to his starting position.