Let x be the number of hours. If first cyclist travels due north at a speed of 18 mph, he will go 18x mi in x hours. If second cyclist travels due east at a speed of 24 mph, he will go 24x mi in x hours. These two cyclists leave from an intersection at the same time in perpendicular directions. Thus, 18x and 24x are legs and 120 mi is hypotenuse. By the Pythagorean theorem,
[tex](18x)^2+(24x)^2=120^2,\\324x^2+576x^2=14400,\\900x^2=14400,\\x^2=16,\\x=4.[/tex]
Answer: 4 hours.