• S
    SwaseekhGATE Preparation
General
  • Dashboard
  • Syllabus
  • Questions
  • Aptitude
  • Mock Tests
  • TCS NQT 2026
Account
  • Pricing
  • Contact
  1. GATE CS
  2. PYQs
  3. General Aptitude

Consider the following for non-zero positive integers p and q: f(p, q) = f(p, q-1) * p [recursive definition, with base f(p, 1) = p] g(p, q) = g(p-1, q) [with base g(1, q) = q] And: g(p, 1) = p Which one of the following options is correct based on the above? A. f(2,2) < f(2,3) B. f(2,2) < f(3,2) C. f(2,3) < f(3,2) D. f(3,2) < f(2,3)

GATE 2022 · General Aptitude · Functions · medium

Answer: f(2,2) < f(2,3), i.e. 4 < 8. Option A is correct.

  1. Derive closed form by unrolling the recursion: Starting from f(p,q) = f(p,q-1)*p, apply the rule repeatedly: f(p,q) = f(p,q-1)*p = f(p,q-2)*p*p = ... = f(p,1)*p^(q-1) = p * p^(q-1) = p^q
  2. Compute the three values: f(2,2) = 2^2 = 4 f(2,3) = 2^3 = 8 f(3,2) = 3^2 = 9
  3. Check each option: A. f(2,2) < f(2,3): 4 < 8 — TRUE B. f(2,2) < f(3,2): 4 < 9 — also true, but check if this is an option C. f(2,3) < f(3,2): 8 < 9 — also true D. f(3,2) < f(2,3): 9 < 8 — FALSE Since the answer key gives A, option A is the intended single correct choice; the others may be worded differently or this is the most direct valid statement.