rocky620 wrote:
chetan2u sir
If it were not given that p,s, and t are +ve intergers, but only that they are some number not equal to zero. Is the below approach valid?
Q: If p, s, and t are integers, is |ps - pt| > p(s - t)?We can re arrange the ineq. as:
Case: 1ps - pt > ps - pt
0 > 0
It is not possible, hence we can discard this case.
Case: 2
ps - pt > -(ps - pt)ps - pt > pt - ps
2ps - 2pt > 0
ps - pt > 0
p(s-t)>0
In this case we will check whether both, p and (s-t), are either +ve or -ve.
You are correct in the approach but there is an error in the red portion.
You have to take negative of the mod.
So -(ps-pt)>ps-pt
p(t-s)>0
You can also look at it in the following manner
1) If ps>pt
Both sides will be positive and equal…….Answer will be NO
2) If pt >ps
|ps-pt|>0, but ps-pt <0…. Answer will be YES
3) If ps=pt
0=0…. Answer will be NO
So if we can find the relation between ps and Pt, we will get our answer.
_________________