You could also get a unique solution if the car has speed of 72 63 56
in downhill, plain and uphill respectively.
I think the speed Vd, Vp, Vu was chosen so that 2Vp = Vd + Vu.
But for unique solution, it ought to be 2/Vp = 1/Vd + 1/Vu.
Under this condition, we can get the unique S=x+y+z:
From
x/Vd + y/Vp + z/Vu = T1
x/Vu + y/Vp + z/Vd = T2
We get (1/Vu+1/Vd)(x+z)+2/Vp*y = T1+T2
Apply 2/Vp = 1/Vd + 1/Vu, then 2/Vp(x+y+z)=T1+T2
S=x+y+z = Vp(T1+T2)/2
On 2010-9-15 9:31, Gene wrote:
This isn't right. Dropping both y terms is the same as setting y to
zero. The answer you get is correct, but there are many others as has
been said.
You could get a unique solution if the route were constrained to be
monotonic (level and up or else level and down).
On Sep 14, 4:28 pm, Minotauraus<[email protected]> wrote:
Actually the solution is unique. The middle part with the Ys is the
same and therefore can be omitted out. Now you are left with
2 equations and 2 unknowns.
I used time in minutes and I have x = 1.28, z = 0.30476 units (y can
be found out).
I guess the trick was 1. to write the equations that Yan did
and 2. to recognize that the plain part is the same and hence can be
cancelled.
On Sep 14, 3:31 am, Yan Wang<[email protected]> wrote:
actually, there are many solutions, just pick up one from them...
On Tue, Sep 14, 2010 at 3:23 AM, Abhilasha jain
<[email protected]> wrote:
how can u solve 3 variables using 2 equations?
On Tue, Sep 14, 2010 at 3:44 PM, Yan Wang<[email protected]> wrote:
x/72 + y/64 + z/56 = 4
&
x/56 + y/64 + z/72 = 4+2/3
find a solution to this ...
On Tue, Sep 14, 2010 at 2:31 AM, bittu<[email protected]> wrote:
Amazon Interview Question for Software Engineer / Developers
A car has speed of 72 64 56 in downhill, plain and uphill
respectively . A guy travels in the car from Pt. A to pt. B in 4 Hrs
and pt. B to pt. A in 4 Hrs and 40 min. what is the distance between A
and B?
Regards
Shashank
--
You received this message because you are subscribed to the Google
Groups "Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text -
- Show quoted text -
--
You received this message because you are subscribed to the Google Groups "Algorithm
Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.