GATE / CS ARCHIVE

PAPER / ORIGINAL ORDER

GATE 2007

85 questions

Paper analysis: marks by subject, top topics and repeated questions →

03:00:00
1 mark · MCQ
Report issue

Continuity and differentiability of absolute value

Calculus

Question 1, GATE 2007: For f(x)=|x|, consider P: f is continuous for every real x; Q: f is differentiable for every real x. Which statement is true?
Options:
(A) P true, Q false
(B) P false, Q true
(C) Both true
(D) Both false
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Write |x| as -x for x<0 and x for x≥0. The values from both sides approach zero at the joining point, but the slopes differ there.

2. Derivation and interpretation. The absolute-value function is continuous everywhere. At 0 its left derivative is −1 and right derivative +1, so it is not differentiable there. Thus P is true and Q false, A.

Original paper, page 2

1 mark · MCQ
Report issue

Largest and smallest equivalence relations

Sets, Relations & Functions

Question 2, GATE 2007: A set S has n elements. How many ordered pairs belong to the largest and smallest equivalence relations on S, respectively?
Options:
(A) n and n
(B) n² and n
(C) n² and 0
(D) n and 1
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. An equivalence relation must be reflexive, symmetric and transitive. Test the two extremes: all possible pairs, and only the n self-pairs.

2. Derivation and interpretation. The universal relation S×S is an equivalence relation with n² pairs. Reflexivity requires every diagonal pair (s,s), and those n pairs alone form the identity equivalence relation. Hence the largest and smallest counts are n² and n, B.

Original paper, page 2

1 mark · MCQ
Report issue

Counting Boolean functions

Boolean Algebra & Logic Gates

Question 3, GATE 2007: What is the maximum number of different Boolean functions on n Boolean variables?
Options:
(A) n²
(B) 2^n
(C) 2^(2^n)
(D) 2^(n²)
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. First count truth-table rows, not functions. A truth table has 2n rows; choosing an output bit independently for every row determines one function.

2. Derivation and interpretation. There are 2n input assignments. Each can independently be assigned output 0 or 1, giving 22^n distinct Boolean functions, C. This counts functions on n variables, including those independent of some variables.

Original paper, page 2

1 mark · MCQ
Report issue

Fewest edges in a nonplanar graph

Graph Theory

Question 4, GATE 2007: Let G be a nonplanar graph with the minimum possible number of edges. Which size is intended for G?
Options:
(A) 9 edges, 5 vertices
(B) 9 edges, 6 vertices
(C) 10 edges, 5 vertices
(D) 10 edges, 6 vertices
Tap to enlarge
Your answer
Answer & solution

Answer: B for the minimal nonplanar core (no official key was published)

1. Approach. Compare the two minimal nonplanar cores K5 and K3,3. Subdividing edges cannot reduce their edge counts. Be careful that isolated vertices do not affect planarity or edge count.

2. Derivation and interpretation. By Kuratowski’s theorem a nonplanar graph contains a subdivision of K5 or K3,3. Such a subgraph needs at least 10 or 9 edges respectively. K3,3 attains the 9-edge minimum with 6 vertices, giving B. The vertex count is not forced by edge minimality alone: isolated vertices can be added without changing the 9 edges or nonplanarity. Thus 6 is the minimum/core vertex count, not a universal claim for every graph minimizing only edges.

Original paper, page 2

1 mark · MCQ
Report issue

Invalid topological order

Graph Algorithms

Question 5, GATE 2007: The directed acyclic graph has V={1,2,3,4,5,6} and edges 1→2, 1→3, 2→4, 3→4, 2→5, 4→5, 3→6, 4→6. Which sequence is NOT a topological ordering?
Options:
(A) 1,2,3,4,5,6
(B) 1,3,2,4,5,6
(C) 1,3,2,4,6,5
(D) 3,2,4,1,6,5
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (4 options)

1. Approach. A topological ordering places the tail of every directed edge before its head. It suffices to find one violated edge to reject an ordering.

2. Derivation and interpretation. The figure has 1→2 and 1→3, then 2,3 preceding 4 and 4 preceding 5,6. A topological ordering must place 1 before 2 and 3. D begins 3,2,4,1 and violates both outgoing constraints from 1; A,B,C respect the displayed edges. Thus D.

Original paper, page 2

1 mark · MCQ
Report issue

Undecidable grammar ambiguity

Decidability & Computability

Question 6, GATE 2007: Which decision problem is undecidable?
Options:
(A) Membership for context-free grammars
(B) Ambiguity for context-free grammars
(C) Finiteness for finite-state automata
(D) Equivalence for finite-state automata
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. Distinguish a property of a particular input string from a property of all derivations of a grammar. Parsing decides membership; finite automata allow finite graph algorithms.

2. Derivation and interpretation. CFG membership is decidable by parsing. Finite-automaton finiteness is decided by useful-cycle detection, and equivalence by symmetric-difference reachability. Ambiguity of an arbitrary CFG is undecidable, so B.

Original paper, page 2

1 mark · MCQ
Report issue

Finite subsets are regular

Regular Expressions & Languages

Question 7, GATE 2007: Which statement about regular languages is true?
Options:
(A) Every subset of a regular set is regular
(B) Every finite subset of a nonregular set is regular
(C) The union of two nonregular sets is nonregular
(D) An infinite union of finite sets is regular
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. A finite language is described by a finite union of its individual words. Closure under finite union does not imply closure under an arbitrary infinite union.

2. Derivation and interpretation. Every finite language is regular, regardless of the parent set, so B. A fails because nonregular languages are subsets ofΣ*. C fails by taking a nonregular language and its nonregular complement, whose union is Σ*. D fails because any nonregular language is an infinite union of singleton finite languages.

Original paper, page 3

1 mark · MCQ
Report issue

Constructing a six-to-sixty-four decoder

Combinational Circuits

Question 8, GATE 2007: How many 3-to-8 line decoders, each with an enable input, are needed to build a 6-to-64 line decoder without other logic gates?
Options:
(A) 7
(B) 8
(C) 9
(D) 10
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Split the six inputs into two groups of three. One decoder selects a bank, and each selected bank decodes the remaining three inputs.

2. Derivation and interpretation. One 3-to 8 decoder decodes the upper three bits into eight enable signals. Each enables one of eight further 3-to 8 decoders for the lower three bits. Total 1+8=9, C, assuming compatible enable/output polarities. Eight final decoders are required to provide 64 outputs, and another is needed to select their banks without extra gates.

Original paper, page 3

1 mark · MCQ
Report issue

Variables absent from a Boolean function

Logic Minimization & Karnaugh Maps

Question 9, GATE 2007: For f(w,x,y,z)=Σm(1,3,4,6,9,11,12,14), which statement is true? Minterm bits are in w,x,y,z order.
Options:
(A) Independent of one variable
(B) Independent of two variables
(C) Independent of three variables
(D) Dependent on all variables
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (10 steps)

1. Approach. List x,z for the selected minterms: each has either x=0,z=1 or x=1,z=0. Both w values and both y values occur for each such pair.

2. Derivation and interpretation. Pairing minterms differing in w or y leaves membership unchanged. The given minterms are exactly those with x≠z, so f=x⊕z. It depends on x,z but not w,y, hence is independent of two variables, B.

Original paper, page 3

1 mark · MCQ
Report issue

Cache tag set and word bits

Cache Memory

Question 10, GATE 2007: A 4-way set-associative cache has 128 lines of 64 words each. Main-memory word addresses are 20 bits. What are the TAG, LINE and WORD field lengths, respectively?
Options:
(A) 9,6,5
(B) 7,7,6
(C) 7,5,8
(D) 9,5,6
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (7 steps)

1. Approach. First divide total lines by associativity to obtain sets. The address chooses a word inside a line, then a set; the remaining high bits form the tag.

2. Derivation and interpretation. There are 128/4=32 sets, needing 5 set-index bits. A 64-word line needs 6 word-offset bits. With 20-bit word addresses the tag uses 20−5−6=9 bits. Thus 9,5,6, option D; the stated LINE field is the set index in this associative organization.

Original paper, page 3

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Disk capacity and sector address bits

Secondary Storage

Question 11, GATE 2007: A disk pack has 16 surfaces, 128 tracks per surface, 256 sectors per track and 512 bytes per sector, stored bit-serially. What are its capacity and the number of bits needed to address a sector?
Options:
(A) 256 Mbyte,19 bits
(B) 256 Mbyte,28 bits
(C) 512 Mbyte,20 bits
(D) 64 Gbyte,28 bits
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Multiply surfaces, tracks and sectors for the number of addressable sectors. Multiply once more by bytes per sector for capacity; these two quantities require different address widths.

2. Derivation and interpretation. The number of sectors is 16×128×256=219. At 512=29 bytes each, capacity is 228 bytes=256 MiB. A sector address therefore needs 19 bits. Thus A, using the usual binary Mbyte convention; no byte/bit offset is needed when selecting a sector.

Original paper, page 3

1 mark · MCQ
Report issue

Maximum nodes at a given edge height

Tree Properties & Traversals

Question 12, GATE 2007: The height of a binary tree is the maximum number of edges on a root-to-leaf path. What is the maximum number of nodes at height h?
Options:
(A) 2^h−1
(B) 2^(h−1)−1
(C) 2^(h+1)−1
(D) 2^(h+1)
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. With edge height, the root is at depth zero. Count all levels including both level zero and level h, rather than counting only h levels.

2. Derivation and interpretation. At depth i a binary tree has at most 2i nodes. For edge height h, depths 0 through h sum to 1+2+...+2h=2h+1−1, C, attained by a perfect binary tree.

Original paper, page 3

1 mark · MCQ
Report issue

Three-node binary-tree shapes

Tree Properties & Traversals

Question 13, GATE 2007: How many different binary trees can be formed using three unlabeled nodes?
Options:
(A) 1
(B) 5
(C) 4
(D) 3
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. Distinguish left and right child positions. There are four three-node chains (LL, LR, RL, RR) and one root with two children.

2. Derivation and interpretation. For ordered binary trees, let T(0)=1 and T(n)=sum T(i)T(n−1−i). Then T(1)=1,T(2)=2 and T(3)=2+1+2=5, B. Left and right child positions are distinguished, as in the standard binary-tree convention; unlabeled does not mean unordered.

Original paper, page 3

1 mark · MCQ
Report issue

Lowest worst-case sorting complexity

Searching, Sorting & Selection

Question 14, GATE 2007: Which listed sorting algorithm has the lowest worst-case time complexity?
Options:
(A) Merge sort
(B) Bubble sort
(C) Quick sort
(D) Selection sort
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Compare guaranteed worst-case bounds, not average performance. Mergesort halves the input and performs linear merging on each recursion level.

2. Derivation and interpretation. Standard mergesort guarantees Θ(n log n) worst-case time. Bubble sort, selection sort and conventional quicksort can take Θ(n²) in the worst case. Hence mergesort, A.

Original paper, page 3

1 mark · MCQ
Report issue

Loop-condition comparison count

Control Flow & Loop Tracing

Question 15, GATE 2007: Consider the C fragment:
int j, n;
j = 1;
while (j <= n)
    j = j * 2;
For n>0, how many comparisons are made during execution? The printed choices are below; note the distinction between successful comparisons and the final failing test.
Options:
(A) ceil(log₂ n)+1
(B) n
(C) ceil(log₂ n)
(D) floor(log₂ n)+1
Tap to enlarge
Your answer
Answer & solution

Answer: floor(log2 n)+2 including the final failed test; no exact listed option (no official key was published)

1. Approach. Let k=floor(log₂ n). The successful tests use j=20 through 2k. Then the loop tests 2k+1 once and fails. Check n=1 as a quick boundary example: two tests, one iteration.

2. Derivation and interpretation. Assume n is supplied positive and arithmetic does not overflow. The loop condition is tested with j=1,2,4,...,2^floor(log2 n), all successful, then once more at 2^(floor(log2 n)+1), which fails. Thus body executions and successful comparisons number floor(log2 n)+1, but all comparisons number floor(log2 n)+2. Option D counts successful tests/body executions only. The fragment declares n without assigning it; the question’s n>0 premise must supply its value, and literal fixed-width C may also overflow for large n. No official key is inferred.

