A student has to travel a distance of 450 km by car at a certain average speed. Write python script to find the total time taken to cover the distance.
Answers
he best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Got it!
menu
GeeksforGeeks
Hire with us!
Login
Courses
Home
Algorithms expand_moreData Structures expand_moreLanguages expand_more
Interview expand_more
Students expand_more
GATE expand_more
CS Subjects expand_more
Quizzes expand_more
GBlog
Puzzles
What’s New?
▲
perm_identity
Time Speed Distance
Time, Speed and Distance (popularly known as TSD) is an important topic for written round of placements for any company.
Distance = Speed x Time
To convert from km / hour to m / sec, we multiply by 5 / 18. So, 1 km / hour = 5 / 18 m / sec
To convert from m / sec to km / hour, we multiply by 18 / 5. So, 1 m / sec = 18 / 5 km / hour = 3.6 km / hour
For a certain distance, if the ratio of speeds is x : y, then the ratio of times taken to cover the distance would be y : x and vice versa.
If a person covers a certain same distance multiple times with different speeds, then
Average speed = n / ∑ (1/si), where n is the number of times the distance is covered and si are the respective speeds of covering the distance.
For example, if a person travels a distance of 10 km three times at the speeds of 4 km/h, 5 km/h and 6 km/h, then the average speed would be 3 / [ (1 / 4) + (1 / 5) + (1 / 6) ] = 3 / (37 / 60) = 180 / 37 ≈ 4.86 km/h
Relative Speed
If two people / objects are moving in same direction with speeds x km / h and y km / h (x > y), then their relative speed would be (x – y) km / h
If two people / objects are moving in opposite direction with speeds x km / h and y km / h, then their relative speed would be (x + y) km / h
Relative speed is the rate at which two moving bodies are separating from / coming closer to each other. For example, if two persons are moving at 10 km/h and 20 km/h in opposite directions, then their relative speed would be 10 + 20 = 30 km / h, i.e., the distance between them after one hour would be 30 km. Similarly, if they were moving in the same direction, their relative speed would be 20 – 10 = 10 km / h, i.e., the distance between them after one hour would be 10 km.