GATE / CS ARCHIVE

GATE CSE 2025 SET 2 / QUESTION 8

GATE CSE 2025 Set 2 Q8

General Aptitude · Algebra, Equations & Number Patterns · Full GATE CSE 2025 Set 2 paper

GATE 2025 Set 2, Q8 2 marks · MCQ
Report issue

Algebra, Equations & Number Patterns

Question 8, GATE 2025: For iterations i=0,1,2,3, the input I is [20,−4,10,15], output X is [20,16,26,41], and output Y is [20,−80,−800,−12000]. Choose recurrences for i>0.
A. X(i)=X(i−1)+I(i); Y(i)=Y(i−1)I(i).
B. X(i)=X(i−1)I(i); Y(i)=Y(i−1)+I(i).
C. X(i)=X(i−1)I(i); Y(i)=Y(i−1)I(i).
D. X(i)=X(i−1)+I(i); Y(i)=Y(i−1)I(i−1).
Tap to enlarge
Your answer
Answer & solution

Official answer: A

For X, take consecutive differences: 16−20=−4, 26−16=10, and 41−26=15. Each difference equals the current input, so X(i)=X(i−1)+I(i). Equivalently, X is the running sum including I(0).

For Y, check the products: 20·(−4)=−80, (−80)·10=−800, and (−800)·15=−12000. Thus Y(i)=Y(i−1)I(i), a running product. These two recurrences together are A.

B and C predict X(1)=20·(−4)=−80 rather than 16, so they fail immediately. D has the correct X recurrence but uses the previous input for Y: it would predict Y(1)=20·20=400. The initialization at i=0 is supplied separately; the recurrences begin at i=1. Answer: A.

Original paper, page 8 · Answer key