Original paper, page 4

1 mark · MCQ
Report issue

Scheduling algorithm applications

CPU Scheduling

Question 16, GATE 2007: Match CPU scheduling algorithms P: Gang, Q: Rate Monotonic, R: Fair Share with applications 1: Guaranteed Scheduling, 2: Real-time Scheduling, 3: Thread Scheduling.
Options:
(A) P-3,Q-2,R-1
(B) P-1,Q-2,R-3
(C) P-2,Q-3,R-1
(D) P-1,Q-3,R-2
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Gang scheduling groups collaborating threads; rate monotonic assigns priorities from task periods; fair share divides capacity between users or groups rather than only individual runnable processes.

2. Derivation and interpretation. Gang scheduling coordinates related threads, P→3. Rate-monotonic priorities schedule periodic real-time tasks, Q→2. Fair-share scheduling aims to guarantee users/groups an allocated CPU share, R→1. Thus A.

Original paper, page 4

1 mark · MCQ
Report issue

Blocking kernel threads

Processes, Threads & System Calls

Question 17, GATE 2007: Which statement about user-level and kernel-level threads is false?
Options:
(A) Context switches take longer for kernel-level than user-level threads
(B) User-level threads need no hardware support
(C) Related kernel threads may run on different processors
(D) Blocking one kernel thread blocks all related threads
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. The kernel knows about each kernel thread and can choose another runnable thread when one blocks. Contrast this with a many-to-one user-thread implementation whose sole kernel thread blocks.

2. Derivation and interpretation. Kernel threads are independently schedulable, including on different processors. Blocking one does not inherently block every sibling thread, making D false. User-level thread switching can avoid kernel entry and dedicated threading hardware under the conventional comparison; kernel scheduling manages each kernel thread separately.

Original paper, page 4

1 mark · MCQ
Report issue

Top-down parsing method

Parsing & Syntax Analysis

Question 18, GATE 2007: Which is a top-down parser?
Options:
(A) Recursive descent
(B) Operator precedence
(C) LR(k)
(D) LALR(k)
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Top-down parsing constructs a derivation beginning with the start symbol. Bottom-up parsing starts with input symbols and reduces them toward the start symbol.

2. Derivation and interpretation. Recursive descent starts from the grammar’s start symbol and expands productions while matching input, so it is top-down. Operator-precedence, LR and LALR parsers reduce handles bottom-up. Therefore A.

Original paper, page 4

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Manchester bit and signal-element rates

Physical Layer & Transmission

Question 19, GATE 2007: In Ethernet using Manchester encoding, the bit rate is which of the following?
Options:
(A) Half the baud rate
(B) Twice the baud rate
(C) Equal to the baud rate
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. One data bit occupies two half-bit signal intervals. Under the convention in the question, count these intervals as signal elements when computing baud.

2. Derivation and interpretation. Manchester uses two half-bit signal elements to encode each bit, with a transition in the middle. Under the conventional signal-element definition of baud, baud rate is twice bit rate, so the bit rate is half the baud rate, A. This is not a claim that every bit causes exactly two transitions.

Original paper, page 4

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Application using UDP

Transport, Congestion Control & Traffic Shaping

Question 20, GATE 2007: Which listed protocol conventionally uses UDP as its transport protocol?
Options:
(A) HTTP
(B) Telnet
(C) DNS
(D) SMTP
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Use the traditional protocol stack assumed by this 2007 paper. The common short DNS request/reply exchange uses UDP; distinguish this from claiming that DNS never uses TCP.

2. Derivation and interpretation. Traditional DNS queries commonly use UDP, while the listed historical HTTP, Telnet and SMTP mappings use TCP. Thus C. DNS can also use TCP, and later HTTP versions may use QUIC; the answer follows the era and conventional protocol mapping.

Original paper, page 4

2 marks · MCQ
Report issue

Abelian groups of order four

Algebraic Structures

Question 21, GATE 2007: How many pairwise nonisomorphic Abelian groups of order 4 exist?
Options:
(A) 2
(B) 3
(C) 4
(D) 5
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Lagrange’s theorem permits element orders 1, 2 or 4. Divide the classification into whether an element of order 4 exists; the remaining case forces all three nonidentity elements to square to the identity.

2. Derivation and interpretation. An element of order 4 generates cyclic C4. If none exists, every nonidentity element has order 2, giving C2×C2, the Klein four-group. These are nonisomorphic because their element orders differ and exhaust the possibilities. Thus 2, A.

Original paper, page 5

2 marks · MCQ
Report issue

Statement not equivalent to a disconnected graph existing

Propositional & Predicate Logic

Question 22, GATE 2007: Graph(x) means x is a graph and Connected(x) means x is connected. Which formula does NOT express “Not every graph is connected”?
Options:
(A) ¬∀x(Graph(x)⇒Connected(x))
(B) ∃x(Graph(x)∧¬Connected(x))
(C) ¬∀x(¬Graph(x)∨Connected(x))
(D) ∀x(Graph(x)⇒¬Connected(x))
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. Negate “every graph is connected” by moving the negation through the universal quantifier, then through the implication. The result asserts at least one disconnected graph, not that all graphs are disconnected.

2. Derivation and interpretation. Not every graph is connected means ∃x(Graph(x)∧¬Connected(x)), B. Negating the universal implication gives A, and rewriting implication as ¬Graph∨Connected gives C. D instead says every graph is disconnected, a stronger and different claim. Hence D.

Original paper, page 5

2 marks · MCQ
Report issue

Graph guaranteed to have an Euler circuit

Graph Theory

Question 23, GATE 2007: Which graph is guaranteed to have an Eulerian circuit?
Options:
(A) Any k-regular graph with even k
(B) The complete graph on 90 vertices
(C) The complement of a cycle on 25 vertices
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. For a nontrivial undirected graph, all nonisolated vertices must be connected and have even degrees. Check connectedness as well as parity; even degrees alone do not suffice.

2. Derivation and interpretation. The complement of C25 has degree 24−2=22 at each vertex and is connected, so it has an Euler circuit, C. An even-regular graph need not be connected, so A is not guaranteed. K90 has odd degree 89 and is not Eulerian. The connectedness of the complement follows because any two nonadjacent vertices were neighbors in the cycle and share a vertex nonadjacent to both on that cycle.

Original paper, page 5

2 marks · MCQ
Report issue

Earliest even number in a random permutation

Probability & Random Variables

Question 24, GATE 2007: Choose uniformly from all 20! permutations of 1,2,…,20. What is the probability that 2 appears before every other even number?
Options:
(A) 1/2
(B) 1/10
(C) 9!/20!
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. Ignore the odd numbers and examine only the relative order of the ten even numbers. Symmetry gives each even number the same chance of occupying the first even position.

2. Derivation and interpretation. There are ten even numbers among 1,...,20. Their relative order is uniformly random, and each is equally likely to be first among them. Therefore the chance that 2 is earliest is 1/10, B.

Original paper, page 5

2 marks · MCQ
Report issue

Eigenvalue of a symmetric block matrix

Linear Algebra

Question 25, GATE 2007: A is a 4×4 matrix with eigenvalues −5,−2,1,4, and I is the 4×4 identity. Which option is an eigenvalue of the 8×8 block matrix [[A,I],[I,A]]?
Options:
(A) −5
(B) −7
(C) 2
(D) 1
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Apply the block matrix separately to (v,v) and (v,−v), where Av=λv. This reduces the eight-dimensional eigenvalue calculation to adding and subtracting one from each eigenvalue of A.

2. Derivation and interpretation. For Av=λv, the block vectors (v,v) and (v,−v) are eigenvectors of [[A,I],[I,A]] with eigenvalues λ+1 and λ−1. The eight values are −4,−6,−1,−3,2,0,5,3. Among the options only 2 occurs, C.

Original paper, page 5

2 marks · MCQ
Report issue

Partition-refinement partial order

Partial Orders & Lattices

Question 26, GATE 2007: Let S={a,b,c,d}. The partitions are π1={{a,b,c,d}}, π2={{a,b},{c,d}}, π3={{a,b,c},{d}}, π4={{a},{b},{c},{d}}. Define πi≺πj when πi refines πj. Which Hasse diagram represents these four partitions? Options are described by bottom-to-top cover relations.
Options:
(A) Chain π4<π3<π2<π1
(B) Diamond with bottom π3, middle π2 and π4, top π1
(C) Diamond with bottom π4, middle π2 and π3, top π1
(D) π4 below each of π1,π2,π3, which are pairwise incomparable
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. A refinement splits blocks but never joins elements from different old blocks. Check whether every block of one partition is contained in a block of the other.

2. Derivation and interpretation. The all-singleton partition π4 refines both π2={ab,cd} and π3={abc,d}; both refine the one-block π1={abcd}. π2 and π3 are incomparable: cd crosses π3’s blocks, while abc crosses π2’s blocks. The Hasse diagram is the diamond with π4 at bottom and π1 at top, C.

Original paper, page 6

2 marks · MCQ
Report issue

Basis of a coordinate-sum-zero plane

Linear Algebra

Question 27, GATE 2007: Let X={x∈R³:x1+x2+x3=0}, with vectors understood as columns. Which statement is true?
Options:
(A) {(1,−1,0),(1,0,−1)} is a basis of X
(B) Those two vectors are independent but do not span X
(C) X is not a subspace of R³
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. The single homogeneous equation removes one degree of freedom from R³. Verify membership, linear independence, and spanning rather than assuming two vectors automatically form a basis.

2. Derivation and interpretation. The vectors (1,−1,0) and (1,0,−1) lie in X and are linearly independent. Any (x1,x2,x3) with x1+x2+x3=0 equals −x2(1,−1,0)−x3(1,0,−1). They span X and form a basis, A.

Original paper, page 6

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Newton iteration limit

Numerical Methods

Question 28, GATE 2007: Newton–Raphson iteration gives x_(n+1)=x_n/2+9/(8x_n), starting at x0=0.5. To what value does the sequence converge?
Options:
(A) 1.5
(B) √2
(C) 1.6
(D) 1.4
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. A limit must satisfy the fixed-point equation, but that equation alone does not prove convergence or choose a sign. Positive iterates select the positive root; monotonicity after the first step verifies convergence.

2. Derivation and interpretation. Rewrite the iteration as x_next=(x+(9/4)/x)/2, Newton’s square-root iteration for 9/4. Starting at .5>0, the first step is 2.5; subsequent iterates stay above 1.5 and decrease to the positive fixed point. Solving x=x/2+9/(8x) yields x²=9/4, so the limit is 1.5, A.

Original paper, page 6

2 marks · MCQ
Report issue

Minimal DFA for two modular counts

Finite Automata

Question 29, GATE 2007: What is the number of states in a minimum DFA for L={w∈{0,1}*: the number of 0s is divisible by 3 and the number of 1s is divisible by 5}?
Options:
(A) 15
(B) 11
(C) 10
(D) 9
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (2 parts)

1. Approach. Use a product state (i,j) recording the two remainders. On 0 update i modulo 3; on 1 update j modulo 5. Minimality requires distinguishability, not merely constructing a 15-state DFA.

2. Derivation and interpretation. Track the number of zeros modulo 3 and ones modulo 5, giving 3×5=15 states; accept residue (0,0). Every residue pair is reachable. Any two different pairs are distinguished by appending zeros and ones that bring one pair to (0,0), leaving the other nonzero in at least one coordinate. Thus 15 states are necessary and sufficient, A.

Original paper, page 6

2 marks · MCQ
Report issue

Equal blocks separated by a marker

Pushdown Automata

Question 30, GATE 2007: Classify L={0^i 2 1^i:i≥0} over alphabet {0,1,2}.
Options:
(A) Not recursive
(B) Recursive and deterministic context-free
(C) Regular
(D) Context-free but not deterministic context-free
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. The marker 2 identifies exactly when to switch from pushing zeros to matching ones. Unlike an unmarked palindrome, there is no need to guess the midpoint.

