programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Ron McLeod
• Paul Clapham
• Bear Bibeault
• Junilu Lacar
Sheriffs:
• Jeanne Boyarsky
• Tim Cooke
• Henry Wong
Saloon Keepers:
• Tim Moores
• Stephan van Hulst
• Tim Holloway
• salvin francis
• Frits Walraven
Bartenders:
• Scott Selikoff
• Piet Souris
• Carey Brown

# Distance problem

Ranch Hand
Posts: 1871
A software engineer just returned from US has eaten too much fat and put a lot of weight every sunday he starts walking 4 km/hr on level
ground then up at 3 km\hr then back down hill at 6km\hr then again
on level grounggd at 4km\hr till he reaches his destination if he
returned home at 9 p.m. e what is the distance did he covered ?

Bartender
Posts: 1197
22

Originally posted by Sameer Jamal:
A software engineer just returned from US has eaten too much fat and put a lot of weight every sunday he starts walking 4 km/hr on level
ground then up at 3 km\hr then back down hill at 6km\hr then again
on level grounggd at 4km\hr till he reaches his destination if he
returned home at 9 p.m. e what is the distance did he covered ?

I think you're missing some information needed to solve the problem.

If he starts at 9 a.m., then he covers quite a bit more ground in that 12 hours than if he starts at 8 p.m.

HOWEVER, I think the "trick" you're hoping we'll find is that the length of road on the hill is irrelevant. Let's say the hill road is 6km long. It would take him (6km)/(3km/hr)=2 hours to walk up the hill and (6km)/(6km/hr)=1 hour to walk back down. This gives an overall hill walking speed of (12km)/(1hr+2hr) = 4 km/hr. Since this is the same speed he walks on level ground, we can just pretend he walks 4 km/hr the whole way. If he starts at 8 p.m., then he goes 4 km.

Greenhorn
Posts: 1
What you have:
1. Ave speed 4+3+6/3 = 4.333333.. Km/h.
2. End time = 21:00
3. Start time = 00:00
4. Total time = 21:00

21 * 4.33333333... +- = 90.99999.. KM

Ryan McGuire
Bartender
Posts: 1197
22
Jack, you can't just average speeds like that without knowing the relative distance and/or time travelled at each speed.

Let's take a simplified version of the problem. Let's say our hypothetical engineer just walked uphill at 3km/hr and downhill back home at 6km/hr. If he walked for one hour at each of these speeds, then it makes sense to to say he walked at an average speed of (3+6)/2=4.5 km/hr for the whole trip. Notice that during this trip he would go up 3 km and down 6. That would put him 3 km below his starting point.

However, there is nothing in the original problem that says he walked at 3 and 6 km/hr for the same amount of time. In fact, in order to get back home it's more likely that he walked the same distance in each direction. If the hill road is 6 km, then he walked uphill at 3km/hr for 2 hours and then downhill at 6 km/hr for 1 hour. In that case, his average speed isn't (3+6)/2. The correct formula would be (2hr*3km/hr + 1hr*6km/hr)/(1hr+2hr) = 4 km/hr.

Sameer's original problem looks a little more complicated because he doesn't give the relative lengths of the level road and the hill road. However, our walker's average speed on the hill (assuming the same distance uphill and downhill) is the same as his speed on level ground, so the relative distances are unimportant. If the walker started at midnight, giving him a total walking time of 21 hours, then he travelled 21*4 = 84 km. Regardless of his starting time, his average speed is 4, not 4 1/3 km/hr.

 Are you here to take over the surface world? Because this tiny ad will stop you! Thread Boost feature https://coderanch.com/t/674455/Thread-Boost-feature