A function, lambda, is defined by lambda(p, q) = (p - q)^2, if p >= 0 p, if p < 0 The value of the expression lambda(-3 + 2, -2 + 3) is: A. -1 B. 0 C. 9/4 D. 16
GATE 2021 · General Aptitude · Functions · easy
Answer: -1 (Option A)
- Evaluate the arguments: Simplify each argument: p = -1, q = 1.
- Select the correct branch: Since p = -1 is negative, we use the second branch: lambda(p, q) = p.
- Compute the result: The answer is simply -1.