2. Derivation and interpretation. A deterministic PDA pushes for each initial 0, switches phase at the unique marker 2, and pops once per 1, accepting exactly when the counts match and input ends. Membership is also decidable. The language is not regular because matching unbounded block lengths requires memory. Hence it is recursive and deterministic context-free, B, including the string 2 for i=0.

Original paper, page 7

2 marks · MCQ
Report issue

Regular language among palindrome-based forms

Regular Expressions & Languages

Question 31, GATE 2007: Which language is regular? In all options w and x are nonempty binary strings, w^R is the reversal of w, and Σ={0,1}.
Options:
(A) {ww^R:w∈Σ+}
(B) {ww^R x:w,x∈Σ+}
(C) {wxw^R:w,x∈Σ+}
(D) {xww^R:w,x∈Σ+}
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. The existential decomposition matters: for option C, w can always be chosen to have length one. This removes the apparent need to remember an arbitrarily long prefix. A direct regular expression is 0(0|1)+0 | 1(0|1)+1.

2. Derivation and interpretation. In C, every string wxwR has the same first and last symbol and length at least 3. Conversely any binary string of length≥3 with equal endpoints has such a representation by choosing w to be its first single symbol and x its nonempty middle. Thus C equals 0(0+1)+0 ∪1(0+1)+1 and is regular. A is the nonempty even-palindrome language and nonregular. For B, intersect with the regular language 0(11)*1 00 (11)*1 01. The result is{0 1k 00 1k 01:k positive odd}: the only possible even-palindrome prefix must match the two odd-length 1 blocks. This equality language is nonregular by pumping the first block. Hence B is nonregular. D is the reversal of B and is likewise nonregular.

Original paper, page 7

2 marks · MCQ
Report issue

Boolean forms not matching the minterms

Logic Minimization & Karnaugh Maps

Question 32, GATE 2007: Let f(w,x,y,z)=Σm(0,4,5,7,8,9,13,15), with minterm bits in w,x,y,z order. Which listed expressions are NOT equivalent to f? Prime denotes complement. The source expressions are:
P = x′y′z′ + w′xy′ + wy′z + xz
Q = w′y′z′ + wx′y′ + xz
R = w′y′z′ + wx′y′ + xyz + xy′z
S = x′y′z′ + wx′y′ + w′y
Options:
(A) P only
(B) Q and S
(C) R and S
(D) S only
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. Read each complement mark carefully before testing equivalence. The source has Q=w′y′z′+wx′y′+xz. Expand product terms into minterms, or enumerate all sixteen inputs; a single extra or missing minterm disproves equivalence.

2. Derivation and interpretation. P, Q and R each produce minterms {0,4,5,7,8,9,13,15}, exactly the target set. For Q, w′y′z′ covers {0,4}, wx′y′ covers {8,9}, and xz covers {5,7,13,15}. For R, xyz+xy′z=xz, so R equals Q. S instead produces {0,2,3,6,7,8,9}: for instance input 0010 makes w′y true although minterm 2 is not in f. Thus only S is not equivalent, option D. The previous B answer resulted from dropping the prime on z in Q; the scanned original visibly contains that prime. This is a source-based independent correction, not an official-key match.

Original paper, page 7

2 marks · MCQ
Report issue

XNOR algebra identities

Boolean Algebra & Logic Gates

Question 33, GATE 2007: Define X*Y=XY+X′Y′ for Boolean variables, and let Z=X*Y. Consider P: X=Y*Z; Q: Y=X*Z; R: X*Y*Z=1. Which statements hold?
Options:
(A) Only P and Q
(B) Only Q and R
(C) Only P and R
(D) All P,Q,R
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. The connective is equivalence/XNOR. Express it as 1⊕X⊕Y, then substitute the definition of Z; each variable appearing twice cancels under XOR.

2. Derivation and interpretation. The operation is XNOR, representable over modulo 2 arithmetic as X*Y=1⊕X⊕Y. With Z=1⊕X⊕Y, we get Y*Z=X and X*Z=Y. Moreover (X*Y)*Z=Z*Z=1; XNOR is associative here. Therefore all P,Q,R hold, D.

Original paper, page 7

2 marks · MCQ
Report issue

Universal function realization with one mux

Combinational Circuits

Question 34, GATE 2007: Only one multiplexer and one inverter may implement an arbitrary Boolean function of n variables. What is the minimum universal multiplexer size?
Options:
(A) 2^n-to-1
(B) 2^(n+1)-to-1
(C) 2^(n−1)-to-1
(D) 2^(n−2)-to-1
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Shannon expansion fixes selector variables and leaves a cofactor at each data input. If one variable remains, its only four Boolean functions are 0,1,x,x′, all available with constants, a wire and one inverter.

2. Derivation and interpretation. Use n−1 variables as selector bits of a 2n−1-to 1 multiplexer. For each selector assignment the remaining one-variable function is 0,1,x or x′, so a single shared inverter suffices. A smaller selector set leaves at least two variables; some cofactors, such as two-variable parity, cannot be supplied by a constant, a wire or one inversion. Thus the universal size under direct-variable selector wiring is 2n−1:1, C.

Original paper, page 7

2 marks · MCQ
Report issue

Carry-lookahead AND and OR counts

Combinational Circuits

Question 35, GATE 2007: For a 4-bit carry-lookahead adder, Pi=Ai⊕Bi, Gi=AiBi, Si=Pi⊕Ci and C_(i+1)=Gi+PiCi, where C0 is the input carry. All Pi and Gi are already available. With two-level AND–OR logic and unbounded gate fan-in, how many AND and OR gates are required for the carry generator used with outputs S3,S2,S1,S0,C4?
Options:
(A) 6 AND,3 OR
(B) 10 AND,4 OR
(C) 6 AND,4 OR
(D) 10 AND,5 OR
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. Expand every carry directly in terms of P,G,C0, avoiding a ripple chain. C1 has one product needing AND; C2 has two; C3 three; C4 four. The standalone Gi terms need no AND gates.

2. Derivation and interpretation. Expand C1=G0+P0C0; C2=G1+P1G0+P1P0C0; similarly C3 and C4 have 3 and 4 nontrivial product terms. With unbounded fan-in and all P,G supplied, the four carry outputs require 1+2+3+4=10 AND gates and one OR gate each, totaling 4 OR gates. Thus B. XOR sum generation is outside this AND/OR carry-generator count.

Original paper, page 8

2 marks · MCQ
Report issue

Asynchronously cleared counter sequence

Counters & Timing

Question 36, GATE 2007: A 4-bit up-counter has outputs A4,A3,A2,A1 from most to least significant. Control table: Clear=1 asynchronously clears to 0; Clear=0,Load=0,Count=0 holds; Clear=0 on a rising clock with Load=1 loads the parallel input; Clear=0 on a rising clock with Load=0,Count=1 counts up. The circuit fixes Count=1, Load=0 and parallel input=0011, and connects Clear=A3 AND A1. Starting at 0 and neglecting all gate/counter delays, which stable count cycle occurs?
Options:
(A) 0,3,4
(B) 0,3,4,5
(C) 0,1,2,3,4
(D) 0,1,2,3,4,5
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. First determine whether the parallel input is enabled. It is not, since Load=0. Then find the first binary count making the asynchronous clear condition true; that state immediately disappears.

2. Derivation and interpretation. The clear input is the AND of outputs A 3 and A 1. With Load=0 the displayed 0011 input is ignored and the device counts upward from 0. The first count having A 3=A 1=1 is 0101=5, which immediately asserts asynchronous clear. With negligible delays this transient 5 is not a stable count state; the stable cycle is 0,1,2,3,4 and back to 0, C.

Original paper, page 8

2 marks · MCQ
Report issue

Forwarded multicycle pipeline timing

Pipelining & Hazards

Question 37, GATE 2007: A pipeline has IF, ID (decode/operand fetch), EX, WB. IF, ID and WB each take one cycle; EX takes one cycle for ADD/SUB and three for MUL. Operand forwarding is available. How many cycles complete this sequence?
ADD R2,R1,R0   (R2←R1+R0)
MUL R4,R3,R2   (R4←R3×R2)
SUB R6,R5,R4   (R6←R5−R4)
Options:
(A) 7
(B) 8
(C) 10
(D) 14
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (5 steps)

1. Approach. Draw one timeline per instruction. Forwarding removes waiting for register writeback, but it cannot make the three-cycle multiply result available before its EX stage finishes.

2. Derivation and interpretation. ADD uses IF1,ID2,EX3,WB4. Its result is forwarded to MUL, which uses IF2,ID3,EX4–6,WB7. SUB uses IF3,ID4 and waits for the EX unit/result, then executes EX7 and WB8. Therefore completion requires 8 cycles, B, assuming the stated forwarding permits consuming an EX result in the next cycle and no additional structural conflicts.

Original paper, page 9

2 marks · MCQ
Report issue

Stack after the first multiplication

Stacks & Queues

Question 38, GATE 2007: Evaluate the postfix expression 8 2 3 ^ / 2 3 * + 5 1 * − using a stack; ^ denotes exponentiation. What are the top two stack elements, top first, immediately after the first * is evaluated?
Options:
(A) 6,1
(B) 5,7
(C) 3,2
(D) 1,5
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (9 steps)

1. Approach. For each operand, push; for each binary operator, pop right operand then left operand, compute left op right, and push the result. Stop at the first multiplication rather than evaluating the whole expression.

2. Derivation and interpretation. Read 8,2,3, then exponentiation replaces 2,3 with 8; division replaces 8,8 with 1. Push 2 and 3; the first multiplication replaces them with 6. The stack is now [1,6] from bottom to top, so its top two elements are 6,1, A.

Original paper, page 9

2 marks · MCQ
Report issue

Postorder from inorder and preorder

Tree Properties & Traversals

Question 39, GATE 2007: A binary tree has inorder traversal d,b,e,a,f,c,g and preorder traversal a,b,d,e,c,f,g. What is its postorder traversal?
Options:
(A) d,e,b,f,g,c,a
(B) e,d,b,g,f,c,a
(C) e,d,b,f,g,c,a
(D) d,e,f,g,b,c,a
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. The first preorder item is the root. Its position in inorder separates left and right subtrees; recursively repeat, then output left subtree, right subtree, root.

2. Derivation and interpretation. Preorder starts with root a. Inorder splits the left subtree as d,b,e and the right as f,c,g. The remaining preorder makes b the left root with children d,e, and c the right root with children f,g. Postorder is d,e,b,f,g,c,a, option A.

Original paper, page 9

2 marks · MCQ
Report issue

Closed hashing with implicit linear probing

Hashing

Question 40, GATE 2007: An initially empty hash table has seven slots indexed 0–6 and h(x)=(3x+4) mod 7. Insert 1,3,8,10 in that order using “closed hashing” as stated in the source. Which final table is intended? A dash means an empty slot. The probing rule is not explicitly specified.
Options:
(A) [8,−,−,−,−,−,10]
(B) [1,8,10,−,−,−,3]
(C) [1,−,−,−,−,−,3]
(D) [1,10,8,−,−,−,3]
Tap to enlarge
Your answer
Answer & solution

Answer: B under linear probing (no official key was published)

1. Approach. Under linear probing, collisions advance one slot at a time with wraparound modulo 7. Compute each home position before inserting and never overwrite an occupied slot.

2. Derivation and interpretation. The hash values for 1,3,8,10 are 0,6,0,6. With linear probing, place 1 at 0 and 3 at 6;8 probes from 0 to 1;10 probes 6,0,1 and lands at 2. The table is [1,8,10,empty,empty,empty,3], B. Closed hashing/open addressing does not alone specify the probing sequence; quadratic or double hashing could differ, so linear probing is an explicit assumption rather than a stated guarantee.

Original paper, page 9

2 marks · MCQ
Report issue

Single-source shortest paths in an unweighted graph

Graph Algorithms

