GATE / CS ARCHIVE

GATE CSE 2000 / QUESTION 14(a)

Locate point below line

Algorithms · Other / Mixed Topics · Full GATE CSE 2000 paper

GATE 2000, Q14(a) Descriptive
Report issue

Other / Mixed Topics

Question 14(a), GATE 2000: Let m,n be positive integers and let the line be y=(n/m)x. Define A=mq−np for endpoint (p,q), and B=ms−nr for endpoint (r,s). If A<0, is (p,q) above, below or on the line?
Question 14(a), GATE 2000: Let m,n be positive integers and let the line be y=(n/m)x. Define A=mq−np for endpoint (p,q), and B=ms−nr for endpoint (r,s). If A<0, is (p,q) above, below or on the line?
Tap to enlarge
Answer & solution

Answer: Below the line. (no official key was published)

Because m>0, dividing mq−np<0 by m preserves the inequality and gives q<(n/m)p. At horizontal coordinate p, the line has height (n/m)p, whereas the point has smaller height q. Therefore the point is below the line. Equality A=0 would mean on the line, and A>0 would mean above. The assumption m>0 is essential when converting the sign to this vertical interpretation.

Original paper, page 8