Skip to content
Official PYQ · 2017

GATE CS 2017 Set 1 QGA-8 — General Aptitude

Explain with AI

The expression (x+y)−∣x−y∣2\large \frac{(x+y) - |x-y|}{2} is equal to :

Choose one option
View worked solution

Answer: B

To find the value of the expression (x+y)−∣x−y∣2\frac{(x+y) - |x-y|}{2}, let us analyze it by considering two cases based on the relative values of xx and yy:

Case 1: x≥yx \ge y
If x≥yx \ge y, then ∣x−y∣=x−y|x-y| = x-y. Substituting this into the expression: (x+y)−(x−y)2=2y2=y\frac{(x+y) - (x-y)}{2} = \frac{2y}{2} = y Since x≥yx \ge y, the minimum of xx and yy is yy.

Case 2: x<yx < y
If x<yx < y, then ∣x−y∣=−(x−y)=y−x|x-y| = -(x-y) = y-x. Substituting this into the expression: (x+y)−(y−x)2=2x2=x\frac{(x+y) - (y-x)}{2} = \frac{2x}{2} = x Since x<yx < y, the minimum of xx and yy is xx.

In both cases, the expression simplifies to the smaller of the two numbers, which is min⁡(x,y)\min(x, y).

Note: Similarly, the expression for the maximum of xx and yy is given by (x+y)+∣x−y∣2\frac{(x+y) + |x-y|}{2}.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore General Aptitude questions