Question 41, GATE 2007: In an unweighted undirected connected graph, which method most efficiently finds shortest paths from a source S to every other vertex?
Options:
(A) Dijkstra from S
(B) Warshall
(C) DFS from S
(D) BFS from S
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. All edges have equal cost, so distance is the number of edges. A FIFO queue processes every distance-d vertex before any distance-(d+1) vertex.

2. Derivation and interpretation. BFS starts at S and discovers vertices in increasing number of edges from S. When a vertex is first discovered, its level is its shortest-path distance; parent pointers recover paths. With adjacency lists, every vertex and edge is processed O(1) times, giving O(V+E). DFS does not generally find shortest paths; generic Dijkstra adds priority-queue overhead, and Warshall solves a more expensive all-pairs/reachability problem. Thus D is the appropriate algorithm.

Original paper, page 10

2 marks · MCQ
Report issue

Recursive function with shared static state

Scope, Lifetime & Storage Classes

Question 42, GATE 2007: What is f(5) for the following C function?
int f(int n) {
    static int r=0;
    if(n<=0) return 1;
    if(n>3) { r=n; return f(n-2)+2; }
    return f(n-1)+r;
}
Options:
(A) 5
(B) 7
(C) 9
(D) 18
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (11 steps)

1. Approach. The static r is one persistent shared object, not a fresh zero-initialized local for each recursive call. Record the single assignment r=5 before unwinding the recursion.

2. Derivation and interpretation. The static variable r is shared by all activations. In f(5), r becomes 5, and the return expression is f(3)+2. Calls f(3), f(2), and f(1) each recurse with n−1 and add the unchanged r=5. The base f(0)=1. Hence f(1)=6, f(2)=11, f(3)=16, and f(5)=18 (D). No smaller activation changes r, so operand evaluation order does not affect this particular call.

Original paper, page 10

2 marks · MCQ
Report issue

Leaves and branching factor of a full n-ary tree

Tree Properties & Traversals

Question 43, GATE 2007: Here a complete n-ary tree means each node has exactly n children or none. It has I=10 internal nodes and L=41 leaves. Find n.
Options:
(A) 3
(B) 4
(C) 5
(D) 6
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Count child edges once from the parent side and once using the identity edges=vertices−1 for a tree. Equating the counts eliminates the shape of the tree.

2. Derivation and interpretation. Count the edges in two ways. Each of the I internal nodes contributes exactly n child edges, while a tree with I+L vertices has I+L−1 edges. Thus nI=I+L−1 and n=(10+41−1)/10=5 (C). The question calls this complete, but explicitly defines the full n-ary property, which is all the calculation needs.

Original paper, page 10

2 marks · MCQ
Report issue

Worst-case recursion depth of Euclid algorithm

Asymptotic Analysis & Recurrences

Question 44, GATE 2007: For the following source C-style function with n≥m, how many recursive calls are made?
int gcd(n,m) {
    if(n % m == 0) return m;
    n = n % m;
    return gcd(m,n);
}
The source does not explicitly say worst case or m>0; state those assumptions in interpreting the options.
Options:
(A) Θ(log₂ n)
(B) Ω(n)
(C) Θ(log₂ log₂ n)
(D) Θ(√n)
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. This is Euclid’s algorithm. An upper bound comes from a constant-factor size reduction within two calls; a tight worst-case lower bound comes from consecutive Fibonacci arguments.

2. Derivation and interpretation. For positive integers n≥m>0, Euclid replaces (n,m) by (m,n mod m). Within two recursive steps the larger argument decreases by at least a factor of two, so there are O(log n) recursive calls. Consecutive Fibonacci inputs attain a matching lower bound: their quotients are one for most steps, and Fk grows exponentially in k, giving Θ(log n) calls in the worst case (A). The statement does not say worst case: when m divides n, there are zero recursive calls. Therefore Θ(log n) is not a pointwise bound for every input satisfying n≥m. Positive m is also necessary to avoid remainder by zero.

Original paper, page 10

2 marks · MCQ
Report issue

Recursion repeatedly taking the square root

Asymptotic Analysis & Recurrences

Question 45, GATE 2007: What is the time complexity of this recursive function, with unit-cost arithmetic and square root?
int DoSomething(int n) {
    if(n<=2) return 1;
    else return DoSomething(floor(sqrt(n))) + n;
}
Options:
(A) Θ(n²)
(B) Θ(n log₂ n)
(C) Θ(log₂ n)
(D) Θ(log₂ log₂ n)
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. The function makes one recursive call, not n calls. Each square root halves the logarithm of the argument, so analyze the recursion in terms of log n.

2. Derivation and interpretation. Assuming unit-cost integer arithmetic and square root as intended, T(n)=T(floor(sqrt(n)))+Θ(1). After k reductions the argument is approximately n1/2^k, and reaches a constant when 2k=Θ(log n). Thus k=Θ(log log n), giving D. Adding n to the returned value is one arithmetic operation, not n operations; floors change only constant-level stopping details.

Original paper, page 10

2 marks · MCQ
Report issue

Recursive leaf counting in a binary tree

Tree Properties & Traversals

Question 46, GATE 2007: CellNode represents a binary-tree node. What does GetValue return when called on the root?
struct CellNode {
    struct CellNode *leftChild;
    int element;
    struct CellNode *rightChild;
};
int GetValue(struct CellNode *ptr) {
    int value=0;
    if(ptr!=NULL) {
        if(ptr->leftChild==NULL && ptr->rightChild==NULL)
            value=1;
        else value=value+GetValue(ptr->leftChild)+GetValue(ptr->rightChild);
    }
    return value;
}
Options:
(A) Number of nodes
(B) Number of internal nodes
(C) Number of leaves
(D) Tree height
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Check the two base cases: null contributes zero, and a node with no children contributes one. All other nodes merely add child results, so their own elements and depths are irrelevant.

2. Derivation and interpretation. GetValue returns zero for a null pointer, one when both children are null, and otherwise the sum of the values for the left and right subtrees. By induction on the tree, this counts precisely the leaves: an internal node adds no contribution of its own. Therefore C, the number of leaf nodes, is correct, including zero for an empty tree.

Original paper, page 11

2 marks · MCQ
Report issue

Binary search along the heap insertion path

Heaps & Priority Queues

Question 47, GATE 2007: Insert an element into an array-represented max heap of n elements. Use binary search along the path from the new leaf to the root to locate its insertion position. What is the asymptotic worst-case number of key comparisons?
Options:
(A) Θ(log₂ n)
(B) Θ(log₂ log₂ n)
(C) Θ(n)
(D) Θ(n log₂ n)
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. The binary search is not across the entire array. It searches the sorted ancestor chain, whose length is logarithmic in n; take the logarithm of that length.

2. Derivation and interpretation. A complete binary heap has a root-to-new-leaf path containing Θ(log n) positions. Existing keys along this path are monotone because it is a max heap. Binary search among h=Θ(log n) positions uses Θ(log h)=Θ(log log n) key comparisons in the usual worst-case interpretation, so B. This is a bound on comparisons, not all insertion work: shifting keys along the path can still require Θ(log n) moves. Array indices allow an ancestor at a specified depth to be selected without doing key comparisons.

Original paper, page 11

2 marks · MCQ
Report issue

Satisfying at least half the clauses of a CNF formula

Propositional & Predicate Logic

Question 48, GATE 2007: Which claim is true for formulas in conjunctive normal form under the usual nonempty-clause convention?
Options:
(A) Every formula has an assignment satisfying at least half its clauses
(B) Every formula has an assignment satisfying all its clauses
(C) Some formula has at most one quarter of its clauses satisfied under every assignment
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Pair any truth assignment with its complement. Each nonempty disjunctive clause has some literal, and that literal is true in exactly one of the two assignments.

2. Derivation and interpretation. For the conventional setting in which each clause contains at least one literal, consider any assignment and its bitwise complement. Every clause is satisfied by at least one of the two: choose any literal in it, which is true in one assignment. Hence the two assignments together satisfy at least m clause occurrences, and one satisfies at least m/2. This proves A. B fails for (x)∧(¬x), and the same half-clause guarantee rules out C. If empty clauses are permitted, the unstated nonempty-clause assumption matters: a formula consisting only of empty clauses is never satisfied at all, so A would fail and C could hold. The intended CNF convention excludes this degenerate case.

Original paper, page 11

2 marks · MCQ
Report issue

A globally minimum-weight edge and minimum spanning trees

Graph Algorithms

Question 49, GATE 2007: In a connected undirected graph, w is the minimum edge weight and e is a particular edge of weight w. Which statement is false?
Options:
(A) Some minimum spanning tree contains e
(B) If an MST T omits e, every edge of the cycle in T+e has the same weight
(C) Every MST contains an edge of weight w
(D) Every MST contains e
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. Use the exchange argument: inserting a non-tree edge creates one cycle, and removing a cycle edge gives another spanning tree. Equal minimum-weight edges need not be individually mandatory.

2. Derivation and interpretation. Take any MST T. If e is absent, adding it creates a cycle. Every edge of that cycle has weight at least w by global minimality of w, and none can have weight greater than w: exchanging such an edge for e would make a strictly cheaper spanning tree. Thus all cycle edges have weight w, proving B; exchanging any one of them for e produces an MST containing e, proving A. Every MST contains an edge of weight w by the same argument (or contains e itself), proving C. However a triangle with all edges weight w has MSTs omitting any chosen edge, so e need not belong to every MST. D is false, assuming the usual loop-free graph convention.

Original paper, page 12

2 marks · MCQ
Report issue

Comparison count to find both minimum and maximum

Searching, Sorting & Selection

Question 50, GATE 2007: Given an array of an even number n of values, both its minimum and maximum must be found. Which comparison-count claim is true?
Options:
(A) At least 2n−c comparisons are necessary for some constant c
(B) At most 1.5n−2 comparisons are sufficient
(C) At least n log₂ n comparisons are necessary
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. A comparison within a pair simultaneously rules one element out as maximum and the other out as minimum. Exploit this dual use before separately reducing the two candidate sets.

2. Derivation and interpretation. Partition the even number n of values into n/2 pairs. Compare within each pair, putting its smaller member in a minimum-candidate set and larger member in a maximum-candidate set. Find the minimum of the n/2 smaller values and maximum of the n/2 larger values. The comparison count is n/2+(n/2−1)+(n/2−1)=3n/2−2, so B. This construction disproves the claimed asymptotically larger lower bounds in A and C.

Original paper, page 12

2 marks · MCQ
Report issue

Bounds on the trial-division primality loop

Asymptotic Analysis & Recurrences

Question 51, GATE 2007: For the following printed C fragment, T(n) counts for-loop executions on input n. Which asymptotic bounds are intended?
int IsPrime(n) {
    int i,n;
    for(i=2;i<=sqrt(n);i++)
        if(n%i==0) { printf("Not Prime\n"); return 0; }
    return 1;
}
The source redeclares n; interpret the intended divisor-testing algorithm separately from literal C validity.
Options:
(A) O(√n) and Ω(√n)
(B) O(√n) and Ω(1)
(C) O(n) and Ω(√n)
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. A uniform lower bound must apply to easy inputs too. Even numbers terminate at i=2, whereas prime numbers make the loop test all candidate divisors through floor(√n).

2. Derivation and interpretation. Under the intended interpretation that n is the positive input integer, at most floor(sqrt(n))−1 candidate divisors are tested, so T(n)=O(sqrt(n)). For even n≥4, the first divisor i=2 causes immediate return, so T(n)=1 on an unbounded input family and no uniform Ω(sqrt(n)) lower bound is valid. For all sufficiently large n at least one iteration occurs, establishing Ω(1); B is therefore the intended answer. Prime n attain Θ(sqrt(n)). Source caveat: the printed function uses old-style IsPrime(n) and then declares int i,n inside its body, redeclaring its parameter n in the same scope. This is not valid C as printed; the algorithmic answer requires repairing the parameter declaration/removing the duplicate local n.

Original paper, page 12

2 marks · MCQ
Report issue

