GATE 2017 CS (CS1) – Question 8
The expression $\dfrac{(x + y) - |x - y|}{2}$ is equal to
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) the minimum of $x$ and $y$
Explanation
Separate the two cases that determine the absolute value.
If x≥y, then |x−y|=x−y and the expression becomes $(x+y-x+y)/2=y$. If x<y, then |x−y|=y−x and it becomes $(x+y-y+x)/2=x$.
In each case it returns the smaller input; at x=y it returns their common value. Therefore the expression is **min(x,y), B**, for all real x,y.
More Quantitative Aptitude: Algebra, Geometry and Mensuration questions
- GATE 2026 ME Q2
- GATE 2026 ME Q8
- GATE 2025 ME Q4
- GATE 2026 CE (CE1) Q7
- GATE 2025 CE (CE1) Q3
- GATE 2025 CE (CE1) Q9
All Quantitative Aptitude: Algebra, Geometry and Mensuration questions →