I have 1 hour to go 10km. I can go by taxi (30km/h) or walk (5km/h). I'm cheap, so I want to pay as little as possible for the taxi. I'm willing to drive the minimum distance and walk the rest to be on time.
- x is the distance I go by taxi
- y is the distance I walk
How do I find x and y values for the minimum possible x?
I came up with 2 equations:
- sum of distances is 10km
- sum of times of the trips is 1 hour
$$ \left\{ \begin{array}{c} x + y = 10 \\ x / 30 + y / 5 = 1 \\ \end{array} \right. $$
This solution, however, gives only one possible x and y it is not clear if this is the optimal solution. Is this the correct approach or I'm missing something?