Dangling-else grammar is not LL(1)

Parsing & Syntax Analysis

Question 52, GATE 2007: A grammar has nonterminals S,C,S1, terminals a,b,i,t,e, start S, and productions S→iCtSS1 | a; S1→eS | ε; C→b. Why is this grammar not LL(1)?
Options:
(A) It is left recursive
(B) It is right recursive
(C) It is ambiguous
(D) It is not context-free
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Read i,t,e as if, then, else. In nested conditionals, an else can attach to either the inner or the outer if. Exhibit two parses of the same string to prove ambiguity.

2. Derivation and interpretation. The grammar is S→iCtSS₁ | a, S₁→eS | ε, C→b. It is the dangling-else grammar. The string i b t i b t a e a has two parse trees: the e a can belong to the inner conditional (inner S₁→eS, outer S₁→ε) or the outer conditional (inner S₁→ε, outer S₁→eS). Therefore it is ambiguous and cannot be LL(1), giving C. Equivalently e belongs both to FIRST(eS) and FOLLOW(S₁), causing a prediction-table conflict with S₁→ε. Right recursion by itself is not an obstruction to LL(1), and these productions are context-free and not left recursive.

Original paper, page 12

2 marks · MCQ
Report issue

Regular grammars versus existence of LR(1) grammars

Parsing & Syntax Analysis

Question 53, GATE 2007: Consider P: Every regular grammar is LL(1). Q: Every regular language has an LR(1) grammar. Which is true?
Options:
(A) Both P and Q true
(B) P true,Q false
(C) P false,Q true
(D) Both false
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. P concerns every presentation of a language, whereas Q asks whether a suitable presentation exists. A language can have a poorly factored grammar even though another grammar parses deterministically.

2. Derivation and interpretation. P is false: the right-linear regular grammar S→aA | aB, A→b, B→c has two alternatives whose FIRST sets both contain a, so this particular grammar is not LL(1). Q is true: construct a grammar from a DFA by using one nonterminal per state, production Q→aR for each transition on a, and Q→ε for each accepting state. Determinism gives at most one alternative per terminal; epsilon is selected at end of input. This yields an LL(1), hence LR(1), grammar for the regular language (or use the standard inclusion of regular languages in deterministic context-free languages). Thus P false and Q true, option C.

Original paper, page 13

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Register allocation and MOV count in a basic block

Code Generation & Register Allocation

Question 54, GATE 2007: A computer has only two registers. Instructions OP Rj,Ri store Rj OP Ri in Ri; OP m,Ri store M[m] OP Ri in Ri; OP is ADD or SUB. MOV m,Ri loads memory into a register and MOV Ri,m stores a register to memory. Generate code for t1=a+b; t2=c+d; t3=e−t2; t4=t1−t3. All operands start in memory and the final result must be in memory. What minimum MOV count is intended?
Options:
(A) 2
(B) 3
(C) 5
(D) 6
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. Track the unusual operand order: SUB e,R2 computes e−R2, not R2−e. Under expression-preserving generation, retain t1 in one register while computing t2 and t3 in the other. The scope of permitted algebraic rewrites affects the literal minimum.

2. Derivation and interpretation. For expression-preserving code generation, three MOVs suffice: MOV a,R1; ADD b,R1; MOV c,R2; ADD d,R2; SUB e,R2; SUB R1,R2; MOV R2,t4. The specified source-minus-destination semantics gives R1=t1, R2=t2 then t3=e−t2 then t4=t1−t3. There are two loads to initialize the two independently computed subexpressions and one store, yielding the intended option B (3). This minimum presumes the usual task of generating code for the given expression structure. If algebraic reassociation is allowed, two MOVs suffice: MOV c,R1; ADD d,R1; SUB e,R1; SUB a,R1; ADD b,R1; MOV R1,t4. This computes t4=a−(e−(c+d))+b. Furthermore, if arbitrary arithmetic instructions may initialize a register, SUB R1,R1 makes zero; replacing the initial MOV c,R1 by SUB R1,R1; ADD c,R1 leaves only the final MOV. Hence the literal unrestricted minimum is not 3, and the scope assumption must be disclosed; B is an intended, conditional answer rather than an unconditional theorem.

Original paper, page 13

2 marks · MCQ
Report issue

Shortest remaining time scheduling and waiting time

CPU Scheduling

Question 55, GATE 2007: Shortest Remaining Time first schedules four processes: P1 arrives at 0 and requires 20 units; P2 at 15 requires 25; P3 at 30 requires 10; P4 at 45 requires 15. What is P2’s total waiting time?
Options:
(A) 5
(B) 15
(C) 40
(D) 55
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (8 steps)

1. Approach. At each arrival compare remaining service, not original burst lengths. Draw the execution intervals and count only the intervals after P2 arrives during which it is ready but not running.

2. Derivation and interpretation. P1 runs from 0 to 20: at P2's arrival at 15, P1 has only 5 units left versus P2's 25. P2 runs 20–30, leaving 15; P3 then arrives with 10 and runs 30–40. P2 resumes at 40. When P4 arrives at 45, P2 has 10 left versus P4's 15, so P2 continues until 55. Its waiting intervals are 15–20 and 30–40, totaling 5+10=15 (B). Equivalently completion−arrival−execution=55−15−25=15.

Original paper, page 13

2 marks · MCQ
Report issue

FIFO anomaly and locality of reference

Virtual Memory & Paging

Question 56, GATE 2007: A virtual-memory system uses FIFO replacement with a fixed allocation of frames. P: increasing a process’s frame allocation sometimes increases its page-fault rate. Q: some programs do not exhibit locality of reference. Which statement is true?
Options:
(A) Both true and Q explains P
(B) Both true but Q does not explain P
(C) P false,Q true
(D) Both false
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. Separate truth from causation. Belady’s anomaly is possible because FIFO does not retain a nested set of resident pages as frame count grows; locality is not the defining cause.

2. Derivation and interpretation. P is true: FIFO can exhibit Belady's anomaly. For example, reference string 1,2,3,4,1,2,5,1,2,3,4,5 incurs 9 faults with three initially empty frames but 10 with four. Q is also true: programs can make accesses without useful locality, for example broadly scattered independent random accesses. Q does not explain the anomaly; the issue is FIFO's failure of the stack-inclusion property, not simply the presence or absence of locality. Stack algorithms such as LRU do not exhibit this anomaly even on reference strings without locality. Thus B.

Original paper, page 14

2 marks · MCQ
Report issue

Safe completion order from available resources

Deadlocks

Question 57, GATE 2007: Three processes share resource types X,Y,Z, with 5 units of each. Allocated and additionally requested vectors (X,Y,Z) are: P0 alloc=(1,2,1), request=(1,0,3); P1 alloc=(2,0,1), request=(0,1,2); P2 alloc=(2,2,1), request=(1,2,0). Each request is needed to finish, after which resources are released. Which process finishes last?
Options:
(A) P0
(B) P1
(C) P2
(D) None; the system is deadlocked
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (5 steps)

1. Approach. Subtract all allocations from the total vector to obtain current availability. Repeatedly choose a process whose remaining request fits componentwise, then add its old allocation back to availability.

2. Derivation and interpretation. Allocated totals are (1,2,1)+(2,0,1)+(2,2,1)=(5,4,3), so the initial available vector is (0,1,2). Only P1's remaining request (0,1,2) can be met. After P1 completes and returns all its resources, availability becomes (0,1,2)+(2,0,1)=(2,1,3). P0's request (1,0,3) can now be met, while P2 still needs two Y units but only one is available. P0 finishes next, leaving availability (2,1,3)+(1,2,1)=(3,3,4), which permits P2's request (1,2,0). The forced safe order is P1,P0,P2, so P2 finishes last (C), assuming each request is the additional resource vector needed for completion as stated.

Original paper, page 14

2 marks · MCQ
Report issue

Two intent flags give mutual exclusion but may deadlock

Synchronization & Concurrency

Question 58, GATE 2007: Shared flags wants1,wants2 are initially false. P1 executes:
while(true) { wants1=true; while(wants2==true); /* critical section */ wants1=false; }
P2 executes:
while(true) { wants2=true; while(wants1==true); /* critical section */ wants2=false; }
The source places each remainder-section comment after its loop. Under atomic sequentially consistent flag operations, which statement is intended?
Options:
(A) Mutual exclusion is not ensured
(B) Bounded waiting is not ensured
(C) Critical sections must alternate strictly
(D) Deadlock is not prevented, but mutual exclusion is ensured
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. Test safety and progress separately. Two critical sections cannot overlap because each entrant advertises its intent. But if both advertise before either tests, neither can reach the instruction clearing its flag.

2. Derivation and interpretation. Under the standard sequentially consistent, atomic-read/write pseudocode model, each process sets its own wants flag before testing the other's flag and keeps it true throughout its critical section. Thus both cannot pass their tests and overlap in the critical section: whichever passes first prevents the other entering until it clears its flag. However, if both set their flags before either tests the other, each spins forever, giving deadlock. Thus D describes the decisive combination: mutual exclusion holds but deadlock prevention fails. Strict alternation is not required; one process can repeatedly enter while the other does not request entry. Option B needs care: under a broad interpretation that bounded waiting guarantees eventual entry, deadlock also violates it. In the usual bounded-overtaking formulation, distinguish this progress failure from another process overtaking a waiter indefinitely; the latter cannot occur here. D is the intended most specific answer, while the phrasing of B can be read more broadly.

Original paper, page 14

2 marks · MCQ
Report issue

Relational difference detects missing female enrollments

Relational Algebra & Calculus

Question 59, GATE 2007: Relations are studInfo(studId,name,sex), keyed by studId, and enroll(studId,courseId), keyed by the pair. Every course has at least one male and one female enrollee. What does π_courseId(((π_studId(σ_sex="female"(studInfo))) × π_courseId(enroll)) − enroll) return?
Options:
(A) Courses taken by all female students
(B) Courses taken by a proper subset of female students
(C) Courses taken only by male students
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. The Cartesian product enumerates required pairs for every female student to take every course. Subtraction identifies missing pairs, and projection asks which courses have at least one such missing pair.

2. Derivation and interpretation. Let F be the set of female student IDs and C the set of course IDs occurring in enroll. The Cartesian product F×C contains every possible female-student/course pair. Subtracting enroll leaves exactly pairs (f,c) for which female f is not enrolled in c. Projecting on courseId therefore returns courses missing at least one female student. Since the premise says every course has at least one female enrollee, these are courses whose female enrollee set is a nonempty proper subset of all female students. This is B, not courses taken by every female student.

Original paper, page 15

2 marks · MCQ
Report issue

Universal condition on immediate subordinates

Relational Algebra & Calculus

Question 60, GATE 2007: employee(name,sex,supervisorName) has key name. supervisorName names an employee’s supervisor. Interpret the tuple-calculus query {e.name | employee(e) ∧ ∀x[¬employee(x) ∨ x.supervisorName≠e.name ∨ x.sex="male"]}.
Options:
(A) Employees with a male supervisor
(B) Employees with no immediate male subordinates
(C) Employees with no immediate female subordinates
(D) Employees with a female supervisor
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Rewrite the disjunction as an implication about x: if x is an employee supervised by e, x must be male. Universal conditions are true even when e has no subordinates.

2. Derivation and interpretation. The universal disjunction ¬employee(x) ∨ x.supervisorName≠e.name ∨ x.sex=male is the implication: if x is an employee supervised by e, then x is male. Consequently the result includes employees all of whose immediate subordinates are male, including employees with no subordinates by vacuous truth. Under the male/female domain convention used by the options, this is exactly employees with no immediate female subordinates (C). It says nothing about the sex of e's own supervisor.

Original paper, page 15

2 marks · MCQ
Report issue

Salary greater than every department employee

SQL & Queries

Question 61, GATE 2007: employee(empId,name,department,salary) has more than one employee in department 5. We want employees paid more than every department-5 employee. Compare:
Q1: SELECT e.empId FROM employee e WHERE NOT EXISTS (SELECT * FROM employee s WHERE s.department="5" AND s.salary>=e.salary);
Q2: SELECT e.empId FROM employee e WHERE e.salary > ANY (SELECT DISTINCT salary FROM employee s WHERE s.department="5");
Which statement is intended for an arbitrary table under non-NULL salary semantics?
Options:
(A) Q1 is correct
(B) Q2 is correct
(C) Both always produce the same answer
(D) Neither is correct
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. NOT EXISTS rejects the presence of a counterexample to “greater than everyone.” SQL ANY is existential: satisfying one comparison suffices. DISTINCT does not change that quantifier.

2. Derivation and interpretation. For each e, Q1 excludes e whenever any department-5 employee has salary >= e.salary. Thus it keeps exactly salaries strictly greater than the department maximum. Q2 uses > ANY, which means greater than at least one returned salary, not every salary. For department salaries 10 and 20, a salary 15 passes Q2 but not Q1. Hence A under the usual non-NULL salary interpretation. Strict SQL NULL semantics require qualification: NULL comparisons are UNKNOWN, so Q1 can admit NULL salaries or ignore unknown department salaries; no NOT NULL constraint is printed.

Original paper, page 15

2 marks · MCQ
Report issue

Normal-form transitive dependency

Normalization & Decomposition

Question 62, GATE 2007: Which normalization statement is intended to be false? Interpret the textbook conventions discussed in the solution.
Options:
(A) Any two-attribute relation is in BCNF
(B) A relation whose every candidate key has one attribute is in 2NF
(C) A prime attribute can be transitively dependent on a key in a 3NF relation
(D) A prime attribute can be transitively dependent on a key in a BCNF relation
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. For a nontrivial dependency X→A, 3NF permits either X to be a superkey or A to be prime. BCNF removes the prime-attribute exception. Definitions of transitive dependence and empty determinants matter here.

2. Derivation and interpretation. Under standard textbook normalization conventions, a two-attribute relation is BCNF: a nontrivial dependency from one attribute to the other makes its determinant a key. Single-attribute candidate keys have no proper nonempty subset, so no partial dependency prevents 2NF. In 3NF a non-key determinant may determine a prime attribute, permitting the transitive dependency in C. BCNF instead requires every nontrivial determinant to be a superkey, so it excludes a transitive dependency through a non-key determinant. D is the intended false statement. Here transitive dependency means the normalization violation through a non-superkey, not merely any composable implication. The claims about two-attribute relations and singleton keys also assume the textbook convention excluding nontrivial empty-determinant dependencies. If such dependencies are allowed, R(A,B) with ∅ -> B and candidate key A violates both BCNF and 2NF: ∅ is not a superkey, and the nonprime B depends on a proper subset of key A. Consequently A and B are also false under that fully general interpretation, so D is the intended answer only with this convention.

Original paper, page 15

2 marks · MCQ
Report issue

B+ tree leaf capacity

Indexing, Storage & Query Processing

Question 63, GATE 2007: The order of a B+ tree leaf is the maximum number of (value,data-record-pointer) pairs it can hold. Block size is 1K bytes, value size 9 bytes, record-pointer size 7 bytes and block-pointer size 6 bytes. What is the leaf order?
Options:
(A) 63
(B) 64
(C) 67
(D) 68
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Reserve space for the leaf’s next-block pointer before dividing the remaining bytes by entry size. Use 1K=1024 bytes and round the result down, because partial entries cannot be stored.

2. Derivation and interpretation. A leaf stores m pairs of 9-byte values and 7-byte record pointers, plus a 6-byte pointer to the next leaf. Therefore 16m+6 <= 1024, giving m <= floor(1018/16)=63. Answer A. Ignoring the leaf-link pointer would incorrectly give 64.

Original paper, page 16

2 marks · MCQ
Report issue

Conflict serializability of two schedules

Transactions & Concurrency Control

Question 64, GATE 2007: For two transactions, consider schedules S1: r1(X);r1(Y);r2(X);r2(Y);w2(Y);w1(X) and S2: r1(X);r2(X);r2(Y);w2(Y);r1(Y);w1(X). Which are conflict serializable?
Options:
(A) Both
(B) S1 only
(C) S2 only
(D) Neither
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (2 schedules)

1. Approach. Create a precedence edge only between different transactions on the same item when at least one access is a write. Read–read pairs do not conflict. A cycle is exactly the obstruction to conflict serializability.

2. Derivation and interpretation. In S1, r1(Y) precedes w2(Y), producing T1 -> T2, while r2(X) precedes w1(X), producing T2 -> T1. The cycle prevents conflict serializability. In S2, w2(Y) precedes r1(Y) and r2(X) precedes w1(X), both giving T2 -> T1; there is no reverse edge. S2 is equivalent to serial order T2,T1. Thus C.

Original paper, page 16

2 marks · MCQ
Report issue

Exactly one slotted-LAN transmission

Medium Access & Ethernet

Question 65, GATE 2007: A slotted LAN has n stations. Each station independently attempts to transmit with probability p in a slot. What is the probability that exactly one station transmits?
Options:
(A) np(1−p)^(n−1)
(B) (1−p)^(n−1)
(C) p(1−p)^(n−1)
(D) 1−(1−p)^(n−1)
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Choose which station is the sole sender, then require it to transmit and every other station to remain silent. The n resulting events are mutually exclusive, so add their probabilities.

2. Derivation and interpretation. Assuming independent station attempts, a fixed station transmits alone with probability p(1-p)n-1. There are n disjoint choices for the sole transmitter, giving np(1-p)n-1, option A.

Original paper, page 16

2 marks · MCQ
Report issue

Cable length of one bit delay

Physical Layer & Transmission

Question 66, GATE 2007: A token-ring network transmits at 10^7 bits/s and signals propagate at 200 metres per microsecond. What cable length corresponds to a one-bit delay?
Options:
(A) 500 metres
(B) 200 metres
(C) 20 metres
(D) 50 metres
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Convert bit rate to time per bit by taking the reciprocal. Express that time in microseconds before multiplying by the propagation speed to avoid a factor-of-a-million unit error.

2. Derivation and interpretation. At 107 bits/s, one bit takes 10-7 s = 0.1 microsecond. During this time a signal travels 200 metres/microsecond times 0.1 microsecond = 20 metres. Answer C.

Original paper, page 16

2 marks · MCQ
Report issue

Class B subnet and host counts

IP Addressing, Fragmentation & Address Resolution

Question 67, GATE 2007: A class B address is divided into subnets using a 6-bit subnet number. What maximum numbers of subnets and hosts per subnet are intended?
Options:
(A) 62 subnets,262142 hosts
(B) 64 subnets,262142 hosts
(C) 62 subnets,1022 hosts
(D) 64 subnets,1024 hosts
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. A class B prefix originally leaves 16 bits. Assigning six of those to subnet IDs leaves ten for hosts. Distinguish historical reserved subnet IDs from reserved host IDs and modern subnet conventions.

2. Derivation and interpretation. A class B network leaves 16 bits after its network prefix. Borrowing 6 subnet bits leaves 10 host bits, so usable ordinary unicast hosts per subnet are 210-2=1022. Under the historical convention excluding all-zero and all-one subnet numbers, the subnet count is 26-2=62, giving C. Modern subnetting permits those two subnet numbers and gives 64 subnets with 1022 hosts each; that pair is absent from the options. C is conditional on the obsolete convention, not a modern universal maximum.

Original paper, page 16

2 marks · MCQ
Report issue

CRC using polynomial x cubed plus one

Data Link, Framing, Error Control & ARQ

Question 68, GATE 2007: Protect message 11001001 using CRC generator x³+1. Which bit string should be transmitted?
Options:
(A) 11001001000
(B) 11001001011
(C) 11001010
(D) 110010010011
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (8 steps)

1. Approach. The generator degree is three, so append exactly three zero bits before polynomial division. Subtraction over GF(2) is XOR, with no borrowing. Replace the three zero placeholders by the remainder.

2. Derivation and interpretation. The generator x3+1 is binary 1001. Append three zeroes to 11001001, obtaining 11001001000. Modulo-2 division by 1001 has remainder 011. Replace the trailing zeroes by this remainder to transmit 11001001011, option B. Dividing this codeword by 1001 gives zero remainder.

Original paper, page 16

2 marks · MCQ
Report issue

Sliding-window sequence field width

Data Link, Framing, Error Control & ARQ

Question 69, GATE 2007: Stations M,N are L kilometres apart. Frames have K bits; propagation delay is t seconds per kilometre; channel capacity is R bits/s; processing delay is negligible. What minimum sequence-number bit width is intended for maximum utilization with the stated “sliding window” protocol? ACK timing and protocol variant are not explicitly specified.
Options:
(A) ceil(log₂((2LtR+2K)/K))
(B) ceil(log₂(2LtR/K))
(C) ceil(log₂((2LtR+K)/K))
(D) ceil(log₂((2LtR+K)/(2K)))
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. A frame takes K/R seconds to serialize and an ACK takes a round trip of approximately 2Lt after the frame is sent. First find the necessary window in frames, then apply the Go-Back-N sequence-space constraint; do not confuse window size with number of labels.

2. Derivation and interpretation. Let transmission time T=K/R and one-way propagation time P=Lt. With negligible ACK serialization, full utilization needs an integer window W >= ceil(1+2P/T). For Go-Back-N with an m-bit sequence field, W <= 2m-1, hence m >= ceil(log2(2+2LtR/K)); this is option A. The problem says only sliding window, not Go-Back-N, and does not state ACK timing: Selective Repeat instead needs sequence space at least 2W, while counting merely enough distinct labels without the Go-Back-N guard gives a different expression. Therefore A requires the standard Go-Back-N/negligible-ACK interpretation; the generic wording alone does not uniquely fix the answer.

Original paper, page 17

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Protocols matched to functional network layers

Network Layers & Devices

Question 70, GATE 2007: Match P: SMTP, Q: BGP, R: TCP, S: PPP to 1: Application, 2: Transport, 3: Data link, 4: Network, 5: Physical layer.
Options:
(A) P-2,Q-1,R-3,S-5
(B) P-1,Q-4,R-2,S-3
(C) P-1,Q-4,R-2,S-5
(D) P-2,Q-4,R-1,S-3
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. SMTP transfers mail, TCP provides end-to-end transport, and PPP frames data on a link. The offered matching classifies BGP by its routing function; its TCP-based transport is a separate layering nuance.

2. Derivation and interpretation. SMTP provides application-layer mail transfer (1); BGP performs interdomain routing, conventionally classified here by its network-layer function (4); TCP is transport-layer (2); PPP is data-link-layer (3). Thus P-1,Q-4,R-2,S-3, option B. BGP actually exchanges control messages over TCP, so its implementation can also be described as an application-layer protocol; the offered matching uses routing function.

Original paper, page 17

2 marks · MCQ
Report issue

Data memory references in a loop

Instructions & Addressing Modes

Question 71, GATE 2007: R1,R2,R3 are general-purpose registers. The program, operation, and size in words are:
MOV R1,(3000): R1←M[3000], 2 words
LOOP: MOV R2,(R3): R2←M[R3], 1 word
ADD R2,R1: R2←R1+R2, 1 word
MOV (R3),R2: M[R3]←R2, 1 word
INC R3: R3←R3+1, 1 word
DEC R1: R1←R1−1, 1 word
BNZ LOOP: branch if the result is nonzero, 2 words
HALT: stop, 1 word.
Initially M[3000]=10, R3=2000 and each location 2000–2010 contains 100. The program begins at location 1000; all these numbers are decimal.
Assume word-addressable memory. How many data-memory references occur while running the whole program?
Options:
(A) 10
(B) 11
(C) 20
(D) 21
Question 71, GATE 2007: R1,R2,R3 are general-purpose registers. The program, operation, and size in words are:
MOV R1,(3000): R1←M[3000], 2 words
LOOP: MOV R2,(R3): R2←M[R3], 1 word
ADD R2,R1: R2←R1+R2, 1 word
MOV (R3),R2: M[R3]←R2, 1 word
INC R3: R3←R3+1, 1 word
DEC R1: R1←R1−1, 1 word
BNZ LOOP: branch if the result is nonzero, 2 words
HALT: stop, 1 word.
Initially M[3000]=10, R3=2000 and each location 2000–2010 contains 100. The program begins at location 1000; all these numbers are decimal.
Assume word-addressable memory. How many data-memory references occur while running the whole program?
Options:
(A) 10
(B) 11
(C) 20
(D) 21
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. R1 is the countdown and starts at ten. Separate instruction fetches from data accesses: only the initial load and the two memory-operand MOVs inside each iteration count.

2. Derivation and interpretation. The initial MOV reads M[3000] once and sets R1=10. Each of 10 iterations reads M[R3] once and writes it once. All other operand operations are on registers; instruction fetches are not data references. Total data memory references = 1+10*2=21, option D.

Original paper, page 18

2 marks · MCQ
Report issue

Final value beyond loop write range

Instructions & Addressing Modes

Question 72, GATE 2007: R1,R2,R3 are general-purpose registers. The program, operation, and size in words are:
MOV R1,(3000): R1←M[3000], 2 words
LOOP: MOV R2,(R3): R2←M[R3], 1 word
ADD R2,R1: R2←R1+R2, 1 word
MOV (R3),R2: M[R3]←R2, 1 word
INC R3: R3←R3+1, 1 word
DEC R1: R1←R1−1, 1 word
BNZ LOOP: branch if the result is nonzero, 2 words
HALT: stop, 1 word.
Initially M[3000]=10, R3=2000 and each location 2000–2010 contains 100. The program begins at location 1000; all these numbers are decimal.
Assume word-addressable memory. What is the final content of location 2010?
Options:
(A) 100
(B) 101
(C) 102
(D) 110
Question 72, GATE 2007: R1,R2,R3 are general-purpose registers. The program, operation, and size in words are:
MOV R1,(3000): R1←M[3000], 2 words
LOOP: MOV R2,(R3): R2←M[R3], 1 word
ADD R2,R1: R2←R1+R2, 1 word
MOV (R3),R2: M[R3]←R2, 1 word
INC R3: R3←R3+1, 1 word
DEC R1: R1←R1−1, 1 word
BNZ LOOP: branch if the result is nonzero, 2 words
HALT: stop, 1 word.
Initially M[3000]=10, R3=2000 and each location 2000–2010 contains 100. The program begins at location 1000; all these numbers are decimal.
Assume word-addressable memory. What is the final content of location 2010?
Options:
(A) 100
(B) 101
(C) 102
(D) 110
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Track the address used before INC R3, not after it. The first iteration uses 2000; after ten iterations R3 reaches 2010 only when the loop is about to terminate.

2. Derivation and interpretation. R3 starts at 2000. The 10 loop iterations access addresses 2000 through 2009, then R3 becomes 2010 and R1 becomes zero, ending the loop. Address 2010 is never written, so its initial content 100 remains. Answer A.

Original paper, page 18

2 marks · MCQ
Report issue

Return address after interrupting INC

Input/Output, DMA & Interrupts

Question 73, GATE 2007: R1,R2,R3 are general-purpose registers. The program, operation, and size in words are:
MOV R1,(3000): R1←M[3000], 2 words
LOOP: MOV R2,(R3): R2←M[R3], 1 word
ADD R2,R1: R2←R1+R2, 1 word
MOV (R3),R2: M[R3]←R2, 1 word
INC R3: R3←R3+1, 1 word
DEC R1: R1←R1−1, 1 word
BNZ LOOP: branch if the result is nonzero, 2 words
HALT: stop, 1 word.
Initially M[3000]=10, R3=2000 and each location 2000–2010 contains 100. The program begins at location 1000; all these numbers are decimal.
Now assume byte-addressable memory and 32-bit words. If an ordinary interrupt occurs while INC R3 executes, what return address is pushed onto the stack?
Options:
(A) 1005
(B) 1020
(C) 1024
(D) 1040
Question 73, GATE 2007: R1,R2,R3 are general-purpose registers. The program, operation, and size in words are:
MOV R1,(3000): R1←M[3000], 2 words
LOOP: MOV R2,(R3): R2←M[R3], 1 word
ADD R2,R1: R2←R1+R2, 1 word
MOV (R3),R2: M[R3]←R2, 1 word
INC R3: R3←R3+1, 1 word
DEC R1: R1←R1−1, 1 word
BNZ LOOP: branch if the result is nonzero, 2 words
HALT: stop, 1 word.
Initially M[3000]=10, R3=2000 and each location 2000–2010 contains 100. The program begins at location 1000; all these numbers are decimal.
Now assume byte-addressable memory and 32-bit words. If an ordinary interrupt occurs while INC R3 executes, what return address is pushed onto the stack?
Options:
(A) 1005
(B) 1020
(C) 1024
(D) 1040
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Sum instruction lengths through the completed INC, multiply by four bytes per word, and add the program base. An ordinary interrupt resumes at the next instruction, not at the interrupted instruction’s starting address.

2. Derivation and interpretation. Instructions up through INC occupy 2+1+1+1+1=6 words. At 4 bytes per word, the next instruction DEC R1 is at byte address 1000+6*4=1024. An ordinary interrupt is serviced after the current instruction completes and saves the next instruction address, so C. The INC itself starts at 1020.

Original paper, page 18

2 marks · MCQ
Report issue

Language of finite-state automaton

Regular Expressions & Languages

Question 74, GATE 2007: A DFA over {a,b} has start state q0, accepting states q1,q2 and nonaccepting states q0,q3. Its complete transition table is: q0: a→q1,b→q0; q1: a→q2,b→q1; q2: a→q1,b→q2; q3: a→q1,b→q2.
Which regular expression denotes its language? Here + denotes union.
Options:
(A) b*ab*ab*ab*
(B) (a+b)*
(C) b*a(a+b)*
(D) b*ab*ab*
Question 74, GATE 2007: A DFA over {a,b} has start state q0, accepting states q1,q2 and nonaccepting states q0,q3. Its complete transition table is: q0: a→q1,b→q0; q1: a→q2,b→q1; q2: a→q1,b→q2; q3: a→q1,b→q2.
Which regular expression denotes its language? Here + denotes union.
Options:
(A) b*ab*ab*ab*
(B) (a+b)*
(C) b*a(a+b)*
(D) b*ab*ab*
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Before the first a the machine stays in nonaccepting q0. Once an a occurs, every later transition stays within the accepting pair q1,q2. q3 cannot affect strings read from the start state.

2. Derivation and interpretation. The start state q0 loops on b and is not accepting. Its first a enters accepting q1. Thereafter a alternates between q1 and q2 and b loops in either accepting state, so every suffix over {a,b} is accepted. q3 is unreachable from q0. Thus exactly the strings containing at least one a are accepted: b*a(a+b)*, option C.

Original paper, page 19

2 marks · MCQ
Report issue

Minimum equivalent DFA size

Finite Automata

Question 75, GATE 2007: A DFA over {a,b} has start state q0, accepting states q1,q2 and nonaccepting states q0,q3. Its complete transition table is: q0: a→q1,b→q0; q1: a→q2,b→q1; q2: a→q1,b→q2; q3: a→q1,b→q2.
How many states does a minimum equivalent DFA have?
Options:
(A) 1
(B) 2
(C) 3
(D) 4
Question 75, GATE 2007: A DFA over {a,b} has start state q0, accepting states q1,q2 and nonaccepting states q0,q3. Its complete transition table is: q0: a→q1,b→q0; q1: a→q2,b→q1; q2: a→q1,b→q2; q3: a→q1,b→q2.
How many states does a minimum equivalent DFA have?
Options:
(A) 1
(B) 2
(C) 3
(D) 4
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. First remove unreachable states, then partition the remaining states by whether any suffix distinguishes their acceptance. q1 and q2 have identical future acceptance behavior even though their names differ.

2. Derivation and interpretation. Delete unreachable q3. States q1 and q2 are equivalent: both accept, b leaves each in the accepting class, and a switches within that class. Merge them. The remaining nonaccepting q0 and accepting merged state are distinguishable by the empty suffix, so two states are necessary and sufficient. Answer B.

Original paper, page 19

2 marks · MCQ
Report issue

Huffman code for dyadic probabilities

Greedy Algorithms

Question 76, GATE 2007: Letters a,b,c,d,e,f occur with probabilities 1/2,1/4,1/8,1/16,1/32,1/32, respectively. Which list, in a,b,c,d,e,f order, is a Huffman code?
Options:
(A) 0,10,110,1110,11110,11111
(B) 11,10,011,010,001,000
(C) 11,10,01,001,0001,0000
(D) 110,100,010,000,001,111
Question 76, GATE 2007: Letters a,b,c,d,e,f occur with probabilities 1/2,1/4,1/8,1/16,1/32,1/32, respectively. Which list, in a,b,c,d,e,f order, is a Huffman code?
Options:
(A) 0,10,110,1110,11110,11111
(B) 11,10,011,010,001,000
(C) 11,10,01,001,0001,0000
(D) 110,100,010,000,001,111
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Repeatedly merge the two lowest-probability nodes. Code length is leaf depth in the resulting binary tree; high-probability a should get a one-bit word. Prefix-free alone is not enough to guarantee optimality.

2. Derivation and interpretation. Huffman merging combines e and f (1/32 each) into 1/16, merges with d to 1/8, merges with c to 1/4, merges with b to 1/2, then merges with a. The resulting leaf depths for a,b,c,d,e,f are 1,2,3,4,5,5. Option A supplies a prefix code with these depths: 0,10,110,1110,11110,11111. Bit reversal at internal branches can give other equivalent codes, but A is the listed optimal code.

Original paper, page 19

2 marks · MCQ
Report issue

Average Huffman code length

Greedy Algorithms

Question 77, GATE 2007: Letters a,b,c,d,e,f occur with probabilities 1/2,1/4,1/8,1/16,1/32,1/32, respectively. What is the average length of an optimal binary Huffman code (the linked Q76 code)? Derive the code lengths from these probabilities.
Options:
(A) 3
(B) 2.1875
(C) 2.25
(D) 1.9375
Question 77, GATE 2007: Letters a,b,c,d,e,f occur with probabilities 1/2,1/4,1/8,1/16,1/32,1/32, respectively. What is the average length of an optimal binary Huffman code (the linked Q76 code)? Derive the code lengths from these probabilities.
Options:
(A) 3
(B) 2.1875
(C) 2.25
(D) 1.9375
Question 77, GATE 2007: Letters a,b,c,d,e,f occur with probabilities 1/2,1/4,1/8,1/16,1/32,1/32, respectively. What is the average length of an optimal binary Huffman code (the linked Q76 code)? Derive the code lengths from these probabilities.
Options:
(A) 3
(B) 2.1875
(C) 2.25
(D) 1.9375
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. Average code length is probability-weighted, not the arithmetic mean of the six word lengths. Huffman merging gives lengths 1,2,3,4,5,5, with the shortest code assigned to the most frequent symbol.

2. Derivation and interpretation. Using the independently derived lengths 1,2,3,4,5,5, the weighted average is (1/2)*1+(1/4)*2+(1/8)*3+(1/16)*4+(1/32)*5+(1/32)*5 = 31/16 = 1.9375 bits per symbol. Answer D.

Original paper, page 19

2 marks · MCQ
Report issue

String generated by equal-count grammar

Context-Free Grammars & Languages

Question 78, GATE 2007: A context-free grammar has nonterminals {S,A,B}, terminals {a,b}, start S, and productions S→aB | bA; B→b | bS | aBB; A→a | aS | bAA. Which string is generated?
Options:
(A) aaaabb
(B) aabbbb
(C) aabbab
(D) abbbba
Question 78, GATE 2007: A context-free grammar has nonterminals {S,A,B}, terminals {a,b}, start S, and productions S→aB | bA; B→b | bS | aBB; A→a | aS | bAA. Which string is generated?
Options:
(A) aaaabb
(B) aabbbb
(C) aabbab
(D) abbbba
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (4 derivations)

1. Approach. Track the invariant #a−#b for strings derived from each nonterminal: it is 0 from S, +1 from A and −1 from B. Reject options violating the invariant, then construct a derivation for the survivor.

2. Derivation and interpretation. Every S-derived string has equal numbers of a and b; A-derived strings have one more a, and B-derived strings one more b. These invariants follow directly from all eight productions. Only aabbab among the four options has equal counts. It is generated by S => aB => aaBB => aabB => aabbS => aabbaB => aabbab. Thus C.

Original paper, page 20

2 marks · MCQ
Report issue

Number of parse trees for aabbab

Context-Free Grammars & Languages

Question 79, GATE 2007: A context-free grammar has nonterminals {S,A,B}, terminals {a,b}, start S, and productions S→aB | bA; B→b | bS | aBB; A→a | aS | bAA. For aabbab, the answer string to linked Q78, how many distinct derivation trees exist?
Options:
(A) 1
(B) 2
(C) 3
(D) 4
Question 79, GATE 2007: A context-free grammar has nonterminals {S,A,B}, terminals {a,b}, start S, and productions S→aB | bA; B→b | bS | aBB; A→a | aS | bAA. For aabbab, the answer string to linked Q78, how many distinct derivation trees exist?
Options:
(A) 1
(B) 2
(C) 3
(D) 4
Question 79, GATE 2007: A context-free grammar has nonterminals {S,A,B}, terminals {a,b}, start S, and productions S→aB | bA; B→b | bS | aBB; A→a | aS | bAA. For aabbab, the answer string to linked Q78, how many distinct derivation trees exist?
Options:
(A) 1
(B) 2
(C) 3
(D) 4
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (2 derivations)

1. Approach. The first two a symbols force S→aB→aaBB. Enumerate how the remaining bbab splits between the two B subtrees. Count trees, not different orders of expanding the same tree.

2. Derivation and interpretation. The first two terminals aa force S -> aB and B -> aBB. The remaining bbab must split between the two B children. Each child has one more b than a. Exactly two splits work: b | bab and bba | b. For the first, the right child uniquely derives bab via B -> bS -> baB -> bab. For the second, the left child uniquely derives bba via B -> bS -> bbA -> bba. The single b children use B -> b. Thus there are 2 parse trees, option B; different orders of expanding a fixed tree do not count as additional trees.

Original paper, page 20

2 marks · MCQ
Report issue

Cache misses across two array scans

Cache Memory

Question 80, GATE 2007: Main memory is byte-addressable with 2^16 bytes. A direct-mapped data cache has 32 lines, 64 bytes each, and starts empty. A 50×50 array of bytes is contiguous starting at hexadecimal address 1100H. The complete array is accessed twice, with no intervening changes to cache contents. The source does not specify traversal order; use increasing-address scans for the intended result. How many total data-cache misses occur?
Options:
(A) 48
(B) 50
(C) 56
(D) 59
Question 80, GATE 2007: Main memory is byte-addressable with 2^16 bytes. A direct-mapped data cache has 32 lines, 64 bytes each, and starts empty. A 50×50 array of bytes is contiguous starting at hexadecimal address 1100H. The complete array is accessed twice, with no intervening changes to cache contents. The source does not specify traversal order; use increasing-address scans for the intended result. How many total data-cache misses occur?
Options:
(A) 48
(B) 50
(C) 56
(D) 59
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Convert the starting address to a block number and count all touched blocks, including the partial final block. For the second scan, identify conflicts modulo the 32 cache lines instead of treating all 40 blocks as compulsory misses again.

2. Derivation and interpretation. Assuming each complete pass reads the array in increasing memory-address order, the 2500-byte array begins at 0x1100=4352, a 64-byte boundary. It spans ceil(2500/64)=40 blocks, numbered 68 through 107. The cold first pass misses 40 times. In the 32-line direct-mapped cache, blocks 68–75 and 100–107 compete for lines 4–11. In the second pass, loading 68–75 evicts 100–107, so both groups miss again, while the other 24 blocks hit. Total 40+8+8=56, option C. Merely saying the complete array is accessed does not specify traversal order; different orders can produce different miss counts.

Original paper, page 20

2 marks · MCQ
Report issue

Cache lines replaced on second scan

Cache Memory

Question 81, GATE 2007: Main memory is byte-addressable with 2^16 bytes. A direct-mapped data cache has 32 lines, 64 bytes each, and starts empty. A 50×50 array of bytes is contiguous starting at hexadecimal address 1100H. The complete array is accessed twice, with no intervening changes to cache contents. The source does not specify traversal order; use increasing-address scans for the intended result. Which cache lines are replaced by new blocks during the second access? Lines are numbered from zero.
Options:
(A) 4 through 11
(B) 4 through 12
(C) 0 through 7
(D) 0 through 8
Question 81, GATE 2007: Main memory is byte-addressable with 2^16 bytes. A direct-mapped data cache has 32 lines, 64 bytes each, and starts empty. A 50×50 array of bytes is contiguous starting at hexadecimal address 1100H. The complete array is accessed twice, with no intervening changes to cache contents. The source does not specify traversal order; use increasing-address scans for the intended result. Which cache lines are replaced by new blocks during the second access? Lines are numbered from zero.
Options:
(A) 4 through 11
(B) 4 through 12
(C) 0 through 7
(D) 0 through 8
Question 81, GATE 2007: Main memory is byte-addressable with 2^16 bytes. A direct-mapped data cache has 32 lines, 64 bytes each, and starts empty. A 50×50 array of bytes is contiguous starting at hexadecimal address 1100H. The complete array is accessed twice, with no intervening changes to cache contents. The source does not specify traversal order; use increasing-address scans for the intended result. Which cache lines are replaced by new blocks during the second access? Lines are numbered from zero.
Options:
(A) 4 through 11
(B) 4 through 12
(C) 0 through 7
(D) 0 through 8
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Map each memory block to block_number mod 32. Forty sequential blocks exceed the cache by eight, so identify which eight line indices are used twice rather than assuming that replacements start at line zero.

2. Derivation and interpretation. With increasing-address scans as in Q80, the array occupies blocks 68–107. Modulo 32, the first eight blocks 68–75 and final eight 100–107 both map to cache lines 4–11. Only those lines are replaced in the second scan, first by 68–75 and later by 100–107. Answer A. Lines are numbered from zero; the result is conditional on the scan-order assumption omitted from the common statement.

Original paper, page 20

2 marks · MCQ
Report issue

Optimal replacement page-fault count

Virtual Memory & Paging

Question 82, GATE 2007: A process has three initially empty page frames and reference string 1,2,1,3,7,4,5,6,3,1. How many page faults occur with optimal replacement?
Options:
(A) 7
(B) 8
(C) 9
(D) 10
Question 82, GATE 2007: A process has three initially empty page frames and reference string 1,2,1,3,7,4,5,6,3,1. How many page faults occur with optimal replacement?
Options:
(A) 7
(B) 8
(C) 9
(D) 10
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (12 steps)

1. Approach. At a miss with full frames, evict the page whose next reference lies farthest in the future, treating never-used-again pages as farthest. Keeping pages 1 and 3 is valuable because both are referenced at the end.

2. Derivation and interpretation. For references 1,2,1,3,7,4,5,6,3,1 with three initially empty frames, first load 1,2,3 (the second reference to 1 hits). When 7 arrives, discard 2 because it is never needed again. Retain 1 and 3 while replacing the third frame successively by 7,4,5,6; each of these pages has no future use. The final 3 and 1 then hit. Faults are on 1,2,3,7,4,5,6, totaling 7, option A. Seven distinct pages also give a matching lower bound.

Original paper, page 20

2 marks · MCQ
Report issue

Extra faults from LRU replacement

Virtual Memory & Paging

Question 83, GATE 2007: A process has three initially empty page frames and reference string 1,2,1,3,7,4,5,6,3,1. How many more faults does LRU incur than optimal replacement?
Options:
(A) 0
(B) 1
(C) 2
(D) 3
Question 83, GATE 2007: A process has three initially empty page frames and reference string 1,2,1,3,7,4,5,6,3,1. How many more faults does LRU incur than optimal replacement?
Options:
(A) 0
(B) 1
(C) 2
(D) 3
Question 83, GATE 2007: A process has three initially empty page frames and reference string 1,2,1,3,7,4,5,6,3,1. How many more faults does LRU incur than optimal replacement?
Options:
(A) 0
(B) 1
(C) 2
(D) 3
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (2 policies)

1. Approach. LRU uses past recency rather than future references. Maintain a least-recent-to-most-recent list and move a page to the end even on a hit; then compare the full LRU count with the optimal count.

2. Derivation and interpretation. LRU faults on references 1,2,3,7,4,5,6,3,1; only the early repeated 1 hits. After loading 3, the least-recent order is 2,1,3; successive new pages evict 2, then 1, then 3, then 7. Therefore final references 3 and 1 also fault. LRU has 9 faults versus the optimal 7, an excess of 2, option C.

Original paper, page 20

2 marks · MCQ
Report issue

Monotone lattice paths to ten ten

Combinatorics & Counting

Question 84, GATE 2007: A robot starts at (0,0). Each move increases either its x-coordinate or y-coordinate by one, so from (i,j) it can move to (i+1,j) or (i,j+1). How many paths reach (10,10)? C(n,k) denotes a binomial coefficient.
Options:
(A) C(20,10)
(B) 2^20
(C) 2^10
(D) None of these
Question 84, GATE 2007: A robot starts at (0,0). Each move increases either its x-coordinate or y-coordinate by one, so from (i,j) it can move to (i+1,j) or (i,j+1). How many paths reach (10,10)? C(n,k) denotes a binomial coefficient.
Options:
(A) C(20,10)
(B) 2^20
(C) 2^10
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Every valid path contains exactly ten right moves and ten up moves. Specify which ten of the twenty move positions are right moves; the rest are then fixed.

2. Derivation and interpretation. A path from (0,0) to (10,10) requires exactly ten right and ten up moves. Choose the positions of the ten right moves among the twenty total moves. The count is C(20,10)=184756, option A.

Original paper, page 21

2 marks · MCQ
Report issue

Monotone paths avoiding a forbidden edge

Combinatorics & Counting

Question 85, GATE 2007: A robot moves one unit right or up at each step, starting at (0,0) and ending at (10,10). It may not traverse the edge (4,4)→(5,4). How many paths remain? C(n,k) denotes a binomial coefficient.
Options:
(A) 2^9
(B) 2^19
(C) C(8,4)×C(11,5)
(D) C(20,10)−C(8,4)×C(11,5)
Question 85, GATE 2007: A robot moves one unit right or up at each step, starting at (0,0) and ending at (10,10). It may not traverse the edge (4,4)→(5,4). How many paths remain? C(n,k) denotes a binomial coefficient.
Options:
(A) 2^9
(B) 2^19
(C) C(8,4)×C(11,5)
(D) C(20,10)−C(8,4)×C(11,5)
Question 85, GATE 2007: A robot moves one unit right or up at each step, starting at (0,0) and ending at (10,10). It may not traverse the edge (4,4)→(5,4). How many paths remain? C(n,k) denotes a binomial coefficient.
Options:
(A) 2^9
(B) 2^19
(C) C(8,4)×C(11,5)
(D) C(20,10)−C(8,4)×C(11,5)
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. Count forbidden paths by splitting at the forbidden edge. Choose a path to (4,4), traverse the single forbidden step, then choose a path from (5,4) to the destination. Subtract this product from all paths.

2. Derivation and interpretation. Subtract paths using the forbidden edge (4,4)->(5,4) from all C(20,10) paths. A path using that edge has C(8,4) choices to reach (4,4), then the fixed forbidden step, then C(11,5) choices for five right and six up moves from (5,4) to (10,10). Thus the permitted count is C(20,10)-C(8,4)*C(11,5)=184756-70*462=152416, option D.

Original paper, page 21