You are on page 1of 853

GATE

Overflow Book
April 2016
GATE Overflow April 2016 1 of 852

GATE Overflow Book

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 2 of 852

This book was created programatically by GATE


Overflow on May 1, 2016. If you feel any doubt
regarding the answer, click on the question link
and give a comment on the site. Studying all
these questions might get you 60 marks in GATE
but that might not be enough for an IIT. So, read
standard books, solve exercise questions and use
these questions for cementing the concepts and
aim 75+. At least if you are not getting solution
to a given problem first refer standard book. If
any error is found on any question it shall be
updated at http://gateoverflow.in/corrections.
Also please update the book on next release
which will be with in 3 months as more questions
are being added and many corrections going on.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 3 of 852

GATE Overflow was started just a year ago and


a lot of people have dedicated their time and
effort in bringing this book now. Initiated by
Omesh Pandita and Arjun Suresh as a Q/A
platform for CSE students, Kathleen was
instrumental in geting all previous year GATE
questions here. Then experts like Praven Saini,
Happy Mittal, Sankaranarayanan, Suraj etc.
have contributed a lot to the answers here.
Pragy Agarwal even after topping GATE has
continuously contributed here with his knowledge
as well as in making the contents beautiful with
fine latex skills. We also have to thank the work
by Jothee, Misbah, Ishrat and Nataliyah who
are continuously adding and keeping the
contents here neat and clean. There are also
many toppers of GATE 2015 and probable ones
of GATE 2016 who are contributing a lot here.
The list of all the contributors can be found here
but even that do not include the contributions of
some like Arif Ali in helping design this book,
Arvind Devaraj and others who have provided
guidance and help etc. Last but not the least, we
thank all the users of GATE Overflow.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 4 of 852

Table of Contents
Algorithms
Ambiguous
Arrays
Asymptotic Notations
Binary Heap
Binary Search
Binary Tree
Connected Components
Decidability
Dfs
Distance Vector Routing
Dynamic Programming
Expectation
Grammar
Graph Algorithms
Graph Search
Greedy Algorithm
Hashing
Heap
Huffman Code
Identify Function
Insertion Sort
Lines Curves
Linked Lists
Loop Invariants
Matrix Chain Ordering
Median
Merge Sort
Minimum
Minimum Spanning Trees
P Np Npc Nph
Programming In C
Quicksort
Radix Sort
Recurrence
Recursion
Reduction
Runtime Environments
Shortest Path
Sorting
Space Complexity
Spanning Tree
Test Cases
Time Complexity
Topological Sort
Transactions
Trees
Compiler Design
Assembler
Code Optimization
Context Free
Dag Representation
Grammar
Intermediate Code
Lexical Analysis
Linking
Live Variable
Macros
Parameter Passing
Parsing
Postfix
Programming In C
Recursion
Register Allocation
Runtime Environments
Static Single Assignment
Syntax Directed Translation
Target Code Generation
CO & Architecture
Addressing Modes
Cache
Cache Memory
Computer Organization

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 5 of 852

Data Dependencies
Data Path
Dma
Hardwired Controller
Instruction Format
Interrupts
Io Handling
Io Organization
Machine Instructions
Memory Interfacing
Microprogramming
Page Fault
Pipeline
Virtual Memory
Writeback
Operating System
Ambiguous
Cache Memory
Computer Organization
Computer Peripherals
Concurrency
Context Switch
Dining Philosopher
Disk
Disk Scheduling
Dma
File
File System
Fork
Interrupts
Io Handling
Linking
Memory Allocation
Memory Management
Page Replacement
Process Schedule
Process Synchronization
Resource Allocation
Semaphore
Shell Script
Threads
User Modes
Virtual Memory
Working Set
Databases
B Tree
Concurrency
Database Normalization
Er Diagram
Er Model
Functional Dependencies
Indexing
Multivalued Dependency 4nf
Natural Join
Referential Integrity
Relational Algebra
Relational Calculus
Sql
Transactions
Theory of Computation
Chomsky Normal Form
Closure Property
Context Free
Decidability
Dfa
Finite Automata
Identify Class Language
Minimal State Automata
Myhill Nerode
Pda
Pumping Lemma
Recursive Recursively Enumerable
Regular Expressions
Regular Set
Turing Machine
Computer Networks

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 6 of 852

Application Layer Protocols


Bit Stuffing
Bridges
Communication
Congestion Control
Crc Polynomial
Cryptography
Csma Cd
Distance Vector Routing
Encoding
Error Detection
Ethernet
Firewall
Hamming Code
Icmp
Ip Packet
Ipv4
Lan Technologies
Link State Routing
Mac Protocol
Manchester Encoding
Network Flow
Network Layering
Network Protocols
Network Security
Network Switching
Osi Protocol
Routers Bridge Hubs Switches
Routing
Selective Repeat
Serial Communication
Sliding Window
Sockets
Stop And Wait
Subnetting
Tcp
Token Bucket
Udp
Wifi
Digital Logic
Adder
Boolean Algebra
Boolean Expressions
Booths Algorithm
Booths Coding
Canonical Normal Form
Circuit Output
Counter
Flip Flop
Floating Point Representation
Functional Completeness
Gray Code
Half Adder
Ieee Representation
K Map
Logic
Memory Interfacing
Min No Gates
Min Sum Of Products Form
Minimal State Automata
Modular Arithmetic
Multiplexer
Multiplexor
Number Representation
Priority Encoder
Ram
Verbal Ability
Closest Word
English Grammar
Grammatically Incorrect Sentence
Inference
Logical Reasoning
Meaning
Most Appropriate Alternative
Most Appropriate Word
Number Series

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 7 of 852

Odd One
Opposite
Passage Reading
Tense
Verbal Reasoning
Word Pairs
Numerical Ability
Bar Charts
Bayes Theorem
Circle
Clock Time
Complex Number
Conditional Probability
Convergence
Cost Market Price
Counting
Data Interpretation
Directions
Distance Time
First Order Logic
Fraction
Functions
Geometry
Growth Rate
Inference
Logical Reasoning
Mean
Modular Arithmetic
Most Appropriate Word
Number Representation
Number Series
Numerical Methods
Odd One
Passage Reading
Percent
Pie Chart
Polynomials
Probability
Proportions
Quadratic Equations
Ratios
Sequence
Sets
Speed
Statistics
System Of Equations
Mathematical Logic
Boolean Expressions
Canonical Normal Form
Differentiability
First Order Logic
Logical Reasoning
Probability
Bayes Theorem
Binomial Distribution
Conditional Probability
Expectation
Exponential Distribution
Greedy Algorithm
Independent Events
Normal Distribution
Poisson Distribution
Probability
Random Variable
Statistics
Uniform Distribution
Set Theory & Algebra
Boolean Algebra
Boolean Expressions
Countable Uncountable Set
Counting
Functions
Generating Functions
Groups
Injective Functions
Lattice

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 8 of 852

Lines Curves
Number Series
Partial Order
Pigeonhole
Polynomials
Recurrence
Relations
Ring
Sequence
Sets
Time Complexity
Combinatory
Binary Tree
Combinations
Combinatorics
Counting
Generating Functions
Number Theory
Permutation
Pigeonhole
Recurrence
Graph Theory
Chromatic Number
Combinatorics
Connected Components
Cutvertices&edges
Degree Sequence
Graph Coloring
Graph Connectivity
Graph Isomorphism
Graph Matching
Groups
Permutation
Spanning Tree
Linear Algebra
Cayley Hamilton Theorem
Eigen Value
Matrices
System Of Equations
Vector Space
Calculus
Continuity
Convergence
Counting
Differentiability
Integration
Limits
Maxima Minima
Programming
Activation Records
Arrays
Concurrency
Loop Invariants
Parameter Passing
Pointers
Post Condition
Programming In C
Programming Paradigms
Recursion
Runtime Environments
Stack
Variable Binding
DS
Arrays
Avl Tree
B Tree
Bfs
Binary Heap
Binary Search
Binary Search Tree
Binary Tree
Counting
Graph Algorithms
Hashing
Heap
Infix Postfix

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 9 of 852

Linked Lists
Queues
Spanning Tree
Stack
Tree Traversal
Trees
IISc/IITs
NITs
IIITs
Other Colleges
Study Resources
GATE Application
Written Exam

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 10 of 852

1 Algorithms top
1.1 Ambiguous: GATE 2016-2-13 top gateoverflow.in/39561

Assume that the algorithms considered here sort the input sequences in ascending order. If the input is already in the
ascending order, which of the following are TRUE?

I. Quicksort runs in (n2 ) time


II. Bubblesort runs in (n2 ) time
III. Mergesort runs in (n) time
IV. Insertion sort runs in (n) time

A. I and II only
B. I and III only
C. II and IV only
D. I and IV only

gate2016-2 algorithms sorting time-complexity normal ambiguous

1.2 Arrays: GATE1994_25 top gateoverflow.in/2521

An array A contains n integers in non-decreasing order, A[1] A[2] A[n] . Describe, using Pascal like pseudo code,
a linear time algorithm to find i, j, such that A[i] + A[j] = a given integer M , if such i, j exist.

gate1994 algorithms arrays normal

1.3 Arrays: TIFR2011-B-30 top gateoverflow.in/20611

Consider an array A[1...n] . It consists of a permutation of numbers 1....n. Now compute another array B[1...n] as follows:
B[A[i]] := i for all i. Which of the following is true?
a. B will be a sorted array.
b. B is a permutation of array A.
c. Doing the same transformation twice will not give the same array.
d. B is not a permutation of array A.
e. None of the above.

tifr2011 algorithms arrays

1.4 Arrays: GATE1997_17 top gateoverflow.in/2277

An array A contains n 1 positive integers in the locations A[1], A[2], A[n]. The following program fragment prints the
length of a shortest sequence of consecutive elements of A, A[i], A[i + 1], , A[j] such that the sum of their values is
M , a given positive number. It prints n+1 if no such sequence exists. Complete the program by filling in the boxes. In
each case use the simplest possible expression. Write only the line number and the contents of the box.

begin
i:=1;j:=1;
sum :=
min:=n; finish:=false;
while not finish do
if then
if j=n then finish:=true
else
begin
j:=j+1;
sum:=
end
else
begin
if(j-i) < min then min:=j-i;
sum:=sum A[i];
i:=i+1;
end

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 11 of 852

writeln (min +1);


end.

gate1997 algorithms arrays normal

1.5 Arrays: GATE1993_12 top gateoverflow.in/2309

The following Pascal program segments finds the largest number in a two-dimensional integer array
A[0 n 1, 0 n 1] using a single loop. Fill up the boxes to complete the program and write against
A , B , C and D in your answer book Assume that max is a variable to store the largest value and i, j are the indices to
the array.

begin
max:=|A|, i:=0, j:=0;
while |B| do
begin
if A[i, j]>max then max:=A[i, j];
if |C| then j:=j+1;
else begin
j:=0;
i:=|D|
end
end
end

gate1993 algorithms arrays normal

1.6 Asymptotic Notations: GATE2015-3_42 top gateoverflow.in/8501

Let f(n) = n and g(n) = n(1+sin n) where n is a positive integer. Which of the following statements is/are correct?
I. f(n) = O(g(n))
II. f(n) = (g(n))

A. Only I
B. Only II
C. Both I and II
D. Neither I nor II

gate2015-3 algorithms asymptotic-notations normal

1.7 Asymptotic Notations: GATE2000_2.17 top gateoverflow.in/664

Consider the following functions

f(n) = 3nn
g(n) = 2n log2 n
h(n) = n!
Which of the following is true?

a. h(n) is O(f(n))
b. h(n) is O(g(n))
c. g(n) is not O(f(n))
d. f(n) is O(g(n))

gate2000 algorithms asymptotic-notations normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 12 of 852

1.8 Asymptotic Notations: GATE1999_2.21 top gateoverflow.in/1498

If T1 = O(1), give the correct matching for the following pairs:


(M) Tn = Tn1 + n (U) Tn = O(n)


(N) Tn= Tn/2 + n (V) Tn = O(n log n)
(O) Tn = Tn/2 + n log n (W) T = O(n2 )
(P) Tn = Tn1 + log n (X) Tn = O(log2 n)

(A) M-W N-V O-U P-X

(B) M-W N-U O-X P-V

(C) M-V N-W O-X P-U

(D) M-W N-U O-V P-X

gate1999 algorithms recurrence asymptotic-notations normal

1.9 Asymptotic Notations: GATE2015-3_4 top gateoverflow.in/8398

Consider the equality (i=0) i3


n
= X and the following choices for X

I. (n4 )
II. (n5 )
III. O(n5 )
IV. (n3 )

The equality above remains correct if X is replaced by

A. Only I
B. Only II
C. I or III or IV but not II
D. II or III or IV but not I

gate2015-3 algorithms asymptotic-notations normal

1.10 Asymptotic Notations: GATE2001_1.16 top gateoverflow.in/709

Let f(n) = n2 log n and g(n) = n(log n)10 be two positive functions of n. Which of the following statements is correct?

(A) f(n) = O(g(n)) and g(n) O(f(n))

(B) g(n) = O(f(n)) and f(n) O(g(n))

(C) f(n) O(g(n)) and g(n) O(f(n))

(D) f(n) = O(g(n)) and g(n) = O(f(n))


gate2001 algorithms asymptotic-notations time-complexity normal

1.11 Asymptotic Notations: GATE2003_20 top gateoverflow.in/910

Consider the following three claims

I. (n + k)m = (nm ) where k and m are constants


II. 2n+1 = O(2n )

2n+1 = O( n)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 13 of 852

III. 22n+1 = O(2n )


Which of the following claims are correct

A. I and II
B. I and III
C. II and III
D. I, II, and III

gate2003 algorithms asymptotic-notations normal

1.12 Asymptotic Notations: GATE2004_29 top gateoverflow.in/1026

The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is of the order of

(a) n

(b) n2

(c) n log n

2
(d) n log n
gate2004 algorithms sorting asymptotic-notations easy

1.13 Asymptotic Notations: GATE2004-IT_55 top gateoverflow.in/3698

Let f(n), g(n) and h(n) be functions defined for positive inter such that
f(n) = O(g(n)), g(n) O(f(n)), g(n) = O(h(n)), and h(n) = O(g(n)).

Which one of the following statements is FALSE?

A) f(n) + g(n) = O(h(n)) + h(n))


B) f(n) = O(h(n))
C) h(n) O(f(n))
D) f(n)h(n) O(g(n)h(n))

gate2004-it algorithms asymptotic-notations normal

1.14 Asymptotic Notations: GATE2008-IT_10 top gateoverflow.in/3270

Arrange the following functions in increasing asymptotic order:


A. n1/3
B. en
C. n7/4
D. n log9n
E. 1.0000001n

A) A, D, C, E, B
B) D, A, C, E, B
C) A, C, D, E, B
D) A, C, D, B, E

gate2008-it algorithms asymptotic-notations normal

1.15 Asymptotic Notations: TIFR2014-B-8 top gateoverflow.in/27192

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 14 of 852

Which of these functions grows fastest with n?

a. en /n.
b. en0.9 log n .
c. 2n .
n1
d. (log n) .
e. None of the above.

tifr2014 algorithms asymptotic-notations

1.16 Asymptotic Notations: GATE1996_1.11 top gateoverflow.in/2715

Which of the following is false?


n log n
A. 100n log n =( )
100

B. log n = O(log log n)
C. If 0 < x < y then nx = O (ny )
D. 2n O (nk )

gate1996 algorithms asymptotic-notations normal

1.17 Asymptotic Notations: GATE2011_37 top gateoverflow.in/2139

Which of the given options provides the increasing order of asymptotic complexity of functions f1 , f2 , f3 and f4 ?

f1 (n) = 2n
f2 (n) = n3/2
f3 (n) = n log2 n
f4 (n) = nlog2 n
(A) f3 , f2 , f4 , f1

(B) f3 , f2 , f1 , f4

(C) f2 , f3 , f1 , f4

(D) f2 , f3 , f4 , f1

gate2011 algorithms asymptotic-notations normal

1.18 Asymptotic Notations: GATE1994_1.23 top gateoverflow.in/2466

Consider the following two functions:

n3 for 0 n 10, 000


g1 (n) = {
n2 for n 10, 000

g2 (n) = {
n for 0 n 100
n3 for n > 100
Which of the following is true?

A. g1 (n) is O(g2 (n))

B. g1 (n) is O(n3 )

C. g2 (n) is O(g1 (n))


2 (n) is O(n)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 15 of 852

D. g2 (n) is O(n)

gate1994 algorithms asymptotic-notations normal

1.19 Asymptotic Notations: GATE2008_39 top gateoverflow.in/450

Consider the following functions:

f(n) = 2n
g(n) = n!

h(n) = nlog n
Which of the following statements about the asymptotic behavior of f(n), g(n) and h(n) is true?

A. f (n) = O (g (n)) ; g (n) = O (h (n))


B. f (n) = (g (n)) ; g(n) = O (h (n))
C. g (n) = O (f (n)) ; h (n) = O (f (n))
D. h (n) = O (f (n)) ; g (n) = (f (n))

gate2008 algorithms asymptotic-notations normal

1.20 Asymptotic Notations: TIFR2011-B-27 top gateoverflow.in/20573

Let n be a large integer. Which of the following statements is TRUE?



A. n1/log2 n < log2 n < n1/100


B. n1/100 < n1/log2 n < log2 n


C. n1/log2 n < n1/100 < log2 n


D. log2 n < n1/log2 n < n1/100


E. log2 n < n1/100 < n1/log2 n

tifr2011 asymptotic-notations

1.21 Asymptotic Notations: GATE2005_37 top gateoverflow.in/1373

Suppose T (n) = 2T ( n2 ) + n, T (0) = T (1) = 1


Which one of the following is FALSE?

A. T (n) = O(n2 )
B. T (n) = (n log n)
C. T (n) = (n2 )
D. T (n) = O(n log n)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 16 of 852

gate2005 algorithms asymptotic-notations recurrence normal

1.22 Binary Heap: GATE2006_10 top gateoverflow.in/889

In a binary max heap containing numbers, the smallest element can be found in time

(A) O(n)

(B) O(log n)

(C) O(log log n)

(D) O(1)

gate2006 data-structure heap binary-heap easy

1.23 Binary Search: GATE2008-85 top gateoverflow.in/43508

Consider the following C program that attempts to locate an element x in an array Y[ ] using binary search. The program is
erroneous.
f (int Y[10] , int x) {
int u, j, k;
i= 0; j = 9;
do {
k = (i+ j) / 2;
if( Y[k] < x) i = k;else j = k;
} while (Y[k] != x) && (i < j)) ;
if(Y[k] == x) printf(" x is in the array ") ;
else printf(" x is not in the array ") ;
}

The correction needed in the program to make it work properly is

A. Change line 6 to: if (Y[k] < x) i = k + 1; else j = k-1;


B. Change line 6 to: if (Y[k] < x) i = k - 1; else j = k +1;
C. Change line 6 to: if (Y[k] < x) i = k; else j = k;
D. Change line 7 to: } while ((Y[k] == x) && (i < j)) ;

gate2008 algorithms binary-search normal

1.24 Binary Search: TIFR2012-B-11 top gateoverflow.in/25140

Consider the following three version of the binary search program. Assume that the elements of type T can be compared
with each other; also assume that the array is sorted.
i, j, k : integer;
a : array [1....N] of T;
x : T;
Program 1 : i := 1; j := N;
repeat
k := (i + j) div 2;
if a[k] < x then i := k else j := k
until (a[k] = x) or (i > j)
Program 2 : i := 1; j := N;
repeat
k := (i + j) div 2;
if x < a[k] then j := k - 1;
if a[k] < x then i := k + 1;
until i > j
Program 3 := i := 1; j := N
repeat
k := (i + j) div 2;
if x < a[k] then j := k else i := k + 1
until i > j

A binary search program is called correct provided it terminates with a[k] = x whenever such an element exists, or it
terminates with a [k] x if there exists no array element with value x. Which of the following statements is correct?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 17 of 852

a. Only Program 1 is correct


b. Only Program 2 is correct
c. Only Program 1 and 2 are correct.
d. Both Program 2 and 3 are correct
e. All the three programs are wrong

tifr2012 algorithms binary-search

1.25 Binary Search: GATE2008-84 top gateoverflow.in/394

Consider the following C program that attempts to locate an element x in an array Y[ ] using binary search. The program is
erroneous.

f (int Y[10] , int x) {


int u, j, k;
i= 0; j = 9;
do {
5. k = (i+ j) / 2;
if( Y[k] < x) i = k;else j = k;
} while (Y[k] != x) && (i < j)) ;
if(Y[k] == x) printf(" x is in the array ") ;
else printf(" x is not in the array ") ;
10. }

On which of the following contents of Y and x does the program fail?

A. Y is [1 2 3 4 5 6 7 8 9 10] and x < 10


B. Y is [1 3 5 7 9 11 13 15 17 19] and x < 1
C. Y is [2 2 2 2 2 2 2 2 2 2] and x > 2
D. Y is [2 4 6 8 10 12 14 16 18 20] and 2 < x < 20 and x is even

gate2008 algorithms binary-search normal

1.26 Binary Search: GATE1996_18 top gateoverflow.in/2770

Consider the following program that attempts to locate an element x in an array a[] using binary search. Assume N > 1.
The program is erroneous. Under what conditions does the program fail?

var i,j,k: integer; x: integer;


a: array; [1..N] of integer;
begin i:= 1; j:= n;
repeat
k:(i+j) div 2;
if a[k] < x then i:= k
else j:= k
until (a[k] = x) or (i >= j);
if (a[k] = x) then
writeln ('x is not in the array')
else
writeln ('x is not in the array')
end;

gate1996 algorithms binary-search normal

1.27 Binary Search: TIFR2010-B-29 top gateoverflow.in/18752

Suppose you are given an array A with 2n numbers.

The numbers in odd positions are sorted in ascending order, that is, A[1] A[3] A[2n 1].
The numbers in even positions are sorted in descending order, that is, A[2] A[4] A[2n].
What is the method you would recommend for determining if a given number is in the array?

A. Sort the array using quick-sort and then use binary search.
B. Merge the sorted lists and perform binary search.
C. Perform a single binary search on the entire array.
D. Perform separate binary searches on the odd positions and the even positions.
E. Search sequentially from the end of the array.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 18 of 852

tifr2010 binary-search

1.28 Binary Tree: GATE2014-3_12 top gateoverflow.in/2046

Consider the following rooted tree with the vertex labeled P as the root:

The order in which the nodes are visited during an in-order traversal of the tree is

(A) SQPTRWUV

(B) SQPTUWRV

(C) SQPTWUVR

(D) SQPTRUWV

gate2014-3 algorithms binary-tree easy

1.29 Binary Tree: GATE2012_47 top gateoverflow.in/2163

The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudo-
code below is invoked as height(root) to compute the height of a binary tree rooted at the tree pointer root.

(A)

B1: (1 + height(n right))


B2: (1 + max(h1, h2))

(B)

B1: (height(n right))


B2: (1 + max(h1, h2))

(C)

B1: height(n right)


max(h1, h2)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 19 of 852

B2: max(h1, h2)

(D)

B1: (1 + height(n right))


B2: max(h1, h2)

gate2012 algorithms binary-tree normal

1.30 Binary Tree: GATE2007_13 top gateoverflow.in/1211

The maximum number of binary trees that can be formed with three unlabeled nodes is:

A. 1
B. 5
C. 4
D. 3

gate2007 algorithms binary-tree normal

1.31 Binary Tree: GATE2004_85 top gateoverflow.in/1079

A program takes as input a balanced binary search tree with n leaf nodes and computes the value of a function g(x) for each
node x. If the cost of computing g(x) is:

min ( number of leaf-nodes


in left-subtree of x
, number of leaf-nodes)
in right-subtree of x
Then the worst-case time complexity of the program is?

A. (n)

B. (n log n)

C. (n2 )

D. (n2 log n)

gate2004 algorithms binary-tree normal time-complexity

1.32 Binary Tree: GATE2000_2.16 top gateoverflow.in/663

Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited `in a postorder, inorder and preorder traversal respectively, of a complete
binary tree. Which of the following is always true?

a. LASTIN = LASTPOST
b. LASTIN = LASTPRE
c. LASTPRE = LASTPOST
d. None of the above

gate2000 algorithms binary-tree normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 20 of 852

1.33 Binary Tree: GATE2008_46 top gateoverflow.in/458

You are given the postorder traversal, P , of a binary search tree on the n elements 1, 2, , n. You have to determine the
unique binary search tree that has P as its postorder traversal. What is the time complexity of the most efficient algorithm
for doing this?

A. (log n)

B. (n)

C. (n log n)

D. None of the above, as the tree cannot be uniquely determined

gate2008 algorithms binary-tree normal

1.34 Binary Tree: GATE2014-3_39 top gateoverflow.in/2073

Suppose we have a balanced binary search tree T holding n numbers. We are given two numbers L and H and wish to sum
up all the numbers in T that lie between L and H . Suppose there are m such numbers in T . If the tightest upper bound on
b d
the time to compute the sum is O(na log n + mc log n), the value of a + 10b + 100c + 1000d is ______.

gate2014-3 algorithms binary-tree time-complexity numerical-answers normal

1.35 Binary Tree: GATE1997_4.5 top gateoverflow.in/2246

A binary search tree contains the value 1, 2, 3, 4, 5, 6, 7, 8. The tree is traversed in pre-order and the values are printed
out. Which of the following sequences is a valid output?

A. 5 3 1 2 4 7 8 6
B. 5 3 1 2 6 4 8 7
C. 5 3 2 4 1 6 7 8
D. 5 3 1 2 4 7 6 8

gate1997 algorithms binary-tree normal

1.36 Binary Tree: GATE2007_46 top gateoverflow.in/1244

Consider the following C program segment where CellNode represents a node in a binary tree:
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);
}

The value returned by GetValue when a pointer to the root of a binary tree is passed as its argument is:

A. the number of nodes in the tree

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 21 of 852

B. the number of internal nodes in the tree

C. the number of leaf nodes in the tree

D. the height of the tree

gate2007 algorithms binary-tree normal

1.37 Binary Tree: GATE2007_39 top gateoverflow.in/1237

The inorder and preorder traversal of a binary tree are

d b e a f c g and a b d e c f g, respectively
The postorder traversal of the binary tree is:

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

gate2007 algorithms binary-tree normal

1.38 Binary Tree: GATE2013_43 top gateoverflow.in/1554

The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is
the postorder traversal sequence of the same tree?

(A) 10, 20, 15, 23, 25, 35, 42, 39, 30

(B) 15, 10, 25, 23, 20, 42, 35, 39, 30

(C) 15, 20, 10, 23, 25, 42, 35, 39, 30

(D) 15, 10, 23, 25, 20, 35, 42, 39, 30

gate2013 algorithms binary-tree normal

1.39 Connected Components: GATE1992_03,iii top gateoverflow.in/580

How many edges can there be in a forest with p components having n vertices in all?

gate1992 algorithms connected-components easy

1.40 Connected Components: GATE2005-IT_14 top gateoverflow.in/3759

In a depth-first traversal of a graph G with n vertices, k edges are marked as tree edges. The number of connected
components in G is

1) k
2) k + 1
3) n - k - 1
4) n - k

gate2005-it algorithms graph-algorithms connected-components normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 22 of 852

1.41 Connected Components: GATE2006-IT_47 top gateoverflow.in/3590

Consider the depth-first-search of an undirected graph with 3 vertices P, Q, and R. Let discovery time d(u) represent the
time instant when the vertex u is first visited, and finish time f(u) represent the time instant when the vertex u is last
visited. Given that
d(P) = 5 units f(P) = 12 units
d(Q) = 6 units f(Q) = 10 units
d(R) = 14 unit f(R) = 18 units

which one of the following statements is TRUE about the graph

A) There is only one connected component


B) There are two connected components, and P and R are connected
C) There are two connected components, and Q and R are connected
D) There are two connected components, and P and Q are connected

gate2006-it algorithms graph-algorithms connected-components normal

1.42 Connected Components: GATE2014-1_3 top gateoverflow.in/1754

Let G = (V , E) be a directed graph where V is the set of vertices and E the set of edges. Then which one of the following graphs has the same strongly
connected components as G ?

(A) G1 = (V , E1 ) where E1 = {(u, v) (u, v) E}

(B) G2 = (V , E2 ) where E2 = {(u, v) (v, u) E}

(C) G3 = (V , E3 ) where E3 = {(u, v) there is a path of length 2 from u to v in E}

(D) G4 = ( V4 , E) where V4 is the set of vertices in G which are not isolated

gate2014-1 algorithms graph-algorithms connected-components normal

1.43 Connected Components: GATE1997_6.2 top gateoverflow.in/2258

Let G be the graph with 100 vertices numbered 1 to 100. Two vertices i and j are adjacent if |i j| = 8 or |i j| = 12.
The number of connected components in G is

a. 8
b. 4
c. 12
d. 25

gate1997 algorithms graph-algorithms connected-components normal

1.44 Connected Components: GATE2006-IT_46 top gateoverflow.in/3589

Which of the following is the correct decomposition of the directed graph given below into its strongly connected
components?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 23 of 852

A) {P, Q, R, S}, {T}, {U}, {V}


B) {P,Q, R, S, T, V}, {U}
C) {P, Q, S, T, V}, {R}, {U}
D) {P, Q, R, S, T, U, V}

gate2006-it algorithms graph-algorithms connected-components normal

1.45 Decidability: GATE2005_45 top gateoverflow.in/1375

Consider three decision problems P 1, P 2 and P 3. It is known that P 1 is decidable and P 2 is undecidable. Which one of the
following is TRUE?

A. P3 is decidable if P 1 is reducible to P 3
B. P3 is undecidable if P 3 is reducible to P 2
C. P3 is undecidable if P 2 is reducible to P 3
D. P3 is decidable if P 3 is reducible to P 2's complement

gate2005 algorithms decidability normal

1.46 Dfs: TIFR2014-B-3 top gateoverflow.in/27137

Consider the following directed graph.

Suppose a depth-first traversal of this graph is performed, assuming that whenever there is a choice, the vertex earlier in
the alphabetical order is to be chosen. Suppose the number of tree edges is T , the number of back edges is B and the
number of cross edges is C. Then

a. B = 1, C = 1, and T = 4.
b. B = 0, C = 2, and T = 4.
c. B = 2, C = 1, and T = 3.
d. B = 1, C = 2, and T = 3.
e. B = 2, C = 2, and T = 1.

tifr2014 dfs data-structure graph-algorithms

1.47 Distance Vector Routing: GATE2011-49 top gateoverflow.in/43324

Consider the following recursive C function that takes two arguments.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 24 of 852

unsigned int foo(unsigned int n, unsigned int r) {


if (n>0) return ((n%r) + foo(n/r, r));
else return 0;
}

What is the return value of the function foo when it is called as foo(513, 2)?

A. 9
B. 8
C. 5
D. 2

gate2011 algorithms recursion identify-function distance-vector-routing normal

1.48 Dynamic Programming: GATE 2016-2-14 top gateoverflow.in/39570

The Floyd-Warshall algorithm for all-pair shortest paths computation is based on

A. Greedy paradigm.
B. Divide-and-conquer paradigm.
C. Dynamic Programming paradigm.
D. Neither Greedy nor Divide-and-Conquer nor Dynamic Programming paradigm.

gate2016-2 algorithms graph-algorithms shortest-path dynamic-programming easy

1.49 Dynamic Programming: GATE2009-53 top gateoverflow.in/1338

A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are
given two sequences X[m] and Y [n] of lengths m and n, respectively with indexes of X and Y starting from 0.

We wish to find the length of the longest common sub-sequence (LCS) of X[m] and Y [n] as l(m, n), where an incomplete
recursive definition for the function I(i, j) to compute the length of the LCS of X[m] and Y [n] is given below:
l(i,j) = 0, if either i = 0 or j = 0
= expr1, if i,j > 0 and X[i-1] = Y[j-1]
= expr2, if i,j > 0 and X[i-1] Y[j-1]

Which one of the following options is correct?

A. expr1 = l (i 1, j) + 1
B. expr1 = l (i, j 1)
C. expr2 = max (l (i 1, j) , l (i, j 1))
D. expr2 = max (l (i 1, j 1) , l (i, j))

gate2009 algorithms normal dynamic-programming recursion

1.50 Dynamic Programming: GATE2009-54 top gateoverflow.in/43476

A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are
given two sequences X[m] and Y [n] of lengths m and n, respectively with indexes of X and Y starting from 0.

We wish to find the length of the longest common sub-sequence (LCS) of X[m] and Y [n] as l(m, n), where an incomplete
recursive definition for the function I(i, j) to compute the length of the LCS of X[m] and Y [n] is given below:

l(i,j) = 0, if either i = 0 or j = 0
= expr1, if i,j > 0 and X[i-1] = Y[j-1]
= expr2, if i,j > 0 and X[i-1] Y[j-1]
The value of l(i, j) could be obtained by dynamic programming based on the correct recursive definition of l(i, j) of the form

L[M, N] M=m+1 N = n+1 L[i, j] = l(i, j)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 25 of 852

given above, using an array L[M, N] , where M = m + 1 and N = n + 1, such that L[i, j] = l(i, j).
Which one of the following statements would be TRUE regarding the dynamic programming solution for the recursive
definition of l(i, j)?

A. All elements of L should be initialized to 0 for the values of l(i, j) to be properly computed.
B. The values of l(i, j) may be computed in a row major order or column major order of L[M, N] .
C. The values of l(i, j) cannot be computed in either row major order or column major order of L[M, N] .
D. L[p, q] needs to be computed before L[r, s] if either p < r or q < s.

gate2009 normal algorithms dynamic-programming recursion

1.51 Expectation: GATE2003-62 top gateoverflow.in/43576

In a permutation a1 . . . an , of n distinct integers, an inversion is a pair (ai , aj ) such that i < j and ai > aj .
What would be the worst case time complexity of the Insertion Sort algorithm, if the inputs are restricted to permutations of
1.. . n with at most n inversions?
A. (n2 )
B. (n log n)
C. (n1.5 )
D. (n)

gate2003 algorithms sorting expectation normal

1.52 Expectation: GATE2003-61 top gateoverflow.in/949

In a permutation a1 . . . an , of n distinct integers, an inversion is a pair (ai , aj ) such that i < j and ai > aj .
If all permutations are equally likely, what is the expected number of inversions in a randomly chosen permutation of 1.. . n?
n(n1)
A.
2
n(n1)
B.
4
n(n+1)
C.
4
D. 2n[ log2 n]

gate2003 algorithms sorting expectation normal

1.53 Grammar: GATE1998_6 top gateoverflow.in/1697

a. Solve the following recurrence relation

xn = 2xn1 1, n > 1
x1 = 2
b. Consider the grammar

S Aa b
A Ac Sd
Construct an equivalent grammar with no left recursion and with minimum number of production rules.

gate1998 algorithms recurrence compiler-design grammar descriptive

1.54 Graph Algorithms: GATE2007-IT_24 top gateoverflow.in/3457

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 26 of 852

A depth-first search is performed on a directed acyclic graph. Let d[u] denote the time at which vertex u is visited for the
first time and f[u] the time at which the dfs call to the vertex u terminates. Which of the following statements is always true
for all edges (u, v) in the graph ?

A) d[u] < d[v]


B) d[u] < f[v]
C) f[u] < f[v]
D) f[u] > f[v]

gate2007-it algorithms graph-algorithms normal

1.55 Graph Algorithms: GATE2007-IT_3 top gateoverflow.in/3434

Consider a weighted undirected graph with positive edge weights and let uv be an edge in the graph. It is known that the
shortest path from the source vertex s to u has weight 53 and the shortest path from s to v has weight 65. Which one of the
following statements is always true?

A) weight (u, v) < 12


B) weight (u, v) 12
C) weight (u, v) > 12
D) weight (u, v) 12

gate2007-it algorithms graph-algorithms normal

1.56 Graph Algorithms: GATE2016-2-41 top gateoverflow.in/39620

In an adjacency list representation of an undirected simple graph G = (V , E), each edge (u, v) has two adjacency list
entries: [v] in the adjacency list of u, and [u] in the adjacency list of v. These are called twins of each other. A twin pointer
is a pointer from an adjacency list entry to its twin. If |E| = m and |V | = n, and the memory size is not a constraint, what is
the time complexity of the most efficient algorithm to set the twin pointer in each entry in each adjacency list?

A. (n2 )
B. (n + m)
C. (m2 )
D. (n4 )

gate2016-2 algorithms graph-algorithms normal

1.57 Graph Algorithms: GATE2004_81 top gateoverflow.in/1075

Let G1= (V , E1 ) and G2 = (V , E2 ) be connected graphs on the same vertex set V with more than two vertices. If
G1 G2 = (V , E1 E2 ) is not a connected graph, then the graph G1 G2 = (V , E1 E2 )

(a). cannot have a cut vertex.

(b). must have a cycle

(c). must have a cut-edge (bridge).

(d). Has chromatic number strictly greater than those of G1 and G2

gate2004 algorithms graph-algorithms normal

1.58 Graph Algorithms: GATE2009_13 top gateoverflow.in/1305

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 27 of 852

Which of the following statement(s) is/are correct regarding Bellman-Ford shortest path algorithm?

A. Always finds a negative weighted cycle, if one exists.

B. Finds whether any negative weighted cycle is reachable from the source.

A. P only
B. Q only
C. Both P and Q
D. Neither P nor Q

gate2009 algorithms graph-algorithms normal

1.59 Graph Algorithms: GATE2007_41 top gateoverflow.in/1239

In an unweighted, undirected connected graph, the shortest path from a node S to every other node is computed most
efficiently, in terms of time complexity, by

A. Dijkstras algorithm starting from S.

B. Warshalls algorithm.

C. Performing a DFS starting from S.

D. Performing a BFS starting from S.

gate2007 algorithms graph-algorithms easy

1.60 Graph Algorithms: GATE2005_82 top gateoverflow.in/1404

Statement for linked Answer Questions 82a & 82b:

Let s and t be two vertices in a undirected graph G = (V , E) having distinct positive edge weights. Let [X, Y ] be a partition
of V such that s X and t Y . Consider the edge e having the minimum weight amongst all those edges that have one
vertex in X and one vertex in Y .

(A) The edge e must definitely belong to:

A. the minimum weighted spanning tree of G

B. the weighted shortest path from s to t

C. each path from s to t

D. the weighted longest path from s to t

(B) Let the weight of an edge e denote the congestion on that edge. The congestion on a path is defined to be the maximum
of the congestions on the edges of the path. We wish to find the path from s to t having minimum congestion. Which of the
following paths is always such a path of minimum congestion?

A. a path from s to t in the minimum weighted spanning tree

B. a weighted shortest path from s to t

C. an Euler walk from s to t

D. a Hamiltonian path from s to t

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 28 of 852

gate2005 algorithms graph-algorithms normal

1.61 Graph Algorithms: GATE2005_38 top gateoverflow.in/1374

Let G(V , E) be an undirected graph with positive edge weights. Dijkstras single source shortest path algorithm can be
implemented using the binary heap data structure with time complexity:

A. O (|V | )
2

B. O (|E| + |V | log |V |)

C. O (|V | log |V |)

D. O ((|E| + |V |) log |V |)

gate2005 algorithms graph-algorithms normal

1.62 Graph Algorithms: GATE1994_24 top gateoverflow.in/2520

An independent set in a graph is a subset of vertices such that no two vertices in the subset are connected by an edge. An
incomplete scheme for a greedy algorithm to find a maximum independent set in a tree is given below:

V: Set of all vertices in the tree;


I :=
while V do
begin
select a vertex u V such that
_______;
V := V - {u};
if u is such that
________then I := I {u}
end;
Output(I);

a. Complete the algorithm by specifying the property of vertex u in each case.

b. What is the time complexity of the algorithm

gate1994 algorithms graph-algorithms normal

1.63 Graph Algorithms: GATE2013_19 top gateoverflow.in/1441

What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices?

(A) (n2 ) (B) (n2 log n) (C) (n3 ) (D) (n3 log n)

gate2013 algorithms graph-algorithms normal

1.64 Graph Algorithms: GATE2004_44 top gateoverflow.in/1041

Suppose we run Dijkstras single source shortest-path algorithm on the following edge-weighted directed graph with vertex P
as the source.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 29 of 852

In what order do the nodes get included into the set of vertices for which the shortest path distances are finalized?

A. P,Q,R,S,T,U
B. P,Q,R,U,S,T
C. P,Q,R,U,T,S
D. P,Q,T,R,U,S

gate2004 algorithms graph-algorithms normal

1.65 Graph Algorithms: GATE2008-IT_47 top gateoverflow.in/3357

Consider the following sequence of nodes for the undirected graph given below.

1. a b e f d g c
2. a b e f c g d
3. a d g e b c f
4. a d b c g e f

A Depth First Search (DFS) is started at node a. The nodes are listed in the order they are first visited. Which all of the
above is (are) possible output(s)?

A) 1 and 3 only
B) 2 and 3 only
C) 2, 3 and 4 only
D) 1, 2 and 3 only

gate2008-it algorithms graph-algorithms normal

1.66 Graph Algorithms: GATE2006_12 top gateoverflow.in/891

To implement Dijkstras shortest path algorithm on unweighted graphs so that it runs in linear time, the data structure to be
used is:

(A) Queue
(B) Stack
(C) Heap
(D) B-Tree

gate2006 algorithms graph-algorithms easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 30 of 852

1.67 Graph Algorithms: GATE2014-3_13 top gateoverflow.in/2047

Suppose depth rst search is executed on the graph below starting at some unknown vertex. Assume that a recursive call to visit a vertex is made only after rst
checking that the vertex has not been visited earlier. Then the maximum possible recursion depth (including the initial call) is _________.

gate2014-3 algorithms graph-algorithms numerical-answers normal

1.68 Graph Algorithms: GATE1998_1.21 top gateoverflow.in/1658

Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?

A. Dynamic programming

B. Backtracking

C. Greedy

D. Divide and Conquer

gate1998 algorithms graph-algorithms easy

1.69 Graph Algorithms: GATE2004-IT_56 top gateoverflow.in/3699

Consider the undirected graph below:

Using Prim's algorithm to construct a minimum spanning tree starting with node A, which one of the following sequences of
edges represents a possible order in which the edges would be added to construct the minimum spanning tree?

A) (E, G), (C, F), (F, G), (A, D), (A, B), (A, C)
B) (A, D), (A, B), (A, C), (C, F), (G, E), (F, G)
C) (A, B), (A, D), (D, F), (F, G), (G, E), (F, C)
D) (A, D), (A, B), (D, F), (F, C), (F, G), (G, E)

gate2004-it algorithms graph-algorithms normal

1.70 Graph Algorithms: GATE2001_2.14 top gateoverflow.in/732

Consider an undirected unweighted graph G. Let a breadth-first traversal of G be done starting from a node r. Let d(r,u) and

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 31 of 852

d(r,v) be the lengths of the shortest paths from r to u and v respectively in G. if u visited before v during the breadth-first
traversal, which of the following statements is correct?

A. d(r, u) < d(r, v)


B. d(r, u) > d(r, v)
C. d(r, u) d(r, v)
D. None of the above

gate2001 algorithms graph-algorithms normal

1.71 Graph Algorithms: GATE2005-IT_84a top gateoverflow.in/3856

A sink in a directed graph is a vertex i such that there is an edge from every vertex j i to i and there is no edge from i to
any other vertex. A directed graph G with n vertices is represented by its adjacency matrix A, where A[i] [j] = 1 if there is
an edge directed from vertex i to j and 0 otherwise. The following algorithm determines whether there is a sink in the graph
G.

i = 0;
do {
j = i + 1;
while ((j < n) && E1) j++;
if (j < n) E2;
} while (j < n);
flag = 1;
for (j = 0; j < n; j++)
if ((j! = i) && E3) flag = 0;
if (flag) printf("Sink exists");
else printf ("Sink does not exist");

Choose the correct expressions for E 1 and E 2

A) E1 : A[i][j] and E 2 : i = j;
B) E1 : !A[i][j] and E 2 : i = j + 1;
C) E1: !A[i][j] and E 2 : i = j;
D) E1 : A[i][j] and E 2 : i = j + 1;

gate2005-it algorithms graph-algorithms normal

1.72 Graph Algorithms: GATE2005-IT_84b top gateoverflow.in/3857

A sink in a directed graph is a vertex i such that there is an edge from every vertex j i to i and there is no edge from i to
any other vertex. A directed graph G with n vertices is represented by its adjacency matrix A, where A[i] [j] = 1 if there is
an edge directed from vertex i to j and 0 otherwise. The following algorithm determines whether there is a sink in the graph
G.

i = 0;
do {
j = i + 1;
while ((j < n) && E1) j++;
if (j < n) E2;
} while (j < n);
flag = 1;
for (j = 0; j < n; j++)
if ((j! = i) && E3) flag = 0;
if (flag) printf("Sink exists") ;
else printf ("Sink does not exist");

Choose the correct expression for E3

A) (A[i][j] && !A[j][i])


B) (!A[i][j] && A[j][i])
C) (!A[i][j] | | A[j][i])
D) (A[i][j] | | !A[j][i])

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 32 of 852

gate2005-it algorithms graph-algorithms normal

1.73 Graph Algorithms: GATE2014-1_11 top gateoverflow.in/1771

Let G be a graph with n vertices and m edges.What is the tightest upper bound on the running time of Depth First Search on G, when G is represented as an
adjacency matrix?

(A) (n)

(B) (n + m)

(C) ( n2 )

(D) ( m2 )

gate2014-1 algorithms graph-algorithms normal

1.74 Graph Algorithms: Gate2000_2.19 top gateoverflow.in/4208

Let G be an undirected graph. Consider a depth-first traversal of G, and let T be the resulting depth-first search tree. Let u
be a vertex in G and let v be the first new (unvisited) vertex visited after visiting u in the traversal. Which of the following
statement is always true?

A. {u, v} must be an edge in G, and u is a descendant of v in T


B. {u, v} must be an edge in G, and v is a descendant of u in T
C. If {u, v} is not an edge in G then u is a leaf in T
D. If {u, v} is not an edge in G then u and v must have the same parent in T

gate2000 algorithms graph-algorithms normal

1.75 Graph Algorithms: GATE2002_12 top gateoverflow.in/865

Fill in the blanks in the following template of an algorithm to compute all pairs shortest path lengths in a directed graph G
with n*n adjacency matrix A. A[i,j] equals 1 if there is an edge in G from i to j, and 0 otherwise. Your aim in filling in the
blanks is to ensure that the algorithm is correct.

INITIALIZATION: For i = 1 ... n


{For j = 1 ... n
{ if a[i,j] = 0 then P[i,j] =_______ else P[i,j] =_______;}
}
ALGORITHM: For i = 1 ... n
{For j = 1 ... n
{For k = 1 ... n
{P[__,__] = min{_______,______}; }
}
}

a. Copy the complete line containing the blanks in the Initialization step and fill in the blanks.
b. Copy the complete line containing the blanks in the Algorithm step and fill in the blanks.
c. Fill in the blank: The running time of the Algorithm is O(___).

gate2002 algorithms graph-algorithms time-complexity normal

1.76 Graph Algorithms: GATE2003_67 top gateoverflow.in/954

Let G = (V,E) be an undirected graph with a subgraph G1 = (V1 , E1 ). Weights are assigned to edges of G as follows.

w(e) = {
Copyright GATE Overflow. All rights reserved.
GATE Overflow April 2016 33 of 852

w(e) = {
0 if e E1
1 otherwise
A single-source shortest path algorithm is executed on the weighted graph ( V,E,w) with an arbitrary vertex v1 of V1 as the
source. Which of the following can always be inferred from the path costs computed?

A. The number of edges in the shortest paths from v1 to all vertices of G


B. G1 is connected

C. V1 forms a clique in G

D. G1 is a tree

gate2003 algorithms graph-algorithms normal

1.77 Graph Algorithms: GATE2003_70 top gateoverflow.in/957

Let G = (V , E) be a directed graph with n vertices. A path from vi to vj in $G$ is a sequence of vertices ( vi , vi+1 , , vj )
such that (vk , vk + 1) E for all k in i through j 1. A simple path is a path in which no vertex appears more than once.

Let A be an n n array initialized as follows.

A[j, k] = {
1 if (j, k) E
0 otherwise
Consider the following algorithm.

for i=1 to n
for j=1 to n
for k=1 to n
A[j,k] = max(A[j,k], A[j,i] + A[i,k]);

Which of the following statements is necessarily true for all j and k after termination of the above algorithm?

A. A[j, k] n
B. If A[j, j] n 1 then G has a Hamiltonian cycle
C. If there exists a path from j to k, A[j,k] contains the longest path length from j to k
D. If there exists a path from j to k, every simple path from j to k contains at most A[j,k] edges

gate2003 algorithms graph-algorithms normal

1.78 Graph Algorithms: GATE2014-2_14 top gateoverflow.in/1969

Consider the tree arcs of a BFS traversal from a source node W in an unweighted, connected, undirected graph. The tree T formed by the tree arcs is a data
structure for computing

(A) the shortest path between every pair of vertices.

(B) the shortest path from W to every vertex in the graph.

(C) the shortest paths from W to only those nodes that are leaves of T .

(D) the longest path in the graph.

gate2014-2 algorithms graph-algorithms normal

1.79 Graph Algorithms: GATE2006_48 top gateoverflow.in/1824

Let T be a depth first search tree in an undirected graph G. Vertices u and are leaves of this tree T. The degrees of both u
and in G are at least 2. which one of the following statements is true?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 34 of 852

(A) There must exist a vertex w adjacent to both u and in G


(B) There must exist a vertex w whose removal disconnects u and in G
(C) There must exist a cycle in G containing u and
(D) There must exist a cycle in G containing u and all its neighbours in G.

gate2006 algorithms graph-algorithms normal

1.80 Graph Algorithms: GATE2003_21 top gateoverflow.in/911

Consider the following graph

Among the following sequences

I. abeghf
II. abfehg
III. abfhge
IV. afghbe

which are depth first traversals of the above graph?

A. I, II and IV only
B. I and IV only
C. II, III and IV only
D. I, III and IV only

gate2003 algorithms graph-algorithms normal

1.81 Graph Algorithms: TIFR2013-B-15 top gateoverflow.in/25798

Let G be an undirected graph with n vertices. For any subset S of vertices, the set of neighbours of S consists of the union
of S and the set of vertices S that are connected to some vertex in S by an edge of G. The graph G has the nice property
that every subset of vertices S of size at most n/2 has at least 1.5|S| -many neighbours. What is the length of a longest path
in G?

a. O(1)
b. O(log log n) but not O(1)
c. O(log n) but not O(log log n)
d. O (n) but not O(log n)
e. O(n) but not O (n)

tifr2013 graph-algorithms

1.82 Graph Algorithms: GATE2008_7 top gateoverflow.in/405

The most efficient algorithm for finding the number of connected components in an undirected graph on n vertices and m
edges has time complexity

(A) (n)

(B) (m)

(C) (m + n)

(mn)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 35 of 852

(D) (mn)

gate2008 algorithms graph-algorithms time-complexity normal

1.83 Graph Search: GATE2015-1_45 top gateoverflow.in/8321

Let G = (V , E) be a simple undirected graph, and s be a particular vertex in it called the source. For x V , let d(x) denote
the shortest distance in G from s to x. A breadth first search (BFS) is performed starting at s. Let T be the resultant BFS
tree. If (u, v) is an edge of G that is not in T , then which one of the following CANNOT be the value of d(u) d(v)?

A. 1
B. 0
C. 1
D. 2

gate2015-1 algorithms graph-search bfs normal

1.84 Greedy Algorithm: GATE2005_84 top gateoverflow.in/1406

Statement for the Linked Answer Questions 84a & 84b:

We are given 9 tasks T1 , T2 , , T9 . The execution of each task requires one unit of time. We can execute one task at a
time. Each task Ti has a profit Pi and a deadline di . Profit Pi is earned if the task is completed before the end of the dith unit
of time.

Task T1 T2 T3 T4 T5 T6 T7 T8 T9
Profit 15 20 30 18 18 10 23 16 25
Deadline 7 2 5 3 4 5 2 7 3

(A) Are all tasks completed in the schedule that gives maximum profit?

A. All tasks are completed

B. T1 and T6 are left out

C. T1 and T8 are left out

D. T4 and T6 are left out

(B) What is the maximum profit earned?

A. 147
B. 165
C. 167
D. 175

gate2005 algorithms greedy-algorithm process-schedule normal

1.85 Hashing: GATE2015-2_33 top gateoverflow.in/8152

Which one of the following hash functions on integers will distribute keys most uniformly over 10 buckets numbered 0 to 9
for i ranging from 0 to 2020?

A. h(i) = i2 mod 10
B. h(i) = i3 mod 10
h(i) = (11 2 )mod 10

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 36 of 852

C. h(i) = (11 i2 )mod 10


D. h(i) = (12 i2 )mod 10

gate2015-2 algorithms hashing normal

1.86 Hashing: GATE2007_40 top gateoverflow.in/1238

Consider a hash table of size seven, with starting index zero, and a hash function (3x + 4) mod 7. Assuming the hash
table is initially empty, which of the following is the contents of the table when the sequence 1, 3, 8, 10 is inserted into the
table using closed hashing? Note that denotes an empty location in the table.

A. 8, , , , , , 10

B. 1, 8, 10, , , , 3

C. 1, , , , , , 3

D. 1, 10, 8, , , , 3

gate2007 algorithms hashing easy

1.87 Heap: GATE2013_30 top gateoverflow.in/1541

The number of elements that can be sorted in (log n) time using heap sort is


log n
(A) (1) (B) (log n) (C) ( log log n ) (D) (log n)

gate2013 algorithms sorting heap normal

1.88 Heap: GATE2007_47 top gateoverflow.in/1245

Consider the process of inserting an element into a Max Heap, where the Max Heap is represented by an array. Suppose
we perform a binary search on the path from the new leaf to the root to find the position for the newly inserted element, the
number of comparisons performed is:

A. (log2 n)
B. (log2 log2 n)
C. (n)

D. (n log2 n)

gate2007 algorithms time-complexity heap normal

1.89 Heap: GATE2003_23 top gateoverflow.in/1110

In a min-heap of size n the 7 th smallest element can be found in

gate2003 algorithms data-structure heap time-complexity

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 37 of 852

1.90 Heap: TIFR2011-B-21 top gateoverflow.in/20324

Let S = {x1 , . . . . , xn } be a set of n numbers. Consider the problem of storing the elements of S in an array A [1...n] such
that the following min-heap property is maintained for all 2 i n : A[i/2] A[i] . (Note that x is the largest integer
that is at most x). Which of the following statements is TRUE?

a. This problem can be solved in O(log n) time.


b. This problem can be solved in O(n) time but not in O(log n) time.
c. This problem can be solved in O(n log n) time but not in O(n) time.
d. This problem can be solved in O (n2 ) time but not in O(n log n) time.
e. None of the above.

tifr2011 algorithms sorting heap

1.91 Huffman Code: GATE2007-77 top gateoverflow.in/43513

Suppose the letters a, b, c, d, e, f have probabilities 12 , 14 , 18 , 1


, 1 , 1 , respectively.
16 32 32

What is the average length of the correct answer to Q.76?

A. 3
B. 2.1875
C. 2.25
D. 1.9375

gate2007 algorithms huffman-code normal

1.92 Huffman Code: GATE2006-IT_48 top gateoverflow.in/3591

The characters a to h have the set of frequencies based on the first 8 Fibonacci numbers as follows
a : 1, b : 1, c : 2, d : 3, e : 5, f : 8, g : 13, h : 21
A Huffman code is used to represent the characters. What is the sequence of characters corresponding to the following code?
110111100111010

A) fdheg
B) ecgdf
C) dchfg
D) fehdg

gate2006-it algorithms huffman-code normal

1.93 Huffman Code: GATE2007-76 top gateoverflow.in/1271

Suppose the letters a, b, c, d, e, f have probabilities 12 , 14 , 18 , 1


, 1 , 1 , respectively.
16 32 32

Which of the following is the Huffman code for the letter a, b, c, d, e, f ?


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

gate2007 algorithms huffman-code normal

1.94 Identify Function: GATE2005_31 top gateoverflow.in/1367

Consider the following C-program:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 38 of 852

void foo (int n, int sum) {


int k = 0, j = 0;
if (n == 0) return;
k = n % 10; j = n/10;
sum = sum + k;
foo (j, sum);
printf ("%d,",k);
}
int main() {
int a = 2048, sum = 0;
foo(a, sum);
printf("%d\n", sum);
}

What does the above program print?

A. 8, 4, 0, 2, 14

B. 8, 4, 0, 2, 0

C. 2, 0, 4, 8, 14

D. 2, 0, 4, 8, 0

gate2005 algorithms identify-function recursion normal

1.95 Identify Function: GATE2014-2_10 top gateoverflow.in/1964

Consider the function func shown below:

int func(int num) {


int count = 0;
while (num) {
count++;
num>>= 1;
}
return (count);
}

The value returned by func(435) is ________

gate2014-2 algorithms identify-function numerical-answers easy

1.96 Identify Function: GATE2013_31 top gateoverflow.in/1542

Consider the following function:

int unknown(int n){


int i, j, k=0;
for (i=n/2; i<=n; i++)
for (j=2; j<=n; j=j*2)
k = k + n/2;
return (k);
}

The return value of the function is

(A) (n2 ) (B) (n2 log n) (C) (n3 ) (D) (n3 log n)

gate2013 algorithms identify-function normal

1.97 Identify Function: GATE1993_7.4 top gateoverflow.in/2292

What does the following code do?

var a, b: integer;
begin
a:=a+b;
b:=a-b;
a:a-b;
end;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 39 of 852

A. exchanges a and b
B. doubles a and stores in b
C. doubles b and stores in a
D. leaves a and b unchanged
E. none of the above

gate1993 algorithms identify-function easy

1.98 Identify Function: GATE1998_2.12 top gateoverflow.in/1684

What value would the following function return for the input x = 95?
Function fun (x:integer):integer;
Begin
If x > 100 then fun := x 10
Else fun := fun(fun (x+11))
End;

A. 89
B. 90
C. 91
D. 92

gate1998 algorithms recursion identify-function normal

1.99 Identify Function: GATE2011-48 top gateoverflow.in/2154

Consider the following recursive C function that takes two arguments.

unsigned int foo(unsigned int n, unsigned int r) {


if (n>0) return ((n%r) + foo(n/r, r));
else return 0;
}

What is the return value of the function foo when it is called as foo(345, 10)?

A. 345
B. 12
C. 5
D. 3

gate2011 algorithms recursion identify-function normal

1.100 Identify Function: GATE2010_35 top gateoverflow.in/2336

What is the value printed by the following C program?

#include<stdio.h>
int f(int *a, int n)
{
if (n <= 0) return 0;
else if (*a % 2 == 0) return *a+f(a+1, n-1);
else return *a - f(a+1, n-1);
}
int main()
{
int a[] = (12, 7, 13, 4, 11, 6);
printf("%d", f(a, 6));
return 0;
}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 40 of 852

(A) -9

(B) 5

(C) 15

(D) 19

gate2010 algorithms recursion identify-function normal

1.101 Identify Function: GATE2014-3_10 top gateoverflow.in/2044

Let A be the square matrix of size n n. Consider the following pseudocode. What is the expected output?

C=100;
for i=1 to n do
for j=1 to n do
{
Temp = A[i][j]+C;
A[i][j] = A[j][i];
A[j][i] = Temp -C;
}
for i=1 to n do
for j=1 to n do
output (A[i][j]);

(A) The matrix A itself

(B) Transpose of the matrix A

(C) Adding 100 to the upper diagonal elements and subtracting 100 from lower diagonal elements of A

(D) None of the above

gate2014-3 algorithms identify-function easy

1.102 Identify Function: GATE1999_2.24 top gateoverflow.in/1501

Consider the following C function definition

int Trial (int a, int b, int c)


{
if ((a>=b) && (c<b) return b;
else if (a>=b) return Trial(a, c, b);
else return Trial(b, a, c);
}

The functional Trial:

A. Finds the maximum of a, b, and c

B. Finds the minimum of a, b, and c

C. Finds the middle number of a, b, c

D. None of the above

gate1999 algorithms identify-function normal

1.103 Identify Function: GATE2006_53 top gateoverflow.in/1831

Consider the following C-function in which a[n] and b[m] are two sorted integer arrays and c[n+m] be another integer
array,

void xyz(int a[], int b [], int c []){


int i,j,k;
i=j=k=0;
while ((i<n) && (j<m))
if (a[i] < b[j]) c[k++] = a[i++];
else c[k++] = b[j++];

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 41 of 852

Which of the following condition(s) hold(s) after the termination of the while loop?

i. j < m, k = n + j 1 and a[n 1] < b[j] if i = n


ii. i < n, k = m + i 1 and b[m 1] a[i] if j = m

(A) only (i)


(B) only (ii)
(C) either (i) or (ii) but not both
(D) neither (i) nor (ii)

gate2006 algorithms identify-function normal

1.104 Identify Function: GATE2004_42 top gateoverflow.in/1039

What does the following algorithm approximate? (Assume m > 1, > 0).
x = m;
y = 1;
While (x-y > )
{
x = (x+y)/2;
y = m/x;
}
print(x);

A. log m
B. m2
1
C. m 2
1
D. m 3

gate2004 algorithms identify-function normal

1.105 Identify Function: GATE2003_88 top gateoverflow.in/971

In the following C program fragment, j, k, n and TwoLog_n are integer variables, and A is an array of integers. The variable
n is initialized to an integer 3, and TwoLog_n is initialized to the value of 2 log2 (n)

for (k = 3; k <= n; k++)


A[k] = 0;
for (k = 2; k <= TwoLog_n; k++)
for (j = k+1; j <= n; j++)
A[j] = A[j] || (j%k);
for (j = 3; j <= n; j++)
if (!A[j]) printf("%d", j);

The set of numbers printed by this program fragment is

A. {m m n, (i) [m = i!]}

B. {m m n, (i) [m = i2 ]}

C. {m m n, m is prime}
D. { }

gate2003 algorithms identify-function normal

1.106 Identify Function: GATE2008-IT_83 top gateoverflow.in/3407

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 42 of 852

Consider the code fragment written in C below :


void f (int n)
{
if (n <= 1) {
printf ("%d", n);
}
else {
f (n/2);
printf ("%d", n%2);
}
}

Which of the following implementations will produce the same output for f(173) as the above code?

P1 P2

void f (int n)
void f (int n) {
{ if (n <=1) {
if (n/2) { printf ("%d", n);
f(n/2); }
} else {
printf ("%d", n%2); printf ("%d", n%2);
} f (n/2);
}
}

A) Both P1 and P2
B) P2 only
C) P1 only
D) Neither P1 nor P2

gate2008-it algorithms recursion identify-function normal

1.107 Identify Function: GATE2008-IT_82 top gateoverflow.in/3406

Consider the code fragment written in C below :

void f (int n)
{
if (n <=1) {
printf ("%d", n);
}
else {
f (n/2);
printf ("%d", n%2);
}
}

What does f(173) print?

1) 010110101
2) 010101101
3) 10110101
4) 10101101

gate2008-it algorithms recursion identify-function normal

1.108 Identify Function: GATE2003_1 top gateoverflow.in/892

Consider the following C function.

For large values of y, the return value of the function f best approximates


float f,(float x, int y) {
float p, s; int i;
for (s=1,p=1,i=1; i<y; i++) {
p *= x/i;
s += p;
}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 43 of 852

return s;
}

A. xy
B. ex
C. ln(1 + x)
D. xx

gate2003 algorithms identify-function normal

1.109 Identify Function: GATE2005-IT_57 top gateoverflow.in/3818

What is the output printed by the following program?

#include <stdio.h>
int f(int n, int k) {
if (n == 0) return 0;
else if (n % 2) return f(n/2, 2*k) + k;
else return f(n/2, 2*k) - k;
}
int main () {
printf("%d", f(20, 1));
return 0;
}

A) 5
B) 8
C) 9
D) 20

gate2005-it algorithms identify-function normal

1.110 Identify Function: GATE2015-3_49 top gateoverflow.in/8558

Suppose c = c[0], , c[k 1] is an array of length k, where all the entries are from the set {0, 1}. For any positive
integers a and n, consider the following pseudocode.

DOSOMETHING (c, a, n)

z1
for i 0 to k 1
do z z 2 mod n
if c[i]=1
then z (z a) mod n
return z

If k = 4, c = 1, 0, 1, 1, a = 2, and n = 8, then the output of DOSOMETHING( c, a, n) is _______.


gate2015-3 algorithms identify-function normal numerical-answers

1.111 Identify Function: TIFR2014-B-2 top gateoverflow.in/27136

Consider the following code.

def brian(n):
count = 0
while ( n ! = 0 )
n = n & ( n-1 )
count = count + 1
return count

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 44 of 852

Here n is meant to be an unsigned integer. The operator & considers its arguments in binary and computes their bit wise
AND. For example, 22 & 15 gives 6, because the binary (say 8-bit) representation of 22 is 00010110 and the binary
representation of 15 is 00001111, and the bit-wise AND of these binary strings is 00000110, which is the binary
representation of 6. What does the function brian return?

a. The highest power of 2 dividing n, but zero if n is zero.


b. The number obtained by complementing the binary representation of n.
c. The number of ones in the binary representation of n.
d. The code might go into an infinite loop for some n.
e. The result depends on the number of bits used to store unsigned integers.

tifr2014 algorithms identify-function

1.112 Identify Function: GATE2015-2_11 top gateoverflow.in/8060

Consider the following C function.

int fun(int n) {
int x=1, k;
if (n==1) return x;
for (k=1; k<n; ++k)
x = x + fun(k) * fun (n-k);
return x;
}

The return value of fun(5) is ______.

gate2015-2 algorithms identify-function recurrence normal

1.113 Identify Function: GATE2014-1_41 top gateoverflow.in/1919

Consider the following C function in which size is the number of elements in the array E:

int MyX(int *E, unsigned int size)


{
int Y = 0;
int Z;
int i, j, k;
for(i = 0; i< size; i++)
Y = Y + E[i];
for(i=0; i < size; i++)
for(j = i; j < size; j++)
{
Z = 0;
for(k = i; k <= j; k++)
Z = Z + E[k];
if(Z > Y)
Y = Z;
}
return Y;
}

The value returned by the function MyX is the

(A) maximum possible sum of elements in any sub-array of array E.

(B) maximum element in any sub-array of array E.

(C) sum of the maximum elements in all possible sub-arrays of array E.

(D) the sum of all the elements in the array E.

gate2014-1 algorithms identify-function normal

1.114 Identify Function: GATE2006-IT_52 top gateoverflow.in/3595

m
The following function computes the value of ( n ) correctly for all legal values m and n (m 1, n 0 and m > n)
int func(int m, int n)
{
if (E) return 1;
else return(func(m -1, n) + func(m - 1, n - 1));
}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 45 of 852

In the above function, which of the following is the correct expression for E?

A) (n = = 0) || (m = = 1)
B) (n = = 0) && (m = = 1)
C) (n = = 0) || (m = = n)
D) (n = = 0) && (m = = n)

gate2006-it algorithms identify-function normal

1.115 Identify Function: GATE1995_2.3 top gateoverflow.in/2615

Assume that X and Y are non-zero positive integers. What does the following Pascal program segment do?

while X <> Y do
if X > Y then
X := X - Y
else
Y := Y - X;
write(X);

A. Computes the LCM of two numbers

B. Divides the larger number by the smaller number

C. Computes the GCD of two numbers

D. None of the above

gate1995 algorithms identify-function normal

1.116 Identify Function: GATE1995_4 top gateoverflow.in/2640

a. Consider the following Pascal function where A and B are non-zero positive integers. What is the value of GET (3, 2)?

function GET(A,B:integer): integer;


begin
if B=0 then
GET:= 1
else if A < B then
GET:= 0
else
GET:= GET(A-1, B) + GET(A-1, B-1)
end;

b. The Pascal procedure given for computing the transpose of an N N, (N > 1) matrix A of integers has an error. Find
the error and correct it. Assume that the following declaration are made in the main program
const
MAXSIZE=20;
type
INTARR=array [1..MAXSIZE,1..MAXSIZE] of integer;
Procedure TRANSPOSE (var A: INTARR; N : integer);
var
I, J, TMP: integer;
begin
for I:=1 to N 1 do
for J:=1 to N do
begin
TMP:= A[I, J];
A[I, J]:= A[J, I];
A[J, I]:= TMP
end
end;

gate1995 algorithms identify-function normal

1.117 Identify Function: GATE1994_6 top gateoverflow.in/2502

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 46 of 852

What function of x, n is computed by this program?

Function what(x, n:integer): integer:


Var
value : integer
begin
value := 1
if n > 0 then
begin
if n mod 2 =1 then
value := value * x;
value := value * what(x*x, n div 2);
end;
what := value;
end;

gate1994 algorithms identify-function normal

1.118 Identify Function: GATE2009_18 top gateoverflow.in/1310

Consider the program below:


#include <stdio.h>
int fun(int n, int *f_p) {
int t, f;
if (n <= 1) {
*f_p = 1;
return 1;
}
t = fun(n-1, f_p);
f = t + *f_p;
*f_p = t;
return f;
}

int main() {
int x = 15;
printf("%d/n", fun(5, &x));
return 0;
}

The value printed is

A. 6
B. 8
C. 14
D. 15

gate2009 algorithms recursion identify-function normal

1.119 Identify Function: GATE1995_1.4 top gateoverflow.in/2591

In the following Pascal program segment, what is the value of X after the execution of the program segment?

X := -10; Y := 20;
If X > Y then if X < 0 then X := abs(X) else X := 2*X;

A. 10
B. -20
C. -10
D. None

gate1995 algorithms identify-function easy

1.120 Insertion Sort: TIFR2010-B-27 top gateoverflow.in/19036

Consider the Insertion Sort procedure given below, which sorts an array L of size n ( 2) in ascending order:
begin

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 47 of 852

for xindex:= 2 to n do
x := L [xindex];
j:= xindex - 1;
while j > 0 and L[j] > x do
L[j + 1]:= L[j];
j:= j - 1;
end {while}
L [j + 1]:=X;
end{for}
end

It is known that insertion sort makes at most n (n - 1) / 2 comparisons. Which of the following is true?

a. There is no input on which insertion Sort makes n (n - 1) / 2 comparisons.


b. Insertion Sort makes n (n - 1) / 2 comparisons when the input is already sorted in ascending order.
c. Insertion Sort makes n (n - 1) / 2 comparisons only when the input is sorted in descending order.
d. There are more than one input orderings where insertion sort makes n (n - 1) / 2 comparisons.
e. Insertion Sort makes n (n - 1) / 2 comparisons whenever all the elements of L are not distinct.

tifr2010 algorithms sorting insertion-sort

1.121 Lines Curves: GATE2007-IT_81 top gateoverflow.in/3533

Let P1 , P2 , , Pn be n points in the xy-plane such that no three of them are collinear. For every pair of points Pi and Pj , let
Lij be the line passing through them. Let Lab be the line with the steepest gradient among all n(n 1)/2 lines.
The time complexity of the best algorithm for finding Pa and Pb is

A) (n)
B) (n log n)
2
C) (n log n)
2
D) (n )

gate2007-it algorithms lines-curves time-complexity normal

1.122 Linked Lists: GATE1994_1.17 top gateoverflow.in/2460

Linked lists are not suitable data structures for which one of the following problems?

A. Insertion sort

B. Binary search

C. Radix sort

D. Polynomial manipulation

gate1994 algorithms linked-lists normal

1.123 Linked Lists: GATE2004-IT_13 top gateoverflow.in/3654

Let P be a singly linked list. Let Q be the pointer to an intermediate node x in the list. What is the worst-case time complexity
of the best-known algorithm to delete the node x from the list ?

A) O(n)
B) O(log2 n)
C) O(log n)
D) O(1)

gate2004-it algorithms linked-lists time-complexity normal

1.124 Linked Lists: GATE1997_18 top gateoverflow.in/2278

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 48 of 852

Consider the following piece of C code fragment that removes duplicates from an ordered list of integers.

Node *remove-duplicates (Node* head, int *j)


{
Node *t1, *t2;
*j=0;
t1 = head;
if (t1! = NULL) t2 = t1 ->next;
else return head;
*j = 1;
if(t2 == NULL)
return head;
while t2 != NULL)
{
if (t1.val != t2.val) ----------------> S1)
{
(*j)++; t1 -> next = t2; t1 = t2: -----> (S2)
}
t2 = t2 ->next;
}
t1 -> next = NULL;
return head;
}

Assume the list contains n elements (n 2) in the following questions.


a. How many times is the comparison in statement S1 made?

b. What is the minimum and the maximum number of times statements marked S2 get executed?

c. What is the significance of the value in the integer pointed to by j when the function completes?

gate1997 algorithms data-structure linked-lists normal

1.125 Linked Lists: GATE2010_36 top gateoverflow.in/2337

The following C function takes a singly-linked list as input argument. It modies the list by moving the last element to the front of the list and returns the modied
list. Some part of the code is left blank.

typedef struct node


{
int value;
struct node *next;
} node;
Node *move_to-front(Node *head)
{
Node *p, *q;
if ((head == NULL) || (head -> next == NULL))
return head;
q = NULL;
p = head;
while (p->next != NULL)
{
q=p;
p=p->next;
}
_______________

return head;
}

Choose the correct alternative to replace the blank line.

(A) q=NULL; p->next = head; head = p;

(B) q->next = NULL; head = p; p->next = head;

(C) head = p; p->next =q; q->next = NULL;

(D) q->next = NULL; p->next = head; head = p;

gate2010 algorithms linked-lists normal

1.126 Linked Lists: GATE1993_13 top gateoverflow.in/2310

Consider a singly linked list having n nodes. The data items d1 , d2 , dn are stored in these n nodes. Let X be a pointer to
the jth node (1 j n) in which dj is stored. A new data item d stored in node with address Y is to be inserted. Give an
algorithm to insert d into the list to obtain a list having items d1 , d2 , , dj , d, , dn in order without using the header.

gate1993 algorithms linked-lists normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 49 of 852

1.127 Loop Invariants: TIFR2010-B-30 top gateoverflow.in/19042

Consider the following program for summing the entries of the array b : array [0. . N 1] of integers, where N is a positive
integer. (The symbol '<>' denotes 'not equal to').

var
i, s: integer;
Program
i:= 0;
s:= 0;
[*] while i <> N do
s := s + b[i];
i := i + 1;
od

Which of the following gives the invariant that holds at the beginning of each loop, that is, each time the program arrives at
point [*] ?

N
A. s = b[j] & 0 i N
j=0
i=1
B. s = b[j] & 0 i < N
j=0
i
C. s = b[j] & 0 < i N
j=0
N
D. s = b[j] & 0 i < N
j=1
i1
E. s = b[j] & 0 i N
j=0

tifr2010 algorithms loop-invariants

1.128 Loop Invariants: GATE 2016-2-35 top gateoverflow.in/39578

The following function computes X Y for positive integers X and Y .

int exp (int X, int Y) {


int res =1, a = X, b = Y;
while (b != 0) {
if (b % 2 == 0) {a = a * a; b = b/2; }
else {res = res * a; b = b - 1; }
}
return res;
}

Which one of the following conditions is TRUE before every iteration of the loop?

A. X Y = ab
B. (res a )Y = (res X )b
C. X Y = res ab
D. X Y = (res a )b

gate2016-2 algorithms loop-invariants normal

1.129 Matrix Chain Ordering: GATE2011_38 top gateoverflow.in/2140

Four Matrices M1 , M2 , M3 , and M4 of dimensions p q, q r, r s and s t respectively can be multiplied in several


ways with different number of total scalar multiplications. For example when multiplied as ((M1 M2 ) (M3 M4 )), the
total number of scalar multiplications is pqr + rst + prt. When multiplied as (((M1 M2 ) M3 ) M4 ), the total number
of scalar multiplications is pqr + prs + pst.

If p = 10, q = 100, r = 20, s = 5 and t = 80, then the minimum number of scalar multiplications needed is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 50 of 852

(A) 248000

(B) 44000

(C) 19000

(D) 25000

gate2011 algorithms dynamic-programming matrix-chain-ordering normal

1.130 Matrix Chain Ordering: GATE 2016-2-38 top gateoverflow.in/39587

Let A1 , A2 , A3 and A4 be four matrices of dimensions 10 5, 5 20, 20 10, and 10 5, respectively. The minimum
number of scalar multiplications required to find the product A1 A2 A3 A4 using the basic matrix multiplication method is
_________.

gate2016-2 dynamic-programming matrix-chain-ordering normal numerical-answers

1.131 Median: TIFR2013-B-12 top gateoverflow.in/25774

It takes O(n) time to find the median in a list of n elements, which are not necessarily in sorted order while it takes only
O(1) time to find the median in a list of n sorted elements. How much time does it take to find the median of 2n elements
which are given as two lists of n sorted elements each?

a. O(1)
b. O (log n) but not O(1)
c. O(n) but not O (log n)
d. O(n) but not O(n)
e. O (n log n) but not O(n)

tifr2013 algorithms median

1.132 Merge Sort: GATE2015-3_27 top gateoverflow.in/8480

Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most
closely approximates the maximum input size of a problem that can be solved in 6 minutes?

A. 256
B. 512
C. 1024
D. 2018

gate2015-3 algorithms sorting merge-sort

1.133 Merge Sort: GATE2005-IT_59 top gateoverflow.in/3820

Let a and b be two sorted arrays containing n integers each, in non-decreasing order. Let c be a sorted array containing 2n
integers obtained by merging the two arrays a and b. Assuming the arrays are indexed starting from 0, consider the
following four statements

I. a[i] b [i] => c[2i] a [i]


II. a[i] b [i] => c[2i] b [i]
III. a[i] b [i] => c[2i] a [i]
IV. a[i] b [i] => c[2i] b [i]

Which of the following is TRUE?

A) only I and II
B) only I and IV
C) only II and III

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 51 of 852

D) only III and IV

gate2005-it algorithms sorting merge-sort normal

1.134 Merge Sort: GATE1995_1.16 top gateoverflow.in/2603

For merging two sorted lists of sizes m and n into a sorted list of size m + n, we require comparisons of

A. O(m)

B. O(n)

C. O(m + n)

D. O(log m + log n)

gate1995 algorithms sorting merge-sort normal

1.135 Minimum: GATE2008_42 top gateoverflow.in/1872

G is a graph on n vertices and 2n 2 edges. The edges of G can be partitioned into two edge-disjoint spanning trees.
Which of the following is NOT true for G?

a. For every subset of k vertices, the induced subgraph has at most 2k 2 edges.
b. The minimum cut in G has at least 2 edges.
c. There are at least 2 edge-disjoint paths between every pair of vertices.
d. There are at least 2 vertex-disjoint paths between every pair of vertices.

gate2008 algorithms graph-algorithms minimum spanning-tree normal

1.136 Minimum Spanning Trees: GATE 2016-1-40 top gateoverflow.in/39727

G = (V , E) is an undirected simple graph in which each edge has a distinct weight, and e is a particular edge of G. Which of
the following statements about the minimum spanning trees (MST s) of G is/are TRUE?

I. If e is the lightest edge of some cycle in G, then every MST of G includes e.

II. If e is the heaviest edge of some cycle in G, then every MST of G excludes e.

A. I only.
B. II only.
C. Both I and II.
D. Neither I nor II.

gate2016-1 algorithms graph-algorithms minimum-spanning-trees normal

1.137 Minimum Spanning Trees: GATE 2016-1-14 top gateoverflow.in/39673

Let G be a weighted connected undirected graph with distinct positive edge weights. If every edge weight is increased by
the same value, then which of the following statements is/are TRUE?

P: Minimum spanning tree of G does not change.


Q: Shortest path between any pair of vertices does not change.

A. P only
B. Q only
C. Neither P nor Q
D. Both P and Q

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 52 of 852

gate2016-1 algorithms graph-algorithms minimum-spanning-trees shortest-path normal

1.138 Minimum Spanning Trees: TIFR2015-B-2 top gateoverflow.in/29844

Consider the following undirected connected graph G with weights on its edges as given in the figure below. A minimum
spanning tree is a spanning tree of least weight and a maximum spanning tree is one with largest weight. A second best
minimum spanning tree whose weight is the smallest among all spanning trees that are not minimum spanning trees in G.

Which of the following statements is TRUE in the above graph? (Note that all the edge weights are distinct in the above
graph)

a. There is more than one minimum spanning tree and similarly, there is more than one maximum spanning tree here.
b. There is a unique minimum spanning tree, however there is more than one maximum spanning tree here.
c. There is more than one minimum spanning tree, however there is a unique maximum spanning tree here.
d. There is more than one minimum spanning tree and similarly, there is more than one second-best minimum spanning
tree here.
e. There is unique minimum spanning tree, however there is more than one second-best minimum spanning tree here.

tifr2015 minimum-spanning-trees

1.139 Minimum Spanning Trees: GATE 2016-1-39 top gateoverflow.in/39725

Let G be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5, and 6. The maximum
possible weight that a minimum weight spanning tree of G can have is __________

gate2016-1 algorithms graph-algorithms minimum-spanning-trees normal numerical-answers

1.140 P Np Npc Nph: TIFR2011-B-37 top gateoverflow.in/20922

Given an integer n 3, consider the problem of determining if there exist integers a, b 2 such that n = ab . Call this the
forward problem. The reverse problem is: given a and b , compute ab (mod b). Note that the input length for the forward
problem is log n + 1, while the input length for the reverse problem is log a + log b + 2. Which of the following
statements is TRUE?

a. Both the forward and reverse problems can be solved in time polynomial in the lengths of their respective inputs.
b. The forward problem can be solved in polynomial time, however the reverse problem is NP -hard.
c. The reverse problem can be solved in polynomial time, however the forward problem is NP -hard.
d. Both the forward and reverse problem are NP -hard.
e. None of the above.

tifr2011 algorithms p-np-npc-nph

1.141 P Np Npc Nph: GATE1995_11 top gateoverflow.in/2647

Let L be a language over i.e., L . Suppose L satisfies the two conditions given below.
i. L is in NP and

L Lc L

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 53 of 852

ii. For every n, there is exactly one string of length n that belongs to L . Let Lc be the complement of L over . Show
that Lc is also in NP.

gate1995 algorithms p-np-npc-nph normal

1.142 P Np Npc Nph: TIFR2013-B-7 top gateoverflow.in/25668

Which of the following is not implied by P = NP ?


a. 3SAT can be solved in polynomial time.
b. Halting problem can be solved in polynomial time.
c. Factoring can be solved in polynomial time.
d. Graph isomorphism can be solved in polynomial time.
e. Travelling salesman problem can be solved in polynomial time.

tifr2013 algorithms p-np-npc-nph

1.143 P Np Npc Nph: TIFR2011-B-25 top gateoverflow.in/20404

Let ATM be defined as follows:

ATM = {M, w The Turning machine M accepts the word w}


And let L be some NP complete language. Which of the following statements is FALSE?

a. L NP
b. Every problem in NP is polynomial time reducible to L .
c. Every problem in NP is polynomial time reducible to ATM .
d. Since L is NP complete, ATM is polynomial time reducible to L .
e. ATM NP .

tifr2011 theory-of-computation algorithms p-np-npc-nph

1.144 P Np Npc Nph: TIFR2012-B-20 top gateoverflow.in/26480

This question concerns the classes P and N P . If you are familiar with them, you may skip the definitions and go directly to
the question.
Let L be a set. We say that L is in P if there is some algorithm which given input x decides if x is in L or not in time bounded
by a polynomial in the length of x. For example, the set of all connected graphs is in P , because there is an algorithm which,
given a graph graph, can decide if it is connected or not in time roughly proportional to the number of edges of the graph.

The class NP is a superset of class P . It contains those sets that have membership witnesses that can be verified in
polynomial time. For example, the set of composite numbers is in NP . To see this take the witness for a composite number
to be one of its divisors. Then the verification process consists of performing just one division using two reasonable size
numbers. Similarly, the set of those graphs that have a Hamilton cycle, i.e. a cycle containing all the vertices of the graph, is
in in NP. To verify that the graph has a Hamilton cycle we just check if the witnessing sequence of vertices indeed a cycle of
the graph that passes through all the vertices of the graph. This can be done in time that is polynomial in the size of the
graph.

More precisely, if L is a set in P consisting of elements of the form (x, w), then the set

M = {x : w, |w| |x|k and (x, w) L},

is in N P .
Let G = (V, E) be a graph. G is said to have perfect matching if there is a subset M of the edges of G so that

i. No two edges in M intersect (have a vertex in common); and


ii. Every vertex of G has an edge in M.

Let MATCH be the set of all graphs that have a perfect matching. Let MATCH be the set of graphs that do not have a
perfect matching. Let o(G) be the number of components of G that have an odd number of vertices.

G MATCH

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 54 of 852

Tuttes Theorem: G MATCH if and only if for all subsets S of V, the number of components in G S (the graph formed
by deleting the vertices in S) with an odd number of vertices is at most |S|. That is,

G MATCH S V o(G S) |S|.


Which of the following is true?

A. MATCH NP and MATCH NP

B. MATCH NP and MATCH NP

C. MATCH NP and MATCH NP

D. MATCH P and MATCH P
E. none of the above

tifr2012 algorithms p-np-npc-nph

1.145 P Np Npc Nph: TIFR2015-B-13 top gateoverflow.in/30076

Two undirected graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are said to be isomorphic if there exist a bijection : V1 V2
such that for all u, v V1 , (u, v) E1 if and only ((u), (v)) E2 . Consider the following language.

L={(G, H)| G and H are undirected graphs such that a subgraph of G is isomorphic to H }

Then which of the following are true?

(i) L NP .
(ii) L is NP - hard.

(iii) L is undecidable.

A. Only (i)
B. Only (ii)
C. Only (iii)
D. (i) and (ii)
E. (ii) and (iii)

tifr2015 p-np-npc-nph non-gate

1.146 P Np Npc Nph: TIFR2010-B-39 top gateoverflow.in/18754

Suppose a language L is NP complete. Then which of the following is FALSE?

A. L NP
B. Every problem in P is polynomial time reducible to L .
C. Every problem in NP is polynomial time reducible to L .
D. The Hamilton cycle problem is polynomial time reducible to L .
E. P NP and L P .

tifr2010 algorithms p-np-npc-nph

1.147 P Np Npc Nph: GATE2009_14 top gateoverflow.in/1306

Let A be a problem that belongs to the class NP. Then which one of the following is TRUE?

A. There is no polynomial time algorithm for A .

B. If A can be solved deterministically in polynomial time, then P = NP.

C. If A is NP-hard, then it is NP-complete.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 55 of 852

D. A may be undecidable.

gate2009 algorithms p-np-npc-nph easy

1.148 P Np Npc Nph: GATE2004_30 top gateoverflow.in/1027

The problem 3-SAT and 2-SAT are

A. both in P

B. both NP complete

C. NP-complete and in P respectively

D. undecidable and NP complete respectively

gate2004 algorithms p-np-npc-nph easy

1.149 P Np Npc Nph: GATE2006_31 top gateoverflow.in/994

Let SHAM3 be the problem of finding a Hamiltonian cycle in a graph G=(V,E) with divisible by 3 and DHAM 3 be the
problem of determining if a Hamiltonian cycle exists in such graphs. Which one of the following is true?

(A) Both DHAM 3 and SHAM 3 are NP-hard


(B) SHAM3 is NP-hard, but DHAM 3 is not
(C) DHAM3 is NP-hard, but SHAM 3 is not
(D) Neither DHAM3 nor SHAM 3 is NP-hard

gate2006 algorithms p-np-npc-nph normal

1.150 P Np Npc Nph: GATE1992_02,vi top gateoverflow.in/561

02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

(vi) Which of the following problems is not NP-hard?

a. Hamiltonian circuit problem


b. The 0/1 Knapsack problem
c. Finding bi-connected components of a graph
d. The graph coloring problem

gate1992 p-np-npc-nph algorithms

1.151 P Np Npc Nph: GATE2003_12 top gateoverflow.in/903

Ram and Shyam have been asked to show that a certain problem is NP-complete. Ram shows a polynomial time reduction
from the 3-SAT problem to , and Shyam shows a polynomial time reduction from to 3-SAT. Which of the following can
be inferred from these reductions?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 56 of 852

A. is NP-hard but not NP-complete

B. is in NP, but is not NP-complete

C. is NP-complete

D. is neither NP-hard, nor in NP

gate2003 algorithms p-np-npc-nph normal

1.152 P Np Npc Nph: GATE2013_18 top gateoverflow.in/1440

Which of the following statements are TRUE?

1. The problem of determining whether there exists a cycle in an undirected graph is in P.


2. The problem of determining whether there exists a cycle in an undirected graph is in NP.
3. If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A.

(A) 1, 2 and 3 (B) 1 and 2 only (C) 2 and 3 only (D) 1 and 3 only

gate2013 algorithms p-np-npc-nph normal

1.153 P Np Npc Nph: GATE2008_44 top gateoverflow.in/456

The subset-sum problem is dened as follows: Given a set S of n positive integers and a positive integer W, determine whether there is a subset of S whose
elements sum to W. An algorithm Q solves this problem in O(nW) time. Which of the following statements is false?

A. Q solves the subset-sum problem in polynomial time when the input is encoded in unary
B. Q solves the subset-sum problem in polynomial time when the input is encoded in binary
C. The subset sum problem belongs to the class NP
D. The subset sum problem is NP-hard

gate2008 algorithms p-np-npc-nph normal

1.154 P Np Npc Nph: GATE2005_58 top gateoverflow.in/1381

Consider the following two problems on undirected graphs:

: Given G(V, E), does G have an independent set of size |V| - 4?


: Given G(V, E), does G have an independent set of size 5?
Which one of the following is TRUE?

A. is in P and is NP-complete

B. is NP-complete and is in P

C. Both and are NP-complete

D. Both and are in P

gate2005 algorithms p-np-npc-nph normal

1.155 P Np Npc Nph: GATE2006_16 top gateoverflow.in/977

Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q is polynomial time reducible
to S and S is polynomial-time reducible to R. Which one of the following statements is true?

(A) R is NP-complete

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 57 of 852

(B) R is NP-hard
(C) Q is NP-complete
(D) Q is NP-hard

gate2006 algorithms p-np-npc-nph normal

1.156 Programming In C: GATE 2016-1-34 top gateoverflow.in/39704

The following function computes the maximum value contained in an integer array P [] of size n (n >= 1).

int max (int *p,int n) {


int a = 0, b=n-1;

while (__________) {
if (p[a]<= p[b]) {a = a+1;}
else {b = b-1;}
}
return p[a];
}

The missing loop condition is

A. a! = n
B. b! = 0
C. b > (a + 1)
D. b! = a

gate2016-1 algorithms programming-in-c normal

1.157 Programming In C: GATE2015-3_30 top gateoverflow.in/8486

Consider the following two C code segments. Y and X are one and two dimensional arrays of size n and n n respectively,
where 2 n 10. Assume that in both code segments, elements of Y are initialized to 0 and each element X[i][j] of array
X is initialized to i + j. Further assume that when stored in main memory all elements of X are in same main memory page
frame.

Code segment 1:

// initialize elements of Y to 0
// initialize elements of X[i][j] of X to i+j
for (i=0; i<n; i++)
Y[i] += X[0][i];

Code segment 2:

// initialize elements of Y to 0
// initialize elements of X[i][j] of X to i+j
for (i=0; i<n; i++)
Y[i] += X[i][0];

Which of the following statements is/are correct?

S1: Final contents of array Y will be same in both code segments

S2: Elements of array X accessed inside the for loop shown in code segment 1 are contiguous in main memory

S3: Elements of array X accessed inside the for loop shown in code segment 2 are contiguous in main memory

A. Only S2 is correct
B. Only S3 is correct
C. Only S1 and S2 are correct
D. Only S1 and S3 are correct

gate2015-3 algorithms programming-in-c normal

1.158 Quicksort: TIFR2012-B-14 top gateoverflow.in/25209

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 58 of 852

Consider the quick sort algorithm on a set of n numbers, where in every recursive subroutine of the algorithm, the algorithm
chooses the median of that set as the pivot. Then which of the following statements is TRUE?

a. The running time of the algorithm is (n).


b. The running time of the algorithm is (n log n).
c. The running time of the algorithm is (n1.5 ).
d. The running time of the algorithm is (n2 ).
e. None of the above.

tifr2012 algorithms sorting quicksort

1.159 Quicksort: GATE1992_03,iv top gateoverflow.in/581

Assume that the last element of the set is used as partition element in Quicksort. If n distinct elements from the set [1 n]
are to be sorted, give an input for which Quicksort takes maximum time.

gate1992 algorithms sorting quicksort easy

1.160 Radix Sort: GATE2008-IT_43 top gateoverflow.in/3353

If we use Radix Sort to sort n integers in the range (nk/2 , nk ], for some k > 0 which is independent of n, the time taken
would be?

A) (n)
B) (kn)
C) (n log n)
D) (n2 )

gate2008-it algorithms sorting radix-sort normal

1.161 Recurrence: TIFR2015-B-1 top gateoverflow.in/29657

Consider the following recurrence relation:

T (n) = {
2T (n) + log n if n 2
1 if n = 1
Which of the following statements is TRUE?

a. T (n) is O(log n).


b. T (n) is O(log n. log log n) but not O(log n).
3/2
c. T (n) is O(log n) but not O(log n. log log n).
d. T (n) is O(log2 n) but not O(log3/2 n).
e. T (n) is O(log2 n. log log n) but not O(log2 n).

tifr2015 algorithms recurrence time-complexity

1.162 Recurrence: GATE2004_84 top gateoverflow.in/1078

The recurrence equation

T (1) = 1

T (n) = 2T (n 1) + n, n 2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 59 of 852

evaluates to

(a) 2n+1 n 2 (b) 2n n (c) 2n+1 2n 2 (d) 2n + n


gate2004 algorithms recurrence normal

1.163 Recurrence: GATE2004-IT_57 top gateoverflow.in/3700

Consider a list of recursive algorithms and a list of recurrence relations as shown below. Each recurrence relation
corresponds to exactly one algorithm and is used to derive the time complexity of the algorithm.

Recursive Algorithm Recurrence Relation


P. Binary search I. T(n) = T(n-k) + T(k) + cn
Q. Merge sort II. T(n) = 2T(n-1) + 1
R. Quick sort III. T(n) = 2T(n/2) + cn
S. Tower of Hanoi IV. T(n) = T(n/2) + 1

Which of the following is the correct match between the algorithms and their recurrence relations?

A) P-II, Q-III, R-IV, S-I


B) P-IV, Q-III, R-I, S-II
C) P-III, Q-II, R-IV, S-I
D) P-IV, Q-II, R-I, S-III

gate2004-it algorithms recurrence normal

1.164 Recurrence: GATE1996_2.12 top gateoverflow.in/2741

The recurrence relation

T (1) = 2
T (n) = 3T ( n4 ) + n
has the solution T (n) equal to

A. O(n)

B. O(log n)

C. O (n 4 )
3

D. None of the above

gate1996 algorithms recurrence normal

1.165 Recurrence: GATE2005-IT_51 top gateoverflow.in/3812

Let T (n) be a function defined by the recurrence

T (n) = 2T (n/2) + n for n 2 and


T (1) = 1
Which of the following statements is TRUE?

A) T (n) = (log n)
T (n) = ( )

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 60 of 852

B) T (n) = (n)
C) T (n) = (n)
D) T (n) = (n log n)

gate2005-it algorithms recurrence easy

1.166 Recurrence: GATE2002_2.11 top gateoverflow.in/841

The running time of the following algorithm

Procedure A(n)

If n<=2 return (1) else return (A(n));

is best described by

A. O(n)
B. O( log n)
C. O(log log n)
D. O(1)

gate2002 algorithms recurrence normal

1.167 Recurrence: GATE2004_83 top gateoverflow.in/1077

The time complexity of the following C function is (assume n > 0)

int recursive (int n) {


if(n == 1)
return (1);
else
return (recursive (n-1) + recursive (n-1));
}

(a) O(n) (b) O(n log n) (c) O(n2 ) (d) O(2n )

gate2004 algorithms recurrence time-complexity normal

1.168 Recurrence: GATE1993_15 top gateoverflow.in/2312

Consider the recursive algorithm given below:

procedure bubblesort (n);


var i,j: index; temp : item;
begin
for i:=1 to n-1 do
if A[i] > A[i+1] then
begin
temp := A[i];
A[i] := A[i+1];
A[i+1] := temp;
end;
bubblesort (n-1)
end

Let an be the number of times the ifthen statement gets executed when the algorithm is run with value n. Set up the
recurrence relation by defining an in terms of an1 . Solve for an .

gate1993 algorithms recurrence normal

1.169 Recurrence: TIFR2014-B-11 top gateoverflow.in/27308

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 61 of 852

Consider the following recurrence relation:

T ( nk ) + T ( 3n )+n if n 2
T (n) = { 4
1 if n = 1
Which of the following statements is FALSE?

a. T (n) is O(n3/2 ) when k = 3.


b. T (n) is O(n log n) when k = 3.
c. T (n) is O(n log n) when k = 4.
d. T (n) is O(n log n) when k = 5.
e. T (n) is O(n) when k = 5.

tifr2014 algorithms recurrence

1.170 Recurrence: GATE2009_35 top gateoverflow.in/1321

The running time of an algorithm is represented by the following recurrence relation:

n3
T (n) = {
n
T ( n3 ) + cn otherwise

Which one of the following represents the time complexity of the algorithm?

A. (n)

B. (n log n)

C. (n2 )

D. (n2 log n)

gate2009 algorithms recurrence time-complexity normal

1.171 Recurrence: GATE1994_1.7 top gateoverflow.in/2444

The recurrence relation that arises in relation with the complexity of binary search is:

A. T (n) = T ( n2 ) + k, k is a constant
B. T (n) = 2T ( n2 ) + k, k is a constant

C. T (n) = T ( n2 ) + log n
D. T (n) = T ( n2 ) + n

gate1994 algorithms recurrence easy

1.172 Recurrence: GATE2003_35 top gateoverflow.in/925

Consider the following recurrence relation

T (1) = 1

T (n + 1) = T (n) + n + 1 for all n 1

2
T( )

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 62 of 852

The value of T (m2 ) for m 1 is


m
A.
6
(21m 39) + 4
B.
m
6
(4m2 3m + 5)
C. m
2
(3m2.5 11m + 20) 5
5
D. m
6
(5m3 34m2 + 137m 104) + 6

gate2003 algorithms time-complexity recurrence

1.173 Recurrence: GATE2008-IT_44 top gateoverflow.in/3354

When n = 2 2k for some k 0, the recurrence relation

T(n) = (2) T(n/2) + n, T(1) = 1

evaluates to :

A) (n) (log n + 1)
B) (n) log n
C) (n) log (n)
D) n log n

gate2008-it algorithms recurrence normal

1.174 Recurrence: GATE1997_4.6 top gateoverflow.in/2247

Let T (n) be the function defined by T (1) = 1, T (n) = 2T ( n2 ) + n for n 2.

Which of the following statements is true?

A. T (n) = On
B. T (n) = O(n)
C. T (n) = O(log n)
D. None of the above

gate1997 algorithms recurrence normal

1.175 Recurrence: GATE1997_15 top gateoverflow.in/2275

Consider the following function.

Function F(n, m:integer):integer;


begin
If (n<=0 or (m<=0) then F:=1
else
F:F(n-1, m) + F(n, m-1);
end;

n1 n1
Use the recurrence relation ( )=( )+( ) to answer the following questions. Assume that n, m are
n
k k k1
positive integers. Write only the answers without any explanation.

a. What is the value of F (n, 2)?

b. What is the value of F (n, m)?

c. How many recursive calls are made to the function F , including the original call, when evaluating F (n, m).

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 63 of 852

gate1997 algorithms recurrence normal

1.176 Recurrence: GATE1992-07b top gateoverflow.in/43600

Consider the function F(n) for which the pseudocode is given below :

Function F(n)
begin
F1 1
if(n=1) then F 3
else
For i = 1 to n do
begin
C 0
For j = 1 to n 1 do
begin C C + 1 end
F1 = F1 * C
end
F = F1
end

[n is a positive integer greater than zero]

Solve the recurrence relation for a closed form solution of F(n).

gate1992 algorithms recurrence descriptive

1.177 Recurrence: GATE1992-07a top gateoverflow.in/586

Consider the function F(n) for which the pseudocode is given below :

Function F(n)
begin
F1 1
if(n=1) then F 3
else
For i = 1 to n do
begin
C 0
For j = 1 to n 1 do
begin C C + 1 end
F1 = F1 * C
end
F = F1
end

[n is a positive integer greater than zero]

(a) Derive a recurrence relation for F(n)

gate1992 algorithms recurrence descriptive

1.178 Recurrence: GATE2015-3_39 top gateoverflow.in/8498

Consider the following recursive C function.

void get(int n)
{
if (n<1) return;
get (n-1);
get (n-3);
printf("%d", n);
}

If get(6) function is being called in main() then how many times will the get() function be invoked before returning to the
main()?

A. 15
B. 25
C. 35
D. 45

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 64 of 852

gate2015-3 algorithms recurrence normal

1.179 Recurrence: GATE2002_1.3 top gateoverflow.in/807

The solution to the recurrence equation T (2k ) = 3T (2k1 ) + 1, T (1) = 1 is


A. 2k
(3k+1 1)
B. 2
log2 k
C. 3
D. 2log3 k

gate2002 algorithms recurrence normal

1.180 Recurrence: GATE2006_51 top gateoverflow.in/1829

Consider the following recurrence:

T (n) = 2T (n) + 1, T (1) = 1

Which one of the following is true?

(A) T (n) = (log log n)

(B) T (n) = (log n)

(C) T (n) = (n)

(D) T (n) = (n)


gate2006 algorithms recurrence normal

1.181 Recurrence: GATE2008-79 top gateoverflow.in/43485

Let xn denote the number of binary strings of length n that contain no consecutive 0s.

The value of x5 is

A. 5
B. 7
C. 8
D. 16

gate2008 algorithms recurrence normal

1.182 Recurrence: GATE2015-1_49 top gateoverflow.in/8355

Let a n represent the number of bit strings of length n containing two consecutive 1s. What is the recurrence relation for an ?
A. an2 + an1 + 2n2
B. an2 + 2an1 + 2n2
C. 2an2 + an1 + 2n2
D. 2an2 + 2an1 + 2n2

gate2015-1 algorithms recurrence normal

1.183 Recurrence: GATE2014-2_13 top gateoverflow.in/1968

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 65 of 852

Which one of the following correctly determines the solution of the recurrence relation with T (1) = 1?
n
T (n) = 2T ( ) + log n
2
(A) (n)

(B) (n log n)

(C) ( n2 )

(D) (log n)

gate2014-2 algorithms recurrence normal

1.184 Recurrence: GATE2008-78 top gateoverflow.in/497

Let xn denote the number of binary strings of length n that contain no consecutive 0s.

Which of the following recurrences does xn satisfy?

A. xn = 2xn1
B. xn = xn/2 + 1
C. xn = xn/2 + n
D. xn = xn1 + xn2

gate2008 algorithms recurrence normal

1.185 Recurrence: GATE 2016-2-39 top gateoverflow.in/39581

The given diagram shows the flowchart for a recursive function A(n). Assume that all statements, except for the recursive
calls, have O(1) time complexity. If the worst case time complexity of this function is O(n ), then the least possible value
(accurate up to two decimal positions) of is ________.

Flow chart for Recursive Function A(n).

gate2016-2 algorithms time-complexity recurrence normal numerical-answers

1.186 Recursion: GATE1991_01,x top gateoverflow.in/507

Consider the following recursive definition of fib :

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 66 of 852

fib(n) := if n = 0 then 1
else if n = 1 then 1
else fib(n-1) + fib(n-2)

The number of times fib is called (including the first call) for evaluation of fib(7) is___________.

gate1991 algorithms recursion recurrence normal

1.187 Recursion: GATE2002_11 top gateoverflow.in/864

The following recursive function in C is a solution to the Towers of Hanoi problem.

void move(int n, char A, char B, char C) {


if (......................) {
move (.............................);
printf("Move disk %d from pole %c to pole %c\n", n, A,C);
move (.....................);
}
}

Fill in the dotted parts of the solution.

gate2002 algorithms recursion normal

1.188 Recursion: GATE2007-IT_27 top gateoverflow.in/3460

The function f is defined as follows:


int f (int n) {
if (n <= 1) return 1;
else if (n % 2 == 0) return f(n/2);
else return f(3n - 1);
}

Assuming that arbitrarily large integers can be passed as a parameter to the function, consider the following statements.

i. The function f terminates for finitely many different values of n 1.


ii. The function f terminates for infinitely many different values of n 1.
iii. The function f does not terminate for finitely many different values of n 1.
iv. The function f does not terminate for infinitely many different values of n 1.

Which one of the following options is true of the above?

A) (i) and (iii)


B) (i) and (iv)
C) (ii) and (iii)
D) (ii) and (iv)

gate2007-it algorithms recursion normal

1.189 Recursion: GATE2007_44 top gateoverflow.in/1242

In the following C function, let n m.


int gcd(n,m) {
if (n%m == 0) return m;
n = n%m;
return gcd(m,n);
}

How many recursive calls are made by this function?

A. (log2 n)
B. (n)

(log2 log2 n)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 67 of 852

C. (log2 log2 n)
D. (n)

gate2007 algorithms recursion time-complexity normal

1.190 Recursion: GATE2007_42 top gateoverflow.in/1240

Consider the following C function:


int f(int n)
{
static int r = 0;
if (n <= 0) return1;
if (n > 3)
{ r = n;
return f(n-2) + 2;
}
return f(n-1) + r;
}

What is the value of f(5)?

A. 5
B. 7
C. 9
D. 18

gate2007 algorithms recursion normal

1.191 Recursion: GATE2007_45 top gateoverflow.in/1243

What is the time complexity of the following recursive function?


int DoSomething (int n) {
if (n <= 2)
return 1;
else
return (DoSomething (floor(sqrt(n))) + n);
}

A. (n2 )

B. (n log2 n)
C. (log2 n)
D. (log2 log2 n)

gate2007 algorithms recursion time-complexity normal

1.192 Recursion: GATE2014-2_40 top gateoverflow.in/2000

Consider the following function

double f(double x){


if( abs(x*x - 3) < 0.01)
return x;
else
return f(x/2 + 1.5/x);
}

Give a value q (to 2 decimals) such that f(q) will return q:_____.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 68 of 852

gate2014-2 algorithms recursion numerical-answers normal

1.193 Reduction: GATE2015-3_53 top gateoverflow.in/8562

Language L1 is polynomial time reducible to language L2 . Language L3 is polynomial time reducible to language L2 , which
in turn polynomial time reducible to language L4 . Which of the following is/are true?

I. if L4 P , then L2 P
II. if L1 P or L3 P , then L2 P
III. L1 P , if and only if L3 P
IV. if L4 P , then L3 P

A. II only
B. III only
C. I and IV only
D. I only

gate2015-3 algorithms reduction normal

1.194 Runtime Environments: GATE1994_21 top gateoverflow.in/2517

Consider the following recursive function:

function fib (n:integer);integer;


begin
if (n=0) or (n=1) then fib := 1
else fib := fib(n-1) + fib(n-2)
end;

The above function is run on a computer with a stack of 64 bytes. Assuming that only return address and parameter are
passed on the stack, and that an integer value and an address takes 2 bytes each, estimate the maximum value of n for
which the stack will not overflow. Give reasons for your answer.

gate1994 algorithms runtime-environments recursion normal

1.195 Shortest Path: GATE 2016-1-38 top gateoverflow.in/39731

Consider the weighted undirected graph with 4 vertices, where the weight of edge {i, j} is given by the entry Wij in the
matrix W .

0 2 8 5
2
W=
8

0 5
8 5 0 x
5 8 x 0
The largest possible integer value of x, for which at least one shortest path between some pair of vertices will contain the
edge with weight x is ___________

gate2016-1 algorithms graph-algorithms shortest-path normal numerical-answers

1.196 Shortest Path: GATE2008_45 top gateoverflow.in/457

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 69 of 852

Dijkstra's single source shortest path algorithm when run from vertex a in the above graph, computes the correct shortest
path distance to

A. only vertex a

B. only vertices a, e, f, g, h

C. only vertices a, b, c, d

D. all the vertices

gate2008 algorithms graph-algorithms shortest-path normal

1.197 Shortest Path: GATE1996_17 top gateoverflow.in/2769

Let G be the directed, weighted graph shown in below figure

We are interested in the shortest paths from A.

a. Output the sequence of vertices identified by the Dijkstras algorithm for single source shortest path when the algorithm
is started at node A

b. Write down sequence of vertices in the shortest path from A to E

c. What is the cost of the shortest path from A to E?

gate1996 algorithms graph-algorithms shortest-path normal

1.198 Shortest Path: GATE2012_40 top gateoverflow.in/1765

Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T . Which
one will be reported by Dijkstras shortest path algorithm? Assume that, in any iteration, the shortest path to a vertex v is
updated only when a strictly shorter path to v is discovered.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 70 of 852

A. SDT
B. SBDT
C. SACDT
D. SACET

gate2012 algorithms graph-algorithms shortest-path normal

1.199 Sorting: GATE1991_01,vii top gateoverflow.in/505

The minimum number of comparisons required to sort 5 elements is ____

gate1991 normal algorithms sorting

1.200 Sorting: GATE 2016-1-13 top gateoverflow.in/39660

The worst case running times of Insertion sort , Merge sort and Quick sort, respectively are:

A. (n log n), (n log n) and (n2 )


B. (n2 ), (n2 ) and (n log n)
C. (n2 ), (n log n) and (n log n)
D. (n2 ), (n log n) and (n2 )

gate2016-1 algorithms sorting easy

1.201 Sorting: GATE1991_13 top gateoverflow.in/540

Give an optimal algorithm in pseudo-code for sorting a sequence of n numbers which has only k distinct numbers (k is not
known a Priori). Give a brief analysis for the time-complexity of your algorithm.

gate1991 sorting time-complexity algorithms difficult

1.202 Sorting: GATE2000_17 top gateoverflow.in/688

An array contains four occurrences of 0, five occurrences of 1, and three occurrences of 2 in any order. The array is to be sorted using swap
operations (elements that are swapped need to be adjacent).

a. What is the minimum number of swaps needed to sort such an array in the worst case?
b. Give an ordering of elements in the above array so that the minimum number of swaps needed to sort the array is maximum.

gate2000 algorithms sorting normal

1.203 Sorting: GATE2001_1.14 top gateoverflow.in/707

Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of
sorting n numbers using Randomized quicksort?

(A) O(n)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 71 of 852

(B) O(n log n)

(C) O(n2 )

(D) O(n!)

gate2001 algorithms sorting time-complexity easy

1.204 Sorting: GATE1996_2.15 top gateoverflow.in/2744

Quick-sort is run on two inputs shown below to sort in ascending order

i. 1, 2, 3, n
ii. n, n 1, n 2, , 2, 1

Let C1 and C2 be the number of comparisons made for the inputs (i) and (ii) respectively. Then,

A. C1 < C2
B. C1 > C2
C. C1 = C2
D. we cannot say anything for arbitrary n

gate1996 algorithms sorting normal

1.205 Sorting: GATE2015-1_2 top gateoverflow.in/8017

Which one of the following is the recurrence equation for the worst case time complexity of the quick sort algorithm for
sorting n ( 2) numbers? In the recurrence equations given in the options below, c is a constant.

A. T(n) = 2 T (n/2) + cn
B. T(n) = T ( n - 1) + T(1) + cn
C. T(n) = 2T ( n - 1) + cn
D. T(n) = T (n/2) + cn

gate2015-1 algorithms recurrence sorting easy

1.206 Sorting: GATE2003_22 top gateoverflow.in/912

The unusual (n2 ) implementation of Insertion Sort to sort an array uses linear search to identify the position where and
element is to be inserted into the already sorted part of the array. If, instead, we use binary search to identify the position,
the worst case running time will

A. remain (n2 )
B. become (n(log n)2 )
C. become (n log n)
D. become (n)

gate2003 algorithms sorting time-complexity normal

1.207 Sorting: TIFR2010-B-23 top gateoverflow.in/18623

Suppose you are given n numbers and you sort them in descending order as follows:

First find the maximum. Remove this element from the list and find the maximum of the remaining elements, remove this
element, and so on, until all elements are exhausted. How many comparisons does this method require in the worst case?

A. Linear in n.

O ( 2)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 72 of 852

B. O (n2 ) but not better.


C. O (n log n)
D. Same as heap sort.
E. O (n1.5 ) but not better.

tifr2010 algorithms time-complexity sorting

1.208 Sorting: GATE2006_14 top gateoverflow.in/975

Which one of the following in place sorting algorithms needs the minimum number of swaps?

(A) Quick sort


(B) Insertion sort
(C) Selection sort
(D) Heap sort

gate2006 algorithms sorting easy

1.209 Sorting: GATE1992_02,ix top gateoverflow.in/559

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Following algorithm(s) can be used to sort n in the range [1.....n3 ] in O(n) time

(a). Heap sort

(b). Quick sort

(c). Merge sort

(d). Radix sort

gate1992 easy algorithms sorting

1.210 Sorting: TIFR2011-B-31 top gateoverflow.in/20617

Given a set of n = 2k distinct numbers, we would like to determine the smallest and the second smallest using comparisons.
Which of the following statements is TRUE?

a. Both these elements can be determined using 2k comparisons.


b. Both these elements can be determined using n 2 comparisons.
c. Both these elements can be determined using n + k 2 comparisons.
d. 2n 3 comparisons are necessary to determine these two elements.
e. nk comparisons are necessary to determine these two elements.

tifr2011 algorithms sorting

1.211 Sorting: GATE1996_14 top gateoverflow.in/2766

A two dimensional array A[1..n][1..n] of integers is partially sorted if


i, j [1..n 1], A[i][j] < A[i][j + 1] and A[i][j] < A[i + 1][j]
Fill in the blanks:

a. The smallest item in the array is at A[i][j] where i=__ and j=__.

b. The smallest item is deleted. Complete the following O(n) procedure to insert item x (which is guaranteed to be smaller
than any item in the last row or column) still keeping A partially sorted.

procedure insert (x: integer);


var i,j: integer;
begin
i:=1; j:=1, A[i][j]:=x;
while (x > __ or x > __) do
if A[i+1][j] < A[i][j] then begin
A[i][j]:=A[i+1][j]; i:=i+1;
end

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 73 of 852

else begin
_____
end
A[i][j]:= ____
end

gate1996 algorithms sorting normal

1.212 Sorting: GATE1999_1.14 top gateoverflow.in/1467

If one uses straight two-way merge sort algorithm to sort the following elements in ascending order:

20, 47, 15, 8, 9, 4, 40, 30, 12, 17

then the order of these elements after second pass of the algorithm is:

A. 8, 9, 15, 20, 47, 4, 12, 17, 30, 40

B. 8, 15, 20, 47, 4, 9, 30, 40, 12, 17

C. 15, 20, 47, 4, 8, 9, 12, 30, 40, 17

D. 4, 8, 9, 15, 20, 47, 12, 17, 30, 40

gate1999 algorithms sorting normal

1.213 Sorting: GATE1998_1.22 top gateoverflow.in/1659

Give the correct matching for the following pairs:

(A) O(log n) (P) Selection


(B) O(n) (Q) Insertion sort
(C) O(n log n) (R) Binary search
(D) O(n2 ) (S) Merge sort

A. A-R B-P C-Q D-S

B. A-R B-P C-S D-Q

C. A-P B-R C-S D-Q

D. A-P B-S C-R D-Q

gate1998 algorithms sorting easy

1.214 Sorting: GATE2013_6 top gateoverflow.in/1415

Which one of the following is the tightest upper bound that represents the number of swaps required to sort n numbers
using selection sort?

(A) O(log n)
(B) O(n)
(C) O(n log n)
(D) O(n2 )

gate2013 algorithms sorting easy

1.215 Sorting: GATE2009_39 top gateoverflow.in/1325

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 74 of 852

th
In quick-sort, for sorting n elements, the (n/4) smallest element is selected as pivot using an O(n) time algorithm. What is
the worst case time complexity of the quick sort?

A. (n)

B. (n log n)

C. (n2 )

D. (n2 log n)

gate2009 algorithms sorting normal

1.216 Sorting: GATE2009_11 top gateoverflow.in/1303

What is the number of swaps required to sort n elements using selection sort, in the worst case?

A. (n)

B. (n log n)

C. (n2 )

D. (n2 log n)

gate2009 algorithms sorting easy

1.217 Sorting: GATE1994_1.19 top gateoverflow.in/2462

Which of the following algorithm design techniques is used in the quicksort algorithm?

A. Dynamic programming

B. Backtracking

C. Divide and conquer

D. Greedy method

gate1994 algorithms sorting easy

1.218 Sorting: GATE2012_39 top gateoverflow.in/1762

A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case
running time of this computation is

(A) O(n log n)


(B) O(n2 log n)
(C) O(n2 + log n)
(D) O(n2 )

gate2012 algorithms sorting normal

1.219 Sorting: GATE2014-1_14 top gateoverflow.in/1780

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 75 of 852

Let P be quicksort program to sort numbers in ascending order using the rst element as the pivot. Let t1 and t2 be the number of comparisons made by P for
the inputs [1 2 3 4 5] and [4 1 5 3 2] respectively. Which one of the following holds?

(A) t1 =5

(B) t1 < t2

(C) t1 > t2

(D) t1 = t2

gate2014-1 algorithms sorting easy

1.220 Sorting: GATE2014-2_38 top gateoverflow.in/1997

Suppose P, Q, R, S, T are sorted sequences having lengths 20, 24, 30, 35, 50 respectively. They are to be merged into a
single sequence by merging together two sequences at a time. The number of comparisons that will be needed in the worst
case by the optimal algorithm for doing this is ____.

gate2014-2 algorithms sorting normal

1.221 Sorting: Gate 1991 Quicksort top gateoverflow.in/1890

Let P be a Quicksort program to sort numbers in ascending order. Let t1 and t2 be the time taken by the program for the
inputs [1,2,3,4] and [5,4,3,2,1] respectively. Which of the following holds?
a)t1=t2
b)t1>t2
c)t1<t2
d)t1=t2+5log5

My approach:-
1) if 1st element is chosen as pivot
i)1,2,3,4:- n(n-1)/2 comparisons + nswaps==>6 comp+4swaps = 10units
ii)5,4,3,2,1:- n(n-1)/2comparisons+n(n-1)/2 swaps==>10+10=20 units

2)if last element is chosen as pivot


i)1,2,3,4:- n(n-1)/2 comp+n(n+1)/2 swaps==>6comp+10swaps = 16 units
ii)5,4,3,2,1:- n(n-1)/2comp+nswaps ==>10+5 = 15 units

so t1<=t2...more safely can't we say t1<t2?

sorting

1.222 Sorting: GATE2006_52 top gateoverflow.in/1830

The median of n elements can be found in O(n) time. Which one of the following is correct about the complexity of quick
sort, in which median is selected as pivot?

(A) (n)

(B) (n log n)

(C) (n2 )

(D) (n3 )

gate2006 algorithms sorting easy

1.223 Sorting: GATE2014-3_14 top gateoverflow.in/2048

You have an array of n elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper
bound for the worst case performance is

O( 2)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 76 of 852

(A) O( n2 )

(B) O(n log n)

(C) (n log n)

(D) O( n3 )

gate2014-3 algorithms sorting easy

1.224 Sorting: TIFR2012-B-13 top gateoverflow.in/25207

An array A contains n integers. We wish to sort A in ascending order. We are told that initially no element of A is more
than a distance k away from its final position in the sorted list. Assume that n and k are large and k is much smaller than n.
Which of the following is true for the worst case complexity of sorting A?

a. A can be sorted with constant . kn comparison but not with fewer comparisons.
b. A cannot be sorted with less than constant . n log n comparisons.
c. A can be sorted with constant . n comparisons.
d. A can be sorted with constant . n log k comparisons but not with fewer comparisons.
e. A can be sorted with constant . k2 n comparisons but not fewer.

tifr2012 algorithms sorting

1.225 Sorting: TIFR2011-B-39 top gateoverflow.in/20935

The first n cells of an array L contain positive integers sorted in decreasing order, and the remaining m n cells all contain
0. Then, given an integer x, in how many comparisons can one find the position of x in L ?

a. At least n comparisons are necessary in the worst case.


b. At least log m comparisons are necessary in the worst case.
c. O(log(m n)) comparisons suffice.
d. O(log n) comparisons suffice.
e. O(log(m/n)) comparisons suffice.

tifr2011 algorithms sorting

1.226 Sorting: GATE1999_1.12 top gateoverflow.in/1465

A sorting technique is called stable if

A. it takes O(n log n) time

B. it maintains the relative order of occurrence of non-distinct elements

C. it uses divide and conquer paradigm

D. it takes O(n) space

gate1999 algorithms sorting easy

1.227 Sorting: GATE2007_14 top gateoverflow.in/1212

Which of the following sorting algorithms has the lowest worse-case complexity?

A. Merge sort

B. Bubble sort

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 77 of 852

C. Quick sort

D. Selection sort

gate2007 algorithms sorting time-complexity easy

1.228 Sorting: GATE1995_1.5 top gateoverflow.in/2592

Merge sort uses

A. Divide and conquer strategy

B. Backtracking approach

C. Heuristic search

D. Greedy approach

gate1995 algorithms sorting easy

1.229 Sorting: GATE1995_12 top gateoverflow.in/2648

Consider the following sequence of numbers

92, 37, 52, 12, 11, 25

Use bubblesort to arrange the sequence in ascending order. Give the sequence at the end of each of the first five passes.

gate1995 algorithms sorting easy

1.230 Space Complexity: GATE2005_81 top gateoverflow.in/1403

double foo(int n)
{
int i;
double sum;
if(n == 0)
{
return 1.0;
}
else
{
sum = 0.0;
for(i = 0; i < n; i++)
{
sum += foo(i);
}
return sum;
}
}

(A) The space complexity of the above code is?

(a) O(1) (b) O(n) (c) O(n!) (d) nn

(b) Suppose we modify the above function foo() and stores the value of foo(i) 0 <= i < n, as and when they are computed.
With this modification the time complexity for function foo() is significantly reduced. The space complexity of the modified
function would be:

(a) O(1) (b) O(n) (c) O(n2 ) (d) n!

gate2005 algorithms space-complexity normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 78 of 852

1.231 Spanning Tree: GATE1992_01,ix top gateoverflow.in/549

Complexity of Kruskals algorithm for finding the minimum spanning tree of an undirected graph containing n vertices and m
edges if the edges are sorted is _______

gate1992 spanning-tree algorithms time-complexity easy

1.232 Spanning Tree: TIFR2014-B-4 top gateoverflow.in/27174

Consider the following undirected graph with some edge costs missing.

Suppose the wavy edges form a Minimum Cost Spanning Tree for G. Then, which of the following inequalities NEED NOT
hold?

a. cost(a, b) 6.
b. cost(b, e) 5.
c. cost(e, f) 5.
d. cost(a, d) 4.
e. cost(b, c) 4.

tifr2014 algorithms graph-algorithms spanning-tree

1.233 Spanning Tree: GATE2005-IT_52 top gateoverflow.in/3813

Let G be a weighted undirected graph and e be an edge with maximum weight in G. Suppose there is a minimum weight
spanning tree in G containing the edge e. Which of the following statements is always TRUE?

A) There exists a cutset in G having all edges of maximum weight.


B) There exists a cycle in G having all edges of maximum weight.
C) Edge e cannot be contained in a cycle.
D) All edges in G have the same weight.

gate2005-it algorithms spanning-tree normal

1.234 Spanning Tree: TIFR2011-B-35 top gateoverflow.in/20842

Let G be a connected simple graph (no self-loops or parallel edges) on n 3 vertices, with distinct edge weights. Let
e1 , e2 , . . . , em be an ordering of the edges in decreasing order of weight. Which of the following statements is FALSE?
a. The edge e1 has to be present in every maximum weight spanning tree.
b. Both e1 and e2 have to be present in every maximum weight spanning tree.
c. The edge em has to be present in every minimum weight spanning tree.
d. The edge em is never present in any maximum weight spanning tree.
e. G has a unique maximum weight spanning tree.

tifr2011 algorithms graph-algorithms spanning-tree

1.235 Spanning Tree: GATE2012_29 top gateoverflow.in/786

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 79 of 852

Let G be a weighted graph with edge weights greater than one and G be the graph constructed by squaring the weights of
edges in G. Let T and T be the minimum spanning trees of G and G , respectively, with total weights t and t . Which of
the following statements is TRUE?

(A) T = T with total weight t = t2

(B) T = T with total weight t < t2

(C) T T but total weight t = t2

(D) None of the above

gate2012 algorithms spanning-tree normal marks-to-all

1.236 Spanning Tree: GATE2001_15 top gateoverflow.in/756

Consider a weighted undirected graph with vertex set V = {n1, n2, n3, n4, n5, n6} and edge set E = {(n1,n2,2), (n1,n3,8),
(n1,n6,3), (n2,n4,4), (n2,n5,12), (n3,n4,7), (n4,n5,9), (n4,n6,4)}. The third value in each tuple represents the weight of
the edge specified in the tuple.

a. List the edges of a minimum spanning tree of the graph.


b. How many distinct minimum spanning trees does this graph have?
c. Is the minimum among the edge weights of a minimum spanning tree unique over all possible minimum spanning trees
of a graph?
d. Is the maximum among the edge weights of a minimum spanning tree unique over all possible minimum spanning tree
of a graph?

gate2001 algorithms spanning-tree normal

1.237 Spanning Tree: GATE2010-51 top gateoverflow.in/43328

Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij in the matrix W below is the weight of the
edge {i, j}

What is the minimum possible weight of a path P from vertex 1 to vertex 2 in this graph such that P contains at most 3 edges?

A. 7
B. 8
C. 9
D. 10

gate2010 normal algorithms spanning-tree

1.238 Spanning Tree: GATE2011-54 top gateoverflow.in/2162

An undirected graph G(V , E) contains n (n > 2) nodes named v1 , v2 , , vn . Two nodes vi , vj are connected if and only if
0 < i j 2. Each edge (vi , vj ) is assigned a weight i + j. A sample graph with n = 4 is shown below.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 80 of 852

What will be the cost of the minimum spanning tree (MST) of such a graph with n nodes?
1
A. 12 (11n2 5n)
2
B. n n + 1
C. 6n 11
D. 2n + 1

gate2011 algorithms graph-algorithms spanning-tree normal

1.239 Spanning Tree: GATE2011-55 top gateoverflow.in/43325

An undirected graph G(V , E) contains n (n > 2) nodes named v1 , v2 , , vn . Two nodes vi , vj are connected if and only if
0 < i j 2 . Each edge (vi , vj ) is assigned a weight i + j. A sample graph with n = 4 is shown below.

The length of the path from v5 to v6 in the MST of previous question withn = 10 is

A. 11
B. 25
C. 31
D. 41

gate2011 algorithms graph-algorithms spanning-tree normal

1.240 Spanning Tree: GATE2000_2.18 top gateoverflow.in/665

Let G be an undirected connected graph with distinct edge weights. Let emax be the edge with maximum weight and emin the edge with
minimum weight. Which of the following statements is false?

a. Every minimum spanning tree of G must contain emin


b. If emax is in a minimum spanning tree, then its removal must disconnect G
c. No minimum spanning tree contains emax
d. G has a unique minimum spanning tree

gate2000 algorithms spanning-tree normal

1.241 Spanning Tree: GATE2015-3_40 top gateoverflow.in/8499

Let G be a connected undirected graph of 100 vertices and 300 edges. The weight of a minimum spanning tree of G is 500.
When the weight of each edge of G is increased by five, the weight of a minimum spanning tree becomes ______.

gate2015-3 algorithms spanning-tree easy numerical-answers

1.242 Spanning Tree: GATE1995_22 top gateoverflow.in/2660

How many minimum spanning trees does the following graph have? Draw them. (Weights are assigned to edges).

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 81 of 852

gate1995 algorithms graph-algorithms spanning-tree easy

1.243 Spanning Tree: GATE2015-1_43 top gateoverflow.in/8313

The graph shown below has 8 edges with distinct integer edge weights. The minimum spanning tree (MST) is of weight 36
and contains the edges: {(A, C), (B, C), (B, E), (E, F), (D, F)}. The edge weights of only those edges which are in the MST
are given in the figure shown below. The minimum possible sum of weights of all 8 edges of this graph is_______________.

gate2015-1 algorithms spanning-tree normal

1.244 Spanning Tree: TIFR2014-B-5 top gateoverflow.in/27180

Let G= (V , E) be an undirected connected simple (i.e., no parallel edges or self-loops) graph with the weight function
w : E R on its edge set. Let w(e1 ) < w(e2 ) < < w(em ), where E = {e1 , e2 , . . . , em }. Suppose T is a minimum
spanning tree of G. Which of the following statements is FALSE?

a. The tree T has to contain the edge e1 .


b. The tree T has to contain the edge e2 .
c. The minimum weight edge incident on each vertex has to be present in T .
d. T is the unique minimum spanning tree in G.
e. If we replace each edge weight wi = w(ei ) by its square w2i , then T must still be a minimum spanning tree of this new
instance.

tifr2014 algorithms spanning-tree

1.245 Spanning Tree: GATE2007_49 top gateoverflow.in/1247

Let w be the minimum weight among all edge weights in an undirected connected graph. Let e be a specific edge of weight
w. Which of the following is FALSE?

A. There is a minimum spanning tree containing e

B. If e is not in a minimum spanning tree T , then in the cycle formed by adding e to T , all edges have the same weight.

C. Every minimum spanning tree has an edge of weight w

D. e is present in every minimum spanning tree

gate2007 algorithms spanning-tree normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 82 of 852

1.246 Spanning Tree: GATE2010-50 top gateoverflow.in/2355

Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4} . Entry Wij in the matrix W below is the weight of the edge {i, j}

What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the treeT ?

A. 7
B. 8
C. 9
D. 10

gate2010 algorithms spanning-tree normal

1.247 Spanning Tree: GATE1997_9 top gateoverflow.in/2269

Consider a graph whose vertices are points in the plane with integer co-ordinates (x, y) such that 1 x n and 1 y n,
where n 2 is an integer. Two vertices (x1 , y1 ) and (x2 , y2 ) are adjacent iff x1 x2 1 and y1 y2 1. The weight of

an edge {(x1 , y1 ), (x2 , y2 )} is (x1 x2 )2 + (y1 y2 )2
a. What is the weight of a minimum weight-spanning tree in this graph? Write only the answer without any explanations.

b. What is the weight of a maximum weight-spanning tree in this graph? Write only the answer without any explanations.

gate1997 algorithms spanning-tree normal

1.248 Spanning Tree: GATE1991_03,vi top gateoverflow.in/521

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Kruskals algorithm for finding a minimum spanning tree of a weighted graph G with n vertices and m edges has the time
complexity of:

(a). O(n2 )

(b). O(mn)

(c). O(m + n)

(d). O(m log n)

(e). O(m2 )

gate1991 algorithms spanning-tree easy

1.249 Spanning Tree: GATE1996_16 top gateoverflow.in/2768

A complete, undirected, weighted graph G is given on the vertex {0, 1, , n 1} for any fixed n. Draw the minimum
spanning tree of G if

a. the weight of the edge (u, v) is u v


(u, v)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 83 of 852

b. the weight of the edge (u, v) is u + v

gate1996 algorithms graph-algorithms spanning-tree normal

1.250 Spanning Tree: GATE2003_68 top gateoverflow.in/955

What is the weight of a minimum spanning tree of the following graph?

A. 29
B. 31
C. 38
D. 41

gate2003 algorithms spanning-tree normal

1.251 Spanning Tree: GATE2014-2_52 top gateoverflow.in/2019

The number of distinct minimum spanning trees for the weighted graph below is _____

gate2014-2 algorithms spanning-tree numerical-answers normal

1.252 Spanning Tree: GATE2006_11 top gateoverflow.in/890

Consider a weighted complete graph G on the vertex set {v 1,v2,.....vn} such that the weight of the edge (v i, vj) is
. The weight of a minimum spanning tree of G is:

(A)

(B)

(C)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 84 of 852

(D)

gate2006 algorithms spanning-tree normal

1.253 Spanning Tree: GATE2006_47 top gateoverflow.in/1823

Consider the following graph:

Which one of the following cannot be the sequence of edges added, in that order, to a minimum spanning tree using
Kruskals algorithm?

(A) (a b), (d f), (b f), (d c), (d e)


(B) (a b), (d f), (d c), (b f), (d e)
(C) (d f), (a b), (d c), (b f), (d e)
(D) (d f), (a b), (b f), (d e), (d c)

gate2006 algorithms graph-algorithms spanning-tree normal

1.254 Spanning Tree: GATE2005_6 top gateoverflow.in/1348

An undirected graph G has n nodes. its adjacency matrix is given by an n n square matrix whose (i) diagonal elements
are 0s and (ii) non-diagonal elements are 1s. Which one of the following is TRUE?

A. Graph G has no minimum spanning tree (MST)

B. Graph G has unique MST of cost n 1

C. Graph G has multiple distinct MSTs, each of cost n 1

D. Graph G has multiple spanning trees of different costs

gate2005 algorithms spanning-tree normal

1.255 Spanning Tree: GATE2008-IT_45 top gateoverflow.in/3355

For the undirected, weighted graph given below, which of the following sequences of edges represents a correct execution of
Prim's algorithm to construct a Minimum Spanning Tree?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 85 of 852

A) (a, b), (d, f), (f, c), (g, i), (d, a), (g, h), (c, e), (f, h)
B) (c, e), (c, f), (f, d), (d, a), (a, b), (g, h), (h, f), (g, i)
C) (d, f), (f, c), (d, a), (a, b), (c, e), (f, h), (g, h), (g, i)
D) (h, g), (g, i), (h, f), (f, c), (f, d), (d, a), (a, b), (c, e)

gate2008-it algorithms graph-algorithms spanning-tree normal

1.256 Spanning Tree: GATE2009_38 top gateoverflow.in/1324

Consider the following graph:

Which one of the following is NOT the sequence of edges added to the minimum spanning tree using Kruskals algorithm?

A. (b, e) (e, f) (a, c) (b, c) (f, g) (c, d)

B. (b, e) (e, f) (a, c) (f, g) (b, c) (c, d)

C. (b, e) (a, c) (e, f) (b, c) (f, g) (c, d)

D. (b, e) (e, f) (b, c) (a, c) (f, g) (c, d)

gate2009 algorithms spanning-tree normal

1.257 Test Cases: GATE2013-51 top gateoverflow.in/43291

The procedure given below is required to find and replace certain characters inside an input character string supplied in array
A. The characters to be replaced are supplied in array oldc, while their respective replacement characters are supplied in
array newc. Array A has a fixed length of five characters, while arrays oldc and newc contain three characters each.
However, the procedure is flawed.

void find_and_replace (char *A, char *oldc, char *newc) {


for (int i=0; i<5; i++)
for (int j=0; j<3; j++)
if (A[i] == oldc[j])
A[i] = newc[j];
}
The procedure is tested with the following four test cases.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 86 of 852

(1) oldc = abc, newc = dab (2) oldc = cde, newc = bcd
(3) oldc = bca, newc = cda (4) oldc = abc, newc = bac

If array A is made to hold the string abcde, which of the above four test cases will be successful in exposing the flaw in this
procedure?

A. None
B. 2 only
C. 3 and 4 only
D. 4 only

gate2013 algorithms test-cases normal

1.258 Test Cases: GATE2013-50 top gateoverflow.in/1557

The procedure given below is required to find and replace certain characters inside an input character string supplied in array
A. The characters to be replaced are supplied in array oldc, while their respective replacement characters are supplied in
array newc. Array A has a fixed length of five characters, while arrays oldc and newc contain three characters each.
However, the procedure is flawed.

void find_and_replace (char *A, char *oldc, char *newc) {


for (int i=0; i<5; i++)
for (int j=0; j<3; j++)
if (A[i] == oldc[j])
A[i] = newc[j];
}

The procedure is tested with the following four test cases.


(1) oldc = abc, newc = dab (2) oldc = cde, newc = bcd
(3) oldc = bca, newc = cda (4) oldc = abc, newc = bac

The tester now tests the program on all input strings of length five consisting of characters a, b, c, d and e with
duplicates allowed. If the tester carries out this testing with the four test cases given above, how many test cases will be
able to capture the flaw?

A. Only one
B. Only two
C. Only three
D. All four

gate2013 algorithms test-cases normal

1.259 Time Complexity: GATE2007_15 top gateoverflow.in/1213

Consider the following segment of C-code:


int j, n;
j = 1;
while (j <= n)
j = j * 2;

The number of comparisons made in the execution of the loop for any n > 0 is:

A. log2 n + 1
B. n

C. log2 n
D. log2 n + 1

gate2007 algorithms time-complexity normal

1.260 Time Complexity: GATE1990 What is the asymptotic behaviour of T(N)


top gateoverflow.in/31625

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 87 of 852

Express T(N) in terms of Harmonic Number

n 1
Hn = t=1 i n>= 1

Where T(n) satisfy the recurrance equation

n+1
T(n) = * T(n-1) +1 for n>=2
2
T(1) = 1
What is the asymptotic behaviour of T(n) in terms of n ?

Please explain me what is harmonic number

time-complexity algorithms

1.261 Time Complexity: GATE2008-74 top gateoverflow.in/495

Consider the following C functions:

int f1 (int n)
{
if(n == 0 || n == 1)
return n;
else
return (2 * f1(n-1) + 3 * f1(n-2));
}
int f2(int n)
{
int i;
int X[N], Y[N], Z[N];
X[0] = Y[0] = Z[0] = 0;
X[1] = 1; Y[1] = 2; Z[1] = 3;
for(i = 2; i <= n; i++){
X[i] = Y[i-1] + Z[i-2];
Y[i] = 2 * X[i];
Z[i] = 3 * X[i];
}
return X[n];
}

The running time of f1(n) and f2(n) are

A. (n) and (n)


B. (2n) and (n)
C. (n) and (2 n)
D. (2n) and (2n)

gate2008 algorithms time-complexity normal

1.262 Time Complexity: GATE2004_82 top gateoverflow.in/1076

Let A[1, n] be an array storing a bit (1 or 0) at each location, and f(m) is a function whose time complexity is (m).
Consider the following program fragment written in a C like language:
counter = 0;
for (i=1; i<=n; i++)
{ if a[i] == 1) counter++;
else {f (counter); counter = 0;}
}

The complexity of this program fragment is

A. (n2 )

B. (n log n) and O(n2 )

C. (n)

D. o(n)

gate2004 algorithms time-complexity normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 88 of 852

1.263 Time Complexity: GATE2014-1_42 top gateoverflow.in/1920

Consider the following pseudo code. What is the total number of multiplications to be performed?

D = 2
for i = 1 to n do
for j = i to n do
for k = j + 1 to n do
D = D * 3

(A) Half of the product of the 3 consecutive integers.

(B) One-third of the product of the 3 consecutive integers.

(C) One-sixth of the product of the 3 consecutive integers.

(D) None of the above.

gate2014-1 algorithms time-complexity normal

1.264 Time Complexity: GATE1999_11 top gateoverflow.in/1510

a. Consider the following algorithms. Assume, procedure A and procedure B take O(1) and O(1/n) unit of time
respectively. Derive the time complexity of the algorithm in O-notation.

algorithm what (n)


begin
if n = 1 then call A
else
begin
what (n-1);
call B(n)
end
end.

b. Write a constant time algorithm to insert a node with data D just before the node with address p of a singly linked list.

gate1999 algorithms time-complexity normal

1.265 Time Complexity: TIFR2014-B-7 top gateoverflow.in/27189

Which of the following statements is TRUE for all sufficiently large n?


log log n
a. (log n) < 2log n < n1/4

b. 2log n < n1/4 < (log n)log log n

c. n
1/4
< (log n)log log n < 2log n

log log n
d. (log n) < n1/4 < 2log n

e. 2log n < (log n)log log n < n1/4

tifr2014 algorithms time-complexity

1.266 Time Complexity: GATE1993_8.7 top gateoverflow.in/2305

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 89 of 852

O(n), where O(n) stands for order n is:


1kn

a. O(n)
b. O(n2 )
c. O(n3 )
d. O(3n2 )
e. O(1.5 n2 )

gate1993 algorithms time-complexity easy

1.267 Time Complexity: GATE2004_39 top gateoverflow.in/1036

Two matrices M1 and M2 are to be stored in arrays A and B respectively. Each array can be stored either in row-major or
column-major order in contiguous memory locations. The time complexity of an algorithm to compute M1 M2 will be

A. best if A is in row-major, and B is in column-major order

B. best if both are in row-major order

C. best if both are in column-major order

D. independent of the storage scheme

gate2004 algorithms time-complexity easy

1.268 Time Complexity: GATE2007_50 top gateoverflow.in/1248

An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers
needs to be determined. Which of the following is TRUE about the number of comparisons needed?

A. At least 2n c comparisons, for some constant c are needed.

B. At most 1.5n 2 comparisons are needed.

C. At least n log2 n comparisons are needed


D. None of the above

gate2007 algorithms time-complexity easy

1.269 Time Complexity: GATE2007_51 top gateoverflow.in/1249

Consider the following C program segment:


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;
}

Let T (n) denote number of times the for loop is executed by the program on input n. Which of the following is TRUE?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 90 of 852

A. T (n) = O(n) and T (n) = (n)


B. T (n) = O(n) and T (n) = (1)
C. T (n) = O(n) and T (n) = (n)
D. None of the above

gate2007 algorithms time-complexity normal

1.270 Time Complexity: GATE2007-IT_17 top gateoverflow.in/3450

Exponentiation is a heavily used operation in public key cryptography. Which of the following options is the tightest upper
bound on the number of multiplications required to compute bn mod m, 0 b, n m ?

A O(log n)
B O(n)

C O( logn n )

D O(n)

gate2007-it algorithms time-complexity normal

1.271 Time Complexity: GATE2008_47 top gateoverflow.in/459

We have a binary heap on n elements and wish to insert n more elements (not necessarily one after another) into this heap.
The total time required for this is

A. (log n)

B. (n)

C. (n log n)

D. (n2 )

gate2008 algorithms time-complexity normal

1.272 Time Complexity: GATE2003_66 top gateoverflow.in/258

The cube root of a natural number n is dened as the largest natural number m such that (m3 n) . The complexity of computing the cube root of n (n is
represented by binary notation) is

(A) O(n) but not O(n0.5 )


(B) O(n0.5 ) but not O((log n)k ) for any constant k > 0
(C) O((log n)k ) for some constant k > 0 , but not O((log log n)m ) for any constant m > 0
(D) O((log log n)k ) for some constant k > 0.5, but not O((log log n)0.5 )

gate2003 algorithms time-complexity normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 91 of 852

1.273 Time Complexity: TIFR2015-B-3 top gateoverflow.in/29846

Consider the following code fragment in the C programming language when run on a non-negative integer n.

int f (int n)
{
if (n==0 || n==1)
return 1;
else
return f (n - 1) + f(n - 2);
}

Assuming a typical implementation of the language, what is the running time of this algorithm and how does it compare to
the optimal running time for this problem?

a. This algorithm runs in polynomial time in n but the optimal running time is exponential in n.
b. This algorithm runs in exponential time in n and the optimal running time is exponential in n.
c. This algorithm runs in exponential time in n but the optimal running time is polynomial in n.
d. This algorithm runs in polynomial time in n and the optimal running time is polynomial in n.
e. The algorithm does not terminate.

tifr2015 time-complexity

1.274 Time Complexity: GATE2010_12 top gateoverflow.in/2185

Two alternative packages A and B are available for processing a database having 10k records. Package A requires 0.0001n2 time units and
package B requires 10n log10 n time units to process n records. What is the smallest value of k for which package B will be preferred over
A?
(A) 12

(B) 10

(C) 6

(D) 5

gate2010 algorithms time-complexity easy

1.275 Time Complexity: GATE2015-2_22 top gateoverflow.in/8113

An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither
maximum nor minimum is

A. (n log n)
B. (n)
C. (log n)
D. (1)

gate2015-2 algorithms time-complexity easy

1.276 Time Complexity: GATE2008-75 top gateoverflow.in/43489

Consider the following C functions:

int f1 (int n)
{
if(n == 0 || n == 1)
return n;
else
return (2 * f1(n-1) + 3 * f1(n-2));
}
int f2(int n)
{
int i;
int X[N], Y[N], Z[N];
X[0] = Y[0] = Z[0] = 0;
X[1] = 1; Y[1] = 2; Z[1] = 3;
for(i = 2; i <= n; i++){

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 92 of 852

X[i] = Y[i-1] + Z[i-2];


Y[i] = 2 * X[i];
Z[i] = 3 * X[i];
}
return X[n];
}

f1(8) and f2(8) return the values

A. 1661 and 1640


B. 59 and 59
C. 1640 and 1640
D. 1640 and 1661

gate2008 normal algorithms time-complexity

1.277 Topological Sort: GATE2014-1_13 top gateoverflow.in/1779

Consider the directed graph below given.

Which one of the following is TRUE?

(A) The graph does not have any topological ordering.

(B) Both PQRS and SRQP are topological orderings.

(C) Both PSRQ and SPRQ are topological orderings.

(D) PSRQ is the only topological ordering.

gate2014-1 topological-sort dfs easy

1.278 Topological Sort: GATE2009 Topological Sorting top gateoverflow.in/31821

I really doubt this question is correct or not !

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 93 of 852

As far as my concept understanding topological sorting is done based on DAG


do DFS
write result in decrasing order of finishing time ( reverse post order )

To do DAG we need to select vertex as source .


Source vertex is nothing but that vertex from which no inbound activity. Here , vertex 2 happens to be the source .
So while writing in reverse postorder vertex 2 will begin.
Here all options starts with 1 .

Is my understanding correct ??
Please help me understand the concepts and please do answer this question :)

topological-sort algorithms graph-algorithms

1.279 Topological Sort: GATE 2016-1-11 top gateoverflow.in/39669

Consider the following directed graph:

The number of different topological orderings of the vertices of the graph is _____________.

gate2016-1 algorithms topological-sort normal numerical-answers

1.280 Transactions: GATE 2016-2-22 top gateoverflow.in/39550

Suppose a database schedule S involves transactions T1 , . . . . . . . . , Tn . Construct the precedence graph of S with vertices
representing the transactions and edges representing the conflicts.If S is serializable, which one of the following orderings of
the vertices of the precedence graph is guaranteed to yield a serial schedule?

A). Topological order

B). Depth-first order

C). Breadth- first order

D). Ascending order of the transaction indices.

gate2016-2 databases transactions normal

1.281 Trees: GATE2008-IT_12 top gateoverflow.in/3272

Which of the following is TRUE?

1) The cost of searching an AVL tree is (log n) but that of a binary search tree is O(n)
2) The cost of searching an AVL tree is (log n) but that of a complete binary tree is (n log n)
3) The cost of searching a binary search tree is O (log n ) but that of an AVL tree is (n)
4) The cost of searching an AVL tree is (n log n) but that of a binary search tree is O(n)

gate2008-it algorithms trees easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 94 of 852

1.282 Trees: GATE2014-3_41 top gateoverflow.in/2075

Consider the pseudocode given below. The functionDoSomething() takes as argument a pointer to the root of an arbitrary tree represented by the
leftMostChild rightSibling representation. Each node of the tree is of type treeNode.
typedef struct treeNode* treeptr;
struct treeNode
{
treeptr leftMostChild, rightSibling;
};

int DoSomething (treeptr tree)


{
int value=0;
if (tree != NULL) {
if (tree->leftMostChild == NULL)
value = 1;
else
value = DoSomething(tree->leftMostChild);
value = value + DoSomething(tree->rightSibling);
}
return(value);
}

When the pointer to the root of a tree is passed as the argument to DoSomething, the value returned by the function corresponds to the

(A) number of internal nodes in the tree.

(B) height of the tree.

(C) number of nodes without a right sibling in the tree.

(D) number of leaf nodes in the tree

gate2014-3 algorithms trees identify-function normal

1.283 Trees: GATE2004_6 top gateoverflow.in/1003

Level order traversal of a rooted tree can be done by starting from the root and performing

A. preorder traversal

B. in-order traversal

C. depth first search

D. breadth first search

gate2004 algorithms trees easy

1.284 Trees: GATE2008-IT_46 top gateoverflow.in/3356

The following three are known to be the preorder, inorder and postorder sequences of a binary tree. But it is not known
which is which.

I. MBCAFHPYK
II. KAMCBYPFH
III. MABCKYFPH

Pick the true statement from the following.

A) I and II are preorder and inorder sequences, respectively


B) I and III are preorder and postorder sequences, respectively
C) II is the inorder sequence, but nothing more can be said about the other two sequences
D) II and III are the preorder and inorder sequences, respectively

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 95 of 852

gate2008-it algorithms trees normal

1.285 TIFR2014-B-20 top gateoverflow.in/27354

Consider the following game. There is a list of distinct numbers. At any round, a player arbitrarily chooses two numbers a, b
from the list and generates a new number c by subtracting the smaller number from the larger one. The numbers a and b
are put back in the list. If the number c is non-zero and is not yet in the list, c is added to the list. The player is allowed to
play as many rounds as the player wants. The score of a player at the end is the size of the final list.

Suppose at the beginning of the game the list contains the following numbers: 48, 99, 120, 165 and 273. What is the score of
the best player for this game?

a. 40
b. 16
c. 33
d. 91
e. 123

tifr2014 algorithms

1.286 TIFR2012-B-15 top gateoverflow.in/25212

Let T be a tree of n nodes. Consider the following algorithm, that constructs a sequence of leaves u1 , u2 . . . . Let u1 be some
leaf of tree. Let u2 be a leaf that is farthest from u1 . Let u3 be the leaf that is farthest from u2 , and, in general, let ui+1 be a
leaf of T that is farthest from ui (if there are many choices for ui+1 , pick one arbitrarily). The algorithm stops when some ui
is visited again. What can u say about the distance between ui and ui+1 , as i = 1, 2, . . . ?

a. For some trees, the distance strictly reduces in each step.


b. For some trees, the distance increases initially and then decreases.
c. For all trees, the path connecting u2 and u3 is a longest path in the tree.
d. For some trees, the distance reduces initially, but then stays constant.
e. For the same tree, the distance between the last two vertices visited can be different, based on the choice of the first
leaf u1 .

tifr2012 algorithms

1.287 GATE 1999 - Time Complexity top gateoverflow.in/31768

Match the following

1.T(n) = T(n-1) +n a. O(n)

2. T(n) = T(n/2) +n b.O(nlogn)

3.T(n) = T(n/2) +nlogn c.O(n^2)

4.T(n) = T(n-1) + logn d.O(log^2 n)

The first one I did by substitution and answer came O(n^2), for next two I used master and advanced master theorem and
for 2 i got O(n) and for 3 got O(nlogn) but dont know how to solve no 4,i tried it by substitution i got log(n!) by using
stirling approx which is nlogn also,as it is a gate qs,pls someone give me detailed solution.

algorithms gate1999

1.288 TIFR2013-B-5 top gateoverflow.in/25666

Given a weighted directed graph with n vertices where edge weights are integers (positive, zero, or negative), determining
whether there are paths of arbitrarily large weight can be performed in time

a. O(n)
b. O(n. log(n)) but not O(n)
1.5
O( ) O(n log n)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 96 of 852

c. O(n1.5 ) but not O(n log n)


d. O(n3 ) but not O(n1.5 )
e. O(2n ) but not O(n3 )

tifr2013 algorithms

1.289 TIFR2014-B-9 top gateoverflow.in/27194

Given a set of n distinct numbers, we would like to determine the smallest three numbers in this set using comparisons.
Which of the following statements is TRUE?

a. These three elements can be determined using O (log2 n) comparisons.


2
b. O (log n) comparisons do not suffice, however these three elements can be determined using n + O(1) comparisons.
c. n + O(1) comparisons do not suffice, however these three elements can be determined using n + O(log n)
comparisons.
d. n + O(log n) comparisons do not suffice, however these three elements can be determined using O(n) comparisons.
e. None of the above.

tifr2014 algorithms

1.290 TIFR2013-B-18 top gateoverflow.in/25865

Let S be a set of numbers. For x S, the rank of x is the number of elements in S that are less than or equal to x. The
procedure Select (S, r) takes a set S of numbers and a rank r (1 r |S|) and returns the element in S of rank r. The
procedure MultiSelect(S, R) takes a set of numbers S and a list of ranks R = {r1 < r2 <. . . < rk }, and returns the list
{x1 < x2 <. . . < xk } of elements of S, such that the rank of xi is ri . Suppose there is an implementation for Select (S, r)
that uses at most (constant |S| ) binary comparisons between elements of S. The minimum number of comparisons needed
to implement MultiSelect (S, R) is

a. constant |S| log |S|


b. constant |S|
c. constant |S||R|
d. constant |R| log |S|
e. constant |S|(1 + log |R|)

tifr2013 algorithms

1.291 TIFR2013-B-20 top gateoverflow.in/25878

Suppose n processors are connected in a linear array as shown below. Each processor has a number. The processors need
to exchange numbers so that the numbers eventually appear in ascending order (the processor P1 should have the
minimum value and the the processor Pn should have the maximum value).

The algorithm to be employed is the following. Odd numbered processors and even numbered processors are activated
alternate steps; assume that in the first step all the even numbered processors are activated. When a processor is activated,
the number it holds is compared with the number held by its right-hand neighbour (if one exists) and the smaller of the two
numbers is retained by the activated processor and the bigger stored in its right hand neighbour.
How long does it take for the processors to sort the values?

a. n log n steps
b. n2 steps
c. n steps
d. n1.5 steps
e. The algorithm is not guaranteed to sort

tifr2013 algorithms

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 97 of 852

1.292 TIFR2014-B-6 top gateoverflow.in/27183

Consider the problem of computing the minimum of a set of n distinct numbers. We choose a permutation uniformly at
random (i.e., each of the n! permutations of 1, . . . . , n is chosen with probability (1/n!) and we inspect the numbers in the
order given by this permutation. We maintain a variable MIN that holds the minimum value seen so far. MIN is initialized to
and if we see a value smaller than MIN during our inspection, then MIN is updated. For example, in the inspection given
by the following sequence, MIN is updated four times.

5 9 4 2 6 8 0 3 1 7

What is the expected number of times MIN is updated?

a. O(1)
b. Hn = ni=1 1/i
c. n
d. n/2
e. n

tifr2014 algorithms

1.293 GATE2008-81 top gateoverflow.in/43484

The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a1 , a2 , a3 , , an }, and positive
integer W , is there a subset of S whose elements sum to W ? A dynamic program for solving this problem uses a 2-
dimensional Boolean array, X , with n rows and W + 1 columns. X[i, j], 1 i n, 0 j W , is TRUE, if and only if there
is a subset of {a1 , a2 , , ai } whose elements sum to j.

Which entry of the array X , if TRUE, implies that there is a subset whose elements sum to W?
A. X[1, W ]
B. X[n, 0]
C. X[n, W ]
D. X[n 1, n]

gate2008 algorithms normal

1.294 TIFR2014-B-10 top gateoverflow.in/27198

Given a set of n distinct numbers, we would like to determine both the smallest and the largest number. Which of the
following statements is TRUE?

a. These two elements can be determined using O (log100 n) comparisons.


b. O (log100 n) comparisons do not suffice, however these two elements can be determined using n + O(log n)
comparisons.
c. n + O(log n) comparisons do not suffice, however these two elements can be determined using 3n/2 comparisons.
d. 3n/2 comparisons do not suffice, however these two elements can be determined using 2(n 1) comparisons.
e. None of the above.

tifr2014 algorithms

1.295 GATE2010_34 top gateoverflow.in/2208

The weight of a sequence a0 , a1 , , an1 of real numbers is dened as a0 + a1 /2 + + an1 / 2n1 . A subsequence of a sequence is
obtained by deleting some elements from the sequence, keeping the order of the remaining elements the same. Let X denote the maximum
possible weight of a subsequence of ao , a1 , , an1 and Y the maximum possible weight of a subsequence of a1 , a2 , , an1 . Then X is
equal to

(A) max(Y , a0 + Y )

(B) max(Y , a0 + Y /2)

(C) max(Y , a0 + 2Y )
0 + Y /2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 98 of 852
0
(D) a0 + Y /2

gate2010 algorithms normal

1.296 GATE2006_15 top gateoverflow.in/976

Consider the following C-program fragment in which i, j and n are integer variables.

for( i = n, j = 0; i > 0; i /= 2, j +=i );

Let val ( j ) denote the value stored in the variable j after termination of the for loop. Which one of the following is true?

(A)

(B)

(C)

(D)

gate2006 algorithms normal

1.297 GATE2006_17 top gateoverflow.in/978

An element in an array X is called a leader if it is greater than all elements to the right of it in X. The best algorithm to find
all leaders in an array

(A) Solves it in linear time using a left to right pass of the array
(B) Solves it in linear time using a right to left pass of the array
(C) Solves it using divide and conquer in time (n log n)
(D) Solves it in time (n2 )

gate2006 algorithms normal

1.298 GATE2003_69 top gateoverflow.in/956

The following are the starting and ending times of activities A, B, C, D, E, F, G and H respectively in chronological order:
as bs cs ae ds ce es fs be de gs ee fe hs ge he . Here, xs denotes the starting time and xe denotes the ending time of activity
X. We need to schedule the activities in a set of rooms available to us. An activity can be scheduled in a room only if the
room is reserved for the activity for its entire duration. What is the minimum number of rooms required?

A. 3
B. 4
C. 5
D. 6

gate2003 algorithms normal

1.299 GATE2002_1.5 top gateoverflow.in/809

In the worst case, the number of comparisons needed to search a single linked list of length n for a given element is

A. log n
n
B. 2
C. log2 n 1
D. n

gate2002 algorithms easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 99 of 852

1.300 GATE2005_39 top gateoverflow.in/784

Suppose there are log n sorted lists of n/ log n elements each. The time complexity of producing a sorted list of all
these elements is: (Hint:Use a heap data structure)

gate2005 algorithms normal

1.301 GATE2004_41 top gateoverflow.in/1038

Consider the following C program

main()
{
int x, y, m, n;
scanf("%d %d", &x, &y);
/* Assume x>0 and y>0*/
m = x; n = y;
while(m != n)
{
if (m > n)
m = m-n;
else
n = n-m;
}
printf("%d", n);
}

The program computes

A. x + y using repeated subtraction

B. x mod y using repeated subtraction


C. the greatest common divisor of x and y

D. the least common multiple of x and y

gate2004 algorithms normal

1.302 GATE1999_1.13 top gateoverflow.in/1466

Suppose we want to arrange the n numbers stored in any array such that all negative values occur before all positive ones.
Minimum number of exchanges required in the worst case is

A. n 1
B. n
C. n + 1
D. None of the above

gate1999 algorithms normal

1.303 GATE2006_54 top gateoverflow.in/1832

Given two arrays of numbers a1 , . . . , an and b1 , . . . , bn where each number is 0 or 1, the fastest algorithm to find the
largest span (i, j) such that ai + ai+1 + + aj = bi + bi+1 + + bj or report that there is not such span,

(A) Takes 0(3n ) and (2n ) time if hashing is permitted


(B) Takes 0(n3 ) and (n2.5 ) time in the key comparison mode
(C) Takes (n) time and space
(D) Takes O(n) time only if the sum of the 2n elements is an even number

gate2006 algorithms normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 100 of 852

1.304 GATE2014-1_37 top gateoverflow.in/1915

There are 5 bags labeled 1 to 5. All the coins in a given bag have the same weight. Some bags have coins of weight 10 gm, others have coins of weight 11 gm. I
pick 1, 2, 4, 8, 16 coins respectively from bags 1 to 5. Their total weight comes out to 323 gm. Then the product of the labels of the bags having 11 gm coins is
___.

gate2014-1 algorithms numerical-answers normal

1.305 GATE2006_50 top gateoverflow.in/1828

A set X can be represented by an array x[n] as follows:

={
1 if i X
x[i]
0 otherwise
Consider the following algorithm in which x y, and z are Boolean arrays of size n:

algorithm zzz(x[], y[], z[]) {


int i;

for(i=0; i<n; ++i)


z[i] = (x[i] ~y[i]) (~x[i] y[i]);
}

The set Z computed by the algorithm is:

(A) (X Y )

(B) (X Y )

(C) (X Y ) (Y X)
(D) (X Y ) (Y X)

gate2006 algorithms normal

1.306 GATE1999_8 top gateoverflow.in/1507

Let A be an n n matrix such that the elements in each row and each column are arranged in ascending order. Draw a
decision tree, which finds 1st, 2nd and 3 rd smallest elements in minimum number of comparisons.

gate1999 algorithms normal descriptive

1.307 GATE1999_1.16 top gateoverflow.in/1469

If n is a power of 2, then the minimum number of multiplications needed to compute an is


(a) log2 n

(b) n

(c) n 1

(d) n

gate1999 algorithms normal

1.308 GATE2000_16 top gateoverflow.in/687

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 101 of 852

A recursive program to compute Fibonacci numbers is shown below. Assume you are also given an array f [ 0......m] with all
elements initialized to 0

fib(n) {
if (n > M) error ();
if (n == 0) return 1;
if (n == 1)return 1;
if ()________________________(1)
return __________________(2)
t = fib(n - 1) + fib(n - 2);
_____________________________(3)
return t;
}

A. Fill in the boxes with expressions/statement to make fib() store and reuse computed Fibonacci values. Write the box
number and the corresponding contents in your answer book.
B. What is the time complexity of the resulting program when computing fib(n)?

gate2000 algorithms normal

1.309 GATE2000_2.15 top gateoverflow.in/662

Suppose you are given an array s[1....n] and a procedure reverse (s, i, j) which reverses the order of elements in s between positions i and j
(both inclusive). What does the following sequence do, where 1 k n:

reverse (s, 1, k);


reverse (s, k+1, n);
reverse (s, 1, n);

a. Rotates s left by k positions


b. Leaves s unchanged
c. Reverses all elements of s
d. None of the above

gate2000 algorithms normal

1.310 GATE2008_40 top gateoverflow.in/452

The minimum number of comparisons required to determine if an integer appears more than n2 times in a sorted array of n
integers is

A. (n)

B. (log n)

C. (log n)
D. (1)

gate2008 normal algorithms

1.311 GATE2008_43 top gateoverflow.in/455

Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-
lists each of which contains at least one-fifth of the elements. Let T(n) be the number of comparisons required to sort n
elements. Then

A. T(n) 2T(n/5) + n

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 102 of 852

B. T(n) T(n/5) + T(4n/5) + n

C. T(n) 2T(4n/5) + n

D. T(n) 2T(n/2) + n

gate2008 algorithms easy

1.312 GATE2012_18 top gateoverflow.in/50

Let W (n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an
input of size n. Which of the following is ALWAYS TRUE?

(A) A(n) = (W (n))


(B) A(n) = (W (n))
(C) A(n) = O(W (n))
(D) A(n) = o(W (n))

gate2012 algorithms easy

1.313 GATE2012_16 top gateoverflow.in/48

The recurrence relation capturing the optimal execution time of the T owersofHanoi problem with n discs is

(A) T (n) = 2T (n 2) + 2
(B) T (n) = 2T (n 1) + n
(C) T (n) = 2T (n/2) + 1
(D) T (n) = 2T (n 1) + 1

gate2012 algorithms easy

1.314 GATE2012_5 top gateoverflow.in/37

The worst case running time to search for an element in a balanced binary search tree with n2n elements is

(A) (n log n) (B) (n2n ) (C) (n) (D) (log n)

gate2012 algorithms normal

1.315 GATE1999_2.20 top gateoverflow.in/466

The minimum number of record movements required to merge five files A (with 10 records), B (with 20 records), C (with 15
records), D (with 5 records) and E (with 25 records) is:
(a) 165 (b) 90 (c) 75 d) 65

gate1999 algorithms normal

1.316 GATE2008-80 top gateoverflow.in/498

The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a1 , a2 , a3 , , an }, and positive
integer W , is there a subset of S whose elements sum to W ? A dynamic program for solving this problem uses a 2-
dimensional Boolean array, X , with n rows and W + 1 columns. X[i, j], 1 i n, 0 j W , is TRUE, if and only if there
is a subset of {a1 , a2 , , ai } whose elements sum to j.

Which of the following is valid for 2 i n, and ai j W ?


A. X[i, j] = X[i 1, j] X[i, j ai ]
B. X[i, j] = X[i 1, j] X[i 1, j ai ]
X[i, j] = X[i 1, j] X[i, j i ]

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 103 of 852

C. X[i, j] = X[i 1, j] X[i, j ai ]


D. X[i, j] = X[i 1, j] X[i 1, j ai ]

gate2008 algorithms normal

1.317 GATE2000_1.15 top gateoverflow.in/638

Let S be a sorted array of n integers. Let t(n) denote the time taken for the most efficient algorithm to determined if there are two elements
with sum less than 1000 in S. Which of the following statement is true?

a. t (n) is 0(1)
b. n t(n) n log2 n
c. n log2 n t(n) < n2
d. t(n) = ( n2 )

gate2000 easy algorithms

1.318 GATE2000_1.13 top gateoverflow.in/636

The most appropriate matching for the following pairs

X: depth first search 1: heap


Y: breadth-first search 2: queue
Z: sorting 3: stack

is:

a. X - 1 Y - 2 Z - 3
b. X - 3 Y - 1 Z - 2
c. X - 3 Y - 2 Z - 1
d. X - 2 Y - 3 Z - 1

gate2000 algorithms easy

1.319 GATE1992_08 top gateoverflow.in/587

Let T be a Depth First Tree of a undirected graph G. An array P indexed by the vertices of G is given. P [V ] is the parent of
vertex V , in T . Parent of the root is the root itself.

Give a method for finding and printing the cycle formed if the edge (u, v) of G not in T (i.e., e G T ) is now added to T .

Time taken by your method must be proportional to the length of the cycle.

Describe the algorithm in a PASCAL like language. Assume that the variables have been suitably declared.

gate1992 algorithms descriptive

1.320 GATE1991_03,viii top gateoverflow.in/523

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Consider the following Pascal function:

Function X(M:integer):integer;
Var i:integer;
Begin
i := 0;
while i*i < M
do i:= i+1
x := i

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 104 of 852

end

The function call X(N), if N is positive, will return



(a). N

(b). N + 1

(c). N

(d). N + 1

(e). None of the above

gate1991 algorithms easy

1.321 GATE2014-1_39 top gateoverflow.in/1917

The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is ________

gate2014-1 algorithms numerical-answers normal

1.322 GATE2014-2_37 top gateoverflow.in/1996

Consider two strings A="qpqrr" and B="pqprqrp". Let x be the length of the longest common subsequence (not necessarily contiguous) between
A and B and let y be the number of such longest common subsequences between A and B. Then x + 10y = ___.

gate2014-2 algorithms normal

1.323 GATE2015-1_6 top gateoverflow.in/8088

Match the following:

(P) Prim's algorithm for minimum spanning tree (i) Backtracking


(Q) Floyd-Warshall algorithm for all pairs shortest
(ii) Greedy method
paths
(iii) Dynamic
(R) Mergesort
programming
(S) Hamiltonian circuit (iv) Divide and conquer

A. P-iii, Q-ii, R-iv, S-i


B. P-i, Q-ii, R-iv, S-iii
C. P-ii, Q-iii, R-iv, S-i
D. P-ii, Q-i, R-iii, S-iv

gate2015-1 algorithms normal

1.324 GATE2015-2_36 top gateoverflow.in/8161

Given below are some algorithms, and some algorithm design paradigms.

1. Dijkstra's Shortest Path i. Divide and Conquer


2. Floyd-Warshall algorithm to compute all
ii. Dynamic Programming
pairs shortest path
3. Binary search on a sorted array iii. Greedy design
4. Backtracking search on a graph iv. Depth-first search

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 105 of 852

v. Breadth-first search
Match the above algorithms on the left to the corresponding design paradigm they follow.

A. 1-i, 2-iii, 3-i, 4-v


B. 1-iii, 2-iii, 3-i, 4-v
C. 1-iii, 2-ii, 3-i, 4-iv
D. 1-iii, 2-ii, 3-i, 4-v

gate2015-2 algorithms easy

1.325 GATE2005-IT_58 top gateoverflow.in/3819

Let a be an array containing n integers in increasing order. The following algorithm determines whether there are two
distinct numbers in the array whose difference is a specified number S > 0.

i = 0; j = 1;
while (j < n ){
if (E) j++;
else if (a[j] - a[i] == S) break;
else i++;
}
if (j < n) printf("yes") else printf ("no");

Choose the correct expression for E.

A) a[j] - a[i] > S


B) a[j] - a[i] < S
C) a[i] - a[j] < S
D) a[i] - a[j] > S

gate2005-it algorithms normal

1.326 GATE2005-IT_53 top gateoverflow.in/3814

The following C function takes two ASCII strings and determines whether one is an anagram of the other. An anagram of a
string s is a string obtained by permuting the letters in s.

int anagram (char *a, char *b) {


int count [128], j;
for (j = 0; j < 128; j++) count[j] = 0;
j = 0;
while (a[j] && b[j]) {
A;
B;
}
for (j = 0; j < 128; j++) if (count [j]) return 0;
return 1;
}

Choose the correct alternative for statements A and B.

A) A : count [a[j]]++ and B : count[b[j]]--


B) A : count [a[j]]++ and B : count[b[j]]++
C) A : count [a[j++]]++ and B : count[b[j]]--
D) A : count [a[j]]++and B : count[b[j++]]--

gate2005-it algorithms programming normal

1.327 GATE2005-IT_15 top gateoverflow.in/3760

In the following table, the left column contains the names of standard graph algorithms and the right column contains the
time complexities of the algorithms. Match each algorithm with its time complexity.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 106 of 852

1. Bellman-Ford A : O ( m log
algorithm n)
2. Kruskals algorithm B : O (n3)
3. Floyd-Warshall C : O (nm)
algorithm D : O (n + m)
4. Topological sorting

1) 1 C, 2 A, 3 B, 4 D
2) 1 B, 2 D, 3 C, 4 A
3) 1 C, 2 D, 3 A, 4 B
4) 1 B, 2 A, 3 C, 4 D

gate2005-it algorithms normal

1.328 GATE2015-2_45 top gateoverflow.in/8243

Suppose you are provided with the following function declaration in the C programming language.

int partition(int a[], int n);

The function treats the first element of a[ ] as a pivot and rearranges the array so that all elements less than or equal to the
pivot is in the left part of the array, and all elements greater than the pivot is in the right part. In addition, it moves the pivot
so that the pivot is the last element of the left part. The return value is the number of elements in the left part.

The following partially given function in the C programming language is used to find the kth smallest element in an array a[ ]
of size n using the partition function. We assume k n.

int kth_smallest (int a[], int n, int k)


{
int left_end = partition (a, n);
if (left_end+1==k) {
return a[left_end];
}
if (left_end+1 > k) {
return kth_smallest (___________);
} else {
return kth_smallest (___________);
}
}

The missing arguments lists are respectively

A. (a, left_end, k) and (a+left_end+1, n-left_end-1, k-left_end-1)


B. (a, left_end, k) and (a, n-left_end-1, k-left_end-1)
C. (a, left_end+1, n-left_end-1, k-left_end-1) and (a, left_end, k)
D. (a, n-left_end-1, k-left_end-1) and (a, left_end, k)

gate2015-2 algorithms normal

1.329 GATE2015-1_31 top gateoverflow.in/8263

Consider the following C function.

int fun1 (int n) {


int i, j, k, p, q = 0;
for (i = 1; i < n; ++i) {
p = 0;
for (j = n; j > 1; j = j/2)
++p;
for (k = 1; k < p; k = k * 2)
++q;
}
return q;
}

Which one of the following most closely approximates the return value of the function fun1?

A. n3
B. n(log n)2
C. n log n

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 107 of 852

D. n log(log n)

gate2015-1 algorithms normal

1.330 TIFR2011-B-38 top gateoverflow.in/20923

Consider the class of recursive and iterative programs. Which of the following is false?

a. Recursive programs are more powerful than iterative programs.


b. For every iterative program there is an equivalent recursive program.
c. Recursive programs require dynamic memory management.
d. Recursive programs do not terminate sometimes.
e. Iterative programs and recursive programs are equally expressive.

tifr2011 algorithms

1.331 TIFR2011-B-29 top gateoverflow.in/20576

You are given ten rings numbered from 1 to 10, and three pegs labeled A, B, and C. Initially all the rings are on peg A,
arranged from top to bottom in ascending order of their numbers. The goal is to move all the rings to peg B in the minimum
number of moves obeying the following constraints:

(i) In one move, only one ring can be moved.

(ii) A ring can only be moved from the top of its peg to the top of a new peg.

(iii) At no point can a ring be placed on top of another ring with a lower number.

How many moves are required?

a. 501
b. 1023
c. 2011
d. 10079
e. None of the above.

tifr2011 algorithms

1.332 GATE-2012 top gateoverflow.in/19597

Let G be a weighted graph with edge weights greater than one and G' be the graph constructed by squaring the
weight of edges in G.Let T and T' be the minimum spanning trees of G and G' respectively with total weights t
and t'. Which of the following statements is true?

a) T'=T with total weight t'=t^2

b)T'=T with total weight t'

c)T' !=T but total weight t'=t^2

d)None of the above

1.333 TIFR2010-B-24 top gateoverflow.in/18742

Consider the following program operating on four variables u, v, x, y, and two constants X and Y .

x, y, u, v:= X, Y, Y, X;
While (x y)
do
if (x > y) then x, v := x - y, v + u;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 108 of 852

else if (y > x) then y, u:= y - x, u + v;


od;
print ((x + y) / 2); print ((u + v) / 2);

Given X > 0 Y > 0, pick the true statement out of the following:
a. The program prints gcd(X, Y ) and the first prime larger than both X and Y .
b. The program prints gcd(X, Y ) followed by lcm(X, Y ).
c. The program prints gcd(X, Y ) followed by 12 lcm(X, Y ).
1 1
d. The program prints 2 gcd(X, Y ) followed by 2 lcm(X, Y ).
e. The program does none of the above.

tifr2010 algorithms

1.334 GATE2004-IT_58 top gateoverflow.in/3701

Consider the following C program which is supposed to compute the transpose of a given 4 x 4 matrix M. Note that, there is
an X in the program which indicates some missing statements. Choose the correct option to replace X in the program.

#include<stdio.h>
#define ROW 4
#define COL 4
int M[ROW][COL] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
main()
{
int i, j, t;
for (i = 0; i < 4; ++i)
{
X
}
for (1 = 0; i < 4; ++i)
for (j = 0; j < 4; ++j)
printf ("%d", M[i][j]);
}

for(j = 0; j < 4; ++j){


t = M[i][j];
M[i][j] = M[j][i];
M[j][i] = t;
A) }

for(j = 0; j < 4; ++j){


M[i][j] = t;
t = M[j][i];
M[j][i] = M[i][j];
B) }

for(j = i; j < 4; ++j){


t = M[i][j];
M[i][j] = M[j][i];
M[j][i] = t;
C) }

for(j = i; j < 4; ++j){


M[i][j] = t;
t = M[j][i];
M[j][i] = M[i][j];
D) }

gate2004-it algorithms easy

1.335 GATE2004-IT_52 top gateoverflow.in/3695

A program attempts to generate as many permutations as possible of the string, 'abcd' by pushing the characters a, b, c, d

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 109 of 852

in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings CANNOT
be generated using this program?

A) abcd
B) dcba
C) cbad
D) cabd

gate2004-it algorithms normal

1.336 GATE1997_1.5 top gateoverflow.in/2221

The correct matching for the following pairs is

(A) All pairs shortest path (1) Greedy


(B) Quick Sort (2) Depth-First search
(C) Minimum weight spanning
(3) Dynamic Programming
tree
(D) Divide and and
(D) Connected Components
Conquer

A. A-2 B-4 C-1 D-3

B. A-3 B-4 C-1 D-2

C. A-3 B-4 C-2 D-1

D. A-4 B-1 C-2 D-3

gate1997 algorithms normal

1.337 GATE1997_4.2 top gateoverflow.in/2243

Let a = (aij ) be an n-rowed square matrix and I12 be the matrix obtained by interchanging the first and second rows of the
n-rowed Identify matrix. Then AI12 is such that its first
A. row is the same as its second row

B. row is the same as the second row of A

C. column is the same as the second column of A

D. row is all zero

gate1997 linear-algebra easy

1.338 GATE2012_4 top gateoverflow.in/36

Assuming P NP, which of the following is TRUE?

(A) NP-complete = NP
(B) NP-complete P =
(C) NP-hard = NP
(D) P = NP-complete

gate2012 algorithms normal

1.339 GATE2011_25 top gateoverflow.in/2127

An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array A[0 : n 1] is given
below.

Li i

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 110 of 852

Let Li , denote the length of the longest monotonically increasing sequence starting at index i in the array.

Initialize Ln1 = 1.
For all i such that 0 i n2

Li = {
1 + Li+1 if A[i] < A[i+1]
1 Otherwise
Finally the the length of the longest monotonically increasing sequence is Max (L0 , L1 , , Ln1 ).

Which of the following statements is TRUE?

(A) The algorithm uses dynamic programming paradigm

(B) The algorithm has a linear complexity and uses branch and bound paradigm

(C) The algorithm has a non-linear polynomial complexity and uses branch and bound paradigm

(D) The algorithm uses divide and conquer paradigm

gate2011 algorithms easy

1.340 GATE2014-3_37 top gateoverflow.in/2071

Suppose you want to move from 0 to 100 on the number line. In each step, you either move right by a unit distance or you take a shortcut. A shortcut is simply a
pre-specified pair of integers i, j with i < j. Given a shortcut i, j if you are at position i on the number line, you may directly move to j. Suppose T (k) denotes
the smallest number of steps needed to move from k to 100. Suppose further that there is at most 1 shortcut involving any number, and in particular from 9 there
is a shortcut to 15. Let y and z be such that T (9) = 1 + min(T (y), T (z)) . Then the value of the product yz is _____.

gate2014-3 algorithms normal

1.341 GATE1994_1.22 top gateoverflow.in/2465

Which of the following statements is false?

A. Optimal binary search tree construction can be performed efficiently using dynamic programming

B. Breadth-first search cannot be used to find connected components of a graph

C. Given the prefix and postfix walks over a binary tree, the binary tree cannot be uniquely constructed.

D. Depth-first search can be used to find connected components of a graph

gate1994 algorithms normal

1.342 GATE1994_7 top gateoverflow.in/2503

An array A contains n integers in locations A[0], A[1], A[n 1] . It is required to shift the elements of the array cyclically
to the left by K places, where 1 K n 1. An incomplete algorithm for doing this in linear time, without using another
array is given below. Complete the algorithm by filling in the blanks. Assume all variables are suitably declared.

min:=n;
i=0;
while _____ do
begin
temp:=A[i];
j:=i;
while ____ do
begin
A[j]:=____;
j:=(j+K) mod n;
if j<min then
min:=j;
end;
A[(n+i-K)mod n]:=____;
i:=______;
end;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 111 of 852

gate1994 algorithms normal

1.343 GATE2008-IT_4 top gateoverflow.in/3264

What is the size of the smallest MIS(Maximal Independent Set) of a chain of nine nodes?

A) 5
B) 4
C) 3
D) 2

gate2008-it algorithms normal

1.344 GATE1996_2.13 top gateoverflow.in/2742

The average number of key comparisons done on a successful sequential search in a list of length n is

(a) log n

(b) n1
2

(c) n2

n+1
(d)
2

gate1996 algorithms easy

1.345 GATE1995_2.22 top gateoverflow.in/2634

Which of the following statements is true?

I. As the number of entries in a hash table increases, the number of collisions increases.

II. Recursive programs are efficient

III. The worst case complexity for Quicksort is O(n2 )

IV. Binary search using a linear linked list is efficient

A. I and II
B. II and III
C. I and IV
D. I and III

gate1995 algorithms

1.346 GATE1995_2.9 top gateoverflow.in/2621

A language with string manipulation facilities uses the following operations

head(s): first character of a string


tail(s): all but the first character of a string
concat(s1, s2): s1s2

For the string acbc what will be the output of

concat(head(s), head(tail(tail(s))))

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 112 of 852

A. ac
B. bc
C. ab
D. cc

gate1995 algorithms normal

1.347 TIFR2012-B-6 top gateoverflow.in/25106

Let n be a large integer. Which of the following statements is TRUE?

a. 22 log n < n
log n
< n1/3
b. n
log n
< n1/3 < 22 log n

c. 22 log n < n1/3 < logn n

d. n1/3 < 22 log n < logn n

e. n
log n
< 22 log n < n1/3

tifr2012 algorithms

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 113 of 852

2 Compiler Design top


2.1 Assembler: GATE1992_3,i top gateoverflow.in/578

Write short answers to the following:

(i). Which of the following macros can put a macro assembler into an infinite loop?

.MACRO MI,X .MACRO M2,X


.IF EQ,X .IF EQ,X
M1 X+1 M2 X
.ENDC .ENDC
.IF NE,X .IF NE,X
.WORD X .WORD X+1
.ENDC .ENDC
.ENDM .ENDM

Give an example call that does so.

gate1992 compiler-design assembler normal

2.2 Assembler: GATE1992_03,ii top gateoverflow.in/579

Mention the pass number for each of the following activities that occur in a two pass assembler:

a. object code generation


b. literals added to literal table
c. listing printed
d. address resolution of local symbols

gate1992 compiler-design assembler easy

2.3 Assembler: GATE1993_7.6 top gateoverflow.in/2294

A simple two-pass assembler does the following in the first pass:

A. It allocates space for the literals.

B. It computes the total length of the program.

C. It builds the symbol table for the symbols and their values.

D. It generates code for all the load and store register instructions.

E. None of the above.

gate1993 compiler-design assembler easy

2.4 Assembler: GATE1992-01,viii top gateoverflow.in/553

The purpose of instruction location counter in an assembler is _______

gate1992 compiler-design assembler normal

2.5 Code Optimization: GATE2008_12 top gateoverflow.in/410

Some code optimizations are carried out on the intermediate code because

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 114 of 852

A. They enhance the portability of the compiler to the target processor

B. Program analysis is more accurate on intermediate code than on machine code

C. The information from dataflow analysis cannot otherwise be used for optimization

D. The information from the front end cannot otherwise be used for optimization

gate2008 normal code-optimization compiler-design

2.6 Code Optimization: GATE2014-1_17 top gateoverflow.in/1784

Which one of the following is FALSE?

A. A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end.
B. Available expression analysis can be used for common subexpression elimination.
C. Live variable analysis can be used for dead code elimination.
D. x = 4 5 x = 20 is an example of common subexpression elimination.

gate2014-1 compiler-design code-optimization normal

2.7 Context Free: GATE2008-IT_78 top gateoverflow.in/3392

A CFG G is given with the following productions where S is the start symbol, A is a non-terminal and a and b are terminals.

S aS A
A aAb bAa
Which of the following strings is generated by the grammar above?

1) aabbaba
2) aabaaba
3) abababb
4) aabbaab

gate2008-it compiler-design context-free grammar normal

2.8 Dag Representation: GATE2014-3_34 top gateoverflow.in/2068

Consider the basic block given below.

a = b + c
c = a + d
d = b + c
e = d - b
a = e + b

The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are

(A) 6 and 6

(B) 8 and 10

(C) 9 and 12

(D) 4 and 4

gate2014-3 compiler-design dag-representation normal

2.9 Grammar: GATE1997_1.6 top gateoverflow.in/2222

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 115 of 852

In the following grammar

X ::= X Y Y
Y ::= Z Y Z
Z ::= id

Which of the following is true?

a. ' ' is left associative while ' ' is right associative


b. Both ' ' and ' ' are left associative
c. ' ' is right associative while ' ' is left associative
d. None of the above

gate1997 compiler-design grammar normal

2.10 Grammar: GATE2004_45 top gateoverflow.in/1042

Consider the grammar with the following translation rules and E as the start symbol

E E1 # T
{E. value = E1 . value T . value}
|T {E. value = T . value}
T T1 & F {T . value = T1 . value + F . value}
|F {T . value = F . value}
F num {F . value = num. value}

Compute E.value for the root of the parse tree for the expression:2 # 3 & 5 # 6 & 4

A. 200
B. 180
C. 160
D. 40

gate2004 compiler-design grammar normal

2.11 Grammar: GATE2004_88 top gateoverflow.in/1082

Consider the following grammar G:

S bS aA b
A bA aB
B bB aS a
Let Na (w) and Nb (w) denote the number of as and bs in a string respectively.
+
The language L(G) over {a, b} generated by G is

A. {w Na (w) > 3Nb (w)}


B. {w Nb (w) > 3Na (w)}
C. {w Na (w) = 3k, k {0, 1, 2, }}
D. {w Nb (w) = 3k, k {0, 1, 2, }}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 116 of 852

gate2004 compiler-design grammar normal

2.12 Grammar: GATE1997_11 top gateoverflow.in/2271

Consider the grammar

S bSe
S P QR
P bP c
P
Q cQd
Q
R dRe
R
where S, P , Q, R are non-terminal symbols with S being the start symbol; b, c, d, e are terminal symbols and is the
empty string. This grammar generates strings of the form bi , cj , d k , em for some i, j, k, m 0.

a. What is the condition on the values of i, j, k, m ?

b. Find the smallest string that has two parse trees.

gate1997 compiler-design grammar normal theory-of-computation

2.13 Grammar: GATE2006_32 top gateoverflow.in/995

Consider the following statements about the context free grammar

G = {S SS, S ab, S ba, S }

I. G is ambiguous
II. G produces all strings with equal number of a s and b s
III. G can be accepted by a deterministic PDA.
Which combination below expresses all the true statements about G?
(A) I only
(B) I and III only
(C) II and III only
(D) I, II and III

gate2006 compiler-design grammar normal

2.14 Grammar: GATE2007_52 top gateoverflow.in/1250

Consider the grammar with non-terminals N = {S, C, S1 }, terminals T = {a, b, i, t, e}, with S as the start symbol, and the
following set of rules:

S iCtSS1 a
S1 eS
Cb
The grammar is NOT LL(1) because:

A. it is left recursive

B. it is right recursive

C. it is ambiguous

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 117 of 852

D. it is not context-free

gate2007 compiler-design grammar normal

2.15 Grammar: GATE2004_8 top gateoverflow.in/1005

Which of the following grammar rules violate the requirements of an operator grammar? P, Q, R are nonterminals, and r, s, t
are terminals.

I. P Q R

II. P Q s R

III. P
IV. P Q t R r

A. (I) only
B. (I) and (III) only
C. (II) and (III) only
D. (III) and (IV) only

gate2004 compiler-design grammar normal

2.16 Grammar: GATE2010_38 top gateoverflow.in/2339

The grammar S aSa bS c is

(A) LL(1) but not LR(1)

(B) LR(1) but not LL(1)

(C) Both LL(1) and LR(1)

(D) Neither LL(1) nor LR(1)

gate2010 compiler-design grammar normal

2.17 Grammar: GATE2005_59 top gateoverflow.in/1382

Consider the grammar:

EE+nEnn
For a sentence n + n n, the handles in the right-sentential form of the reduction are:

A. n, E + n and E + n n

B. n, E + n and E + E n

C. n, n + n and n + n n

D. n, E + n and E n

gate2005 compiler-design grammar normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 118 of 852

2.18 Grammar: GATE2006_59 top gateoverflow.in/1837

Consider the following translation scheme.

S ER
R E {print( ); } R
E F + E {print( + ); } F
F S id {print(id. value); }
Here id is a token that represents an integer and id.value represents the corresponding integer value. For an input '2 * 3 +
4', this translation scheme prints

(A) 2 * 3 + 4
(B) 2 * +3 4
(C) 2 3 * 4 +
(D) 2 3 4+*

gate2006 compiler-design grammar normal

2.19 Grammar: GATE1999_2.15 top gateoverflow.in/1493

A grammar that is both left and right recursive for a non-terminal, is

A. Ambiguous

B. Unambiguous

C. Information is not sufficient to decide whether it is ambiguous or unambiguous

D. None of the above

gate1999 compiler-design grammar normal

2.20 Grammar: GATE1999_9 top gateoverflow.in/1508

Let synthesized attribute val give the value of the binary number generated by S in the following grammar. For example, on
input 101.101, S.val = 5.625.

S L. L L
L LB B
B01
Write S-attributed values corresponding to each of the productions to find S.val.

gate1999 compiler-design grammar normal

2.21 Grammar: GATE2006_84,85 top gateoverflow.in/1856

Statement for Linked Answer Questions 84 & 85:

84. Which one of the following grammars generates the language L = {ai bj i j} ?

(A)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 119 of 852

S AC CB

C aCb a b

A aA

B Bb

(B)

S aS Sb a b

(C)

S AC CB

C aCb

A aA

B Bb

(D)

S AC CB

C aCb

A aA a

B Bb b

85. In the correct grammar above, what is the length of the derivation (number of steps starring from S) to generate the
string al bm with l m

(A) max(l, m) + 2
(B) l + m + 2
(C)l + m + 3
(D)max(l, m) + 3

gate2006 compiler-design grammar normal

2.22 Grammar: GATE2014-2_17 top gateoverflow.in/1973

Consider the grammar defined by the following production rules, with two operators and +

S T P
T U T U
P Q+P Q
Q Id
U Id

Which one of the following is TRUE?

A. + is left associative, while is right associative


B. + is right associative, while is left associative
C. Both + and are right associative
D. Both + and are left associative

gate2014-2 compiler-design grammar normal

2.23 Grammar: GATE2007-78 top gateoverflow.in/1272

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 120 of 852

Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the terminal alphabet, S as the start symbol and
the following set of production rules:

S aB SbA

B b A a

B bS A aS

B aBB S bAA

Which of the following strings is generated by the grammar?

A. aaaabb
B. aabbbb
C. aabbab
D. abbbba

gate2007 compiler-design grammar normal

2.24 Grammar: GATE2008_50 top gateoverflow.in/395

Which of the following statements are true?

I. Every left-recursive grammar can be converted to a right-recursive grammar and vice-versa


II. All -productions can be removed from any context-free grammar by suitable transformations
III. The language generated by a context-free grammar all of whose productions are of the form X w or X wY
(where, w is a string of terminals and Y is a non-terminal), is always regular
IV. The derivation trees of strings generated by a context-free grammar in Chomsky Normal Form are always binary trees

A. I, II, III and IV


B. II, III and IV only
C. I, III and IV only
D. I, II and IV only

gate2008 normal compiler-design grammar

2.25 Grammar: GATE2003_58 top gateoverflow.in/946

Consider the translation scheme shown below.

S T R

R + T {print(+);} R

T num {print(num.val);}

Here num is a token that represents an integer and num.val represents the corresponding integer value. For an input string
9 + 5 + 2, this translation scheme will print

A. 9 + 5 + 2
B. 9 5 + 2 +
C. 9 5 2 + +
D. + + 9 5 2

gate2003 compiler-design grammar normal

2.26 Grammar: GATE2007_53 top gateoverflow.in/1251

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 121 of 852

Consider the following two statements:

P: Every regular grammar is LL(1)


Q: Every regular set has a LR(1) grammar

Which of the following is TRUE?

A. Both P and Q are true

B. P is true and Q is false

C. P is false and Q is true

D. Both P and Q are false

gate2007 compiler-design grammar normal

2.27 Grammar: GATE1994_3.5 top gateoverflow.in/2482

Match the following items

(i) Backus-Naur form (a) Regular expressions

(ii) Lexical analysis (b) LALR(1) grammar


(iii) YACC (c) LL(1) grammars
(iv) Recursive descent (d) General context-free
parsing grammars

gate1994 compiler-design grammar normal

2.28 Grammar: GATE 2016-2-45 top gateoverflow.in/39594

Which one of the following grammars is free from left recursion?

(A) S AB
A Aa|b

B c
(B) S Ab|Bb|c
A Bd|
B e
(C) S Aa|B
A Bb|Sc|
B d
(D) S Aa|Bb|c
A Bd|
B Ae|

gate2016-2 compiler-design grammar easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 122 of 852

2.29 Grammar: GATE2007-IT_9 top gateoverflow.in/3442

Consider an ambiguous grammar G and its disambiguated version D. Let the language recognized by the two grammars be
denoted by L(G) and L(D) respectively. Which one of the following is true ?

A) L (D) L (G)
B) L (D) L (G)
C) L (D) = L (G)
D) L (D) is empty

gate2007-it compiler-design grammar normal

2.30 Grammar: GATE1996_11 top gateoverflow.in/2763

Let G be a context-free grammar where G = ({S, A, B, C}, {a, b, d}, P , S) with the productions in P given below.
S ABAC
A aA
B bB
Cd
( denotes the null string). Transform the grammar G to an equivalent context-free grammar G that has no productions
and no unit productions. (A unit production is of the form x y, and x and y are non terminals).

gate1996 compiler-design grammar normal

2.31 Grammar: GATE 2016-2-46 top gateoverflow.in/39598

A student wrote two context-free grammars G1 and G2 for generating a single C-like array declaration. The dimension of the
array is at least one. For example,

int a[10] [3];

The grammars use D as the start symbol, and use six terminal symbols int ; id [ ] num.

Grammar G1 Grammar G2

D int L; D int L;
L id [E L id E
E num ] E E [num]
E num ] [E E [num]
Which of the grammars correctly generate the declaration mentioned above?

A. Both G1 and G2
B. Only G1
C. Only G2
D. Neither G1 nor G2

gate2016-2 compiler-design grammar normal

2.32 Grammar: GATE1991-10a top gateoverflow.in/537

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 123 of 852

Consider the following grammar for arithmetic expressions using binary operators and / which are not associative

E ET T

T T /F F

F (E) id

(E is the start symbol)

Is the grammar unambiguous? Is so, what is the relative precedence between and /? If not, give an unambiguous
grammar that gives / precedence over .

gate1991 grammar compiler-design normal descriptive

2.33 Grammar: GATE1991-10c top gateoverflow.in/43605

Consider the following grammar for arithmetic expressions using binary operators and / which are not associative

E ET T

T T /F F

F (E) id

(E is the start symbol)

Does the grammar allow expressions with redundant parentheses as in (id/id) or in id (id/id)? If so, convert the
grammar into one which does not generate expressions with redundant parentheses. Do this with minimum number of
changes to the given production rules and adding at most one more production rule.

Convert the grammar obtained above into one that is not left recursive.

gate1991 grammar compiler-design normal descriptive

2.34 Grammar: GATE1991-10b top gateoverflow.in/43604

Consider the following grammar for arithmetic expressions using binary operators and / which are not associative

E ET T

T T /F F

F (E) id

(E is the start symbol)

Does the grammar allow expressions with redundant parentheses as in (id/id) or in id (id/id) ? If so, convert the
grammar into one which does not generate expressions with redundant parentheses. Do this with minimum number of
changes to the given production rules and adding at most one more production rule.

gate1991 grammar compiler-design normal descriptive

2.35 Grammar: GATE2007-79 top gateoverflow.in/43512

Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the terminal alphabet, S as the start symbol and
the following set of production rules:

S aB S bA
B b A a
B bS A aS

B aBB S bAA

For the string aabbab , how many derivation trees are there?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 124 of 852

A. 1
B. 2
C. 3
D. 4

gate2007 compiler-design grammar normal

2.36 Grammar: GATE2001_1.18 top gateoverflow.in/711

Which of the following statements is false?

(A) An unambiguous grammar has same leftmost and rightmost derivation

(B) An LL(1) parser is a top-down parser

(C) LALR is more powerful than SLR

(D) An ambiguous grammar can never be LR(k) for any k

gate2001 compiler-design grammar normal

2.37 Grammar: GATE2000_2.21 top gateoverflow.in/668

Given the following expression grammar:

E EF F +E F

F F F id
Which of the following is true?

A. has higher precedence than +


B. has higher precedence than
C. + and have same precedence
D. + has higher precedence than

gate2000 grammar normal compiler-design

2.38 Grammar: GATE1996_2.10 top gateoverflow.in/2739

The grammar whose productions are

-> if id then <stmt>

-> if id then <stmt> else <stmt>

-> id := id

is ambiguous because

(a) the sentence

if a then if b then c:= d

has more than two parse trees

(b) the left most and right most derivations of the sentence

if a then if b then c:= d

give rise to different parse trees

(c) the sentence

if a then if b then c:= d else c:= f

has more than two parse trees

(d) the sentence

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 125 of 852

if a then if b then c:= d else c:= f

has two parse trees

gate1996 compiler-design grammar normal

2.39 Grammar: GATE1995_9 top gateoverflow.in/2644

a. Translate the arithmetic expression a (b + c) into syntax tree.


b. A grammar is said to have cycles if it is the case that

A + A
Show that no grammar that has cycles can be LL(1).

gate1995 compiler-design grammar normal

2.40 Grammar: GATE1995_1.10 top gateoverflow.in/2597

Consider a grammar with the following productions

S ab bc aB
S S b
S bb ab
S bdb b
The above grammar is:

A. Context free
B. Regular
C. Context sensitive
D. LR(k)

gate1995 compiler-design grammar normal

2.41 Grammar: GATE1998_14 top gateoverflow.in/1728

a. Let G1 = (N, T , P , S1 ) be a CFG where, N = {S1 A, B}, T = {a, b} and P is given by


S1 aS1 b S1 aBb

S1 aAb B Bb

A aA Bb

Aa

What is L(G1 )?

b. Use the grammar in Part(a) to give a CFG for L2 = {ai bi ak bl i, j, k, 1 1, i = j or k = l} by adding not more than 5
production rules.

c. Is L2 inherently ambiguous?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 126 of 852

gate1998 compiler-design grammar descriptive

2.42 Grammar: GATE1994_1.18 top gateoverflow.in/2461

Which of the following features cannot be captured by context-free grammars?

A. Syntax of if-then-else statements

B. Syntax of recursive procedures

C. Whether a variable has been declared before its use

D. Variable names of arbitrary length

gate1994 compiler-design grammar normal

2.43 Grammar: GATE2001_17 top gateoverflow.in/758

The syntax of the repeat-until statement is given by the following grammar

S repeat S1 until E
where E stands for expressions, S and S1 stand for statements. The non-terminals S and S1 have an attribute code that
represents generated code. The non-terminal E has two attributes. The attribute code represents generated code to evaluate
the expression and store its value in a distinct variable, and the attribute varName contains the name of the variable in
which the truth value is stored? The truth-value stored in the variable is 1 if E is true, 0 if E is false.

Give a syntax-directed definition to generate three-address code for the repeat-until statement. Assume that you can call a
function newlabel() that returns a distinct label for a statement. Use the operator '\\' to concatenate two strings and the
function gen(s) to generate a line containing the string s.

gate2001 compiler-design grammar normal

2.44 Grammar: GATE2003_56 top gateoverflow.in/944

Consider the grammar shown below

S i E t S S | a

S e S |

E b

In the predictive parse table, M, of this grammar, the entries M[S , e] and M[S , $] respectively are

A. {S e S} and {S }
B. {S e S} and { }
C. {S } and {S }
D. {S e S, S } and {S }

gate2003 compiler-design grammar normal

2.45 Grammar: GATE2001_18 top gateoverflow.in/759

(a) Remove left-recursion from the following grammar:

S Sa Sb a b

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 127 of 852

(b) Consider the following grammar:

S aSbS bSaS
Construct all possible parse trees for the string abab. Is the grammar ambiguous?

gate2001 compiler-design grammar

2.46 Grammar: GATE1994_20 top gateoverflow.in/2516

A grammar G is in Chomsky-Normal Form (CNF) if all its productions are of the form A BC or A a , where A, B and
C, are non-terminals and a is a terminal. Suppose G is a CFG in CNF and w is a string in L(G) of length n, then how long is
a derivation of w in G?

gate1994 compiler-design grammar normal

2.47 Intermediate Code: GATE1992-11b top gateoverflow.in/43583

Write 3 address intermediate code (quadruples) for the following boolean expression in the sequence as it would be
generated by a compiler. Partial evaluation of boolean expressions is not permitted. Assume the usual rules of precedence of
the operators.

(a + b) > (c + d) or a > c and b < d

gate1992 compiler-design syntax-directed-translation intermediate-code descriptive

2.48 Intermediate Code: GATE2015-1_55 top gateoverflow.in/8365

The least number of temporary variables required to create a three-address code in static single assignment form for the
expression q + r / 3 + s - t * 5 + u * v/w is__________________.

gate2015-1 compiler-design intermediate-code normal

2.49 Intermediate Code: GATE1994_1.12 top gateoverflow.in/2453

Generation of intermediate code based on an abstract machine model is useful in compilers because

A. it makes implementation of lexical analysis and syntax analysis easier

B. syntax-directed translations can be written for intermediate code generation

C. it enhances the portability of the front end of the compiler

D. it is not possible to generate code for real machines directly from high level language programs

gate1994 compiler-design intermediate-code easy

2.50 Intermediate Code: GATE2015-1_8 top gateoverflow.in/8096

For computer based on three-address instruction formats, each address field can be used to specify which of the following:

(S1) A memory operand

(S2) A processor register

(S3) An implied accumulator register

A. Either S1 or S2
B. Either S2 or S3
C. Only S2 and S3
D. All of S1, S2 and S3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 128 of 852

gate2015-1 compiler-design intermediate-code normal

2.51 Intermediate Code: GATE2014-2_34 top gateoverflow.in/1993

For a C program accessing X[i] [j] [k], the following intermediate code is generated by a compiler. Assume that the size of an integer is 32 bits and the
size of a character is 8 bits.

t0 = i 1024
t1 = j 32
t2 = k 4
t3 = t1 + t0
t4 = t3 + t2
t5 = X[t4]

Which one of the following statements about the source code for the C program is CORRECT?

(A) X is declared as "int X[32] [32] [8].

(B) X is declared as "int X[4] [1024] [32].

(C) X is declared as "char X[4] [32] [8].

(D) X is declared as "char X[32] [16] [2].

gate2014-2 compiler-design intermediate-code programming-in-c normal

2.52 Intermediate Code: GATE2015-2_29 top gateoverflow.in/8139

Consider the intermediate code given below.

(1) i=1
(2) j=1
(3) t1 = 5 * i
(4) t2 = t1 + j
(5) t3 = 4 * t2
(6) t4 = t3
(7) a[t4] = -1
(8) j = j + 1
(9) if j <= 5 goto (3)
(10) i = i +1
(11) if i < 5 goto (2)

The number of nodes and edges in control-flow-graph constructed for the above code, respectively, are

A. 5 and 7
B. 6 and 7
C. 5 and 5
D. 7 and 8

gate2015-2 compiler-design intermediate-code normal

2.53 Intermediate Code: GATE2014-3_17 top gateoverflow.in/2051

One of the purposes of using intermediate code in compilers is to

(A) make parsing and semantic analysis simpler.

(B) improve error recovery and error reporting.

(C) increase the chances of reusing the machine-independent code optimizer in other compilers.

(D) improve the register allocation.

gate2014-3 compiler-design intermediate-code easy

2.54 Intermediate Code: GATE1992-11a top gateoverflow.in/590

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 129 of 852

Write syntax directed definitions (semantic rules) for the following grammar to add the type of each identifier to its entry in
the symbol table during semantic analysis. Rewriting the grammar is not permitted and semantic rules are to be added to
the ends of productions only.

D T L;
T int
T real
L L, id
L id

gate1992 compiler-design syntax-directed-translation intermediate-code normal

2.55 Lexical Analysis: GATE2011_1 top gateoverflow.in/2103

In a compiler, keywords of a language are recognized during

(A) parsing of the program

(B) the code generation

(C) the lexical analysis of the program

(D) dataflow analysis

gate2011 compiler-design lexical-analysis easy

2.56 Lexical Analysis: GATE2010_13 top gateoverflow.in/2186

Which data structure in a compiler is used for managing information about variables and their attributes?

A. Abstract syntax tree


B. Symbol table
C. Semantic stack
D. Parse table

gate2010 compiler-design lexical-analysis easy

2.57 Lexical Analysis: GATE2011_19 top gateoverflow.in/2121

The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a
necessary and sufficient sense?

(A) Finite state automata

(B) Deterministic pushdown automata

(C) Non-deterministic pushdown automata

(D) Turing machine

gate2011 compiler-design lexical-analysis easy

2.58 Lexical Analysis: GATE2000_1.18 top gateoverflow.in/641

The number of tokens in the following C statement

printf("i=%d, &i=%x", i, &i);

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 130 of 852

is

A. 3
B. 26
C. 10
D. 21

gate2000 compiler-design lexical-analysis easy

2.59 Linking: GATE2003_76 top gateoverflow.in/962

Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statistically
linked libraries?

A. Smaller sizes of executable files

B. Lesser overall page fault rate in the system

C. Faster program startup

D. Existing programs need not be re-linked to take advantage of newer versions of libraries

gate2003 compiler-design runtime-environments linking easy

2.60 Live Variable: GATE2015-1_50 top gateoverflow.in/8356

A variable x is said to be live at a statement s i in a program if the following three conditions hold simultaneously:

i. There exists a statement S j that uses x


ii. There is a path from S i to S j in the flow graph corresponding to the program
iii. The path has no intervening assignment to x including at S i and S j

The variables which are live both at the statement in basic block 2 and at the statement in basic block 3 of the above control
flow graph are

A. p, s, u
B. r, s, u
C. r, u
D. q, v

gate2015-1 compiler-design live-variable normal

2.61 Macros: GATE1995_1.11 top gateoverflow.in/2598

What are x and y in the following macro definition?

macro Add x, y
Load y
Mul x
Store y
end macro

A. Variables
B. Identifiers

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 131 of 852

C. Actual parameters
D. Formal parameters

gate1995 compiler-design macros easy

2.62 Macros: GATE1996_2.16 top gateoverflow.in/2745

Which of the following macros can put a macro assembler into an infinite loop?

(i)

i. .MACRO M1, X
.IF EQ, X ;if X=0 then
M1 X + 1
.ENDC
.IF NE, X ;if X O then
.WORD X ;address (X) is stored here
.ENDC
.ENDM

(ii)

ii. .MACRO M2, X


.IF EQ, X
M2 X
.ENDC
.IF NE, X
.WORD X + 1
.ENDC
.ENDM

A. (ii) only
B. (i) only
C. both (i) and (ii)
D. None of the above

gate1996 compiler-design macros normal

2.63 Macros: GATE1997_1.9 top gateoverflow.in/2225

The conditional expansion facility of macro processor is provided to

a. test a condition during the execution of the expanded program


b. to expand certain model statements depending upon the value of a condition during the execution of the expanded
program
c. to implement recursion
d. to expand certain model statements depending upon the value of a condition during the process of macro expansion

gate1997 compiler-design macros easy

2.64 Macros: GATE1992_01,vii top gateoverflow.in/552

Macro expansion is done in pass one instead of pass two in a two pass macro assembler because _________

gate1992 compiler-design macros easy

2.65 Parameter Passing: GATE1991_03,x top gateoverflow.in/524

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Indicate all the true statements from the following:

(a). Recursive descent parsing cannot be used for grammar with left recursion.

(b). The intermediate form for representing expressions which is best suited for code optimization is the postfix form.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 132 of 852

(c). A programming language not supporting either recursion or pointer type does not need the support of dynamic memory
allocation.

(d). Although C does not support call-by-name parameter passing, the effect can be correctly simulated in C

(e). No feature of Pascal typing violates strong typing in Pascal.

gate1991 compiler-design parameter-passing programming difficult

2.66 Parameter Passing: GATE 2016-1-36 top gateoverflow.in/39701

What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is
assumed?

a = 3;
void n(x) { x = x * a; print (x); }
void m(y) { a = 1 ; a = y - a; n(a); print (a); }
void main () { m(a); }

A. 6, 2
B. 6, 6
C. 4, 2
D. 4, 4

gate2016-1 parameter-passing normal

2.67 Parsing: GATE1998_1.26 top gateoverflow.in/1663

Which of the following statements is true?

A. SLR paper is more powerful than LALR

B. LALR parser is more powerful than Canonical LR parser

C. Canonical LR parser is more powerful than LALR parser

D. The parsers SLR, Canonical CR, and LALR have the same power

gate1998 compiler-design parsing normal

2.68 Parsing: GATE2006_07 top gateoverflow.in/886

Consider the following grammar

S S * E
S E
E F + E
E F
F id
Consider the following LR(0) items corresponding to the grammar above

(i) S S *.E
(ii) E F. + E
(iii) E F + .E

Given the items above, which two of them will appear in the same set in the canonical sets-of-items for the grammar?

(A) (i) and (ii)


(B) (ii) and (iii)
(C) (i) and (iii)
(D) None of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 133 of 852

gate2006 compiler-design parsing normal

2.69 Parsing: GATE1998_22 top gateoverflow.in/1737

a. An identifier in a programming language consists of up to six letters and digits of which the first character must be a
letter. Derive a regular expression for the identifier.

b. Build an LL(1) parsing table for the language defined by the LL(1) grammar with productions

Program begin d semi X end


X d semi X sY
Y semi sY

gate1998 compiler-design parsing descriptive

2.70 Parsing: GATE1995_8 top gateoverflow.in/2643

Construct the LL(1) table for the following grammar.

1. Expr _Expr
2. Expr (Expr)
3. Expr V ar ExprT ail
4. ExprT ail _Expr
5. Expr
6. V ar Id V arT ail
7. V arT ail (Expr)
8. V arT ail
9. Goal Expr$

gate1995 compiler-design parsing normal

2.71 Parsing: GATE2003_16 top gateoverflow.in/906

Which of the following suffices to convert an arbitary CFG to an LL(1) grammar?

A. Removing left recursion alone


B. Factoring the grammar alone
C. Removing left recursion and factoring the grammar
D. None of the above

gate2003 compiler-design parsing easy

2.72 Parsing: TIFR2012-B-8 top gateoverflow.in/25108

Consider the parse tree

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 134 of 852

Assume that has higher precedence than + , and operators associate right to left (i.e (a + b + c = (a + (b + c))).
Consider

(i) 2 + a b

(ii) 2 + a b a + b

(iii) 2 + ((a b) (a + b)))

(iv) 2 + (a b) (a + b)

The parse tree corresponds to

a. Expression (i)
b. Expression (ii)
c. Expression (iv) only
d. Expression (ii), (iii), and (iv)
e. Expression (iii) and (iv) only

tifr2012 compiler-design parsing

2.73 Parsing: GATE2013_9 top gateoverflow.in/1418

What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon and
unit-production (i.e., of type A and A a ) to parse a string with n tokens?

(A) n/2

(B) n 1

(C) 2n 1

(D) 2n

gate2013 compiler-design parsing normal

2.74 Parsing: GATE2003_17 top gateoverflow.in/907

Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. The relationship
between n1 and n2 is

A. n1 is necessarily less than n2


B. n1 is necessarily equal to n2
C. n1 is necessarily greater than n2
D. None of the above

gate2003 compiler-design parsing easy

2.75 Parsing: TIFR2012-B-17 top gateoverflow.in/25215

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 135 of 852

Which of the following correctly describes LR(k) parsing?

a. The input string is alternately scanned left to right and right to left with k reversals.
b. Input string is scanned once left to right with rightmost derivation and k symbol look-ahead.
c. LR(k) grammers are expressively as powerful as context-free grammers.
d. Parser makes k left-to-right passes over input string.
e. Input string is scanned from left to right once with k symbol to the right as look-ahead to give left-most derivation.

tifr2012 compiler-design parsing

2.76 Parsing: GATE2002_22 top gateoverflow.in/875

a. Construct all the parse trees corresponding to i + j * k for the grammar


E E+E
E E*E
E id
b. In this grammar, what is the precedence of the two operators * and +?
c. If only one parse tree is desired for any string in the same language, what changes are to be made so that the resulting
LALR(1) grammar is unambiguous?

gate2002 compiler-design parsing normal

2.77 Parsing: GATE2003_57 top gateoverflow.in/945

Consider the grammar shown below.

S C C

C c C | d

This grammar is

A. LL(1)
B. SLR(1) but not LL(1)
C. LALR(1) but not SLR(1)
D. LR(I) but not LALR(1)

gate2003 compiler-design grammar parsing normal

2.78 Parsing: GATE2001_16 top gateoverflow.in/757

Consider the following grammar with terminal alphabet {a, (, ), + , } and start symbol E. The production rules of the
grammar are:

E aA
E (E)
A +E
A E
A
a. Compute the FIRST and FOLLOW sets for E and A.
b. Complete the LL(1) parse table for the grammar.

gate2001 compiler-design parsing normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 136 of 852

2.79 Parsing: GATE2005-IT_83a top gateoverflow.in/3849

Consider the context-free grammar

E E + E
E (E * E)
E id

where E is the starting symbol, the set of terminals is {id, (,+,),*}, and the set of nonterminals is {E}.
Which of the following terminal strings has more than one parse tree when parsed according to the above grammar?


A) id + id + id + id
B) id + (id* (id * id))
C) (id* (id * id)) + id
D) ((id * id + id) * id)

gate2005-it compiler-design grammar parsing easy

2.80 Parsing: GATE2005-IT_83b top gateoverflow.in/3850

Consider the context-free grammar

E E + E
E (E * E)
E id

where E is the starting symbol, the set of terminals is {id, (,+,),*}, and the set of non-terminals is {E}.

For the terminal string id + id + id + id, how many parse trees are possible?

A) 5
B) 4
C) 3
D) 2

gate2005-it compiler-design parsing normal

2.81 Parsing: GATE2015-1_13 top gateoverflow.in/8187

Which one of the following is TRUE at any valid state in shift-reduce parsing?

A. Viable prefixes appear only at the bottom of the stack and not inside
B. Viable prefixes appear only at the top of the stack and not inside
C. The stack contains only a set of viable prefixes
D. The stack never contains viable prefixes

gate2015-1 compiler-design parsing normal

2.82 Parsing: GATE1998_1.27 top gateoverflow.in/1664

Type checking is normally done during

(a) lexical analysis

(b) syntax analysis

(c) syntax directed translation

(d) code optimization

gate1998 compiler-design parsing easy

2.83 Parsing: GATE2000_1.19 top gateoverflow.in/642

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 137 of 852

Which of the following derivations does a top-down parser use while parsing an input string? The input is assumed to be
scanned in left to right order.

A. Leftmost derivation
B. Leftmost derivation traced out in reverse
C. Rightmost derivation
D. Rightmost derivation traced out in reverse

gate2000 compiler-design parsing normal

2.84 Parsing: GATE2008-IT_79 top gateoverflow.in/3393

A CFG G is given with the following productions where S is the start symbol, A is a non-terminal and a and b are terminals.

S aS A
A aAb bAa
For the correct answer in above Question http://gateoverflow.in/3392/gate2008-it_78, how many steps are required to
derive the string and how many parse trees are there?

A) 6 and 1

B) 6 and 2

C) 7 and 2
D) 4 and 2

gate2008-it compiler-design context-free parsing normal

2.85 Parsing: GATE1993_25 top gateoverflow.in/2321

A simple Pascal like language has only three statements.

i. assignment statement e.g. x:=expression


ii. loop construct e.g. for i:=expression to expression do statement
iii. sequencing e.g. begin statement ;; statement end

A. Write a context-free grammar (CFG) for statements in the above language. Assume that expression has already been
defined. Do not use optional parenthesis and * operator in CFG.
B. Show the parse tree for the following statements:
for j:=2 to 10 do
begin
x:=expr1;
y:=expr2;
end

gate1993 compiler-design parsing normal

2.86 Parsing: GATE2015-3_16 top gateoverflow.in/8413

Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is
very easy to implement and the method that is the most powerful, in that order?

A. SLR, LALR

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 138 of 852

B. Canonical LR, LALR


C. SLR, canonical LR
D. LALR, canonical LR

gate2015-3 compiler-design parsing normal

2.87 Parsing: GATE1992_02,xiv top gateoverflow.in/571

Choose the correct alternatives (more than one may be correct ) and write the corresponding letters only:

Consider the SLR(1) and LALR(1) parsing tables for a context free grammar. Which of the following statement is/are
true?

(a). The goto part of both tables may be different.

(b). The shift entries are identical in both the tables.

(c). The reduce entries in the tables may be different.

(d). The error entries in tables may be different

gate1992 compiler-design normal parsing

2.88 Parsing: GATE2015-3_31 top gateoverflow.in/8488

Consider the following grammar G

S F | H

F p | c

H d | c

Where S, F, and H are non-terminal symbols, p, d, and c are terminal symbols. Which of the following statement(s) is/are
correct?

S1: LL(1) can parse all strings that are generated using grammar G

S2: LR(1) can parse all strings that are generated using grammar G

A. Only S1
B. Only S2
C. Both S1 and S2
D. Neither S1 and S2

gate2015-3 compiler-design parsing normal

2.89 Parsing: TIFR2015-B-15 top gateoverflow.in/30079

Consider the following grammar (the start symbol is E) for generating expressions.

E T E|T + E|T
T T F |F
F 0|1|2|3|4|5|6|7|8|9
With respect to this grammar, which of the following trees is the valid evaluation tree for the expression
2 3 4 5 6 + 7?
(a)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 139 of 852

(b)

(c)

(d)

(e)

tifr2015 parsing

2.90 Parsing: GATE1999_1.17 top gateoverflow.in/1470

Which of the following is the most powerful parsing method?

A. LL (1)
B. Canonical LR
C. SLR
D. LALR

gate1999 compiler-design parsing easy

2.91 Parsing: GATE2006_58 top gateoverflow.in/1836

Consider the following grammar:

S FR

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 140 of 852

S FR
R S

F id
In the predictive parser table, M, of the grammar the entries M[S,id] and M[R,$] respectively are

(A) {S F R} and {R }

(B) {S F R} and {}

(C) {S F R} and {R S}

(D) {F id} and {R }

gate2006 compiler-design parsing normal

2.92 Parsing: GATE2011_27 top gateoverflow.in/2129

Consider two binary operators and with the precedence of operator being lower than that of the operator .
Operator is right associative while operator is left associative. Which one of the following represents the parse tree for
expression (7 3 4 3 2)

(A)

(B)

(C)

(D)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 141 of 852

gate2011 compiler-design parsing normal

2.93 Parsing: GATE2013_40 top gateoverflow.in/1551

Consider the following two sets of LR(1) items of an LR(1) grammar.

X c.X, c/d X c.X, $


X .cX, c/d X .cX, $
X .d, c/d X .d, $

Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are FALSE?

1. Cannot be merged since look aheads are different.

2. Can be merged but will result in S-R conflict.

3. Can be merged but will result in R-R conflict.

4. Cannot be merged since goto on c will lead to two different sets.

(A) 1 only (B) 2 only (C) 1 and 4 only (D) 1, 2, 3 and 4

gate2013 compiler-design parsing normal

2.94 Parsing: GATE2009_42 top gateoverflow.in/1328

Which of the following statements are TRUE?

I. There exist parsing algorithms for some programming languages whose complexities are less than (n3 )
II. A programming language which allows recursion can be implemented with static storage allocation.

III. No L-attributed definition can be evaluated in the framework of bottom-up parsing.

IV. Code improving transformations can be performed at both source language and intermediate code level.

A. I and II
B. I and IV
C. III and IV
D. I, III and IV

gate2009 compiler-design parsing normal

2.95 Parsing: GATE2012-53 top gateoverflow.in/43312

For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 142 of 852

filled are indicated as E1, E2, and E3. is the empty string, $ indicates end of input, and, separates alternate right hand
sides of productions.

S aAbB bAaB
AS
BS

a b $

S E1 E2 S

AA S A S error

BB S B S E3

The appropriate entries for E1, E2, and E3 are

(A)

E1 : S aAbB, A S
E2 : S bAaB, B S
E1 : B S

(B)

E1 : S aAbB, S
E2 : S bAaB, S
E3 : S

(C)

E1 : S aAbB, S
E2 : S bAaB, S
E3 : B S

(D)

E1 : A S, S
E2 : B S, S
E3 : B S

normal gate2012 compiler-design parsing

2.96 Parsing: GATE2005_83 top gateoverflow.in/1405

Statement for Linked Answer Questions 83a & 83b:

Consider the following expression grammar. The semantic rules for expression evaluation are stated next to each grammar
production.

E number E. val = number.val


|E '+' E E (1) . val = E (2) . val + E (3) . val
|E ' ' E E (1) . val = E (2) . val E (3) . val

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 143 of 852

(A) The above grammar and the semantic rules are fed to a yaac tool (which is an LALR(1) parser generator) for parsing
and evaluating arithmetic expressions. Which one of the following is true about the action of yaac for the given grammar?

A. It detects recursion and eliminates recursion

B. It detects reduce-reduce conflict, and resolves

C. It detects shift-reduce conflict, and resolves the conflict in favor of a shift over a reduce action

D. It detects shift-reduce conflict, and resolves the conflict in favor of a reduce over a shift action

(B) Assume the conflicts in Part(a) of this question are resolved and an LALR(1) parser is generated for parsing arithmetic
expressions as per the given grammar. Consider an expression 3 2 + 1. What precedence and associativity properties does
the generated parser realize?

A. Equal precedence and left associativity; expression is evaluated to 7

B. Equal precedence and right associativity; expression is evaluated to 9

C. Precedence of is higher than that of +, and both operators are left associative; expression is evaluated to 7

D. Precedence of + is higher than that of , and both operators are left associative; expression is evaluated to 9

gate2005 compiler-design parsing normal

2.97 Parsing: GATE2005_60 top gateoverflow.in/1383

Consider the grammar:

S (S) a
Let the number of states in SLR (1), LR(1) and LALR(1) parsers for the grammar be n1 , n2 and n3 respectively. The following
relationship holds good:

A. n1 < n2 < n3
B. n1 = n3 < n2
C. n1 = n2 = n3
D. n1 n3 n2

gate2005 compiler-design parsing normal

2.98 Parsing: GATE2005_14 top gateoverflow.in/1350

The grammar A AA (A) is not suitable for predictive-parsing because the grammar is:

A. ambiguous

B. left-recursive

C. right-recursive

D. an operator-grammar

gate2005 compiler-design parsing grammar easy

2.99 Parsing: GATE2007_18 top gateoverflow.in/1216

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 144 of 852

Which one of the following is a top-down parser?

A. Recursive descent parser.

B. Operator precedence parser.

C. An LR(k) parser.

D. An LALR(k) parser.

gate2007 compiler-design parsing normal

2.100 Parsing: GATE2012-52 top gateoverflow.in/2181

For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be
filled are indicated as E1, E2, and E3. is the empty string, $ indicates end of input, and, separates alternate right hand
sides of productions.

S aAbB bAaB
AS
BS

a b $

S E1 E2 S

A AS AS error

B BS BS E3

The FIRST and FOLLOW sets for the non-terminals A and B are

(A)

FIRST(A) = {a, b, } = FIRST(B)


FOLLOW(A) = {a, b}
FOLLOW(B) = {a, b, $}

(B)

FIRST(A) = {a, b, $}
FIRST(B) = {a, b, }
FOLLOW(A) = {a, b}
FOLLOW(B) = {$}

(C)

FIRST(A) = {a, b, } = FIRST(B)


FOLLOW(A) = {a, b}
FOLLOW(B) =

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 145 of 852

(D)

FIRST(A) = {a, b} = FIRST(B)


FOLLOW(A) = {a, b}
FOLLOW(B) = {a, b}

gate2012 compiler-design parsing normal

2.101 Parsing: GATE2008_55 top gateoverflow.in/478

An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if

A. The SLR(1) parser for G has S-R conflicts

B. The LR(1) parser for G has S-R conflicts

C. The LR(0) parser for G has S-R conflicts

D. The LALR(1) parser for G has reduce-reduce conflicts

gate2008 compiler-design parsing normal

2.102 Parsing: GATE2008_11 top gateoverflow.in/409

Which of the following describes a handle (as applicable to LR-parsing) appropriately?

A. It is the position in a sentential form where the next shift or reduce operation will occur

B. It is non-terminal whose production will be used for reduction in the next step

C. It is a production that may be used for reduction in a future step along with a position in the sentential form where the
next shift or reduce operation will occur

D. It is the production p that will be used for reduction in the next step along with a position in the sentential form where
the right hand side of the production may be found

gate2008 compiler-design parsing normal

2.103 Parsing: GATE2014-1_34 top gateoverflow.in/1807

A canonical set of items is given below

S L. > R
Q R.
On input symbol < the set has

(A) a shift-reduce conflict and a reduce-reduce conflict.

(B) a shift-reduce conflict but not a reduce-reduce conflict.

(C) a reduce-reduce conflict but not a shift-reduce conflict.

(D) neither a shift-reduce nor a reduce-reduce conflict.

gate2014-1 compiler-design parsing normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 146 of 852

2.104 Parsing: GATE 2016-1-45 top gateoverflow.in/39697

The attribute of three arithmetic operators in some programming language are given below.

OPERATOR PRECEDENCE ASSOCIATIVITY ARITY


+ high Left Binary
- Medium Right Binary
* Low Left Binary

The value of the expression 2 5 + 1 7 3 in this language is ________.

gate2016-1 compiler-design parsing normal numerical-answers

2.105 Parsing: GATE1992_02,xiii top gateoverflow.in/570

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

For a context free grammar, FOLLOW(A) is the set of terminals that can appear immediately to the right of non-terminal A
in some "sentential" form. We define two sets LFOLLOW(A) and RFOLLOW(A) by replacing the word "sentential" by "left
sentential" and "right most sentential" respectively in the definition of FOLLOW (A).

(a). FOLLOW(A) and LFOLLOW(A) may be different.

(b). FOLLOW(A) and RFOLLOW(A) are always the same.

(c). All the three sets are identical.

(d). All the three sets are different.

gate1992 parsing compiler-design normal

2.106 Postfix: GATE1998_19b top gateoverflow.in/15708

Compute the post fix equivalent of the following expression 3 log(x + 1) a2

gate1998 compiler-design postfix

2.107 Programming In C: GATE2005_61 top gateoverflow.in/4066

Consider line number 3 of the following C-program.


int main() { /*Line 1 */
int I, N; /*Line 2 */
fro (I=0, I<N, I++); /*Line 3 */
}

Identify the compilers response about this line while creating the object-module:

A. No compilation error

B. Only a lexical error

C. Only syntactic errors

D. Both lexical and syntactic errors

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 147 of 852

gate2005 compiler-design programming-in-c normal

2.108 Recursion: GATE2014-3_18 top gateoverflow.in/2052

Which of the following statements are CORRECT?

1. Static allocation of all data areas by a compiler makes it impossible to implement recursion.
2. Automatic garbage collection is essential to implement recursion.
3. Dynamic allocation of activation records is essential to implement recursion.
4. Both heap and stack are essential to implement recursion.

(A) 1 and 2 only

(B) 2 and 3 only

(C) 3 and 4 only

(D) 1 and 3 only

gate2014-3 compiler-design recursion normal

2.109 Register Allocation: GATE2010_37 top gateoverflow.in/2338

The program below uses six temporary variables a, b, c, d, e, f .


a = 1
b = 10
c = 20
d = a + b
e = c + d
f = c + e
b = c + e
e = b + f
d = 5 + e
return d + f

Assuming that all operations take their operands from registers, what is the minimum number of registers needed to execute this program without spilling?

(A) 2

(B) 3

(C) 4

(D) 6

gate2010 compiler-design target-code-generation register-allocation normal

2.110 Register Allocation: GATE1997_4.9 top gateoverflow.in/2250

The expression (a b) c op
where op is one of +, * and (exponentiation) can be evaluated on a CPU with single register without storing the value
of (a * b) if

A. op is + or *

B. op is or *

C. op is or +

D. not possible to evaluate without storing

gate1997 compiler-design target-code-generation register-allocation normal

2.111 Register Allocation: GATE2011_36 top gateoverflow.in/2138

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 148 of 852

Consider evaluating the following expression tree on a machine with load-store architecture in which memory can be
accessed only through load and store instructions. The variables a, b, c, d, and e are initially stored in memory. The binary
operators used in this expression tree can be evaluated by the machine only when operands are in registers. The instructions
produce result only in a register. If no intermediate results can be stored in memory, what is the minimum number of
registers needed to evaluate this expression?

(A) 2

(B) 9

(C) 5

(D) 3

gate2011 compiler-design register-allocation normal

2.112 Runtime Environments: GATE1998_1.28 top gateoverflow.in/1665

A linker reads four modules whose lengths are 200, 800, 600 and 500 words, respectively. If they are loaded in that order,
what are the relocation constants?

A. 0, 200, 500, 600


B. 0, 200, 1000, 1600
C. 200, 500, 600, 800
D. 200, 700, 1300, 2100

gate1998 compiler-design runtime-environments normal

2.113 Runtime Environments: GATE1995_1.14 top gateoverflow.in/2601

A linker is given object modules for a set of programs that were compiled separately. What information need to be included
in an object module?

A. Object code

B. Relocation bits

C. Names and locations of all external symbols defined in the object module

D. Absolute addresses of internal symbols

gate1995 compiler-design runtime-environments normal

2.114 Runtime Environments: GATE1998_1.25 top gateoverflow.in/1662

In a resident OS computer, which of the following systems must reside in the main memory under all situations?

A. Assembler
B. Linker

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 149 of 852

C. Loader
D. Compiler

gate1998 compiler-design runtime-environments normal

2.115 Runtime Environments: GATE2001_1.17 top gateoverflow.in/710

The process of assigning load addresses to the various parts of the program and adjusting the code and the date in the
program to reflect the assigned addresses is called

A. Assembly
B. parsing
C. Relocation
D. Symbol resolution

gate2001 compiler-design runtime-environments easy

2.116 Runtime Environments: GATE1993_7.7 top gateoverflow.in/2295

A part of the system software which under all circumstances must reside in the main memory is:

a. text editor
b. assembler
c. linker
d. loader
e. none of the above

gate1993 compiler-design runtime-environments easy

2.117 Static Single Assignment: GATE 2016-1-19 top gateoverflow.in/39675

Consider the following code segment.

x = u - t;
y = x * v;
x = y + w;
y = t - z;
y = x * y;

The minimum number of total variables required to convert the above code segment to static single assignment form is
__________.

gate2016-1 compiler-design static-single-assignment normal numerical-answers

2.118 Syntax Directed Translation: GATE 2016-1-46 top gateoverflow.in/39700

Consider the following Syntax Directed Translation Scheme (SDT S), with non-terminals {S, A} and terminals {a, b}.

S aA {print 1}
S a {print 2}
A Sb {print 3}
Using the above SDT S , the output printed by a bottom-up parser, for the input aab is:
A. 1 3 2
B. 2 2 3

2 3 1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 150 of 852

C. 2 3 1
D. syntax error

gate2016-1 compiler-design syntax-directed-translation normal

2.119 Syntax Directed Translation: GATE1994_23 top gateoverflow.in/2519

Suppose we have a computer with single register and only three instructions given below:

LOAD addren ; load register


; from addren
STORE addren ; store register
; at addren

ADD addren ; add register to


; contents of addren
; and place the result
; in the register

Consider the following grammar:

A id := E EE+T T T (E) id

Write a syntax directed translation to generate code using this grammar for the computer described above.

gate1994 compiler-design grammar syntax-directed-translation normal

2.120 Syntax Directed Translation: GATE1996_20 top gateoverflow.in/2772

Consider the syntax-directed translation schema (SDTS) shown below:

E E + E {print +}
E E E {print .}
E id {print id.name}
E (E)
An LR-parser executes the actions associated with the productions immediately after a reduction by the corresponding
production. Draw the parse tree and write the translation for the sentence.

(a + b) (c + d), using SDTS given above.


gate1996 compiler-design syntax-directed-translation normal

2.121 Syntax Directed Translation: GATE1995_2.10 top gateoverflow.in/2622

A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of
grammar

S xxW {print"1"}
S y{print"2"}
W Sz{print"3"}
What is the translation of xxxxyzz using the syntax directed translation scheme described by the above rules?

A. 23131
B. 11233
11231

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 151 of 852

C. 11231
D. 33211

gate1995 compiler-design grammar syntax-directed-translation normal

2.122 Syntax Directed Translation: GATE2003_18 top gateoverflow.in/908

In a bottom-up evaluation of a syntax directed definition, inherited attributes can

A. always be evaluated
B. be evaluated only if the definition is L-attributed
C. be evaluated only if the definition has synthesized attributes
D. never be evaluated

gate2003 compiler-design syntax-directed-translation normal

2.123 Syntax Directed Translation: GATE2000_19 top gateoverflow.in/690

Consider the syntax directed translation scheme (SDTS) given in the following. Assume attribute evaluation with bottom-up parsing, i.e.,
attributes are evaluated immediately after a reduction.

E E1 * T {E.val = E1 .val * T.val}

E T {E.val = T.val}

T F - T1 {T.val = F.val - T1 .val}

T F {T.val = F.val}

F 2 {F.val = 2}

F 4 {F.val = 4}

a. Using this SDTS, construct a parse tree for the expression 4 - 2 - 4 * 2 and also compute its E.val.
b. It is required to compute the total number of reductions performed to parse a given input. Using synthesized attributes only, modify the
SDTS given, without changing the grammar, to find E.red, the number of reductions performed while reducing an input to E.

gate2000 compiler-design syntax-directed-translation normal

2.124 Syntax Directed Translation: GATE1997_23 top gateoverflow.in/2283

The language L, defined by the following grammar, allows use of real or integer data in expressions and assignment
statements.

gate1997 compiler-design syntax-directed-translation normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 152 of 852

2.125 Syntax Directed Translation: GATE1998_23 top gateoverflow.in/1738

Let the attribute val give the value of a binary number generated by S in the following grammar:

S L. L L

L LB B

B01

For example, an input 101.101 gives S. val = 5.625


Construct a syntax directed translation scheme using only synthesized attributes, to determine S. val.

gate1998 compiler-design syntax-directed-translation normal

2.126 Target Code Generation: GATE2003_59 top gateoverflow.in/947

Consider the syntax directed definition shown below.

S id := E {gen(id.place = E.place;);}

E E1 + E2 {t = newtemp();
gen(t = E1 .place + E2 place;);
E.place = t;}
E id {E.place = id.place;}

Here, gen is a function that generates the output code, and newtemp is a function that returns the name of a new temporary
variable on every call. Assume that ti's are the temporary variable names generated by newtemp. For the statement X : = Y
+ Z, the 3-address code sequence generated by this definition is

A. X = Y + Z
B. t1 = Y + Z; X = t1
C. t1 = Y ; t2 = t1 + Z; X = t2
D. t1 = Y ; t2 = Z; t3 = t1 + t2 ; X = t3

gate2003 compiler-design target-code-generation normal

2.127 Target Code Generation: GATE2004_10 top gateoverflow.in/4069

Consider the grammar rule E E1 E2 for arithmetic expressions. The code generated is targeted to a CPU having a single user register.
The subtraction operation requires the first operand to be in the register. If E1 and E2 do not have any common sub expression, in order to get
the shortest possible code

(A) E1 should be evaluated first


(B) E2 should be evaluated first
(C) Evaluation of E1 and E2 should necessarily be interleaved
(D) Order of evaluation of E1 and E2 is of no consequence

gate2004 compiler-design target-code-generation normal

2.128 GATE2009_17 top gateoverflow.in/1309

Match all items in Group 1 with the correct options from those given in Group 2.

Group 1 Group 2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 153 of 852

P. Regular Expression 1. Syntax analysis


Q. Pushdown automata 2. Code generation
R. Dataflow analysis 3. Lexical analysis
S. Register allocation 4. Code optimization

A. P-4, Q-1, R-2, S-3


B. P-3, Q-1, R-4, S-2
C. P-3, Q-4, R-1, S-2
D. P-2, Q-1, R-4, S-3

gate2009 compiler-design easy

2.129 GATE2014-3_11 top gateoverflow.in/2045

The minimum number of arithmetic operations required to evaluate the polynomial P(X) = X 5 + 4 X 3 + 6X + 5 for a given value of X, using only one
temporary variable is ______.

gate2014-3 compiler-design numerical-answers normal

2.130 GATE1991_03,ix top gateoverflow.in/519

Choose the correct alternatives (more than one may be correct ) and write the corresponding letters only

A link editor is a program that:

(a). matches the parameters of the macro-definition with locations of the parameters of the macro call

(b). matches external names of one program with their location in other programs

(c). matches the parameters of subroutine definition with the location of parameters of subroutine call.

(d). acts as a link between text editor and the user

(e). acts as a link between compiler and the user program

gate1991 compiler-design normal

2.131 GATE1997_1.7 top gateoverflow.in/2223

Which of the following is essential for converting an infix expression to the postfix form efficiently?

a. An operator stack
b. An operand stack
c. An operand stack and an operator stack
d. A parse tree

gate1997 compiler-design normal

2.132 GATE2014-2_18 top gateoverflow.in/1975

Which one of the following is NOT performed during compilation?

(A) Dynamic memory allocation

(B) Type checking

(C) Symbol table management

(D) Inline expansion

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 154 of 852

gate2014-2 compiler-design easy

2.133 GATE2014-2_39 top gateoverflow.in/1999

Consider the expression tree shown. Each leaf represents a numerical value, which can either be 0 or 1. Over all possible choices of the values at the leaves, the
maximum possible value of the expression represented by the tree is ___.

gate2014-2 compiler-design normal

2.134 GATE 2016-2-19 top gateoverflow.in/39548

Match the following:

(P) Lexical analysis (i) Leftmost derivation

(Q) Top down parsing (ii) Type checking

(R) Semantic analysis (iii) Regular expressions

(S) Runtime environment (iv) Activation records

A. P i, Q ii, R iv, S iii


B. P iii, Q i, R ii, S iv
C. P ii, Q iii, R i, S iv
D. P iv, Q i, R ii, S iii

gate2016-2 compiler-design easy

2.135 GATE1994_18 top gateoverflow.in/2514

State whether the following statements are True or False with reasons for your answer

a. A subroutine cannot always be used to replace a macro in an assembly language program.

b. A symbol declared as external in an assembly language program is assigned an address outside the program by the
assembler itself.

gate1994 compiler-design normal

2.136 GATE1996_1.17 top gateoverflow.in/2721

The pass numbers for each of the following activities

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 155 of 852

i. object code generation

ii. literals added to literal table

iii. listing printed

iv. address resolution of local symbols that occur in a two pass assembler

respectively are

A. 1, 2, 1, 2

B. 2, 1, 2, 1

C. 2, 1, 1, 2

D. 1, 2, 2, 2

gate1996 compiler-design normal

2.137 GATE2015-2_14 top gateoverflow.in/8084

In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE?

A. In both AST and CFG, let node N2 be the successor of node N1 . In the input program, the code corresponding to N2 is
present after the code cprresponding to N1
B. For any input program, neither AST nor CFG will contain a cycle
C. The maximum number of successors of a node in an AST and a CFG depends on the input program
D. Each node in AST and CFG corresponds to at most one statement in the input program

gate2015-2 compiler-design easy

2.138 GATE1994_17 top gateoverflow.in/2513

State whether the following statements are True or False with reasons for your answer:

a. Coroutine is just another name for a subroutine.

b. A two pass assembler uses its machine opcode table in the first pass of assembly.

gate1994 compiler-design normal

2.139 GATEFORUM Section Test 1 (que no. 14th ) top gateoverflow.in/36739

2.140 GATE2004_9 top gateoverflow.in/1006

M1 M2 M1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 156 of 852

Consider a program P that consists of two source modules M1 and M2 contained in two different files. If M1 contains a
reference to a function defined in M2 the reference will be resolved at

A. Edit time
B. Compile time
C. Link time
D. Load time

gate2004 compiler-design easy

2.141 GATE2015-2_19 top gateoverflow.in/8098

Match the following:

P. Lexical analysis 1. Graph coloring

Q. Parsing 2. DFA minimization

R. Register allocation 3. Post-order traversal

S. Express evaluation 4. Production tree

A. P-2, Q-3, R-1, S-4


B. P-2, Q-1, R-4, S-3
C. P-2, Q-4, R-1, S-3
D. P-2, Q-3, R-4, S-1

gate2015-2 compiler-design normal

2.142 GATE1997_1.8 top gateoverflow.in/2224

A language L allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use
of memory. Which one of the following is true?

a. A compiler using static memory allocation can be written for L


b. A compiler cannot be written for L ; an interpreter must be used
c. A compiler using dynamic memory allocation can be written for L
d. None of the above

gate1997 compiler-design easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 157 of 852

3 CO & Architecture top


3.1 Addressing Modes: GATE2006-IT_39 top gateoverflow.in/3578

Which of the following statements about relative addressing mode is FALSE?

A) It enables reduced instruction size


B) It allows indexing of array elements with same instruction
C) It enables easy relocation of data
D) It enables faster address calculations than absolute addressing

gate2006-it co&architecture addressing-modes normal

3.2 Addressing Modes: GATE2006-IT_40 top gateoverflow.in/3581

The memory locations 1000, 1001 and 1020 have data values 18, 1 and 16 respectively before the following program is
executed.
MOVI Rs, 1 ; Move immediate
LOAD Rd, 1000(Rs) ; Load from memory
ADDI Rd, 1000 ; Add immediate
STOREI 0(Rd), 20 ; Store immediate

Which of the statements below is TRUE after the program is executed ?

A) Memory location 1000 has value 20


B) Memory location 1020 has value 20
C) Memory location 1021 has value 20
D) Memory location 1001 has value 20

gate2006-it co&architecture addressing-modes normal

3.3 Addressing Modes: GATE1999_2.23 top gateoverflow.in/1500

A certain processor supports only the immediate and the direct addressing modes. Which of the following programming
language features cannot be implemented on this processor?

A. Pointers
B. Arrays
C. Records
D. Recursive procedures with local variable

gate1999 co&architecture addressing-modes normal

3.4 Addressing Modes: GATE2001_2.9 top gateoverflow.in/727

Which is the most appropriate match for the items in the first column with the items in the second column

X. Indirect Addressing I. Array implementation


Y. Indexed addressing II. Writing relocatable code
Z. Base Register Addressing III. Passing array as parameter

(A) (X, III) (Y, I) (Z, II)

(B) (X, II) (Y, III) (Z, I)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 158 of 852

(C) (X, III) (Y, II) (Z, I)

(D) (X, I) (Y, III) (Z, II)

gate2001 co&architecture addressing-modes normal

3.5 Addressing Modes: GATE1996_1.16 top gateoverflow.in/2720

Relative mode of addressing is most relevant to writing

A. coroutines

B. position independent code

C. shareable code

D. interrupt handlers

gate1996 co&architecture addressing-modes easy

3.6 Addressing Modes: GATE1993_10 top gateoverflow.in/2307

The instruction format of a CPU is:

OP CODE MODE RegR

_____one memory word___

Mode and RegR together specify the operand. RegR specifies a CPU register and Mode specifies an addressing mode. In
particular, Mode = 2 specifies that the register RegR contains the address of the operand, after fetching the operand, the
contents of R RegR are incremented by 1'.

An instruction at memory location 2000 specifies Mode = 2 and the RegR refers to program counter (PC).

a. What is the address of the operand?

b. Assuming that is a non-jump instruction, what are the contents of PC after the execution of this instruction?

gate1993 co&architecture addressing-modes normal

3.7 Addressing Modes: GATE2011_21 top gateoverflow.in/2123

Consider a hypothetical processor with an instruction of type LW R1 , 20(R2), which during execution reads a 32-bit word from memory and stores it in a 32-
bit register R1. The eective address of the memory location is obtained by the addition of a constant 20 and the contents of register R2. Which of the following
best reflects the addressing mode implemented by this instruction for the operand in memory?

(A) Immediate addressing

(B) Register addressing

(C) Register Indirect Scaled Addressing

(D) Base Indexed Addressing

gate2011 co&architecture addressing-modes easy

3.8 Addressing Modes: GATE2002_1.24 top gateoverflow.in/829

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 159 of 852

In the absolute addressing mode

A. the operand is inside the instruction


B. the address of the operand in inside the instruction
C. the register containing the address of the operand is specified inside the instruction
D. the location of the operand is implicit

gate2002 co&architecture addressing-modes easy

3.9 Addressing Modes: GATE1998_1.19 top gateoverflow.in/1656

Which of the following addressing modes permits relocation without any change whatsoever in the code?

A. Indirect addressing

B. Indexed addressing

C. Base register addressing

D. PC relative addressing

gate1998 co&architecture addressing-modes easy

3.10 Addressing Modes: GATE2005_66 top gateoverflow.in/1389

Match each of the high level language statements given on the left hand side with the most natural addressing mode from
those listed on the right hand side.

(1) A[I] = B[J] (a) Indirect addressing


(2) while (*A++); (b) Indexed addressing
(3) int temp = *x (C) Auto increment

A. (1, c), (2, b) (3, a)


B. (1, c), (2, c) (3, b)
C. (1, b), (2, c) (3, a)
D. (1, a), (2, b) (3, c)

gate2005 co&architecture addressing-modes easy

3.11 Addressing Modes: GATE2005_65 top gateoverflow.in/1388

Consider a three word machine instruction

ADD A[R0], @B

The first operand (destination) A[R0] uses indexed addressing mode with R0 as the index register. The second operand
(source) @B uses indirect addressing mode. A and B are memory addresses residing at the second and third words,
respectively. The first word of the instruction specifies the opcode, the index register designation and the source and
destination addressing modes. During execution of ADD instruction, the two operands are added and stored in the
destination (first operand).

The number of memory cycles needed during the execution cycle of the instruction is:

A. 3
B. 4
C. 5
D. 6

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 160 of 852

gate2005 co&architecture addressing-modes normal

3.12 Addressing Modes: GATE2008_33 top gateoverflow.in/444

Which of the following is/are true of the auto-increment addressing mode?

I. It is useful in creating self-relocating code

II. If it is included in an Instruction Set Architecture, then an additional ALU is required for effective address calculation

III. The amount of increment depends on the size of the data item accessed

A. I only
B. II only
C. III only
D. II and III only

gate2008 addressing-modes co&architecture normal

3.13 Addressing Modes: GATE2004_20 top gateoverflow.in/1017

Which of the following addressing modes are suitable for program relocation at run time?

I. Absolute addressing

II. Based addressing

III. Relative addressing

IV. Indirect addressing

A. (I) and (IV)


B. (I) and (II)
C. (II) and (III)
D. (I), (II) and (IV)

gate2004 co&architecture addressing-modes easy

3.14 Cache: GATE2016-2-32 top gateoverflow.in/39622

The width of the physical address on a machine is 40 bits. The width of the tag field in a 512 KB 8-way set associative cache
is ________ bits.

gate2016-2 computer-organization cache normal numerical-answers

3.15 Cache Memory: GATE2014-2_9 top gateoverflow.in/1963

A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is
32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is ____

gate2014-2 co&architecture cache-memory numerical-answers normal

3.16 Cache Memory: GATE2014-3_44 top gateoverflow.in/2078

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 161 of 852

The memory access time is 1 nanosecond for a read operation with a hit in cache, 5 nanoseconds for a read operation with a miss in cache, 2 nanoseconds for a
write operation with a hit in cache and 10 nanoseconds for a write operation with a miss in cache. Execution of a sequence of instructions involves 100 instruction
fetch operations, 60 memory operand read operations and 40 memory operand write operations. The cache hit-ratio is 0.9. The average memory access time (in
nanoseconds) in executing the sequence of instructions is ______.

gate2014-3 co&architecture cache-memory numerical-answers normal

3.17 Cache Memory: GATE2011_43 top gateoverflow.in/2145

An 8KB direct-mapped write-back cache is organized as multiple blocks, each size of 32-bytes. The processor generates 32-
bit addresses. The cache controller contains the tag information for each cache block comprising of the following.

1 valid bit
1 modified bit
As many bits as the minimum needed to identify the memory block mapped in the cache.

What is the total size of memory needed at the cache controller to store meta-data (tags) for the cache?

(A) 4864 bits

(B) 6144 bits

(C) 6656 bits

(D) 5376 bits

gate2011 co&architecture cache-memory normal

3.18 Cache Memory: GATE2007_10 top gateoverflow.in/1208

Consider a 4-way set associative cache consisting of 128 lines with a line size of 64 words. The CPU generates a 20-bit
address of a word in main memory. The number of bits in the TAG, LINE and WORD fields are respectively:

A. 9, 6, 5
B. 7, 7, 6
C. 7, 5, 8
D. 9, 5, 6

gate2007 co&architecture cache-memory normal

3.19 Cache Memory: GATE2007-80 top gateoverflow.in/1273

Consider a machine with a byte addressable main memory of 2 16 bytes. Assume that a direct mapped data cache consisting
of 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memory
starting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.
Assume that the contents of the data cache do not change in between the two accesses.

How many data misses will occur in total?

A. 48
B. 50
C. 56
D. 59

gate2007 co&architecture cache-memory normal

3.20 Cache Memory: GATE2014-2_43 top gateoverflow.in/2009

In designing a computer's cache system, the cache block (or cache line) size is an important parameter. Which one of the
following statements is correct in this context?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 162 of 852

(A) A smaller block size implies better spatial locality

(B) A smaller block size implies a smaller cache tag and hence lower cache tag overhead

(C) A smaller block size implies a larger cache tag and hence lower cache hit time

(D) A smaller block size incurs a lower cache miss penalty

gate2014-2 co&architecture cache-memory normal

3.21 Cache Memory: GATE2009_29 top gateoverflow.in/1315

Consider a 4-way set associative cache (initially empty) with total 16 cache blocks. The main memory consists of 256 blocks
and the request for memory blocks are in the following order:

0, 255, 1, 4, 3, 8, 133, 159, 216, 129, 63, 8, 48, 32, 73, 92, 155.

Which one of the following memory block will NOT be in cache if LRU replacement policy is used?

A. 3
B. 8
C. 129
D. 216

gate2009 co&architecture cache-memory normal

3.22 Cache Memory: GATE1999_1.22 top gateoverflow.in/1475

The main memory of a computer has 2 cm blocks while the cache has 2c blocks. If the cache uses the set associative
mapping scheme with 2 blocks per set, then block k of the main memory maps to the set

A. (k mod m) of the cache


B. (k mod c) of the cache
C. (k mod 2c) of the cache
D. (k mod 2 cm) of the cache

gate1999 co&architecture cache-memory normal

3.23 Cache Memory: GATE2005_67 top gateoverflow.in/1390

Consider a direct mapped cache of size 32 KB with block size 32 bytes. The CPU generates 32 bit addresses. The number of
bits needed for cache indexing and the number of tag bits are respectively,

A. 10, 17
B. 10, 22
C. 15, 17
D. 5, 17

gate2005 co&architecture cache-memory easy

3.24 Cache Memory: GATE2013_20 top gateoverflow.in/1442

In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are
placed in sequence one after another. The lines in set s are sequenced before the lines in set (s + 1). The main memory
blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from

(A) (j mod v) k to (j mod v) k + (k 1)

(B) (j mod v) to (j mod v) + (k 1)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 163 of 852

(C) (j mod k) to (j mod k) + (v 1)

(D) (j mod k) v to (j mod k) v + (v 1)

gate2013 co&architecture cache-memory normal

3.25 Cache Memory: GATE2012-54 top gateoverflow.in/2192

A computer has a 256-KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor
sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid
bits, 1 modified bit and 1 replacement bit.

The number of bits in the tag field of an address is

A. 11
B. 14
C. 16
D. 27

gate2012 co&architecture cache-memory normal

3.26 Cache Memory: GATE1998_18 top gateoverflow.in/1732

For a set-associative Cache organization, the parameters are as follows:

tc Cache access time


tm Main memory access time
l number of sets
b block size
k*b set size

Calculate the hit ratio for a loop executed 100 times where the size of the loop is n*b, and n = k*m is a non-zero integer and
1 < m 1.

Give the value of the hit ratio for l = 1.

gate1998 co&architecture cache-memory descriptive

3.27 Cache Memory: GATE2006-80 top gateoverflow.in/1854

A CPU has a 32 KB direct mapped cache with 128 byte-block size. Suppose A is two dimensional array of size 512 512 with
elements that occupy 8-bytes each. Consider the following two C code segments, P1 and P2.

P1:

for (i=0; i<512; i++)


{
for (j=0; j<512; j++)
{
x +=A[i] [j];
}
}

P2:

for (i=0; i<512; i++)


{
for (j=0; j<512; j++)
{
x +=A[j] [i];
}
}

P1 and P2 are executed independently with the same initial state, namely, the array A is not in the cache and i, j, x are in
registers. Let the number of cache misses experienced by P1 be M1 and that for P2 be M 2.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 164 of 852

The value of M 1 is:

A. 0
B. 2048
C. 16384
D. 262144

gate2006 co&architecture cache-memory normal

3.28 Cache Memory: GATE2006-74 top gateoverflow.in/1851

Consider two cache organizations. First one is 32 kb 2-way set associative with 32 byte block size, the second is of same size
but direct mapped. The size of an address is 32 bits in both cases . A 2-to-1 multiplexer has latency of 0.6ns while a k bit
k
comparator has latency of 10 ns. The hit latency of the set associative organization is h1 while that of direct mapped is h2 .
The value of h1 is:

A. 2.4 ns
B. 2.3 ns
C. 1.8 ns
D. 1.7 ns

gate2006 co&architecture cache-memory normal

3.29 Cache Memory: GATE2014-1_44 top gateoverflow.in/1922

An access sequence of cache block addresses is of length N and contains n unique block addresses. The number of unique
block addresses between two consecutive accesses to the same block address is bounded above by k. What is the miss ratio
if the access sequence is passed through a cache of associativity A k exercising least-recently-used replacement policy?

(A) n/N

(B) 1/N

(C) 1/A

(D) k/n

gate2014-1 co&architecture cache-memory normal

3.30 Cache Memory: GATE1995_1.6 top gateoverflow.in/2593

The principle of locality justifies the use of

(a) Interrupts
(b) DMA
(c) Polling
(d) Cache Memory

gate1995 co&architecture cache-memory easy

3.31 Cache Memory: GATE2012-55 top gateoverflow.in/43311

A computer has a 256-KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor
sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid
bits, 1 modified bit and 1 replacement bit.

The size of the cache tag directory is

A. 160 Kbits
B. 136 Kbits
C. 40 Kbits
D. 32 Kbits

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 165 of 852

normal gate2012 co&architecture cache-memory

3.32 Cache Memory: GATE2015-3_14 top gateoverflow.in/8410

Consider a machine with a byte addressable main memory of 220 bytes, block size of 16 bytes and a direct mapped cache
having 212 cache lines. Let the addresses of two consecutive bytes in main memory be (E201F )16 and (E2020)16 . What are
the tag and cache line addresses ( in hex) for main memory address (E201F )16 ?

A. E, 201
B. F, 201
C. E, E20
D. 2, 01F

gate2015-3 co&architecture cache-memory normal

3.33 Cache Memory: GATE2015-2_24 top gateoverflow.in/8119

Assume that for a certain processor, a read request takes 50 nanoseconds on a cache miss and 5 nanoseconds on a cache
hit. Suppose while running a program, it was observed that 80% of the processor's read requests result in a cache hit. The
average read access time in nanoseconds is _____.

gate2015-2 co&architecture cache-memory easy

3.34 Cache Memory: GATE2005-IT_61 top gateoverflow.in/3822

Consider a 2-way set associative cache memory with 4 sets and total 8 cache blocks (0-7) and a main memory with 128
blocks (0-127). What memory blocks will be present in the cache after the following sequence of memory block references if
LRU policy is used for cache block replacement. Assuming that initially the cache did not have any memory block from the
current job?
0 5 3 9 7 0 16 55

A) 0 3 5 7 16 55
B) 0 3 5 7 9 16 55
C) 0 5 7 9 16 55
D) 3 5 7 9 16 55

gate2005-it co&architecture cache-memory normal

3.35 Cache Memory: GATE2010-49 top gateoverflow.in/43329

A computer system has an L1 cache, an L2 cache, and a main memory unit connected as shown below. The block size in L1
cache is 4 words. The block size in L2 cache is 16 words. The memory access times are 2 nanoseconds, 20 nanoseconds and
200 nanoseconds for L1 cache, L2 cache and the main memory unit respectively.

When there is a miss in both L1 cache and L2 cache, first a block is transferred from main memory to L2 cache, and then a
block is transferred from L2 cache to L1 cache. What is the total time taken for these transfers?

A. 222 nanoseconds

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 166 of 852

B. 888 nanoseconds
C. 902 nanoseconds
D. 968 nanoseconds

gate2010 co&architecture cache-memory normal

3.36 Cache Memory: GATE2008-72 top gateoverflow.in/43490

Consider a machine with a 2-way set associative data cache of size 64 Kbytes and block size 16 bytes. The cache is managed
using 32 bit virtual addresses and the page size is 4 Kbytes. A program to be run on this machine begins as follows:

double ARR[1024][1024];
int i, j;
/*Initialize array ARR to 0.0 */
for(i = 0; i < 1024; i++)
for(j = 0; j < 1024; j++)
ARR[i][j] = 0.0;

The size of double is 8 bytes. Array ARR is located in memory starting at the beginning of virtual page 0xFF000 and stored in
row major order. The cache is initially empty and no pre-fetching is done. The only data memory references made by the
program are those to array ARR.

Which of the following array elements have the same cache index as ARR[0][0]?

A. ARR[0][4]
B. ARR[4][0]
C. ARR[0][5]
D. ARR[5][0]

gate2008 co&architecture cache-memory normal

3.37 Cache Memory: GATE2006-75 top gateoverflow.in/43565

Consider two cache organizations. First one is 32 kb 2-way set associative with 32 byte block size, the second is of same size
but direct mapped. The size of an address is 32 bits in both cases . A 2-to-1 multiplexer has latency of 0.6ns while a k bit
k
comparator has latency of 10 ns. The hit latency of the set associative organization is h1 while that of direct mapped is h2 .
The value of h2 is:

A. 2.4 ns
B. 2.3 ns
C. 1.8 ns
D. 1.7 ns

gate2006 co&architecture cache-memory normal

3.38 Cache Memory: GATE2006-81 top gateoverflow.in/43517

A CPU has a 32 KB direct mapped cache with 128 byte-block size. Suppose A is two dimensional array of size 512 512 with
elements that occupy 8-bytes each. Consider the following two C code segments, P1 and P2.

P1:

for (i=0; i<512; i++)


{
for (j=0; j<512; j++)
{
x +=A[i] [j];
}
}

P2:

for (i=0; i<512; i++)


{
for (j=0; j<512; j++)
{
x +=A[j] [i];
}
}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 167 of 852

P1 and P2 are executed independently with the same initial state, namely, the array A is not in the cache and i, j, x are in
registers. Let the number of cache misses experienced by P1 be M1 and that for P2 be M2.
M1
The value of the ratio
M2

A. 0
B. 1
16
C. 18
D. 16

co&architecture cache-memory normal gate2006

3.39 Cache Memory: GATE2007-81 top gateoverflow.in/43511

Consider a machine with a byte addressable main memory of 216 bytes. Assume that a direct mapped data cache consisting
of 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memory
starting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.
Assume that the contents of the data cache do not change in between the two accesses.

Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?

A. line 4 to line 11
B. line 4 to line 12
C. line 0 to line 7
D. line 0 to line 8

gate2007 co&architecture cache-memory normal

3.40 Cache Memory: GATE2008-73 top gateoverflow.in/43491

Consider a machine with a 2-way set associative data cache of size 64 Kbytes and block size 16 bytes. The cache is managed
using 32 bit virtual addresses and the page size is 4 Kbytes. A program to be run on this machine begins as follows:

double ARR[1024][1024];
int i, j;
/*Initialize array ARR to 0.0 */
for(i = 0; i < 1024; i++)
for(j = 0; j < 1024; j++)
ARR[i][j] = 0.0;

The size of double is 8 bytes. Array ARR is located in memory starting at the beginning of virtual page 0xFF000 and stored in
row major order. The cache is initially empty and no pre-fetching is done. The only data memory references made by the
program are those to array ARR.

The cache hit ratio for this initialization loop is

A. 0%
B. 25%
C. 50%
D. 75%

gate2008 co&architecture cache-memory normal

3.41 Cache Memory: GATE2004-IT_48 top gateoverflow.in/3691

Consider a fully associative cache with 8 cache blocks (numbered 0-7) and the following sequence of memory block
requests:

4, 3, 25, 8, 19, 6, 25, 8, 16, 35, 45, 22, 8, 3, 16, 25, 7


If LRU replacement policy is used, which cache block will have memory block 7?

A) 4
B) 5

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 168 of 852

C) 6
D) 7

gate2004-it co&architecture cache-memory normal

3.42 Cache Memory: GATE2004-IT_12 top gateoverflow.in/3653

Consider a system with 2 level cache. Access times of Level 1 cache, Level 2 cache and main memory are 1 ns, 10 ns, and
500 ns, respectively. The hit rates of Level 1 and Level 2 caches are 0.8 and 0.9, respectively. What is the average access
time of the system ignoring the search time within the cache?

A) 13.0 ns
B) 12.8 ns
C) 12.6 ns
D) 12.4 ns

gate2004-it co&architecture cache-memory normal

3.43 Cache Memory: GATE1996_26 top gateoverflow.in/2778

A computer system has a three level memory hierarchy, with access time and hit ratios as shown below:

Level 1 (Cache memory)

Access time = 50 nsec/byte

Size Hit Ratio


8 M byte 0.80
16 M byte 0.90
64 M byte 0.95

Level 2 (main memory)

Access time = 200 nsec/byte

Size Hit ratio

4M byte 0.98
16 M byte 0.99
64 M byte 0.995

Level 3

Size Hit ratio


260 Mbyte 1.0

A. What should be the minimum sizes of level 1 and 2 memories to achieve an average access time of less than 100 nsec

B. What is the average access time achieved using the chosen sizes of level 1 and level 2 memories?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 169 of 852

gate1996 co&architecture cache-memory normal

3.44 Cache Memory: GATE1995_2.25 top gateoverflow.in/2638

A computer system has a 4 K word cache organized in block-set-associative manner with 4 blocks per set, 64 words per
block. The number of bits in the SET and WORD fields of the main memory address format is:

(A) 15, 40
(B) 6, 4
(C) 7, 2
(D) 4, 6

gate1995 co&architecture cache-memory normal

3.45 Cache Memory: GATE2004_65 top gateoverflow.in/1059

Consider a small two-way set-associative cache memory, consisting of four blocks. For choosing the block to be replaced,
use the least recently used (LRU) scheme. The number of cache misses for the following sequence of block addresses is

8, 12, 0, 12, 8

A. 2
B. 3
C. 4
D. 5

gate2004 co&architecture cache-memory normal

3.46 Cache Memory: GATE2010-48 top gateoverflow.in/2352

A computer system has an L1 cache, an L2 cache, and a main memory unit connected as shown below. The block size in L1 cache is 4
words. The block size in L2 cache is 16 words. The memory access times are 2 nanoseconds, 20 nanoseconds and 200 nanoseconds for L1
cache, L2 cache and the main memory unit respectively.

Q.48 When there is a miss in L1 cache and a hit in L2 cache, a block is transferred from L2 cache to L1 cache. What is the time taken for this
transfer?

(A) 2 nanoseconds

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 170 of 852

(B) 20 nanoseconds

(C) 22 nanoseconds

(D) 88 nanoseconds

gate2010 co&architecture cache-memory normal

3.47 Cache Memory: GATE2008-IT_80 top gateoverflow.in/3403

Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main
memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.

The number of bits in the TAG, SET and WORD fields, respectively are:

A. 7, 6, 7
B. 8, 5, 7
C. 8, 6, 6
D. 9, 4, 7

gate2008-it co&architecture cache-memory normal

3.48 Cache Memory: GATE2008-IT_81 top gateoverflow.in/3405

Consider a computer with a 4-ways set-associative mapped cache of the following characteristics: a total of 1 MB of main
memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.

While accessing the memory location 0C795H by the CPU, the contents of the TAG field of the corresponding cache line is

A. 000011000
B. 110001111
C. 00011000
D. 110010101

gate2008-it co&architecture cache-memory normal

3.49 Cache Memory: GATE2006-IT_43 top gateoverflow.in/3586

A computer system has a level-1 instruction cache (1-cache), a level-1 data cache (D-cache) and a level-2 cache (L2-cache)
with the following specifications:

Block
Capacity Mapping Method
size
I-cache 4K words Direct mapping 4 Words
2-way set associative
D-cache 4K words 4 Words
mapping
L2- 64K 4-way set associative
16 Words
cache words mapping

The length of the physical address of a word in the main memory is 30 bits. The capacity of the tag memory in the I-cache,
D-cache and L2-cache is, respectively,

A) 1 K x 18-bit, 1 K x 19-bit, 4 K x 16-bit


B) 1 K x 16-bit, 1 K x 19-bit, 4 K x 18-bit
C) 1 K x 16-bit, 512 x 18-bit, 1 K x 16-bit
D) 1 K x 18-bit, 512 x 18-bit, 1 K x 18-bit

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 171 of 852

gate2006-it co&architecture cache-memory normal

3.50 Cache Memory: GATE2006-IT_42 top gateoverflow.in/3585

A cache line is 64 bytes. The main memory has latency 32ns and bandwidth 1G.Bytes/s. The time required to fetch the entire
cache line from the main memory is

A) 32 ns
B) 64 ns
C) 96 ns
D) 128 ns

gate2006-it co&architecture cache-memory normal

3.51 Cache Memory: GATE2007-IT_37 top gateoverflow.in/3470

Consider a Direct Mapped Cache with 8 cache blocks (numbered 0-7). If the memory block requests are in the following
order
3, 5, 2, 8, 0, 63, 9,16, 20, 17, 25, 18, 30, 24, 2, 63, 5, 82,17, 24.

Which of the following memory blocks will not be in the cache at the end of the sequence ?

A) 3
B) 18
C) 20
D) 30

gate2007-it co&architecture cache-memory normal

3.52 Cache Memory: GATE1993_11 top gateoverflow.in/2308

In the three-level memory hierarchy shown in the following table, pi denotes the probability that an access request will refer
to Mi .

Hierarchy Access Probability of Page Transfer


Level Time access Time

(Mi ) (ti ) ( pi ) (Ti )

M1 106 0.99000 0.001 sec


5
M2 10 0.00998 0.1 sec

M3 104 0.00002 --

If a miss occurs at level Mi , a page transfer occurs from Mi+1 to Mi and the average time required for such a page swap is
Ti . Calculate the average time tA required for a processor to read one word from this memory system.

gate1993 co&architecture cache-memory normal

3.53 Cache Memory: GATE2014-2_44 top gateoverflow.in/2010

If the associativity of a processor cache is doubled while keeping the capacity and block size unchanged, which one of the
following is guaranteed to be NOT affected?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 172 of 852

(A) Width of tag comparator

(B) Width of set index decoder

(C) Width of way selection multiplexor

(D) Width of processor to main memory data bus

gate2014-2 co&architecture cache-memory normal

3.54 Cache Memory: GATE2001_9 top gateoverflow.in/750

A CPU has 32-bit memory address and a 256 KB cache memory. The cache is organized as a 4-way set associative cache
with cache block size of 16 bytes.

A. What is the number of sets in the cache?


B. What is the size (in bits) of the tag field per cache block?
C. What is the number and size of comparators required for tag matching?
D. How many address bits are required to find the byte offset within a cache block?
E. What is the total amount of extra memory (in bytes) required for the tag bits?

gate2001 co&architecture cache-memory normal

3.55 Cache Memory: GATE2002_10 top gateoverflow.in/863

In a C program, an array is declared as float A[2048]. Each array element is 4 Bytes in size, and the starting address of the
array is 0x00000000. This program is run on a computer that has a direct mapped data cache of size 8 Kbytes, with block
(line) size of 16 Bytes.

a. Which elements of the array conflict with element A[0] in the data cache? Justify your answer briefly.
b. If the program accesses the elements of this array one by one in reverse order i.e., starting with the last element and
ending with the first element, how many data cache misses would occur? Justify your answer briefly. Assume that the
data cache is initially empty and that no other data or instruction accesses are to be considered.

gate2002 co&architecture cache-memory normal

3.56 Cache Memory: GATE1992-5,a top gateoverflow.in/584

The access times of the main memory and the Cache memory, in a computer system, are 500 n sec and 50 n sec,
respectively. It is estimated that 80% of the main memory request are for read the rest for write. The hit ratio for the read
access only is 0.9 and a write-through policy (where both main and cache memories are updated simultaneously) is used.
Determine the average time of the main memory.

gate1992 co&architecture cache-memory normal

3.57 Cache Memory: GATE2008-71 top gateoverflow.in/494

Consider a machine with a 2-way set associative data cache of size 64 Kbytes and block size 16 bytes. The cache is managed
using 32 bit virtual addresses and the page size is 4 Kbytes. A program to be run on this machine begins as follows:

double ARR[1024][1024];
int i, j;
/*Initialize array ARR to 0.0 */
for(i = 0; i < 1024; i++)
for(j = 0; j < 1024; j++)
ARR[i][j] = 0.0;

The size of double is 8 bytes. Array ARR is located in memory starting at the beginning of virtual page 0xFF000 and stored in
row major order. The cache is initially empty and no pre-fetching is done. The only data memory references made by the
program are those to array ARR.

The total size of the tags in the cache directory is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 173 of 852

A. 32 Kbits
B. 34 Kbits
C. 64 Kbits
D. 68 Kbits

gate2008 co&architecture cache-memory normal

3.58 Cache Memory: GATE2008_35 top gateoverflow.in/446

For inclusion to hold between two cache levels L1 and L2 in a multi-level cache hierarchy, which of the following are
necessary?

I. L1 must be write-through cache

II. L2 must be a write-through cache

III. The associativity of L2 must be greater than that of L1

IV. The L2 cache must be at least as large as the L1 cache

A. IV only
B. I and IV only
C. I, II and IV only
D. I, II, III and IV

gate2008 co&architecture cache-memory normal

3.59 Computer Organization: GATE 2016-2-33 top gateoverflow.in/39580

Consider a 3 GHz (gigahertz) processor with a three stage pipeline and stage latencies 1 , 2 and 3 such that
3
1 = 42 = 23 . If the longest pipeline stage is split into two pipeline stages of equal latency , the new frequency is
__________ GHz, ignoring delays in the pipeline registers.

gate2016-2 computer-organization pipeline normal numerical-answers

3.60 Computer Organization: GATE 2016-2-50 top gateoverflow.in/39592

A file system uses an in-memory cache to cache disk blocks. The miss rate of the cache is shown in the figure. The latency
to read a block from the cache is 1 ms and to read a block from the disk is 10 ms. Assume that the cost of checking whether
a block exists in the cache is negligible. Available cache sizes are in multiples of 10 MB.

The smallest cache size required to ensure an average read latency of less than 6 ms is _________ MB.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 174 of 852

gate2016-2 computer-organization cache-memory normal numerical-answers

3.61 Computer Organization: GATE 2016-1-09 top gateoverflow.in/39632

A processor can support a maximum memory of 4GB, where the memory is word-addressable (a word consists of two
bytes). The size of address bus of the processor is at least _________bits.

gate2016-1 computer-organization easy numerical-answers

3.62 Computer Organization: GATE2005_69 top gateoverflow.in/1392

A device with data transfer rate 10 KB/sec is connected to a CPU. Data is transferred byte-wise. Let the interrupt overhead
be 4sec. The byte transfer time between the device interface register and CPU or memory is negligible. What is the
minimum performance gain of operating the device under interrupt mode over operating it under program-controlled mode?

A. 15
B. 25
C. 35
D. 45

gate2005 computer-organization

3.63 Data Dependencies: GATE2015-3_47 top gateoverflow.in/8556

Consider the following code sequence having five instructions from I1 to I5 . Each of these instructions has the following
format.

OP Ri, Rj, Rk

Where operation OP is performed on contents of registers Rj and Rk and the result is stored in register Ri.

I1 : ADD R1, R2, R3


I2 : MUL R7, R1, R3
I3 : SUB R4, R1, R5
I4 : ADD R3, R2, R4
I5 : MUL R7, R8, R9
Consider the following three statements.

S1: There is an anti-dependence between instructions I2 and I5

S2: There is an anti-dependence between instructions I2 and I4

S3: Within an instruction pipeline an anti-dependence always creates one or more stalls

Which one of the above statements is/are correct?

A. Only S1 is true
B. Only S2 is true
C. Only S1 and S3 are true
D. Only S2 and S3 are true

gate2015-3 co&architecture pipeline data-dependencies normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 175 of 852

3.64 Data Dependencies: GATE2007-IT_39 top gateoverflow.in/3472

Data forwarding techniques can be used to speed up the operation in presence of data dependencies. Consider the following
replacements of LHS with RHS.
R1 Loc, Loc R1 R2, R1
(i)
R2 Loc
R1 Loc, Loc
(ii) R1 R2
R2
R1 Loc, R2
(iii) R1 Loc
Loc
R1 Loc, R2
(iv) R1 Loc
Loc

In which of the following options, will the result of executing the RHS be the same as executing the LHS irrespective of the
instructions that follow ?

A) (i) and (iii)


B) (i) and (iv)
C) (ii) and (iii)
D) (ii) and (iv)

gate2007-it data-dependencies

3.65 Data Path: GATE2001_2.13 top gateoverflow.in/731

Consider the following data path of a simple non-pipelined CPU. The registers A, B, A 1, A 2, MDR, the bus and the ALU are 8-
bit wide. SP and MAR are 16-bit registers. The MUX is of size 8 (2 : 1) and the DEMUX is of size 8 (1 : 2). Each memory
operation takes 2 CPU clock cycles and uses MAR (Memory Address Register) and MDR (Memory Date Register). SP can be
decremented locally.

The CPU instruction "push r" where, r = A or B has the specification

M[SP] r

SP SP - 1

How many CPU clock cycles are required to execute the "push r" instruction?

A. 2
B. 3
C. 4
D. 5

gate2001 co&architecture data-path machine-instructions normal

3.66 Data Path: GATE2005-80 top gateoverflow.in/43568

The ALU, the bus and all the registers in the data path are of identical size. All operations including incrementation of the PC
and the GPRs are to be carried out in the ALU. Two clock cycles are needed for memory read operation the first one for
loading address in the MAR and the next one for loading data from the memory bus into the MDR.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 176 of 852

The instruction "call Rn, sub is a two word instruction. Assuming that PC is incremented during the fetch cycle of the first
word of the instruction, its register transfer interpretation is

Rn <= PC + 1;

PC <= M[PC];

The minimum number of CPU clock cycles needed during the execution cycle of this instruction is:

A. 2
B. 3
C. 4
D. 5

co&architecture normal gate2005 data-path machine-instructions

3.67 Data Path: GATE2005-79 top gateoverflow.in/1402

Consider the following data path of a CPU.

The ALU, the bus and all the registers in the data path are of identical size. All operations including incrementation of the PC
and the GPRs are to be carried out in the ALU. Two clock cycles are needed for memory read operation the first one for
loading address in the MAR and the next one for loading data from the memory bus into the MDR.

The instruction add R0, R1 has the register transfer interpretation R0 <= R0 + R1. The minimum number of clock cycles
needed for execution cycle of this instruction is:

A. 2
B. 3
C. 4
D. 5

gate2005 co&architecture machine-instructions data-path normal

3.68 Data Path: GATE 2016-2-30 top gateoverflow.in/39627

Suppose the functions F and G can be computed in 5 and 3 nanoseconds by functional units UF and UG , respectively.
Given two instances of UF and two instances of UG , it is required to implement the computation F (G(Xi )) for 1 i 10.
Ignoring all other delays, the minimum time required to complete this computation is ____________ nanoseconds.

gate2016-2 co&architecture data-path normal numerical-answers

3.69 Dma: GATE2011_28 top gateoverflow.in/2130

On a non-pipelined sequential processor, a program segment, which is the part of the interrupt service routine, is given to

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 177 of 852

transfer 500 bytes from an I/O device to memory.

Initialize the address register


Initialize the count to 500
LOOP: Load a byte from device
Store in memory at address given by address register
Increment the address register
Decrement the count
If count !=0 go to LOOP

Assume that each statement in this program is equivalent to a machine instruction which takes one clock cycle to execute if
it is a non-load/store instruction. The load-store instructions take two clock cycles to execute.

The designer of the system also has an alternate approach of using the DMA controller to implement the same transfer. The
DMA controller requires 20 clock cycles for initialization and other overheads. Each DMA transfer cycle takes two clock cycles
to transfer one byte of data from the device to the memory.

What is the approximate speed up when the DMA controller based design is used in a place of the interrupt driven program
based input-output?

(A) 3.4

(B) 4.4

(C) 5.1

(D) 6.7

gate2011 co&architecture dma normal

3.70 Dma: GATE 2016-1-31 top gateoverflow.in/39698

The size of the data count register of a DMA controller is 16bits. The processor needs to transfer a file of 29,154 kilobytes
from disk to main memory. The memory is byte addressable. The minimum number of times the DMA controller needs to
get the control of the system bus from the processor to transfer the file from the disk to main memory is _________-.

gate2016-1 co&architecture dma normal numerical-answers

3.71 Hardwired Controller: GATE1991-07a top gateoverflow.in/533

It is required to design a hardwired controller to handle the fetch cycle of a single address CPU with a 16 bit instruction-
length. The effective address of an indexed instruction should be derived in the fetch cycle itself. Assume that the lower
order 8 bits of an instruction constitute the operand field.

Give the register transfer sequence for realizing the above instruction fetch cycle.

gate1991 co&architecture control-unit hardwired-controller normal

3.72 Hardwired Controller: GATE1991-07b top gateoverflow.in/43606

It is required to design a hardwired controller to handle the fetch cycle of a single address CPU with a 16 bit instruction-
length. The effective address of an indexed instruction should be derived in the fetch cycle itself. Assume that the lower
order 8 bits of an instruction constitute the operand field.

Draw the logic schematic of the hardwired controller including the data path.

gate1991 co&architecture control-unit hardwired-controller normal

3.73 Instruction Format: GATE1992_01,vi top gateoverflow.in/551

In an 11-bit computer instruction format, the size of address field is 4-bits. The computer uses expanding OP code technique
and has 5 two-address instructions and 32 one-address instructions. The number of zero-address instructions it can support
is ________

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 178 of 852

gate1992 co&architecture machine-instructions instruction-format normal

3.74 Instruction Format: GATE 2016-2-31 top gateoverflow.in/39601

Consider a processor with 64 registers and an instruction set of size twelve. Each instruction has five distinct fields, namely,
opcode, two source register identifiers, one destination register identifier, and twelve-bit immediate value. Each instruction
must be stored in memory in a byte-aligned fashion. If a program has 100 instructions, the amount of memory (in bytes)
consumed by the program text is _________.

gate2016-2 instruction-format machine-instructions computer-organization normal numerical-answers

3.75 Instruction Format: GATE2014-1_9 top gateoverflow.in/1767

A machine has a 32-bit architecture, with 1-word long instructions. It has 64 registers, each of which is 32 bits long. It needs to support 45 instructions, which
have an immediate operand in addition to two register operands. Assuming that the immediate operand is an unsigned integer, the maximum value of the
immediate operand is ____________

gate2014-1 co&architecture machine-instructions instruction-format numerical-answers normal

3.76 Instruction Format: GATE1994_3.2 top gateoverflow.in/2479

State True or False with one line explanation

Expanding opcode instruction formats are commonly employed in RISC. (Reduced Instruction Set Computers) machines.

gate1994 co&architecture machine-instructions instruction-format normal

3.77 Interrupts: GATE2007-73 top gateoverflow.in/43516

Consider the following program segment. Here R1, R2 and R3 are the general purpose registers.

Instruction
Instruction Operation size (no. of
words)

MOV R1, (3000) R1 m[3000] 2

LOOP: MOV R2, (R3) R2 M[R3] 1

ADD R2, R1 R2 R1 + R2 1

MOV (R3), R2 M[R3] R2 1

INC R3 R3 R3 +1 1

DEC R1 R1 R1 - 1 1

BNZ LOOP Branch on not zero 2

HALT Stop 1

Assume that the content of memory location 3000 is 10 and the content of the register R3 is 2000. The content of each of
the memory locations from 2000 to 2010 is 100. The program is loaded from the memory location 1000. All the numbers are
in decimal.

Assume that the memory is byte addressable and the word size is 32 bits. If an interrupt occurs during the execution of the
instruction INC R3, what return address will be pushed on to the stack?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 179 of 852

A. 1005
B. 1020
C. 1024
D. 1040

gate2007 co&architecture machine-instructions interrupts normal

3.78 Interrupts: GATE2007-72 top gateoverflow.in/43515

Consider the following program segment. Here R1, R2 and R3 are the general purpose registers.

Instruction
Instruction Operation size (no. of
words)

MOV R1, (3000) R1 m[3000] 2

LOOP: MOV R2, (R3) R2 M[R3] 1

ADD R2, R1 R2 R1 + R2 1

MOV (R3), R2 M[R3] R2 1

INC R3 R3 R3 +1 1

DEC R1 R1 R1 - 1 1

BNZ LOOP Branch on not zero 2

HALT Stop 1

Assume that the content of memory location 3000 is 10 and the content of the register R3 is 2000. The content of each of
the memory locations from 2000 to 2010 is 100. The program is loaded from the memory location 1000. All the numbers are
in decimal.

Assume that the memory is word addressable. After the execution of this program, the content of memory location 2010 is:

A. 100
B. 101
C. 102
D. 110

gate2007 co&architecture machine-instructions interrupts normal

3.79 Interrupts: GATE1998_1.20 top gateoverflow.in/1657

Which of the following is true?

A. Unless enabled, a CPU will not be able to process interrupts.

B. Loop instructions cannot be interrupted till they complete.

C. A processor checks for interrupts before executing a new instruction.

D. Only level triggered interrupts are possible on microprocessors.

gate1998 co&architecture interrupts normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 180 of 852

3.80 Interrupts: GATE1995_1.3 top gateoverflow.in/2590

In a vectored interrupt

A. The branch address is assigned to a fixed location in memory

B. The interrupting source supplies the branch information to the processor through an interrupt vector

C. The branch address is obtained from a register in the processor

D. None of the above

gate1995 co&architecture interrupts normal

3.81 Interrupts: GATE2007-71 top gateoverflow.in/1269

Consider the following program segment. Here R1, R2 and R3 are the general purpose registers.

Instruction
Instruction Operation size (no. of
words)
MOV R1, (3000) R1 m[3000] 2
LOOP: MOV R2, (R3) R2 M[R3] 1
ADD R2, R1 R2 R1 + R2 1
MOV (R3), R2 M[R3] R2 1
INC R3 R3 R3 +1 1
DEC R1 R1 R1 - 1 1
BNZ LOOP Branch on not zero 2
HALT Stop 1

Assume that the content of memory location 3000 is 10 and the content of the register R3 is 2000. The content of each of
the memory locations from 2000 to 2010 is 100. The program is loaded from the memory location 1000. All the numbers are
in decimal.

Assume that the memory is word addressable. The number of memory references for accessing the data in executing the
program completely is

A. 10
B. 11
C. 20
D. 21

gate2007 co&architecture machine-instructions interrupts normal

3.82 Interrupts: GATE2002_1.9 top gateoverflow.in/813

A device employing INTR line for device interrupt puts the CALL instruction on the data bus while

A. INT A is active
B. HOLD is active
C. READY is inactive
D. None of the above

gate2002 co&architecture interrupts normal

3.83 Interrupts: GATE2009_8 top gateoverflow.in/1300

A CPU generally handles an interrupt by executing an interrupt service routine

A. As soon as an interrupt is raised.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 181 of 852

B. By checking the interrupt register at the end of fetch cycle.

C. By checking the interrupt register after finishing the execution of the current instruction.

D. By checking the interrupt register at fixed time intervals.

gate2009 co&architecture interrupts normal

3.84 Interrupts: GATE1992-05,b top gateoverflow.in/31576

Three devices A, B and C are corrected to the bus of a computer, input/output transfers for all three devices use interrupt
control. Three interrupt request lines INTR1, INTR2 and INTR3 are available with priority of INTR1 > priority of INTR2 >
priority of INTR3. Draw a schematic of the priority logic, using an interrupt mask register, in which Priority of A > Priority of
B > Priority of C.

gate1992 co&architecture interrupts normal

3.85 Io Handling: GATE1996_25 top gateoverflow.in/2777

A hard disk is connected to a 50 MHz processor through a DMA controller. Assume that the initial set-up of a DMA transfer
takes 1000 clock cycles for the processor, and assume that the handling of the interrupt at DMA completion requires 500
clock cycles for the processor. The hard disk has a transfer rate of 2000 Kbytes/sec and average block transferred is 4 K
bytes. What fraction of the processor time is consumed by the disk, if the disk is actively transferring 100% of the time?

gate1996 computer-organization io-handling dma normal

3.86 Io Handling: GATE2008_64 top gateoverflow.in/487

Which of the following statements about synchronous and asynchronous I/O is NOT true?

A. An ISR is invoked on completion of I/O in synchronous I/O but not in asynchronous I/O

B. In both synchronous and asynchronous I/O, an ISR (Interrupt Service Routine) is invoked after completion of the I/O

C. A process making a synchronous I/O call waits until I/O is complete, but a process making an asynchronous I/O call
does not wait for completion of the I/O

D. In the case of synchronous I/O, the process waiting for the completion of I/O is woken up by the ISR that is invoked
after the completion of I/O

gate2008 operating-system io-handling normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 182 of 852

3.87 Io Handling: GATE1996_1.24 top gateoverflow.in/2728

For the daisy chain scheme of connecting I/O devices, which of the following statements is true?

A. It gives non-uniform priority to various devices


B. It gives uniform priority to all devices
C. It is only useful for connecting slow devices to a processor device
D. It requires a separate interrupt pin on the processor for each device

gate1996 co&architecture io-handling normal

3.88 Io Organization: GATE2005 top gateoverflow.in/33006

Consider a disk drive with the following specifications:

16 surfaces, 512 tracks/surface, 512 sectors/track, 1 KB/sector, rotation speed 3000 rpm. The disk is operated in cycle
stealing mode whereby whenever one 4 byte word is ready it is sent to memory; similarly, for writing, the disk interface
reads a 4 byte word from the memory in each DMA cycle. Memory cycle time is 40 nsec. The maximum percentage of time
that the CPU gets blocked during DMA operation is____________

co&architecture io-organization dma

3.89 Machine Instructions: GATE2004-63 top gateoverflow.in/1058

Consider the following program segment for a hypothetical CPU having three user registers R1, R2 and R3.

Instruction Size
Instruction Operation
(in words)
MOV R1, 5000 R1 Memory[5000] 2
MOV R2(R1) R2 Memory[(R1)] 1
ADD R2, R3 R2 R2 + R3 1
MOV 6000, R2 Memory[6000] R2 2
HALT Machine halts 1

Consider that the memory is byte addressable with size 32 bits, and the program has been loaded starting from memory
location 1000 (decimal). If an interrupt occurs while the CPU has been halted after executing the HALT instruction, the return
address (in decimal) saved in the stack will be

A. 1007
B. 1020
C. 1024
D. 1028

gate2004 co&architecture machine-instructions normal

3.90 Machine Instructions: GATE1994_12 top gateoverflow.in/2508

a. Assume that a CPU has only two registers R1 and R2 and that only the following instruction is available
XOR Ri , Rj ; {Rj Ri Rj , for i, j = 1, 2}
Using this XOR instruction, find an instruction sequence in order to exchange the contents of the registers R1 and R2
b. The line p of the circuit shown in figure has stuck at 1 fault. Determine an input test to detect the fault.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 183 of 852

gate1994 co&architecture machine-instructions normal

3.91 Machine Instructions: GATE 2016-2-10 top gateoverflow.in/39547

A processor has 40 distinct instruction and 24 general purpose registers. A 32-bit instruction word has an opcode, two
registers operands and an immediate operand. The number of bits available for the immediate operand field is_______.

gate2016-2 machine-instructions computer-organization easy numerical-answers

3.92 Machine Instructions: GATE2008-IT_38 top gateoverflow.in/3348

Assume that EA = (X)+ is the effective address equal to the contents of location X, with X incremented by one word length
after the effective address is calculated; EA = (X) is the effective address equal to the contents of location X, with X
decremented by one word length before the effective address is calculated; EA = (X) is the effective address equal to the
contents of location X, with X decremented by one word length after the effective address is calculated. The format of the
instruction is (opcode, source, destination), which means (destination source op destination). Using X as a stack pointer,
which of the following instructions can pop the top two elements from the stack, perform the addition operation and push
the result back to the stack.

A) ADD (X), (X)


B) ADD (X), (X)
C) ADD (X), (X)+
D) ADD (X), (X)

gate2008-it co&architecture machine-instructions normal

3.93 Machine Instructions: GATE2008_34 top gateoverflow.in/445

Which of the following must be true for the RFE (Return From Exception) instruction on a general purpose processor?

I. It must be a trap instruction

II. It must be a privileged instruction

III. An exception cannot be allowed to occur during execution of an RFE instruction

A. I only
B. II only
C. I and II only
D. I, II and III only

gate2008 co&architecture machine-instructions normal

3.94 Machine Instructions: GATE2007-IT_41 top gateoverflow.in/3476

Following table indicates the latencies of operations between the instruction producing the result and instruction using the
result.

Instruction producing Instruction using the


Latency
the result result
ALU Operation ALU operation 2
ALU Operation Store 2
Load ALU Operation 1
Load Store 0

Consider the following code segment.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 184 of 852

Load R1, Loc 1; Load R1 from memory location Loc1


Load R2, Loc 2; Load R2 from memory location Loc 2
Add R1, R2, R1; Add R1 and R2 and save result in R1
Dec R2; Decrement R2
Dec R1; Decrement R1
Mpy R1, R2, R3; Multiply R1 and R2 and save result in R3
Store R3, Loc 3; Store R3 in memory location Loc 3

What is the number of cycles needed to execute the above code segment assuming each instruction takes one cycle to
execute ?

A) 7
B) 10
C) 13
D) 14

gate2007-it co&architecture machine-instructions normal

3.95 Machine Instructions: GATE2003-49 top gateoverflow.in/43577

Consider the following assembly language program for a hypothetical processor A, B, and C are 8 bit registers. The meanings
of various instructions are shown as comments.

MOV B, #0 ;B 0

MOV C, #8 ;C 8

Z: CMP C, #0 ; compare C with 0

JZ X ; jump to X if zero flag is set

SUB C, #1 ;C C1

RRC A, #1 ; right rotate A through carry by one bit. Thus:

; If the initial values of A and the carry flag are a7 . . a0 and

; c0 respectively, their values after the execution of this

; instruction will be c0 a7 . . a1 and a0 respectively.

JC Y ; jump to Y if carry flag is set

JMP Z ; jump to Z

Y: ADD B, #1 ;B B+1

JMP Z ; jump to Z

X:

Which of the following instructions when inserted at location X will ensure that the value of the register A after program
execution is as same as its initial value?

A. RRC A, #1
B. NOP ; no operation
C. LRC A, #1; left rotate A through carry flag by one bit
D. ADD A, #1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 185 of 852

gate2003 co&architecture machine-instructions normal

3.96 Machine Instructions: GATE1999_17 top gateoverflow.in/1516

Consider the following program fragment in the assembly language of a certain hypothetical processor. The processor has
three general purpose registers R1, R2 and R3. The meanings of the instructions are shown by comments (starting with ;)
after the instructions.

X: CMP R1, 0; Compare R1 and 0, set flags appropriately in status register


JZ Z; Jump if zero to target Z
MOV R2, R1; Copy contents of R1 to R2
SHR R1; Shift right R1 by 1 bit
SHL R1; Shift left R1 by 1 bit
CMP R2, R1; Compare R2 and R1 and set flag in status register
JZ Y; Jump if zero to target Y
INC R3; Increment R3 by 1;
Y: SHR R1; Shift right R1 by 1 bit
JMP X; Jump to target X
Z:...

a. Initially R1, R2 and R3 contain the values 5, 0 and 0 respectively, what are the final values of R1 and R3 when control
reaches Z?

b. In general, if R1, R2 and R3 initially contain the values n, 0, and 0 respectively. What is the final value of R3 when
control reaches Z?

gate1999 co&architecture machine-instructions normal

3.97 Machine Instructions: GATE2006_09 top gateoverflow.in/888

A CPU has 24-bit instructions. A program starts at address 300 (in decimal). Which one of the following is a legal program
counter (all values in decimal)?

(A) 400
(B) 500
(C) 600
(D) 700

gate2006 co&architecture machine-instructions easy

3.98 Machine Instructions: GATE2007_54 top gateoverflow.in/1252

In a simplified computer the instructions are:

-Performs Rj OP Ri and stores the


OP Rj , Ri
result in register Rj .
-Performs val OP Ri and stores the
result in register Ri . val
OP m, Ri
denotes the content of the memory
location m .
-Moves the content of memory
MOV m, Ri
location m to register Ri
-Moves the content of register Ri to
MOV Ri , m
memory location m

The computer has only two registers, and OP is either ADD or SUB. Consider the following basic block:

t1 = a + b
t2 = c + d
t3 = e t2
t4 = t1 t3
Assume that all operands are initially in memory. The final value of the computation should be in memory. What is the
minimum number of MOV instructions in the code generated for this basic block?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 186 of 852

A. 2
B. 3
C. 5
D. 6

gate2007 co&architecture machine-instructions normal

3.99 Machine Instructions: GATE2003-48 top gateoverflow.in/938

Consider the following assembly language program for a hypothetical processor A, B, and C are 8 bit registers. The meanings
of various instructions are shown as comments.

MOV B, #0 ;B 0
MOV C, #8 ;C 8
Z: CMP C, #0 ; compare C with 0
JZ X ; jump to X if zero flag is set
SUB C, #1 ;C C 1
RRC A, #1 ; right rotate A through carry by one bit. Thus:
; If the initial values of A and the carry flag are a7 . . a0 and
; c0 respectively, their values after the execution of this
; instruction will be c0 a7 . . a1 and a0 respectively.
JC Y ; jump to Y if carry flag is set
JMP Z ; jump to Z
Y: ADD B, #1 ;B B + 1
JMP Z ; jump to Z
X:

If the initial value of register A is A0 the value of register B after the program execution will be

A. the number of 0 bits in A0


B. the number of 1 bits in A0
C. A0
D. 8

gate2003 co&architecture machine-instructions normal

3.100 Machine Instructions: GATE2004-IT_46 top gateoverflow.in/3689

If we use internal data forwarding to speed up the performance of a CPU (R1, R2 and R3 are registers and M[100] is a
memory reference), then the sequence of operations

R1 M[100]
M[100] R2
M[100] R3

can be replaced by

R1 R3
A)
R2 M[100]
M[100] R2
B) R1 R2
R1 R3
R1 M[100]
C)
R2 R3
R1 R2
D) R1 R3
R1 M[100]

gate2004-it co&architecture machine-instructions easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 187 of 852

3.101 Machine Instructions: GATE2015-2_42 top gateoverflow.in/8215

Consider a processor with byte-addressable memory. Assume that all registers, including program counter (PC) and Program
Status Word (PSW), are size of two bytes. A stack in the main memory is implemented from memory location (0100)16 and it
grows upward. The stack pointer (SP) points to the top element of the stack. The current value of SP is (016E)16 . The CALL
instruction is of two words, the first word is the op-code and the second word is the starting address of the subroutine (one
word = 2 bytes). The CALL instruction is implemented as follows:

Store the current value of PC in the stack


Store the value of PSW register in the stack
Load the statring address of the subroutine in PC

The content of PC just before the fetch of a CALL instruction is (5F A0)16 . After execution of the CALL instruction, the value
of the stack pointer is

A. (016A)16
B. (016C)16
C. (0170)16
D. (0172)16

gate2015-2 co&architecture machine-instructions easy

3.102 Machine Instructions: GATE2004-64 top gateoverflow.in/43570

Consider the following program segment for a hypothetical CPU having three user registers R1, R2 and R3.

Instruction Size
Instruction Operation
(in words)

MOV R1, 5000 R1 Memory[5000] 2

MOV R2(R1) R2 Memory[(R1)] 1

ADD R2, R3 R2 R2 + R3 1

MOV 6000, R2 Memory[6000] R2 2

HALT Machine halts 1

Let the clock cycles required for various operations be as follows:

Register to/from memory transfer : 3 clock cycles

ADD with both operands in register : 1 clock cycle

Instruction fetch and decode : 2 clock cycles per word

The total number of clock cycles required to execute the program is

A. 29
B. 24
C. 23
D. 20

gate2004 co&architecture machine-instructions normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 188 of 852

3.103 Memory Interfacing: Gate 2016 syllabus C.O. memory interface gateoverflow.in/35673

top

Memory Interface topic has been removed. Can someone tell me what kind question will not be asked.

or what not to do in this section?

co&architecture memory-interfacing

3.104 Memory Interfacing: GATE2006_41 top gateoverflow.in/1817

A CPU has a cache with block size 64 bytes. The main memory has k banks, each bank being c bytes wide. Consecutive c
byte chunks are mapped on consecutive banks with wrap-around. All the k banks can be accessed in parallel, but two
accesses to the same bank must be serialized. A cache block access may involve multiple iterations of parallel bank accesses
depending on the amount of data obtained by accessing all the k banks in parallel. Each iteration requires decoding the bank
numbers to be accessed in parallel and this takes k2 ns.The latency of one bank access is 80 ns. If c = 2 and k = 24, the
latency of retrieving a cache block starting at address zero from main memory is:

(A) 92 ns

(B) 104 ns

(C) 172 ns

(D) 184 ns

gate2006 co&architecture cache-memory memory-interfacing normal

3.105 Microprogramming: GATE2006-IT_41 top gateoverflow.in/3584

The data path shown in the figure computes the number of 1s in the 32-bit input word corresponding to an unsigned even
integer stored in the shift register.
The unsigned counter, initially zero, is incremented if the most significant bit of the shift register is 1.

The microprogram for the control is shown in the table below with missing control words for microinstructions I 1, I 2, ..... I n.

Microinstruction reset_counter shift_left load_output


BEGIN 1 0 0
I1 ? ? ?
: : :
In ? ? ?
END 0 0 1

The counter width (k) , the number of missing microinstructions (n), and the control word for microinstructions I 1, I 2, ..... I n
are, respectively,

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 189 of 852

A) 32, 5, 010
B) 5, 32, 010
C) 5, 31, 011
D) 5, 31, 010

gate2006-it co&architecture microprogramming normal

3.106 Microprogramming: GATE1996_2.25 top gateoverflow.in/2754

A micro program control unit is required to generate a total of 25 control signals. Assume that during any microinstruction,
at most two control signals are active. Minimum number of bits required in the control word to generate the required control
signals will be

A. 2
B. 2.5
C. 10
D. 12

gate1996 co&architecture microprogramming normal

3.107 Microprogramming: GATE2002_2.7 top gateoverflow.in/837

Horizontal microprogramming

A. does not require use of signal decoders


B. results in larger sized microinstructions than vertical microprogramming
C. uses one bit for each control signal
D. all of the above

gate2002 co&architecture microprogramming

3.108 Microprogramming: GATE2005-IT_49 top gateoverflow.in/3810

An instruction set of a processor has 125 signals which can be divided into 5 groups of mutually exclusive signals as follows:

Group 1 : 20 signals, Group 2 : 70 signals, Group 3 : 2 signals, Group 4 : 10 signals, Group 5 : 23 signals.

How many bits of the control words can be saved by using vertical microprogramming over horizontal microprogramming?

A) 0
B) 103
C) 22
D) 55

gate2005-it co&architecture microprogramming normal

3.109 Microprogramming: GATE1999_2.19 top gateoverflow.in/1497

Arrange the following configuration for CPU in decreasing order of operating speeds:

Hard wired control, Vertical microprogramming, Horizontal microprogramming.

A. Hard wired control, Vertical microprogramming, Horizontal microprogramming.

B. Hard wired control, Horizontal microprogramming, Vertical microprogramming.

C. Horizontal microprogramming, Vertical microprogramming, Hard wired control.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 190 of 852

D. Vertical microprogramming, Horizontal microprogramming, Hard wired control.

gate1999 co&architecture microprogramming normal

3.110 Microprogramming: GATE1997_5.3 top gateoverflow.in/2254

A micro instruction is to be designed to specify

a. none or one of the three micro operations of one kind and

b. none or upto six micro operations of another kind

The minimum number of bits in the micro-instruction is

A. 9
B. 5
C. 8
D. None of the above

gate1997 co&architecture microprogramming normal

3.111 Microprogramming: GATE2013_28 top gateoverflow.in/1539

Consider the following sequence of micro-operations.


MBR PC MAR X PC Y Memory MBR

Which one of the following is a possible operation performed by this sequence?

(A) Instruction fetch

(B) Operand fetch

(C) Conditional branch

(D) Initiation of interrupt service

gate2013 co&architecture microprogramming normal

3.112 Microprogramming: GATE2004_67 top gateoverflow.in/1061

The microinstructions stored in the control memory of a processor have a width of 26 bits. Each microinstruction is divided
into three fields: a micro-operation field of 13 bits, a next address field (X ), and a MUX select field ( Y ). There are 8 status
bits in the input of the MUX.

How many bits are there in the X and Y fields, and what is the size of the control memory in number of words?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 191 of 852

A. 10, 3, 1024
B. 8, 5, 256
C. 5, 8, 2048
D. 10, 3, 512

gate2004 co&architecture microprogramming normal

3.113 Microprogramming: GATE2004-IT_49 top gateoverflow.in/3692

A CPU has only three instructions I1, I2 and I3, which use the following signals in time steps T1-T5:

I1 : T1 : Ain, Bout, Cin


T2 : PCout, Bin
T3 : Zout, Ain
T4 : Bin, Cout
T5 : End

I2 : T1 : Cin, Bout, Din


T2 : Aout, Bin
T3 : Zout, Ain
T4 : Bin, Cout
T5 : End

I3 : T1 : Din, Aout
T2 : Ain, Bout
T3 : Zout, Ain
T4 : Dout, Ain
T5 : End

Which of the following logic functions will generate the hardwired control for the signal Ain ?

A) T1.I1 + T2.I3 + T4.I3 + T3


B) (T1 + T2 + T3).I3 + T1.I1
C) (T1 + T2 ).I1 + (T2 + T4).I3 + T3
D) (T1 + T2 ).I2 + (T1 + T3).I1 + T3

gate2004-it co&architecture microprogramming normal

3.114 Microprogramming: GATE2005-IT_45 top gateoverflow.in/3806

A hardwired CPU uses 10 control signals S1 to S10 , in various time steps T1 to T5 , to implement 4 instructions I1 to I4 as
shown below:

Which of the following pairs of expressions represent the circuit for generating control signals S5 and S10 respectively?

((Ij + Ik )Tn indicates that the control signal should be generated in time step Tn if the instruction being executed is Ij or
lk )

S5 = T1 + I2 T3 and
A)
S10 = (I1 + I3 ) T4 + (I2 + I4 ) T5

S5 = T1 + (I2 + I4 ) T3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 192 of 852

S5 = T1 + (I2 + I4 ) T3 and
B)
S10 = (I1 + I3 ) T4 + (I2 + I4 ) T5

S5 = T1 + (I2 + I4 ) T3 and
C)
S10 = (I2 + I3 + I4 ) T2 + (I1 + I3 ) T4 + (I2 + I4 ) T5

S5 = T1 + (I2 + I4 ) T3 and
D)
S10 = (I2 + I3 ) T2 + I4 T3 + (I1 + I3 ) T4 + (I2 + I4 ) T5

gate2005-it co&architecture microprogramming normal

3.115 Microprogramming: GATE2008-IT_39 top gateoverflow.in/3349

Consider a CPU where all the instructions require 7 clock cycles to complete execution. There are 140 instructions in the
instruction set. It is found that 125 control signals are needed to be generated by the control unit. While designing the
horizontal microprogrammed control unit, single address field format is used for branch control logic. What is the minimum
size of the control word and control address register?

A) 125, 7
B) 125, 10
C) 135, 9
D) 135, 10

gate2008-it co&architecture microprogramming normal

3.116 Page Fault: GATE1998_2.18 top gateoverflow.in/1691

If an instruction takes i microseconds and a page fault takes an additional j microseconds, the effective instruction time if on
the average a page fault occurs every k instruction is:
j
A. i + k

B. i + j k
i+j
C. k

D. (i + j) k

gate1998 co&architecture page-fault easy

3.117 Pipeline: GATE2008-IT_40 top gateoverflow.in/3350

A non pipelined single cycle processor operating at 100 MHz is converted into a synchronous pipelined processor with five
stages requiring 2.5 nsec, 1.5 nsec, 2 nsec, 1.5 nsec and 2.5 nsec, respectively. The delay of the latches is 0.5 nsec. The
speedup of the pipeline processor for a large number of instructions is

A) 4.5
B) 4.0
C) 3.33
D) 3.0

gate2008-it co&architecture pipeline normal

3.118 Pipeline: GATE2006-IT_79 top gateoverflow.in/3623

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 193 of 852

A pipelined processor uses a 4-stage instruction pipeline with the following stages: Instruction fetch (IF), Instruction decode
(ID), Execute (EX) and Writeback (WB). The arithmetic operations as well as the load and store operations are carried out in
the EX stage. The sequence of instructions corresponding to the statement X = (S - R * (P + Q))/T is given below. The
values of variables P, Q, R, S and T are available in the registers R0, R1, R2, R3 and R4 respectively, before the execution of
the instruction sequence.
ADD R5, R0, R1 ; R5 R0 + R1
MUL R6, R2, R5 ; R6 R2 * R5
SUB R5, R3, R6 ; R5 R3 - R6
DIV R6, R5, R4 ; R6 R5/R4
STORE R6, X ; X R6

The IF, ID and WB stages take 1 clock cycle each. The EX stage takes 1 clock cycle each for the ADD, SUB and STORE
operations, and 3 clock cycles each for MUL and DIV operations. Operand forwarding from the EX stage to the ID stage is
used. The number of clock cycles required to complete the sequence of instructions is

A) 10
B) 12
C) 14
D) 16

gate2006-it co&architecture pipeline normal

3.119 Pipeline: GATE2015-2_44 top gateoverflow.in/8218

Consider the sequence of machine instruction given below:

MUL R5, R0, R1


DIV R6, R2, R3
ADD R7, R5, R6
SUB R8, R7, R4

In the above sequence, R0 to R8 are general purpose registers. In the instructions shown, the first register shows the result
of the operation performed on the second and the third registers. This sequence of instructions is to be executed in a
pipelined instruction processor with the following 4 stages: (1) Instruction Fetch and Decode (IF), (2) Operand Fetch (OF),
(3) Perform Operation (PO) and (4) Write back the result (WB). The IF, OF and WB stages take 1 clock cycle each for any
instruction. The PO stage takes 1 clock cycle for ADD and SUB instruction, 3 clock cycles for MUL instruction and 5 clock
cycles for DIV instruction. The pipelined processor uses operand forwarding from the PO stage to the OF stage. The number
of clock cycles taken for the execution of the above sequence of instruction is _________.

gate2015-2 co&architecture pipeline normal

3.120 Pipeline: GATE2007-IT_6 top gateoverflow.in/3437

A processor takes 12 cycles to complete an instruction I. The corresponding pipelined processor uses 6 stages with the
execution times of 3, 2, 5, 4, 6 and 2 cycles respectively. What is the asymptotic speedup assuming that a very large
number of instructions are to be executed?

A) 1.83
B) 2
C) 3
D) 6

gate2007-it co&architecture pipeline normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 194 of 852

3.121 Pipeline: GATE2008-76 top gateoverflow.in/496

Delayed branching can help in the handling of control hazards

For all delayed conditional branch instructions, irrespective of whether the condition evaluates to true or false,

A. The instruction following the conditional branch instruction in memory is executed

B. The first instruction in the fall through path is executed

C. The first instruction in the taken path is executed

D. The branch takes longer to execute than any other instruction

gate2008 co&architecture pipeline normal

3.122 Pipeline: GATE2015-1_38 top gateoverflow.in/8288

Consider a non-pipelined processor with a clock rate of 2.5 gigahertz and average cycles per instruction of four. The same
processor is upgraded to a pipelined processor with five stages; but due to the internal pipeline delay, the clock speed is
reduced to 2 gigahertz. Assume that there are no stalls in the pipeline. The speedup achieved in this pipelined processor
is_______________.

gate2015-1 co&architecture pipeline normal

3.123 Pipeline: GATE2015-3_51 top gateoverflow.in/8560

Consider the following reservation table for a pipeline having three stages S1 , S2 and S3 .

T ime
1 2 3 4 5
S1 X X
S2 X X
S3 X

The minimum average latency (MAL) is ______

gate2015-3 co&architecture pipeline difficult numerical-answers

3.124 Pipeline: GATE2004-IT_47 top gateoverflow.in/3690

Consider a pipeline processor with 4 stages S1 to S4. We want to execute the following loop:
for (i = 1; i < = 1000; i++)
{I1, I2, I3, I4}


where the time taken (in ns) by instructions I1 to I4 for stages S1 to S4 are given below:

The output of I1 for i = 2 will be available after



A) 11 ns
B) 12 ns
C) 13 ns
D) 28 ns

gate2004-it co&architecture pipeline normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 195 of 852

3.125 Pipeline: GATE2000_12 top gateoverflow.in/683

An instruction pipeline has five stages where each stage take 2 nanoseconds and all instruction use all five stages. Branch
instructions are not overlapped. i.e., the instruction after the branch is not fetched till the branch instruction is completed.
Under ideal conditions,

a. Calculate the average instruction execution time assuming that 20% of all instructions executed are branch instruction.
Ignore the fact that some branch instructions may be conditional.
b. If a branch instruction is a conditional branch instruction, the branch need not be taken. If the branch is not taken,
the following instructions can be overlapped. When 80% of all branch instructions are conditional branch instructions,
and 50% of the conditional branch instructions are such that the branch is taken, calculate the average instruction
execution time.

gate2000 co&architecture pipeline normal

3.126 Pipeline: GATE1999_13 top gateoverflow.in/1512

An instruction pipeline consists of 4 stages Fetch (F), Decode field (D), Execute (E) and Result Write (W). The 5
instructions in a certain instruction sequence need these stages for the different number of clock cycles as shown by the
table below

No. of cycles needed for


Instruction F D E W
1 1 2 1 1
2 1 2 2 1
3 2 1 3 2
4 1 3 2 1
5 1 2 1 2

Find the number of clock cycles needed to perform the 5 instructions.

gate1999 co&architecture pipeline normal

3.127 Pipeline: GATE2005-IT_44 top gateoverflow.in/3805

We have two designs D1 and D2 for a synchronous pipeline processor. D1 has 5 pipeline stages with execution times of 3
nsec, 2 nsec, 4 nsec, 2 nsec and 3 nsec while the design D2 has 8 pipeline stages each with 2 nsec execution time How
much time can be saved using design D2 over design D1 for executing 100 instructions?

A) 214 nsec
B) 202 nsec
C) 86 nsec
D) - 200 nsec

gate2005-it co&architecture pipeline normal

3.128 Pipeline: GATE2013_45 top gateoverflow.in/330

Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction (FI), Decode Instruction
(DI), Fetch Operand (FO), Execute Instruction (EI) and Write Operand (WO). The stage delays for FI, DI, FO, EI and WO are
5 ns, 7 ns, 10 ns, 8 ns and 6 ns, respectively. There are intermediate storage buffers after each stage and the delay of each
buffer is 1 ns. A program consisting of 12 instructions I1, I2, I3, , I12 is executed in this pipelined processor. Instruction I4
is the only branch instruction and its branch target is I9. If the branch is taken during the execution of this program, the
time (in ns) needed to complete the program is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 196 of 852

(A) 132 (B) 165 (C) 176 (D) 328

gate2013 normal co&architecture pipeline

3.129 Pipeline: GATE2006_42 top gateoverflow.in/1818

A CPU has a five-stage pipeline and runs at 1 GHz frequency. Instruction fetch happens in the first stage of the pipeline. A
conditional branch instruction computes the target address and evaluates the condition in the third stage of the pipeline. The
processor stops fetching new instructions following a conditional branch until the branch outcome is known. A program
executes 109 instructions out of which 20% are conditional branches. If each instruction takes one cycle to complete on
average, the total execution time of the program is:

(A) 1.0 second


(B) 1.2 seconds
(C) 1.4 seconds
(D) 1.6 seconds

gate2006 co&architecture pipeline normal

3.130 Pipeline: GATE2005_68 top gateoverflow.in/1391

A 5 stage pipelined CPU has the following sequence of stages:

IF instruction fetch from instruction memory

RD Instruction decode and register read

EX Execute: ALU operation for data and address computation

MA Data memory access for write access, the register read at RD state is used.

WB Register write back

Consider the following sequence of instructions:

I1 : L R0, loc 1; R0 <= M[loc1]


I2 : A R0, R0 1; R0 <= R0 +R0
I3 : S R2, R0 1; R2 <= R2-R0
Let each stage take one clock cycle

What is the number of clock cycles taken to complete the above sequence of instructions starting from the fetch of I1 ?

A. 8
B. 10
C. 12
D. 15

gate2005 co&architecture pipeline normal

3.131 Pipeline: GATE2002_2.6 top gateoverflow.in/836

The performance of a pipelined processor suffers if

A. the pipeline stages have different delays


B. consecutive instructions are dependent on each other

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 197 of 852

C. the pipeline stages share hardware resources


D. All of the above

gate2002 co&architecture pipeline easy

3.132 Pipeline: GATE2004_69 top gateoverflow.in/1063

A 4-stage pipeline has the stage delays as 150, 120, 160 and 140 nanoseconds respectively. Registers that are used
between the stages have a delay of 5 nanoseconds each. Assuming constant clocking rate, the total time taken to process
1000 data items on this pipeline will be

A. 120.4 microseconds

B. 160.5 microseconds

C. 165.5 microseconds

D. 590.0 microseconds

gate2004 co&architecture pipeline normal

3.133 Pipeline: GATE2007_37 top gateoverflow.in/1235

Consider a pipelined processor with the following four stages:

IF: Instruction Fetch


ID: Instruction Decode and Operand Fetch
EX: Execute
WB: Write Back

The IF, ID and WB stages take one clock cycle each to complete the operation. The number of clock cycles for the EX stage
depends on the instruction. The ADD and SUB instructions need 1 clock cycle and the MUL instruction needs 3 clock cycles in
the EX stage. Operand forwarding is used in the pipelined processor. What is the number of clock cycles taken to complete
the following sequence of instructions?

ADD R2, R1, R0 R2 R1 + R0


MUL R4, R3, R2 R4 R3 * R2
SUB R6, R5, R4 R6 R5 - R4

A. 7
B. 8
C. 10
D. 14

gate2007 co&architecture pipeline normal

3.134 Pipeline: GATE2003_10 top gateoverflow.in/901

For a pipelined CPU with a single ALU, consider the following situations

I. The j+1 st instruction uses the result of the j-th instruction as an operand

II. The execution of a conditional jump instruction

III. The j-th and j+1 st instructions require the ALU at the same time.

Which of the above can cause a hazard

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 198 of 852

A. I and II only
B. II and III only
C. III only
D. All the three

gate2003 co&architecture pipeline normal

3.135 Pipeline: GATE2009_28 top gateoverflow.in/1314

Consider a 4 stage pipeline processor. The number of cycles needed by the four instructions I1, I2, I3, I4 in stages S1, S2,
S3, S4 is shown below:

S1 S2 S3 S4
I1 2 1 1 1
I2 1 3 2 2
I3 2 1 1 3
I4 1 2 2 2

What is the number of cycles needed to execute the following loop?

For (i=1 to 2) {I1; I2; I3; I4;}

A. 16
B. 23
C. 28
D. 30

gate2009 co&architecture pipeline normal

3.136 Pipeline: GATE2001_12 top gateoverflow.in/753

Consider a 5-stage pipeline - IF (Instruction Fetch), ID (Instruction Decode and register read), EX (Execute), MEM
(memory), and WB (Write Back). All (memory or register) reads take place in the second phase of a clock cycle and all
writes occur in the first phase. Consider the execution of the following instruction sequence:

I1: sub r2, r3, r4; /* r2 r3 r4 */


I2: sub r4, r2, r3; /* r4 r2 r3 */
I3: sw r2, 100(r1) /* M[r1 + 100] r2 */
I4: sub r3, r4, r2 /* r3 r4 r2 */

a. Show all data dependencies between the four instructions.


b. Identify the data hazards.
c. Can all hazards be avoided by forwarding in this case.

gate2001 co&architecture pipeline normal

3.137 Pipeline: GATE2014-1_43 top gateoverflow.in/1921

Consider a 6-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead
of pipelining. When an application is executing on this 6-stage pipeline, the speedup achieved with respect to non-pipelined

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 199 of 852

execution if 25% of the instructions incur 2 pipeline stall cycles is ____________

gate2014-1 co&architecture pipeline numerical-answers normal

3.138 Pipeline: GATE2006-IT_78 top gateoverflow.in/3622

A pipelined processor uses a 4-stage instruction pipeline with the following stages: Instruction fetch (IF), Instruction decode
(ID), Execute (EX) and Writeback (WB). The arithmetic operations as well as the load and store operations are carried out in
the EX stage. The sequence of instructions corresponding to the statement X = (S - R * (P + Q))/T is given below. The
values of variables P, Q, R, S and T are available in the registers R0, R1, R2, R3 and R4 respectively, before the execution of
the instruction sequence.
ADD R5, R0, R1 ; R5 R0 + R1
MUL R6, R2, R5 ; R6 R2 * R5
SUB R5, R3, R6 ; R5 R3 - R6
DIV R6, R5, R4 ; R6 R5/R4
STORE R6, X ; X R6

The number of Read-After-Write (RAW) dependencies, Write-After-Read( WAR) dependencies, and Write-After-Write (WAW)
dependencies in the sequence of instructions are, respectively,

A) 2, 2, 4
B) 3, 2, 3
C) 4, 2, 2
D) 3, 3, 2

gate2006-it co&architecture pipeline normal

3.139 Pipeline: GATE2011_41 top gateoverflow.in/2143

Consider an instruction pipeline with four stages (S1, S2, S3 and S4) each with combinational circuit only. The pipeline registers are required
between each stage and at the end of the last stage. Delays for the stages and for the pipeline registers are as given in the figure.

What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline
implementation?

(A) 4.0

(B) 2.5

(C) 1.1

(D) 3.0

gate2011 co&architecture pipeline normal

3.140 Pipeline: GATE2010_33 top gateoverflow.in/2207

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 200 of 852

A 5-stage pipelined processor has Instruction Fetch (IF), Instruction Decode (ID), Opearnd Fetch (OF), Perform Operation
(PO) and Write Operand (WO) stages. The IF, ID, OF and WO stages take 1 clock cycle each for any instruction. The PO
stage takes 1 clock cycle for ADD and SUB instructions, 3 clock cycles for MUL instruction and 6 clock cycles for DIV
instruction respectively. Operand forwarding is used in the pipeline. What is the number of clock cycles needed to execute
the following sequence of instructions?

Instruction Meaning of instruction


t0 : MUL R2 , R0 , R1 R2 R0 R1
t1 : DIV R5 , R3 , R4 R5 R3 /R4
t2 : ADD R2 , R5 , R2 R2 R5 + R2
t3 : SUB R5 , R2 , R6 R5 R2 R6

(A) 13

(B) 15

(C) 17

(D) 19

gate2010 co&architecture pipeline normal

3.141 Pipeline: GATE 2016-1-32 top gateoverflow.in/39691

The stage delays in a 4-stage pipeline are 800, 500, 400 and 300 picoseconds. The first stage (with delay 800 picoseconds) is
replaced with a functionality equivalent design involving two stages with respective delays 600 and 350 picoseconds. The
throughput increase of the pipeline is ___________ percent.

gate2016-1 co&architecture pipeline normal numerical-answers

3.142 Pipeline: GATE2014-3_43 top gateoverflow.in/2077

An instruction pipeline has five stages, namely, instruction fetch (IF), instruction decode and register fetch (ID/RF),
instruction execution (EX), memory access (MEM), and register writeback (WB) with stage latencies 1 ns, 2.2 ns, 2 ns, 1 ns,
and 0.75 ns, respectively (ns stands for nanoseconds). To gain in terms of frequency, the designers have decided to split the
ID/RF stage into three stages (ID, RF1, RF2) each of latency 2.2/3 ns. Also, the EX stage is split into two stages (EX1, EX2)
each of latency 1 ns. The new design has a total of eight pipeline stages. A program has 20% branch instructions which
execute in the EX stage and produce the next instruction pointer at the end of the EX stage in the old design and at the end
of the EX2 stage in the new design. The IF stage stalls after fetching a branch instruction until the next instruction pointer is
computed. All instructions other than the branch instruction have an average CPI of one in both the designs. The execution
times of this program on the old and the new design are P and Q nanoseconds, respectively. The value of P /Q is
__________.

gate2014-3 co&architecture pipeline numerical-answers normal

3.143 Pipeline: GATE2014-3_9 top gateoverflow.in/2043

Consider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero latency.

P1: Four-stage pipeline with stage latencies 1 ns, 2 ns, 2 ns, 1 ns.

P2: Four-stage pipeline with stage latencies 1 ns, 1.5 ns, 1.5 ns, 1.5 ns.

P3: Five-stage pipeline with stage latencies 0.5 ns, 1 ns, 1 ns, 0.6 ns, 1 ns.

P4: Five-stage pipeline with stage latencies 0.5 ns, 0.5 ns, 1 ns, 1 ns, 1.1 ns.

Which processor has the highest peak clock frequency?

(A) P1

(B) P2

(C) P3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 201 of 852

(D) P4

gate2014-3 co&architecture pipeline normal

3.144 Pipeline: GATE2008_36 top gateoverflow.in/447

Which of the following are NOT true in a pipelined processor?

I. Bypassing can handle all RAW hazards


II. Register renaming can eliminate all register carried WAR hazards
III. Control hazard penalties can be eliminated by dynamic branch prediction

A. I and II only
B. I and III only
C. II and III only
D. I, II and III

gate2008 pipeline co&architecture normal

3.145 Pipeline: GATE2008-77 top gateoverflow.in/43487

Delayed branching can help in the handling of control hazards

The following code is to run on a pipelined processor with one branch delay slot:

I1: ADD R2 R7 + R8
I2: Sub R4 R5 R6
I3: ADD R1 R2 + R3
I4: STORE Memory [R4] R1
BRANCH to Label if R1 == 0
Which of the instructions I1, I2, I3 or I4 can legitimately occupy the delay slot without any program modification?

A. I1
B. I2
C. I3
D. I4

gate2008 co&architecture pipeline normal

3.146 Pipeline: GATE2012_20 top gateoverflow.in/52

Register renaming is done in pipelined processors

(A) as an alternative to register allocation at compile time


(B) for efficient access to function parameters and local variables
(C) to handle certain kinds of hazards
(D) as part of address translation

gate2012 co&architecture pipeline easy

3.147 Pipeline: GATE2000_1.8 top gateoverflow.in/631

Comparing the time T1 taken for a single instruction on a pipelined CPU with time T2 taken on a non-pipelined but identical CPU, we can say
that

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 202 of 852

a. T1 T2
b. T1 T2
c. T1 < T2
d. T1 and T2 plus the time taken for one instruction fetch cycle

gate2000 pipeline co&architecture easy

3.148 Virtual Memory: GATE2008_38 top gateoverflow.in/449

In an instruction execution pipeline, the earliest that the data TLB (Translation Lookaside Buffer) can be accessed is

A. before effective address calculation has started

B. during effective address calculation

C. after effective address calculation has completed

D. after data cache lookup has completed

gate2008 co&architecture virtual-memory normal

3.149 Virtual Memory: GATE1991_03,iii top gateoverflow.in/517

03. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

(iii) The total size of address space in a virtual memory system is limited by

a. the length of MAR


b. the available secondary storage
c. the available main memory
d. all of the above
e. none of the above

gate1991 co&architecture virtual-memory normal

3.150 Virtual Memory: GATE2004_47 top gateoverflow.in/318

Consider a system with a two-level paging scheme in which a regular memory access takes 150 nanoseconds, and servicing
a page fault takes 8 milliseconds. An average instruction takes 100 nanoseconds of CPU time, and two memory accesses.
The TLB hit ratio is 90%, and the page fault rate is one in every 10,000 instructions. What is the effective average instruction
execution time?

(A) 645 nanoseconds

(B) 1050 nanoseconds

(C) 1215 nanoseconds

(D) 1230 nanoseconds

gate2004 co&architecture virtual-memory normal

3.151 Writeback: Gate q-43_44 top gateoverflow.in/21189

Consider a cache memory hit ratios for read and write operations are 80% and 90% respectively. If there is a miss then 2
word block is to be through from main memory to cache. Consider 30% updations and the cache access time is 20ns/word
and memory access time 100 ns/word.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 203 of 852

Q43 calculate the efficiency of the cache using write through scheme?

A. 13.8 million words/ sec

B 12.8 million words/sec

C 14.8 million words/sec

D 11.8 million words/sec

Q 44 find efficiency of cache using write back scheme?( in million words per sec)

A.15.5 b. 16.5 c. 14.5 d. 13.5

co&architecture writeback write_through cache-memory

3.152 GATE2008_37 top gateoverflow.in/448

The use of multiple register windows with overlap causes a reduction in the number of memory accesses for

I. Function locals and parameters

II. Register saves and restores

III. Instruction fetches

A. I only
B. II only
C. III only
D. I, II and III

gate2008 co&architecture normal

3.152 GATE2008_71,72,73 in this question if virtual address is 32 bit how


can the virtual page address be 0xFF000 which is 20 bits? top gateoverflow.in/6354

3.153 GATE1991_01,ii top gateoverflow.in/499

In interleaved memory organization, consecutive words are stored in consecutive memory modules in _______ interleaving,
whereas consecutive words are stored within the module in ________ interleaving.

gate1991 co&architecture normal

3.153 GATE2008_71,72,73 in this question how the 32 bit virtual address can
be used in finding the mapping in cache i.e the tags blocks etc........should
we not first covert it into physical address ?????/ top gateoverflow.in/6352

3.154 GATE2001_1.10 top gateoverflow.in/703

Suppose a processor does not have any stack pointer register. Which of the following statements is true?

(A) It can not have subroutine call instruction

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 204 of 852

(B) It can have subroutine call instruction, but no nested subroutine calls

(C) Nested subroutine calls are possible, but interrupts are not

(D) All sequences of subroutine calls and also interrupts are possible

gate2001 co&architecture normal

3.155 GATE2000_1.10 top gateoverflow.in/633

The most appropriate matching for the following pairs

X: Indirect addressing 1: Loops


Y: Immediate addressing 2: Pointers
Z: Auto decrement addressing 3: Constants

is

a. X - 3 Y - 2 Z - 1
b. X - 1 Y - 3 Z - 2
c. X - 2 Y - 3 Z - 1
d. X - 3 Y - 1 Z - 2

gate2000 co&architecture normal

3.156 GATE1997_2.4 top gateoverflow.in/2230

The correct matching for the following pairs is:

(A) DMA I/O (1) High speed RAM


(B) Cache (2) Disk
(C) Interrupt I/O (3) Printer
(D) Condition Code Register (4) ALU

A. A-4 B-3 C-1 D-2

B. A-2 B-1 C-3 D-4

C. A-4 B-3 C-2 D-1

D. A-2 B-3 C-4 D-1

gate1997 co&architecture normal

3.157 GATE2014-1_55 top gateoverflow.in/1935

Consider two processors P1 and P2 executing the same instruction set. Assume that under identical conditions, for the same input, a program running on P2
takes 25% less time but incurs 20% more CPI (clock cycles per instruction) as compared to the program running on P1 . If the clock frequency of P1 is 1GHZ,
then the clock frequency of P2 (in GHz) is ______.

gate2014-1 co&architecture numerical-answers normal

3.158 GATE2006_43 top gateoverflow.in/1819

Consider a new instruction named branch-on-bit-set (mnemonic bbs). The instruction bbs reg, pos, label jumps to label if
bit in position pos of register operand reg is one. A register is 32 bits wide and the bits are numbered 0 to 31, bit in
position 0 being the least significant. Consider the following emulation of this instruction on a processor that does not have
bbs implemented.

temp reg&mask

Branch to label if temp is non-zero. The variable temp is a temporary register. For correct emulation, the variable mask
must be generated by

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 205 of 852

(A) mask 0x1 << pos


(B) mask 0xffffffff << pos
(C) mask pos
(D) mask 0xf
gate2006 co&architecture normal

3.159 GATE1999_2.22 top gateoverflow.in/1499

The main difference(s) between a CISC and a RISC processor is/are that a RISC processor typically

(a) has fewer instructions

(b) has fewer addressing modes

(c) has more registers

(d) is easier to implement using hard-wired logic

gate1999 co&architecture normal

3.160 GATE2002_1.13 top gateoverflow.in/817

Which of the following is not a form of memory

A. instruction cache
B. instruction register
C. instruction opcode
D. translation look-a-side buffer

gate2002 co&architecture easy

3.161 GATE2004-IT_50 top gateoverflow.in/790

In an enhancement of a design of a CPU, the speed of a floating point until has been increased by 20% and the speed of a
fixed point unit has been increased by 10%. What is the overall speedup achieved if the ratio of the number of floating point
operations to the number of fixed point operations is 2:3 and the floating point operation used to take twice the time taken
by the fixed point operation in the original design?

(A) 1.155 (B) 1.185 (C) 1.255 (D) 1.285

gate2004-it normal co&architecture

3.162 GATE1992_01,iii top gateoverflow.in/547

(iii) Many microprocessors have a specified lower limit on clock frequency (apart from the maximum clock frequency limit)
because _____

gate1992 normal co&architecture

3.163 GATE1992_01,iv top gateoverflow.in/548

Many of the advanced microprocessors prefetch instructions and store it in an instruction buffer to speed up processing. This
speed up is achieved because ________

gate1992 co&architecture easy

3.164 GATE2007-IT_36 top gateoverflow.in/3469

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 206 of 852

The floating point unit of a processor using a design D takes 2t cycles compared to t cycles taken by the fixed point unit.
There are two more design suggestions D1 and D2. D1 uses 30% more cycles for fixed point unit but 30% less cycles for
floating point unit as compared to design D. D2 uses 40% less cycles for fixed point unit but 10% more cycles for floating
point unit as compared to design D. For a given program which has 80% fixed point operations and 20% floating point
operations, which of the following ordering reflects the relative performances of three designs?
(Di > Dj denotes that Di is faster than Dj)

A) D1 > D > D2
B) D2 > D > D1
C) D > D2 > D1
D) D > D1 > D2

gate2007-it co&architecture normal

3.165 GATE1992_02,iii top gateoverflow.in/557

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Bit-slice processors

(a). can be cascaded to get any desired word length processor

(b). speed of operation is independent of the word length configured

(c). do not contain anything equivalent of program counter in a 'normal' microprocessor

(d). Contain only the data path of a 'normal' CPU

gate1992 co&architecture normal

3.166 GATE1995_1.2 top gateoverflow.in/2589

Which of the following statements is true?

A. ROM is a Read/Write memory

B. PC points to the last instruction that was executed

C. Stack works on the principle of LIFO

D. All instructions affect the flags

gate1995 co&architecture normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 207 of 852

4 Operating System top


4.1 Ambiguous: GATE 2016-1-50 top gateoverflow.in/39719

Consider the following proposed solution for the critical section problem. There are n processes : P0 . . . . Pn1 . In the code,
function pmax returns an integer not smaller than any of its arguments .For all i, t[i] is initialized to zero.

Code for Pi ;

do {
c[i]=1; t[i]= pmax (t[0],....,t[n-1])+1; c[i]=0;
for every j != i in {0,....,n-1} {
while (c[j]);
while (t[j] != 0 && t[j] <=t[i]);
}
Critical Section;
t[i]=0;

Remainder Section;
} while (true);

Which of the following is TRUE about the above solution?

A. At most one process can be in the critical section at any time


B. The bounded wait condition is satisfied
C. The progress condition is satisfied
D. It cannot cause a deadlock

gate2016-1 operating-system resource-allocation difficult ambiguous

4.2 Cache Memory: GATE2001_1.7 top gateoverflow.in/700

More than one word are put in one cache block to

(a) exploit the temporal locality of reference in a program

(b) exploit the spatial locality of reference in a program

(c) reduce the miss penalty

(d) none of the above

gate2001 operating-system easy cache-memory

4.3 Computer Organization: GATE2004_68 top gateoverflow.in/1062

A hard disk with a transfer rate of 10 Mbytes/second is constantly transferring data to memory using DMA. The processor
runs at 600 MHz, and takes 300 and 900 clock cycles to initiate and complete DMA transfer respectively. If the size of the
transfer is 20 Kbytes, what is the percentage of processor time consumed for the transfer operation?

A. 5.0%
B. 1.0%
C. 0.5%
D. 0.1%

gate2004 operating-system disk normal computer-organization

4.4 Computer Peripherals: GATE1992_02,xii top gateoverflow.in/569

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 208 of 852

Which of the following is an example of a spooled device?

(a). The terminal used to input data for a program being executed.

(b). The secondary memory device in a virtual memory system

(c). A line printer used to print the output of a number of jobs.

(d). None of the above.

gate1992 operating-system computer-peripherals easy

4.5 Concurrency: GATE2015-1_9 top gateoverflow.in/8121

The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.

P1() { P2(){
C = B - 1; D = 2 * B;
B = 2 * C; B = D - 1;
} }

The number of distinct values that B can possibly take after the execution is______________________.

gate2015-1 operating-system concurrency normal

4.6 Context Switch: GATE2011_6 top gateoverflow.in/2108

Let the time taken to switch between user and kernel modes of execution be t1 while the time taken to switch between two processes be t2 . Which of the
following is TRUE?

(A) t1 > t2

(B) t1 = t2

(C) t1 < t2

(D) nothing can be said about the relation between t1 and t2

gate2011 operating-system context-switch easy

4.7 Context Switch: GATE1999_2.12 top gateoverflow.in/1490

Which of the following actions is/are typically not performed by the operating system when switching context from process A
to process B?

A. Saving current register values and restoring saved register values for process B.
B. Changing address translation tables.
C. Swapping out the memory image of process A to the disk.
D. Invalidating the translation look-aside buffer.

gate1999 operating-system context-switch normal

4.8 Dining Philosopher: TIFR2011-B-26 top gateoverflow.in/20572

Consider the following two scenarios in the dining philosophers problem:

(i) First a philosopher has to enter a room with the table that restricts the number of philosophers to four.

(ii) There is no restriction on the number of philosophers entering the room. Which of the following is true?

a. Deadlock is possible in (i) and (ii).

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 209 of 852

b. Deadlock is possible in (i).


c. Starvation is possible in (i).
d. Deadlock is not possible in (ii).
e. Starvation is not possible in (ii)

tifr2011 operating-system process-synchronization dining-philosopher

4.9 Disk: GATE1997_74 top gateoverflow.in/19704

A program P reads and processes 1000 consecutive records from a sequential file F stored on device D without using any file
system facilities. Given the following

Size of each record = 3200 bytes

Access time of D = 10 msecs

Data transfer rate of D = 800 103 bytes/second

CPU time to process each record = 3 msecs

What is the elapsed time of P if

a. F contains unblocked records and P does not use buffering?

b. F contains unblocked records and P uses one buffer (i.e., it always reads ahead into the buffer)?

c. records of F are organized using a blocking factor of 2 (i.e., each block on D contains two records of F) and P uses one
buffer?

gate1997 operating-system disk

4.10 Disk: GATE2009-51 top gateoverflow.in/1337

A hard disk has 63 sectors per track, 10 platters each with 2 recording surfaces and 1000 cylinders. The address of a sector
is given as a triple c, h, s, where c is the cylinder number, h is the surface number and s is the sector number. Thus, the 0
th sector is addresses as 0, 0, 0, the 1 st sector as 0, 0, 1, and so on

51. The address <400, 16, 29> corresponds to sector number:

A. 505035
B. 505036
C. 505037
D. 505038

gate2009 operating-system disk normal

4.11 Disk: GATE2015-2_49 top gateoverflow.in/8251

Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer rate of 50 106 bytes/sec. If the
average seek time of the disk is twice the average rotational delay and the controller's transfer time is 10 times the disk
transfer time, the average time (in milliseconds) to read or write a 512-byte sector of the disk is _____.

gate2015-2 operating-system disk normal

4.12 Disk: GATE1993_7.8 top gateoverflow.in/2296

The root directory of a disk should be placed

(A) at a fixed address in main memory


(B) at a fixed location on the disk
(C) anywhere on the disk
(D) at a fixed location on the system disk
(E) anywhere on the system disk

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 210 of 852

gate1993 operating-system disk normal

4.13 Disk: GATE2001_20 top gateoverflow.in/761

Consider a disk with the 100 tracks numbered from 0 to 99 rotating at 3000 rpm. The number of sectors per track is 100 and
the time to move the head between two successive tracks is 0.2 millisecond.

a. Consider a set of disk requests to read data from tracks 32, 7, 45, 5 and 10. Assuming that the elevator algorithm is
used to schedule disk requests, and the head is initially at track 25 moving up (towards larger track numbers), what is
the total seek time for servicing the requests?
b. Consider an initial set of 100 arbitrary disk requests and assume that no new disk requests arrive while servicing these
requests. If the head is initially at track 0 and the elevator algorithm is used to schedule disk requests, what is the
worse case time to complete all the requests?

gate2001 operating-system disk normal

4.14 Disk: GATE2004-IT_51 top gateoverflow.in/3694

The storage area of a disk has innermost diameter of 10 cm and outermost diameter of 20 cm. The maximum storage
density of the disk is 1400bits/cm. The disk rotates at a speed of 4200 RPM. The main memory of a computer has 64-bit
word length and 1s cycle time. If cycle stealing is used for data transfer from the disk, the percentage of memory cycles
stolen for transferring one word is

A) 0.5%
B) 1%
C) 5%
D) 10%

gate2004-it operating-system disk normal

4.15 Disk: GATE2005-IT_63 top gateoverflow.in/3824

In a computer system, four files of size 11050 bytes, 4990 bytes, 5170 bytes and 12640 bytes need to be stored. For storing
these files on disk, we can use either 100 byte disk blocks or 200 byte disk blocks (but can't mix block sizes). For each block
used to store a file, 4 bytes of bookkeeping information also needs to be stored on the disk. Thus, the total space used to
store a file is the sum of the space taken to store the file and the space taken to store the book keeping information for the
blocks allocated for storing the file. A disk block can store either bookkeeping information for a file or data from a file, but
not both.
What is the total space required for storing the files using 100 byte disk blocks and 200 byte disk blocks respectively?

A) 35400 and 35800 bytes


B) 35800 and 35400 bytes
C) 35600 and 35400 bytes
D) 35400 and 35600 bytes

gate2005-it operating-system disk normal

4.16 Disk: GATE1993_6.7 top gateoverflow.in/2289

A certain moving arm disk storage, with one head, has the following specifications:

Number of tracks/recording surface = 200


Disk rotation speed = 2400 rpm
Track storage capacity = 62,500 bits

The average latency of this device is P ms and the data transfer rate is Q bits/sec. Write the values of P and Q.

gate1993 operating-system disk normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 211 of 852

4.17 Disk: GATE2001_8 top gateoverflow.in/749

Consider a disk with following specifications: 20 surface, 1000 tracks/surface, 16 sectors/track, data destiny 1 KB/sector,
rotation speed 3000 rpm. The operating system initiates the transfer between the disk and the memory sector-wise. Once
the head has been placed on the right track, the disk reads a sector in a single scan. It reads bits from the sector while the
head is passing over the sector. The read bits are formed into bytes in a serial-in-parallel-out buffer and each byte is then
transferred to memory. The disk writing is exactly a complementary process.

For parts (C) and (D) below, assume memory read-write time = 0.1 microsecond/byte, interrupt driven transfer has an
interrupt overhead = 0.4 microseconds, the DMA initialization and termination overhead is negligible compared to the total
sector transfer time. DMA requests are always granted.

A. What is the total capacity of the desk?


B. What is the data transfer rate?
C. What is the percentage of time the CPU is required for this disk I/O for bite-wise interrupts driven transfer?
D. What is the maximum percentage of time the CPU is held up for this disk I/O for cycle-stealing DMA transfer?

gate2001 operating-system disk normal

4.18 Disk: GATE2005_21 top gateoverflow.in/1357

What is the swap space in the disk used for?

A. Saving temporary html pages

B. Saving process data

C. Storing the super-block

D. Storing device drivers

gate2005 operating-system disk easy

4.19 Disk: GATE1995_14 top gateoverflow.in/2650

If the overhead for formatting a disk is 96 bytes for a 4000 byte sector,

a. Compute the unformatted capacity of the disk for the following parameters:

Number of surfaces: 8
Outer diameter of the disk: 12 cm
Inner diameter of the disk: 4 cm
Inner track space: 0.1 mm
Number of sectors per track: 20

b. If the disk in (a) is rotating at 360 rpm, determine the effective data transfer rate which is defined as the number of
bytes transferred per second between disk and memory.

gate1995 operating-system disk normal

4.20 Disk: GATE2001_1.22 top gateoverflow.in/715

Which of the following requires a device driver?

(A) Register

(B) Cache

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 212 of 852

(C) Main memory

(D) Disk

gate2001 operating-system disk easy

4.21 Disk: GATE2007-IT_44 top gateoverflow.in/3479

A hard disk system has the following parameters :

Number of tracks = 500


Number of sectors/track = 100
Number of bytes /sector = 500
Time taken by the head to move from one track to adjacent track = 1 ms
Rotation speed = 600 rpm.

What is the average time taken for transferring 250 bytes from the disk ?

A) 300.5 ms
B) 255.5 ms
C) 255 ms
D) 300 ms

gate2007-it operating-system disk normal

4.22 Disk: GATE1999_2.18 top gateoverflow.in/1496

One of more options can be correct. Mark all of them.

Raid configurations of the disks are used to provide

A. Fault-tolerance

B. High speed

C. High data density

D. None of the above

gate1999 operating-system disk easy

4.23 Disk: GATE2003_25 top gateoverflow.in/915

Using a larger block size in a fixed block size file system leads to

A. better disk throughput but poorer disk space utilization


B. better disk throughput and better disk space utilization
C. poorer disk throughput but better disk space utilization
D. poorer disk throughput and poorer disk space utilization

gate2003 operating-system disk normal

4.24 Disk: GATE2009-52 top gateoverflow.in/43477

A hard disk has 63 sectors per track, 10 platters each with 2 recording surfaces and 1000 cylinders. The address of a sector
is given as a triple c, h, s, where c is the cylinder number, h is the surface number and s is the sector number. Thus, the 0
th
0, 0, 0 st
0, 0, 1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 213 of 852

th
sector is addresses as 0, 0, 0, the 1 st sector as 0, 0, 1, and so on

The address of the 1039 th sector is

A. 0, 15, 31
B. 0, 16, 30
C. 0, 16, 31
D. 0, 17, 31

gate2009 operating-system disk normal

4.25 Disk: GATE2005-IT_81b top gateoverflow.in/3846

A disk has 8 equidistant tracks. The diameters of the innermost and outermost tracks are 1 cm and 8 cm respectively. The
innermost track has a storage capacity of 10 MB.

If the disk has 20 sectors per track and is currently at the end of the 5 th sector of the inner-most track and the head can
move at a speed of 10 meters/sec and it is rotating at constant angular velocity of 6000 RPM, how much time will it take to
read 1 MB contiguous data starting from the sector 4 of the outer-most track?

A) 13.5 ms
B) 10 ms
C) 9.5 ms
D) 20 ms

gate2005-it operating-system disk normal

4.26 Disk: GATE2008_32 top gateoverflow.in/443

For a magnetic disk with concentric circular tracks, the seek latency is not linearly proportional to the seek distance due to

A. non-uniform distribution of requests

B. arm starting and stopping inertia

C. higher capacity of tracks on the periphery of the platter

D. use of unfair arm scheduling policies

gate2008 operating-system disk normal

4.27 Disk: GATE2004_49 top gateoverflow.in/1045

A unix-style I-nodes has 10 direct pointers and one single, one double and one triple indirect pointers. Disk block size is 1
Kbyte, disk block address is 32 bits, and 48-bit integers are used. What is the maximum possible file size?

A. 224 bytes
B. 232 bytes
C. 234 bytes
D. 248 bytes

gate2004 operating-system disk normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 214 of 852

4.28 Disk: GATE2007_11 top gateoverflow.in/1209

Consider a disk pack with 16 surfaces, 128 tracks per surface and 256 sectors per track. 512 bytes of data are stored in a bit
serial manner in a sector. The capacity of the disk pack and the number of bits required to specify a particular sector in the
disk are respectively:

A. 256 Mbyte, 19 bits


B. 256 Mbyte, 28 bits
C. 512 Mbyte, 20 bits
D. 64 Gbyte, 28 bits

gate2007 operating-system disk normal

4.29 Disk: GATE2013_29 top gateoverflow.in/1540

Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and each cylinder contains 64
sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are organized cylinder-wise and the addressing
format is <cylinder no., surface no., sector no.> . A file of size 42797 KB is stored in the disk and the starting disk location
of the file is <1200, 9, 40>. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?

(A) 1281 (B) 1282 (C) 1283 (D) 1284

gate2013 operating-system disk normal

4.30 Disk: GATE1998-25b top gateoverflow.in/41055

Consider a disk with c cylinders, t tracks per cylinder, s sectors per track and a sector length sl . A logical file dl with fixed
record length rl is stored continuously on this disk starting at location (cL , tL , sL ), where cL , tL and SL are the cylinder,
track and sector numbers, respectively. Derive the formula to calculate the disk address (i.e. cylinder, track and sector) of a
logical record n assuming that rl = sl .

gate1998 operating-system disk descriptive

4.31 Disk: GATE2011_44 top gateoverflow.in/2146

An application loads 100 libraries at startup. Loading each library requires exactly one disk access. The seek time of the disk to a random
location is given as 10 ms. Rotational speed of disk is 6000 rpm. If all 100 libraries are loaded from random locations on the disk, how long
does it take to load all libraries? (The time to transfer data from the disk block once the head has been positioned at the start of the block may
be neglected.)

(A) 0.50 s

(B) 1.50 s

(C) 1.25 s

(D) 1.00 s

gate2011 operating-system disk normal

4.32 Disk: GATE1998_2.9 top gateoverflow.in/1681

Formatting for a floppy disk refers to

A. arranging the data on the disk in contiguous fashion

B. writing the directory

C. erasing the system data

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 215 of 852

D. writing identification information on all tracks and sectors

gate1998 operating-system disk normal

4.33 Disk: GATE2012_41 top gateoverflow.in/2149

A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly
indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The
maximum possible file size in this file system is

(A) 3 KBytes
(B) 35 KBytes
(C) 280 KBytes
(D) dependent on the size of the disk

gate2012 operating-system disk normal

4.34 Disk: GATE1998_17 top gateoverflow.in/1731

Calculate the total time required to read 35 sectors on a 2-sided floppy disk. Assume that each track has 8 sectors and the
track-to-track step time is 8 milliseconds. The first sector to be read is sector 3 on track 10. Assume that the diskette is soft
sectored and the controller has a 1-sector buffer. The diskette spins at 300 RPM and initially, the head is on track 10.

gate1998 operating-system disk normal numerical-answers

4.35 Disk: GATE2015-1_48 top gateoverflow.in/8354

Consider a disk pack with a seek time of 4 milliseconds and rotational speed of 10000 rotations per minute (RPM). It has 600
sectors per track and each sector can store 512 bytes of data. Consider a file stored in the disk. The file contains 2000
sectors. Assume that every sector access necessitates a seek, and the average rotational latency for accessing each sector is
half of the time for one complete rotation. The total time (in milliseconds) needed to read the entire file
is__________________.

gate2015-1 operating-system disk normal

4.36 Disk: GATE2005-IT_81a top gateoverflow.in/3845

A disk has 8 equidistant tracks. The diameters of the innermost and outermost tracks are 1 cm and 8 cm respectively. The
innermost track has a storage capacity of 10 MB.

What is the total amount of data that can be stored on the disk if it is used with a drive that rotates it with (i) Constant
Linear Velocity (ii) Constant Angular Velocity?

A) (i) 80 MB (ii) 2040 MB


B) (i) 2040 MB (ii) 80 MB
C) (i) 80 MB (ii) 360 MB
D) (i) 360 MB (ii) 80 MB

gate2005-it operating-system disk normal

4.37 Disk: GATE1998-25a top gateoverflow.in/1740

Free disk space can be used to keep track of using a free list or a bit map. Disk addresses require d bits. For a disk with B
blocks, F of which are free, state the condition under which the tree list uses less space than the bit map.

gate1998 operating-system disk descriptive

4.38 Disk Scheduling: GATE2015-1_30 top gateoverflow.in/8227

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 216 of 852

Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given:

45, 20, 90, 10, 50, 60, 80, 25, 70.

Assume that the initial position of the R/W head is on track 50. The additional distance that will be traversed by the R/W
head when the Shortest Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming
that SCAN algorithm moves towards 100 when it starts execution) is________________tracks.

gate2015-1 operating-system disk-scheduling normal

4.39 Disk Scheduling: GATE2007-IT_83 top gateoverflow.in/3535

The head of a hard disk serves requests following the shortest seek time first (SSTF) policy. The head is initially positioned at
track number 180.

What is the maximum cardinality of the request set, so that the head changes its direction after servicing every request if
the total number of tracks are 2048 and the head can start from any track?

A) 9
B) 10
C) 11
D) 12

gate2007-it operating-system disk-scheduling normal

4.40 Disk Scheduling: GATE2007-IT_82 top gateoverflow.in/3534

The head of a hard disk serves requests following the shortest seek time first (SSTF) policy. The head is initially positioned at
truck number 180.

Which of the request sets will cause the head to change its direction after servicing every request assuming that the head
does not change direction if there is a tie in SSTF and all the requests arrive before the servicing starts?

A) 11, 139, 170, 178, 181, 184, 201, 265


B) 10, 138, 170, 178, 181, 185, 201, 265
C) 10, 139, 169, 178, 181, 184, 201, 265
D) 10, 138, 170, 178, 181, 185, 200, 265

gate2007-it operating-system disk-scheduling normal

4.41 Disk Scheduling: GATE1995_20 top gateoverflow.in/2658

The head of a moving head disk with 100 tracks numbered 0 to 99 is currently serving a request at track 55. If the queue of
requests kept in FIFO order is

10, 70, 75, 23, 65

which of the two disk scheduling algorithms FCFS (First Come First Served) and SSTF (Shortest Seek Time First) will require
less head movement? Find the head movement for each of the algorithms.

gate1995 operating-system disk-scheduling normal

4.42 Disk Scheduling: GATE2014-1_19 top gateoverflow.in/1786

Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for
cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is
serviced after servicing ____________ number of requests.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 217 of 852

gate2014-1 operating-system disk-scheduling numerical-answers normal

4.43 Disk Scheduling: GATE2004-IT_62 top gateoverflow.in/3705

A disk has 200 tracks (numbered 0 through 199). At a given time, it was servicing the request of reading data from track
120, and at the previous request, service was for track 90. The pending requests (in order of their arrival) are for track
numbers.

30 70 115 130 110 80 20 25.

How many times will the head change its direction for the disk scheduling policies SSTF(Shortest Seek Time First) and FCFS
(First Come Fist Serve)?

A. 2 and 3
B. 3 and 3
C. 3 and 4
D. 4 and 4

gate2004-it operating-system disk-scheduling normal

4.44 Disk Scheduling: GATE2004_12 top gateoverflow.in/1009

Consider an operating system capable of loading and executing a single sequential user process at a time. The disk head
scheduling algorithm used is First Come First Served (FCFS). If FCFS is replaced by Shortest Seek Time First (SSTF), claimed
by the vendor to give 50% better benchmark results, what is the expected improvement in the I/O performance of user
programs?

A. 50%
B. 40%
C. 25%
D. 0%

gate2004 operating-system disk-scheduling normal

4.45 Disk Scheduling: GATE 2016-1-48 top gateoverflow.in/39716

Cylinder a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling
algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass.
The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these
requests is__________.

gate2016-1 operating-system disk-scheduling normal numerical-answers

4.46 Disk Scheduling: GATE2010_24 top gateoverflow.in/2203

A system uses FIFO policy for system replacement. It has 4 page frames with no pages loaded to begin with. The system
first accesses 100 distinct pages in some order and then accesses the same 100 pages but now in the reverse order. How
many page faults will occur?

(A) 196

(B) 192

(C) 197

(D) 195

gate2010 operating-system disk-scheduling normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 218 of 852

4.47 Disk Scheduling: GATE2009_31 top gateoverflow.in/1317

Consider a disk system with 100 cylinders. The requests to access the cylinders occur in following sequence:

4, 34, 10, 7, 19, 73, 2, 15, 6, 20

Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all requests if it takes 1ms to move from
one cylinder to adjacent one and shortest seek time first policy is used?

A. 95 ms
B. 119 ms
C. 233 ms
D. 276 ms

gate2009 operating-system disk-scheduling normal

4.48 Disk Scheduling: GATE1999_1.10 top gateoverflow.in/1463

Which of the following disk scheduling strategies is likely to give the best throughput?

A. Farthest cylinder next

B. Nearest cylinder next

C. First come first served

D. Elevator algorithm

gate1999 operating-system disk-scheduling normal

4.49 Dma: GATE2005_70 top gateoverflow.in/1393

Consider a disk drive with the following specifications:

16 surfaces, 512 tracks/surface, 512 sectors/track, 1 KB/sector, rotation speed 3000 rpm. The disk is operated in cycle
stealing mode whereby whenever one 4 byte word is ready it is sent to memory; similarly, for writing, the disk interface
reads a 4 byte word from the memory in each DMA cycle. Memory cycle time is 40 nsec. The maximum percentage of time
that the CPU gets blocked during DMA operation is:

A. 10
B. 25
C. 40
D. 50

gate2005 operating-system disk normal dma

4.50 File: GATE2014-2_20 top gateoverflow.in/1977

A FAT (le allocation table) based le system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a 100 106 bytes disk on
which the file system is stored and data block size is 103 bytes, the maximum size of a file that can be stored on this disk in units of 106 bytes is _________.

gate2014-2 operating-system disk numerical-answers normal file file-system

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 219 of 852

4.51 File System: GATE1996_23 top gateoverflow.in/2775

A file system with a one-level directory structure is implemented on a disk with disk block size of 4K bytes. The disk is used
as follows:

File Allocation Table, consisting of one 8-bit


entry per data block, representing the data
Disk-block 0
block address of the next data block in the
file

Disk-block 1 Directory, with one 32 bit entry per file:

Disk-block 2 Data-block 1;
Disk-block 3 Data-block 2; etc.

a. What is the maximum possible number of files?


b. What is the maximum possible file size in blocks

gate1996 operating-system disk normal file-system

4.52 File System: GATE2008_20 top gateoverflow.in/418

The data blocks of a very large file in the Unix file system are allocated using

A. continuous allocation
B. linked allocation
C. indexed allocation
D. an extension of indexed allocation

gate2008 file-system operating-system normal

4.53 File System: GATE2004-IT_67 top gateoverflow.in/3710

In a particular Unix OS, each data block is of size 1024 bytes, each node has 10 direct data block addresses and three
additional addresses: one for single indirect block, one for double indirect block and one for triple indirect block. Also, each
block can contain addresses for 128 blocks. Which one of the following is approximately the maximum size of a file in the file
system?

A) 512 MB
B) 2 GB
C) 8 GB

D) 16 GB

gate2004-it operating-system file-system normal

4.54 Fork: GATE2005_72 top gateoverflow.in/765

Consider the following code fragment:


if (fork() == 0)
{
a = a + 5;
printf("%d, %p n", a, &a);
}
else
{
a = a - 5;
printf ("%d, %p n", a,& a);

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 220 of 852

Let u,v be the values printed by the parent process and x,y be the values printed by the child process. Which one of the
following is TRUE?

a) x < u and y < v

b) x < u and y = v

c) x = u+10 and y < v

d) x = u+10 y = v

gate2005 operating-system fork normal

4.55 Fork: GATE2004-IT_64 top gateoverflow.in/3707

A process executes the following segment of code :

for(i = 1; i < = n; i++)


fork ();

The number of new processes created is

A) n
B) ((n(n + 1))/2)
C) 2n - 1
D) 3n - 1

gate2004-it operating-system fork easy

4.56 Fork: GATE2008_66 top gateoverflow.in/489

A process executes the following code

for(i=0; i<n; i++) fork();

The total number of child processes created is

(A) n (B) 2 n-1 (C) 2 n (D) 2n+1 - 1

gate2008 operating-system fork normal

4.57 Interrupts: GATE1998_1.18 top gateoverflow.in/1655

Which of the following devices should get higher priority in assigning interrupts?

A. Hard disk
B. Printer
C. Keyboard
D. Floppy disk

gate1998 operating-system interrupts normal

4.58 Interrupts: GATE2011_11 top gateoverflow.in/2113

A computer handles several interrupt sources of which of the following are relevant for this question.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 221 of 852

Interrupt from CPU temperature sensor (raises interrupt if CPU temperature is too high)
Interrupt from Mouse (raises Interrupt if the mouse is moved or a button is pressed)
Interrupt from Keyboard (raises Interrupt if a key is pressed or released)
Interrupt from Hard Disk (raises Interrupt when a disk read is completed)

Which one of these will be handled at the HIGHEST priority?

(A) Interrupt from Hard Disk


(B) Interrupt from Mouse
(C) Interrupt from Keyboard
(D) Interrupt from CPU temperature sensor

gate2011 operating-system interrupts normal

4.59 Interrupts: GATE1997_3.8 top gateoverflow.in/2239

When an interrupt occurs, an operating system

A. ignores the interrupt

B. always changes state of interrupted process after processing the interrupt

C. always resumes execution of interrupted process after processing the interrupt

D. may change state of interrupted process to blocked and schedule another process.

gate1997 operating-system interrupts normal

4.60 Interrupts: GATE1993_6.8 top gateoverflow.in/2290

The details of an interrupt cycle are shown in figure.

Given that an interrupt input arrives every 1 msec, what is the percentage of the total time that the CPU devotes for the
main program execution.

gate1993 operating-system interrupts normal

4.61 Interrupts: GATE2001_1.12 top gateoverflow.in/705

A processor needs software interrupt to

(A) test the interrupt system of the processor

(B) implement co-routines

(C) obtain system services which need execution of privileged instructions

(D) return from subroutine

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 222 of 852

gate2001 operating-system interrupts easy

4.62 Io Handling: GATE1998_1.29 top gateoverflow.in/1666

Which of the following is an example of a spooled device?

A. The terminal used to enter the input data for the C program being executed

B. An output device used to print the output of a number of jobs

C. The secondary memory device in a virtual storage system

D. The swapping area on a disk used by the swapper

gate1998 operating-system io-handling easy

4.63 Io Handling: GATE2005_19 top gateoverflow.in/1355

Which one of the following is true for a CPU having a single interrupt request line and a single interrupt grant line?

A. Neither vectored interrupt nor multiple interrupting devices are possible

B. Vectored interrupts are not possible but multiple interrupting devices are possible

C. Vectored interrupts and multiple interrupting devices are both possible

D. Vectored interrupts are possible but multiple interrupting devices are not possible

gate2005 operating-system io-handling normal

4.64 Io Handling: GATE1995_17 top gateoverflow.in/2653

a. An asynchronous serial communication controller that uses a start-stop scheme for controlling the serial I/O of a system
is programmed for a string of length seven bits, one parity bit (odd parity) and one step bit. The transmission rate is
1200 bits/second.
i. What is the complete bit stream that is transmitted for the string 0110101?

ii. How many such string can be transmitted per second?

b. Consider a CRT display that has a text mode display format of 80 25 characters with a 9 12 character cell. What is
the size of the video buffer RAM for the display to be used in monochrome (1 bit per pixel) graphics mode?

gate1995 operating-system io-handling normal

4.65 Io Handling: GATE1996_1.20 top gateoverflow.in/2724

Which of the following is an example of spooled device?

A. A line printer used to print the output of a number of jobs

B. A terminal used to enter input data to a running program

C. A secondary storage device in a virtual memory system

D. A graphic display device

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 223 of 852

gate1996 operating-system io-handling normal

4.66 Io Handling: GATE2004-IT_11 top gateoverflow.in/3652

What is the bit rate of a video terminal unit with 80 characters/line, 8 bits/character and horizontal sweep time of 100 s
(including 20 s of retrace time)?

A) 8 Mbps
B) 6.4 Mbps
C) 0.8 Mbps

D) 0.64 Mbps

gate2004-it operating-system io-handling easy

4.67 Io Handling: GATE2005_20 top gateoverflow.in/1356

Normally user programs are prevented from handling I/O directly by I/O instructions in them. For CPUs having explicit I/O
instructions, such I/O protection is ensured by having the I/O instruction privileged. In a CPU with memory mapped I/O,
there is no explicit I/O instruction. Which one of the following is true for a CPU with memory mapped I/O?

A. I/O protection is ensured by operating system routine(s)

B. I/O protection is ensured by a hardware trap

C. I/O protection is ensured during system configuration

D. I/O protection is not possible

gate2005 operating-system io-handling normal

4.68 Io Handling: GATE2006-IT_8 top gateoverflow.in/3547

Which of the following DMA transfer modes and interrupt handling mechanisms will enable the highest I/O band-width?

A) Transparent DMA and Polling interrupts


B) Cycle-stealing and Vectored interrupts
C) Block transfer and Vectored interrupts
D) Block transfer and Polling interrupts

gate2006-it operating-system io-handling dma normal

4.69 Linking: GATE2002_2.20 top gateoverflow.in/850

Dynamic linking can cause security concerns because

A. Security is dynamic
B. The path for searching dynamic libraries is not known till runtime
C. Linking is insecure
D. Cryptographic procedures are not available for dynamic linking

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 224 of 852

gate2002 operating-system linking easy

4.70 Memory Allocation: GATE2015-2_30 top gateoverflow.in/8145

Consider 6 memory partitions of sizes 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250 KB, where KB refers to kilobyte.
These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB, 491 KB in that order. If the best fit
algorithm is used, which partitions are NOT allotted to any process?

A. 200 KB and 300 KB


B. 200 KB and 250 KB
C. 250 KB and 300 KB
D. 300 KB and 400 KB

gate2015-2 operating-system memory-allocation easy

4.71 Memory Management: GATE1992-12b top gateoverflow.in/43582

Let the page reference and the working set window be c c d b c e c e a d and 4, respectively. The initial working set at time
t = 0 contains the pages {a, d, e}, where a was referenced at time t = 0, d was referenced at time t = 1, and e was
referenced at time t = 2. Determine the total number of page faults and he average number of page frames used by
computing the working set at each reference.

gate1992 operating-system memory-management normal

4.72 Memory Management: GATE2007-IT_11 top gateoverflow.in/3444

Let a memory have four free blocks of sizes 4k, 8k, 20k, 2k. These blocks are allocated following the best-fit strategy. The
allocation requests are stored in a queue as shown below.

Request No J1 J2 J3 J4 J5 J6 J7 J8
Request Sizes 2k 14k 3k 6k 6k 10k 7k 20k
Usage Time 4 10 2 8 4 1 8 6

The time at which the request for J7 will be completed will be

A) 16
B) 19
C) 20
D) 37

gate2007-it operating-system memory-management normal

4.73 Memory Management: GATE1995_5 top gateoverflow.in/2641

A computer installation has 1000k of main memory. The jobs arrive and finish in the following sequences.

Job 1 requiring 200k arrives


Job 2 requiring 350k arrives

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 225 of 852

Job 3 requiring 300k arrives


Job 1 finishes
Job 4 requiring 120k arrives
Job 5 requiring 150k arrives
Job 6 requiring 80k arrives

a. Draw the memory allocation table using Best Fit and First Fit algorithms

b. Which algorithm performs better for this sequence?

gate1995 operating-system memory-management normal

4.74 Memory Management: GATE2014-2_55 top gateoverflow.in/2022

Consider a main memory system that consists of 8 memory modules attached to the system bus, which is one word wide.
When a write request is made, the bus is occupied for 100 nanoseconds (ns) by the data, address, and control signals.
During the same 100 ns, and for 500 ns thereafter, the addressed memory module executes one cycle accepting and storing
the data. The (internal) operation of different memory modules may overlap in time, but only one request can be on the bus
at any time. The maximum number of stores (of one word each) that can be initiated in 1 millisecond is ________

gate2014-2 operating-system memory-management numerical-answers normal

4.75 Memory Management: GATE1996_2.18 top gateoverflow.in/2747

A 1000 Kbyte memory is managed using variable partitions but no compaction. It currently has two partitions of sizes 200
Kbytes and 260 Kbytes respectively. The smallest allocation request in Kbytes that could be denied is for

A. 151
B. 181
C. 231
D. 541

gate1996 operating-system memory-management normal

4.76 Memory Management: GATE2006-IT_56 top gateoverflow.in/3600

For each of the four processes P 1, P 2, P 3 and P 4. The total size in kilobytes (KB) and the number of segments are given
below.

Process Total size (in KB) Number of segments


P1 195 4
P2 254 5
P3 45 3
P4 364 8

The page size is 1 KB. The size of an entry in the page table is 4 bytes. The size of an entry in the segment table is 8 bytes.
The maximum size of a segment is 256 KB. The paging method for memory management uses two-level paging, and its
storage overhead is P. The storage overhead for the segmentation method is S. The storage overhead for the segmentation
and paging method is T. What is the relation among the overheads for the different methods of memory management in the
concurrent execution of the above four processes ?

A) P < S < T
B) S < P < T
C) S < T < P
D) T < S < P

gate2006-it operating-system memory-management normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 226 of 852

4.77 Page Replacement: GATE1997_3.9 top gateoverflow.in/2240

Thrashing

A. reduces page I/O


B. decreases the degree of multiprogramming
C. implies excessive page I/O
D. improve the system performance

gate1997 operating-system page-replacement easy

4.78 Page Replacement: GATE2007-IT_58 top gateoverflow.in/3500

A demand paging system takes 100 time units to service a page fault and 300 time units to replace a dirty page. Memory
access time is 1 time unit. The probability of a page fault is p. In case of a page fault, the probability of page being dirty is
also p. It is observed that the average access time is 3 time units. Then the value of p is

A) 0.194
B) 0.233
C) 0.514
D) 0.981

gate2007-it operating-system page-replacement probability normal

4.79 Page Replacement: GATE2007-IT_12 top gateoverflow.in/3445

The address sequence generated by tracing a particular program executing in a pure demand paging system with 100 bytes
per page is
0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0410.

Suppose that the memory can store only one page and if x is the address which causes a page fault then the bytes from
addresses x to x + 99 are loaded on to the memory.

How many page faults will occur ?

A) 0
B) 4
C) 7
D) 8

gate2007-it operating-system virtual-memory page-replacement normal

4.80 Page Replacement: GATE2014-2_33 top gateoverflow.in/1992

A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, ..., 100 in that
order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the
optimal page replacement policy for this program?

(A) Least-recently-used

(B) First-in-first-out

(C) Last-in-first-out

(D) Most-recently-used

gate2014-2 operating-system page-replacement easy

4.81 Page Replacement: GATE1993_21 top gateoverflow.in/2318

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 227 of 852

The following page addresses, in the given sequence, were generated by a program:

1 2 3 4 1 3 5 2 1 5 4 3 2 3

This program is run on a demand paged virtual memory system, with main memory size equal to 4 pages. Indicate the page
references for which page faults occur for the following page replacement algorithms.

a. LRU
b. FIFO

Assume that the main memory is initially empty

gate1993 operating-system page-replacement normal

4.82 Page Replacement: GATE1997_3.10 top gateoverflow.in/2241

Dirty bit for a page in a page table

A. helps avoid unnecessary writes on a paging device

B. helps maintain LRU information

C. allows only read on a page

D. None of the above

gate1997 operating-system page-replacement easy

4.83 Page Replacement: GATE2002_1.23 top gateoverflow.in/828

The optimal page replacement algorithm will select the page that

A. Has not been used for the longest time in the past
B. Will not be used for the longest time in the future
C. Has been used least number of times
D. Has been used most number of times

gate2002 operating-system page-replacement easy

4.84 Page Replacement: GATE2007-83 top gateoverflow.in/43510

A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory
initially. The process makes the following sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1

Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above
reference string, how many more page faults occur with LRU than with the optimal page replacement policy?

A. 0
B. 1
C. 2
D. 3

gate2007 normal operating-system page-replacement

4.85 Page Replacement: GATE1995_2.7 top gateoverflow.in/2619

The address sequence generated by tracing a particular program executing in a pure demand based paging system with 100
records per page with 1 free main memory frame is recorded as follows. What is the number of page faults?

0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0370

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 228 of 852

0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0370
A. 13
B. 8
C. 7
D. 10

gate1995 operating-system page-replacement normal

4.86 Page Replacement: TIFR2013-B-14 top gateoverflow.in/25794

Assume a demand paged memory system where ONLY THREE pages can reside in the memory at a time. The following
sequence gives the order in which the program references the pages.
1, 3, 1, 3, 4, 2, 2, 4
Assume that least frequently used page is replaced when necessary. If there is more than one least frequently used pages
then the least recently used page among them is replaced. During the programs execution, how many times will the pages
1, 2, 3 and 4 be brought to the memory?
a. 2, 2, 2, 2 times, respectively
b. 1, 1, 1, 2 times, respectively
c. 1, 1, 1, 1 times, respectively
d. 2, 1, 2, 2 times, respectively
e. None of the above

tifr2013 operating-system page-replacement

4.87 Page Replacement: GATE2012_42 top gateoverflow.in/2150

Consider the virtual page reference string

1, 2, 3, 2, 4, 1, 3, 2, 4, 1

on a demand paged virtual memory system running on a computer system that has main memory size of 3 page frames
which are initially empty. Let LRU , F IF O and OP T IMAL denote the number of page faults under the corresponding
page replacement policy. Then

(A) OP T IMAL < LRU < F IF O


(B) OP T IMAL < F IF O < LRU
(C) OP T IMAL = LRU
(D) OP T IMAL = F IF O

gate2012 operating-system page-replacement normal

4.88 Page Replacement: GATE1994_1.13 top gateoverflow.in/2454

A memory page containing a heavily used variable that was initialized very early and is in constant use is removed then

A. LRU page replacement algorithm is used

B. FIFO page replacement algorithm is used

C. LFU page replacement algorithm is used

D. None of the above

gate1994 operating-system page-replacement easy

4.89 Page Replacement: GATE 2016-2-20 top gateoverflow.in/39559

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 229 of 852

In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the
number of allocated frames increases?

A. LRU (Least Recently Used)


B. OPT (Optimal Page Replacement)
C. MRU (Most Recently Used)
D. FIFO (First In First Out)

gate2016-2 operating-system page-replacement easy

4.90 Page Replacement: GATE 2016-1-49 top gateoverflow.in/39711

Consider a computer system with ten physical page frames. The system is provided with an access sequence
(a1 , a2 , . . . . , a20 , a1 , a2 , . . . a20 ), where each ai is a distinct virtual page number. The difference in the number of page
faults between the last-in-first-out page replacement policy and the optimal page replacement policy is_________.

gate2016-1 operating-system page-replacement normal numerical-answers

4.91 Page Replacement: GATE2015-1_47 top gateoverflow.in/8353

Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3,
6, 2, 1, 3. Which one of the following is true with respect to page replacement policies First In First Out (FIFO) and Least
Recently Used (LRU)?

A. Both incur the same number of page faults


B. FIFO incurs 2 more page faults than LRU
C. LRU incurs 2 more page faults than FIFO
D. FIFO incurs 1 more page faults than LRU

gate2015-1 operating-system page-replacement normal

4.92 Page Replacement: GATE2007_56 top gateoverflow.in/1254

A virtual memory system uses First In First Out (FIFO) page replacement policy and allocates a fixed number of frames to a
process. Consider the following statements:

P: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.

Q: Some programs do not exhibit locality of reference.

Which one of the following is TRUE?

A. Both P and Q are true, and Q is the reason for P

B. Both P and Q are true, but Q is not the reason for P.

C. P is false but Q is true

D. Both P and Q are false.

gate2007 operating-system page-replacement normal

4.93 Page Replacement: GATE2007-82 top gateoverflow.in/1274

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 230 of 852

A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory
initially. The process makes the following sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1

If optimal page replacement policy is used, how many page faults occur for the above reference string?

A. 7
B. 8
C. 9
D. 10

gate2007 operating-system page-replacement normal

4.94 Page Replacement: GATE2005_22 top gateoverflow.in/1358

Increasing the RAM of a computer typically improves performance because:

A. Virtual Memory increases

B. Larger RAMs are faster

C. Fewer page faults occur

D. Fewer segmentation faults occur

gate2005 operating-system page-replacement easy

4.95 Page Replacement: GATE1997_3.5 top gateoverflow.in/2236

Locality of reference implies that the page reference being made by a process

A. will always be to the page used in the previous page reference

B. is likely to be to one of the pages used in the last few page references

C. will always be to one of the pages existing in memory

D. will always lead to a page fault

gate1997 operating-system page-replacement easy

4.96 Page Replacement: GATE1994_1.24 top gateoverflow.in/2467

Consider the following heap (figure) in which blank regions are not in use and hatched region are in use.

The sequence of requests for blocks of sizes 300, 25, 125, 50 can be satisfied if we use

A. either first fit or best fit policy (any one)

B. first fit but not best fit policy

C. best fit but not first fit policy

D. None of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 231 of 852

gate1994 operating-system page-replacement normal

4.97 Page Replacement: GATE2014-3_20 top gateoverflow.in/2054

A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used ( LRU) page
replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will
occur while processing the page reference string given below?

4, 7, 6, 1, 7, 6, 1, 2, 7, 2

gate2014-3 operating-system page-replacement numerical-answers normal

4.98 Page Replacement: GATE2004_21 top gateoverflow.in/1018

The minimum number of page frames that must be allocated to a running process in a virtual memory environment is
determined by

(a) the instruction set architecture

(b) page size

(c) physical memory size

(d) number of processes in memory

gate2004 operating-system virtual-memory page-replacement normal

4.99 Page Replacement: GATE2014-1_33 top gateoverflow.in/1805

Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6,
the number of page faults using the optimal replacement policy is__________.

gate2014-1 operating-system page-replacement numerical-answers

4.100 Page Replacement: GATE1995_1.8 top gateoverflow.in/2595

Which of the following page replacement algorithms suffers from Beladys anamoly?

A. Optimal replacement

B. LRU

C. FIFO

D. Both (A) and (C)

gate1995 operating-system page-replacement normal

4.101 Process Schedule: GATE2008-IT_55 top gateoverflow.in/3365

If the time-slice used in the round-robin scheduling policy is more than the maximum time required to execute any process,
then the policy will

A) degenerate to shortest job first


B) degenerate to priority scheduling
C) degenerate to first come first serve

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 232 of 852

D) none of the above

gate2008-it operating-system process-schedule easy

4.102 Process Schedule: GATE2010_25 top gateoverflow.in/2204

Which of the following statements are true?

I. Shortest remaining time first scheduling may cause starvation


II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time

(A) I only

(B) I and III only

(C) II and III only

(D) I, II and III

gate2010 operating-system process-schedule easy

4.103 Process Schedule: GATE1996_2.20 top gateoverflow.in/2749

Four jobs to be executed on a single processor system arrive at time 0 in the order A, B, C, D . Their burst CPU time
requirements are 4, 1, 8, 1 time units respectively. The completion time of A under round robin scheduling with time slice of
one time unit is

A. 10
B. 4
C. 8
D. 9

gate1996 operating-system process-schedule normal

4.104 Process Schedule: GATE2014-2_32 top gateoverflow.in/1991

Three processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single
computation that requires tc CPU milliseconds and then initiates a single I/O operation that lasts for tio milliseconds. It is
assumed that the computer where the processes execute has sufficient number of I/O devices and the OS of the computer
assigns different I/O devices to each process. Also, the scheduling overhead of the OS is negligible. The processes have the
following characteristics:

Process id tc tio

A 100 ms 500 ms
B 350 ms 500 ms
C 200 ms 500 ms

The processes A, B, and C are started at times 0, 5 and 10 milliseconds respectively, in a pure time sharing system (round
robin scheduling) that uses a time slice of 50 milliseconds. The time in milliseconds at which process C would complete its
first I/O operation is ___________.

gate2014-2 operating-system process-schedule numerical-answers normal

4.105 Process Schedule: GATE2014-3_32 top gateoverflow.in/2066

An operating system uses shortest


remaining
time
rst scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes
with their arrival times and CPU burst times (in milliseconds):

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 233 of 852

Process Arrival Time Burst Time


P1 0 12
P2 2 4
P3 3 6
P4 8 5

The average waiting time (in milliseconds) of the processes is ______.

gate2014-3 operating-system process-schedule numerical-answers normal

4.106 Process Schedule: GATE2011_35 top gateoverflow.in/2137

Consider the following table of arrival time and burst time for three processes P0, P1 and P2.

Process Arrival Time Burst Time


P0 0 ms 9 ms
P1 1 ms 4 ms
P2 2 ms 9 ms

The pre-emptive shortest job rst scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is
the average waiting time for the three processes?

(A) 5.0 ms

(B) 4.33 ms

(C) 6.33 ms

(D) 7.33 ms

gate2011 operating-system process-schedule normal

4.107 Process Schedule: GATE2006_65 top gateoverflow.in/1843

Consider three processes, all arriving at time zero, with total execution time of 10, 20 and 30 units, respectively. Each
process spends the first 20% of execution time doing I/O, the next 70% of time doing computation, and the last 10% of time
doing I/O again. The operating system uses a shortest remaining compute time first scheduling algorithm and schedules a
new process either when the running process gets blocked on I/O or when the running process finishes its compute burst.
Assume that all I/O operations can be overlapped as much as possible. For what percentage of time does the CPU remain
idle?

(A) 0%
(B) 10.6%
(C) 30.0%
(D) 89.4%

gate2006 operating-system process-schedule normal

4.108 Process Schedule: GATE2006_64 top gateoverflow.in/1842

Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2, 4 and 8 time units. All processes
arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving
priority to the process with the lowest process id. The average turn around time is:

(A) 13 units
(B) 14 units
(C) 15 units
(D) 16 units

gate2006 operating-system process-schedule normal

4.109 Process Schedule: GATE2005-IT_60 top gateoverflow.in/3821

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 234 of 852

We wish to schedule three processes P1, P2 and P3 on a uniprocessor system. The priorities, CPU time requirements and
arrival times of the processes are as shown below.

Arrival
Process Priority CPU time time
required (hh:mm:ss)

P1 10(highest) 20 sec 00:00:05


P2 9 10 sec 00:00:03
P3 8 (lowest) 15 sec 00:00:00

We have a choice of preemptive or non-preemptive scheduling. In preemptive scheduling, a late-arriving higher priority
process can preempt a currently running process with lower priority. In non-preemptive scheduling, a late-arriving higher
priority process must wait for the currently executing process to complete before it can be scheduled on the processor.
What are the turnaround times (time from arrival till completion) of P2 using preemptive and non-preemptive scheduling
respectively?

A) 30 sec, 30 sec
B) 30 sec, 10 sec
C) 42 sec, 42 sec
D) 30 sec, 42 sec

gate2005-it operating-system process-schedule normal

4.110 Process Schedule: GATE2015-3_34 top gateoverflow.in/8492

For the processes listed in the following table, which of the following scheduling schemes will give the lowest average
turnaround time?

Process Arrival Time Process Time


A 0 3
B 1 6
C 4 4
D 6 2

A. First Come First Serve


B. Non-preemprive Shortest job first
C. Shortest Remaining Time
D. Round Robin with Quantum value two

gate2015-3 operating-system process-schedule normal

4.111 Process Schedule: GATE1998_7b top gateoverflow.in/12963

a. In a computer system where the best-fit algorithm is used for allocating jobs to memory partitions, the following
situation was encountered:

Partitions size in KB 4K 8K 20K 2K


Job sizes in KB 2K 14K 3K 6K 6K 10K 20K 2K
Time for execution 4 10 2 1 4 1 8 6

When will the 20K job complete?

gate1998 operating-system process-schedule normal

4.112 Process Schedule: GATE2002_1.22 top gateoverflow.in/827

Which of the following scheduling algorithms is non-preemptive?

A. Round Robin

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 235 of 852

B. First-In First-Out
C. Multilevel Queue Scheduling
D. Multilevel Queue Scheduling with Feedback

gate2002 operating-system process-schedule easy

4.113 Process Schedule: GATE2015-3_1 top gateoverflow.in/8390

The maximum number of processes that can be in ready Ready state for a computer system with n CPUs is

A. n
B. n2
C. 2n
D. Independent of n

gate2015-3 operating-system process-schedule easy

4.114 Process Schedule: GATE2006_06 top gateoverflow.in/885

Consider three CPU-intensive processes, which require 10, 20 and 30 time units and arrive at times 0, 2 and 6, respectively.
How many context switches are needed if the operating system implements a shortest remaining time first scheduling
algorithm? Do not count the context switches at time zero and at the end.

(A) 1
(B) 2
(C) 3
(D) 4

gate2006 operating-system process-schedule normal

4.115 Process Schedule: GATE1993_7.10 top gateoverflow.in/2298

Assume that the following jobs are to be executed on a single processor system

Job Id CPU Burst Time


p 4
q 1
r 8
s 1
t 2

The jobs are assumed to have arrived at time 0+ and in the order p, q, r, s, t. Calculate the departure time (completion time)
for job p if scheduling is round robin with time slice 1

(a). 4

(b). 10

(c). 11

(d). 12

(e). None of the above

gate1993 operating-system process-schedule normal

4.116 Process Schedule: GATE2001_1.19 top gateoverflow.in/712

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 236 of 852

Consider a set of tasks with known runtimes r1 , r2 , rn to be run on a uniprocessor machine. Which of the following
processor scheduling algorithms will result in the maximum throughput?

(A) Round-Robin

(B) Shortest-Job-First

(C) Highest-Response_Ratio-Next

(D) First-Come-First-Served

gate2001 operating-system process-schedule normal

4.117 Process Schedule: GATE 2016-1-20 top gateoverflow.in/39655

Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer
system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready
queue?

A. Shortest remaining time first


B. Round-robin with the time quantum less than the shortest CPU burst
C. Uniform random
D. Highest priority first with priority proportional to CPU burst length

gate2016-1 operating-system process-schedule normal

4.118 Process Schedule: GATE2016-2-47 top gateoverflow.in/39625

Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling
algorithm used is preemptive shortest remaining-time first.

Process Arrival Time Burst Time


P1 0 10
P2 3 6
P3 7 1
P4 8 3

The average turn around time of these processes is ___________ milliseconds.

gate2016-2 operating-system process-schedule normal numerical-answers

4.119 Process Schedule: GATE1995_1.15 top gateoverflow.in/2602

Which scheduling policy is most suitable for a time shared operating system?

A. Shortest Job First


B. Round Robin
C. First Come First Serve
D. Elevator

gate1995 operating-system process-schedule easy

4.120 Process Schedule: GATE1995_2.6 top gateoverflow.in/2618

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 237 of 852

The sequence .. is an optimal non-preemptive scheduling sequence for the following jobs which leaves the CPU idle for
. unit(s) of time.

Job Arrival Time Burst Time


1 0.0 9
2 0.6 5
3 1.0 1

A. {3, 2, 1}, 1
B. {2, 1, 3}, 0
C. {3, 2, 1}, 0
D. {1, 2, 3}, 5

gate1995 operating-system process-schedule normal

4.121 Process Schedule: GATE2015-1_46 top gateoverflow.in/8330

Consider a uniprocessor system executing three tasks T1 , T2 and T3 each of which is composed of an infinite sequence of
jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is
the inverse of its period, and the available tasks are scheduled in order of priority, which is the highest priority task
scheduled first. Each instance of T1 , T2 and T3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that
all tasks initially arrive at the beginning of the 1st millisecond and task preemptions are allowed, the first instance of T3
completes its execution at the end of_____________________milliseconds.

gate2015-1 operating-system process-schedule normal

4.122 Process Schedule: GATE2003_77 top gateoverflow.in/963

A uni-processor computer system only has two processes, both of which alternate 10 ms CPU bursts with 90 ms I/O bursts.
Both the processes were created at nearly the same time. The I/O of both processes can proceed in parallel. Which of the
following scheduling strategies will result in the least CPU utilization (over a long period of time) for this system?

A. First come first served scheduling

B. Shortest remaining time first scheduling

C. Static priority scheduling with different priorities for the two processes

D. Round robin scheduling with a time quantum of 5 ms

gate2003 operating-system process-schedule normal

4.123 Process Schedule: GATE1998_2.17 top gateoverflow.in/1690

Consider n processes sharing the CPU in a round-robin fashion. Assuming that each process switch takes s seconds, what
must be the quantum size q such that the overhead resulting from process switching is minimized but at the same time each
process is guaranteed to get its turn at the CPU at least every t seconds?
tns
A. q n1
tns
B. q n1
tns
C. q n+1
tns
D. q n+1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 238 of 852
n+1

gate1998 operating-system process-schedule normal

4.124 Process Schedule: GATE1998_24 top gateoverflow.in/1739

a. Four jobs are waiting to be run. Their expected run times are 6, 3, 5 and x. In what order should they be run to
minimize the average response time?

b. Write a concurrent program using par begin-par end to represent the precedence graph shown below.

gate1998 operating-system process-schedule descriptive

4.125 Process Schedule: GATE2012_31 top gateoverflow.in/1749

Consider the 3 processes, P1, P2 and P3 shown in the table.

Arrival
Process Time Units Required
time

P1 0 5

P2 1 7

P3 3 4

The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of 2
time units) are

(A) FCFS: P1, P2, P3 RR2: P1, P2, P3


(B) FCFS: P1, P3, P2 RR2: P1, P3, P2
(C) FCFS: P1, P2, P3 RR2: P1, P3, P2
(D) FCFS: P1, P3, P2 RR2: P1, P2, P3

gate2012 operating-system process-schedule normal

4.126 Process Schedule: GATE2007-IT_26 top gateoverflow.in/3459

Consider n jobs J 1, J2,......Jn such that job J i has execution time t i and a non-negative integer weight w i. The weighted mean
ni=1 wi Ti
completion time of the jobs is defined to be , where T i is the completion time of job J i. Assuming that there is only
ni=1 wi
one processor available, in what order must the jobs be executed in order to minimize the weighted mean completion time of
the jobs?

A) Non-decreasing order of t i
B) Non-increasing order of w i
C) Non-increasing order of w iti
D) None-increasing order of w i/ti

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 239 of 852

gate2007-it operating-system process-schedule normal

4.127 Process Schedule: GATE2006-IT_54 top gateoverflow.in/3597

The arrival time, priority, and duration of the CPU and I/O bursts for each of three processes P 1, P 2 and P 3 are given in the
table below. Each process has a CPU burst followed by an I/O burst followed by another CPU burst. Assume that each
process has its own I/O resource.

Arrival Burst duration, CPU, I/O


Process Priority
time CPU
P1 0 2 1, 5, 3
3
P2 2 (lowest) 3, 3, 1

P3 1
3 2, 3, 1
(highest)

The multi-programmed operating system uses preemptive priority scheduling. What are the finish times of the processes P 1,
P2 and P 3 ?

A) 11, 15, 9
B) 10, 15, 9
C) 11, 16, 10
D) 12, 17, 11

gate2006-it operating-system process-schedule normal

4.128 Process Schedule: GATE2013_10 top gateoverflow.in/1419

A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with zero (the
lowest priority). The scheduler re-evaluates the process priorities every T time units and decides the next process to
schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?

(A) This algorithm is equivalent to the first-come-first-serve algorithm.

(B) This algorithm is equivalent to the round-robin algorithm.

(C) This algorithm is equivalent to the shortest-job-first algorithm.

(D) This algorithm is equivalent to the shortest-remaining-time-first algorithm.

gate2013 operating-system process-schedule normal

4.129 Process Schedule: GATE2004_46 top gateoverflow.in/1043

Consider the following set of processes, with the arrival times and the CPU-burst times gives in milliseconds.

Process Arrival Time Burst Time


P1 0 5
P2 1 3
P3 2 3
P4 4 1

What is the average turnaround time for these processes with the preemptive shortest remaining processing time first
(SRPT) algorithm?

A. 5.50
B. 5.75

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 240 of 852

C. 6.00
D. 6.25

gate2004 operating-system process-schedule normal

4.130 Process Schedule: GATE2007_16 top gateoverflow.in/1214

Group 1 contains some CPU scheduling algorithms and Group 2 contains some applications. Match entries in Group 1 to
entries in Group 2.

Group I Group II
(P) Gang Scheduling (1) Guaranteed Scheduling
(Q) Rate Monotonic Scheduling (2) Real-time Scheduling
(R) Fair Share Scheduling (3) Thread Scheduling

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

gate2007 operating-system process-schedule normal

4.131 Process Schedule: GATE2007_55 top gateoverflow.in/1253

An operating system used Shortest Remaining System Time first (SRT) process scheduling algorithm. Consider the arrival
times and execution times for the following processes:

Process Execution Time Arrival time


P1 20 0
P2 25 15
P3 10 30
P4 15 45

What is the total waiting time for process P2?

A. 5
B. 15
C. 40
D. 55

gate2007 operating-system process-schedule normal

4.132 Process Schedule: GATE2014-1_32 top gateoverflow.in/1803

Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds.

Process Name Arrival Time Execution Time


A 0 6
B 3 2
C 5 4
D 7 6
E 10 3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 241 of 852

Using the shortest remaining time first scheduling algorithm, the average process turnaround time (in msec) is ____________________.

gate2014-1 operating-system process-schedule numerical-answers normal

4.133 Process Schedule: GATE2009_32 top gateoverflow.in/1318

In the following process state transition diagram for a uniprocessor system, assume that there are always some processes in
the ready state:

Now consider the following statements:

I. If a process makes a transition D, it would result in another process making transition A immediately.
II. A process P2 in blocked state can make transition E while another process P1 is in running state.
III. The OS uses preemptive scheduling.
IV. The OS uses non-preemptive scheduling.

Which of the above statements are TRUE?

A. I and II
B. I and III
C. II and III
D. II and IV

gate2009 operating-system process-schedule normal

4.134 Process Synchronization: GATE1995_19 top gateoverflow.in/2656

Consider the following program segment for concurrent processing using semaphore operators P and V for synchronization.
Draw the precedence graph for the statements S1 to S9.

var
a,b,c,d,e,f,g,h,i,j,k : semaphore;
begin
cobegin
begin S1; V(a); V(b) end;
begin P(a); S2; V(c); V(d) end;
begin P(c); S4; V(e) end;
begin P(d); S5; V(f) end;
begin P(e); P(f); S7; V(k) end
begin P(b); S3; V(g); V(h) end;
begin P(g); S6; V(i) end;
begin P(h); P(i); S8; V(j) end;
begin P(j); P(k); S9 end;
coend
end;

gate1995 operating-system process-synchronization normal

4.135 Process Synchronization: GATE2004-IT_65 top gateoverflow.in/3708

The semaphore variables full, empty and mutex are initialized to 0, n and 1, respectively. Process P 1 repeatedly adds one
item at a time to a buffer of size n, and process P2 repeatedly removes one item at a time from the same buffer using the

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 242 of 852

programs given below. In the programs, K, L, M and N are unspecified statements.



while (1) {
K;
P(mutex);
Add an item to the buffer;
V(mutex);
P1 L;
}

while (1) {
M;
P(mutex);
Remove an item from the buffer;
V(mutex);
P2 N;
}

The statements K, L, M and N are respectively

A. P(full), V(empty), P(full), V(empty)


B. P(full), V(empty), P(empty), V(full)
C. P(empty), V(full), P(empty), V(full)
D. P(empty), V(full), P(full), V(empty)

gate2004-it operating-system process-synchronization normal

4.136 Process Synchronization: TIFR2011-B-28 top gateoverflow.in/20575

Consider a basic block:

x:= a[i]; a[j]:= y; z:= a[j]

optimized by removing common sub expression a[i] as follows:


x:= a[i]; z:= x; a[j]:= y.

Which of the following is true?

a. Both are equivalent.


b. The values computed by both are exactly the same.
c. Both give exactly the same values only if i is not equal to j.
d. They will be equivalent in concurrent programming languages with shared memory.
e. None of the above.

tifr2011 process-synchronization

4.137 Process Synchronization: TIFR2011-B-22 top gateoverflow.in/20330

Consider the program


P:: x:=1; y:=1; z:=1; u:=0

And the program


Q:: x, y, z, u := 1, 1, 1, 1; u:= 0

Which of the following is true?

a. P and Q are equivalent for sequential processors.


b. P and Q are equivalent for all multi-processor models.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 243 of 852

c. P and Q are equivalent for all multi-core machines.


d. P and Q are equivalent for all networks of computers.
e. None of the above

tifr2011 operating-system process-synchronization

4.138 Process Synchronization: GATE1997_73 top gateoverflow.in/19703

A concurrent system consists of 3 processes using a shared resource R in a non-preemptible and mutually exclusive manner.
The processes have unique priorities in the range 1 3, 3 being the highest priority. It is required to synchronize the
processes such that the resource is always allocated to the highest priority requester. The pseudo code for the system is as
follows.

Shared data

mutex:semaphore = 1:/* initialized to 1*/

process[3]:semaphore = 0; /*all initialized to 0 */


R_requested [3]:boolean = false; /*all initialized to flase */

busy: boolean = false; /*initialized to false */

Code for processes


begin process
my-priority:integer;
my-priority:=___; /*in the range 1..3*/
repeat
request_R(my-priority);
P (proceed [my-priority]);
{use shared resource R}
release_R (my-priority);
forever
end process;

Procedures
procedure request_R(priority);
P(mutex);
if busy = true then
R_requested [priority]:=true;
else
begin
V(proceed [priority]);
busy:=true;
end
V(mutex)

Give the pseudo code for the procedure release_R.

gate1997 operating-system process-synchronization

4.139 Process Synchronization: TIFR2010-B-32 top gateoverflow.in/19244

Consider the following solution (expressed in Dijkstra's guarded command notation) to the mutual exclusion problem.

process P1 is
begin
loop
Non_critical_section;
while not (Turn=1) do
skip od;
Critical_section_1;
Turn=2;
end loop
end


process P2 is
begin
loop
Non_critical_section;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 244 of 852

while not (turn=2) do


skip od;
Critical_section_2;
Turn=1;
end loop
end

Initially, Turn=1, Assume that the two process run forever and that no process stays in its critical and non-critical section
infinitely. A mutual exclusion program is correct if it satisfies the following requirements.

1) Only one process can be in a critical region at a time.

2) Program is a dead-lock free, i.e., if both processes are trying to enter the critical region then at least one of them does
enter the critical region.

3) Program is starvation-free; i.e, a process trying to enter the critical region eventually manages to do so.

The above mutual exclusion solution.

a. Does not satisfy the requirement (1).


b. Satisfy the requirement (1) but does not satisfy the requirement (2).
c. Satisfies the requirements (1) and (2), but does not satisfies the requirement (3).
d. Satisfies the requirement (1) and (3), but does not satisfies the requirement (2).
e. Satisfies all the requirement (1), (2), and (3).

tifr2010 operating-system process-synchronization

4.140 Process Synchronization: TIFR2011-B-34 top gateoverflow.in/20838

Consider the class of synchronization primitives. Which of the following is false?

a. Test and set primitives are as powerful as semaphores.


b. There are various synchronizations that can be implemented using an array of semaphores but not by binary
semaphores.
c. Split binary semaphores and binary semaphores are equivalent.
d. All statements a - c are false.
e. Petri nets with and without inhibitor arcs have the same power.

tifr2011 operating-system process-synchronization

4.141 Process Synchronization: TIFR2015-B-14 top gateoverflow.in/30077

Consider the following concurrent program (where statements separated by | | with-in cobegin-coend are executed
concurrently).

x:=1
cobegin
x:= x + 1 || x:= x + 1 || x:= x + 1
coend

Reading and writing of variables is atomic but evaluation of expressions is not atomic. The set of possible values of x at the
end of execution of the program is

a. {4}
b. {2, 3, 4}
c. {2, 4}
d. {2, 3}
e. {2}

tifr2015 process-synchronization

4.142 Process Synchronization: GATE2003-81 top gateoverflow.in/43574

Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the
processes P and Q is shown below.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 245 of 852

Process P: Process Q:

while(1) { while(1) {

W: Y:

print '0'; print '1';

print '0'; print '1';

X: Z:

} }

Synchronization statements can be inserted only at points W, X, Y, and Z

Which of the following will ensure that the output string never contains a substring of the form 01 n0 and 10 n1 where n is
odd?

A. P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1


B. P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1
C. P(S) at W, V(S) at X, P(S) at Y, V(S) at Z, S initially 1
D. V(S) at W, V(T) at X, P(S) at Y, P(T) at Z, S and T initially 1

gate2003 operating-system process-synchronization normal

4.143 Process Synchronization: GATE2006-79 top gateoverflow.in/43564

Barrier is a synchronization construct where a set of processes synchronizes globally i.e., each process in the set arrives at
the barrier and waits for all others to arrive and then all processes leave the barrier. Let the number of processes in the set
be three and S be a binary semaphore with the usual P and V functions. Consider the following C implementation of a barrier
with line numbers shown on left.

void barrier (void) {

P(S);
process_arrived++;
V(S);
while (process_arrived !=3);
5. P(S);
process_left++;
if (process_left==3) {
process_arrived = 0;
process_left = 0;
10. }
V(S);

The variables process_arrived and process_left are shared among all processes and are initialized to zero. In a concurrent
program all the three processes call the barrier function when they need to synchronize globally.

Which one of the following rectifies the problem in the implementation?

A. Lines 6 to 10 are simply replaced by process_arrived--


B. At the beginning of the barrier the first process to enter the barrier waits until process_arrived becomes zero before
proceeding to execute P(S).
C. Context switch is disabled at the beginning of the barrier and re-enabled at the end.
D. The variable process_left is made private instead of shared

gate2006 operating-system process-synchronization normal

4.144 Process Synchronization: GATE1991_11,b top gateoverflow.in/43000

Consider the following scheme for implementing a critical section in a situation with three processes Pi , Pj and Pk .

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 246 of 852

Pi;

repeat
flag[i] := true;
while flag [j] or flag[k] do
case turn of
j: if flag [j] then
begin
flag [i] := false;
while turn != i do skip;
flag [i] := true;
end;
k: if flag [k] then
begin
flag [i] := false,
while turn != i do skip;
flag [i] := true
end
end
critical section
if turn = i then turn := j;
flag [i] := false
non-critical section
until false;

Is there a situation in which a waiting process can never enter the critical section? If so, explain and suggest modifications to
the code to solve this problem

gate1991 process-synchronization normal operating_system

4.145 Process Synchronization: GATE 2016-2-48 top gateoverflow.in/39600

Q). Consider the following two-process synchronization solution.

PROCESS 0 Process 1

Entry: loop while (turn ==1); Entry: loop while (turn==0);


(critical section) (critical section)
Exit: turn=1; Exit turn =0;

The shared variable turn is initialized to zero . Which one of the following is TRUE?

A). This is a correct two- process synchronization solution.

B). This solution violates mutual exclusion requirement.

C). This solution violates progress requirement.

D). This solution violates bounded wait requirement.

gate2016-2 operating-system process-synchronization normal

4.146 Process Synchronization: TIFR2010-B-28 top gateoverflow.in/18751

Consider the concurrent program:

x: 1;
cobegin
x:= x + 3 || x := x + x + 2
coend

Reading and writing of variables is atomic, but the evaluation of an expression is not atomic.

The set of possible values of variable x at the end of the execution of the program is:

A. {4}
B. {8}
C. {4, 7, 10}
D. {4, 7, 8, 10}
E. {4, 7, 8}

tifr2010 process-synchronization

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 247 of 852

4.147 Process Synchronization: GATE2015-3_10 top gateoverflow.in/8405

Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the
processes

Process X Process Y

/* other code for process x*/ /* other code for process Y */


while (true) { while (true)
varP = true; {
while (varQ == true) varQ = true;
{ while (varP == true)
/* Critical Section */ {
varP = false; /* Critical Section */
} varQ = false;
} }
/* other code for process X */ }
/* other code for process Y */

Here varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true?

A. The proposed solution prevents deadlock but fails to guarantee mutual exclusion
B. The proposed solution guarantees mutual exclusion but fails to prevent deadlock
C. The proposed solution guarantees mutual exclusion and prevents deadlock
D. The proposed solution fails to prevent deadlock and fails to guarantee mutual exclusion

gate2015-3 operating-system process-synchronization normal

4.148 Process Synchronization: GATE2007-IT_10 top gateoverflow.in/3443

Processes P1 and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is
initialized to FALSE in the main program.
get_exclusive_access ( )
{
if (critical _flag == FALSE) {
critical_flag = TRUE ;
critical_region () ;
critical_flag = FALSE;
}
}

Consider the following statements.

i. It is possible for both P1 and P2 to access critical_region concurrently.


ii. This may lead to a deadlock.

Which of the following holds?

A) (i) is false and (ii) is true


B) Both (i) and (ii) are false
C) (i) is true and (ii) is false
D) Both (i) and (ii) are true

gate2007-it operating-system process-synchronization normal

4.149 Process Synchronization: GATE2008-IT_53 top gateoverflow.in/3363

The following is a code with two threads, producer and consumer, that can run in parallel. Further, S and Q are binary
semaphores equipped with the standard P and V operations.

semaphore S = 1, Q = 0;
integer x;

producer: consumer:
while (true) do while (true) do

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 248 of 852

P(S); P(Q);
x = produce (); consume (x);
V(Q); V(S);
done done

Which of the following is TRUE about the program above?

A) The process can deadlock


B) One of the threads can starve
C) Some of the items produced by the producer may be lost
Values generated and stored in 'x' by the producer will always be consumed before the producer can generate a new
D)
value

gate2008-it operating-system process-synchronization normal

4.150 Process Synchronization: GATE1996_21 top gateoverflow.in/2773

The concurrent programming constructs fork and join are as below:

fork <label> which creates a new process executing from the specified label

join <variable> which decrements the specified synchronization variable (by 1) and terminates the process if the new value
is not 0.

Show the precedence graph for S1, S2, S3, S4, and S5 of the concurrent program below.

gate1996 operating-system process-synchronization normal

4.151 Process Synchronization: GATE1996_2.19 top gateoverflow.in/2748

A solution to the Dining Philosophers Problem which avoids deadlock is to

A. ensure that all philosophers pick up the left fork before the right fork

B. ensure that all philosophers pick up the right fork before the left fork

C. ensure that one particular philosopher picks up the left fork before the right fork, and that all other philosophers pick up
the right fork before the left fork

D. None of the above

gate1996 operating-system process-synchronization normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 249 of 852

4.152 Process Synchronization: GATE2007-IT_56 top gateoverflow.in/3498

Synchronization in the classical readers and writers problem can be achieved through use of semaphores. In the following
incomplete code for readers-writers problem, two binary semaphores mutex and wrt are used to obtain synchronization
wait (wrt)
writing is performed
signal (wrt)
wait (mutex)
readcount = readcount + 1
if readcount = 1 then S1
S2
reading is performed
S3
readcount = readcount - 1
if readcount = 0 then S4
signal (mutex)

The values of S1, S2, S3, S4, (in that order) are

A) signal (mutex), wait (wrt), signal (wrt), wait (mutex)


B) signal (wrt), signal (mutex), wait (mutex), wait (wrt)
C) wait (wrt), signal (mutex), wait (mutex), signal (wrt)
D) signal (mutex), wait (mutex), signal (mutex), wait (mutex)

gate2007-it operating-system process-synchronization normal

4.153 Process Synchronization: GATE2006-IT_55 top gateoverflow.in/3598

Consider the solution to the bounded buffer producer/consumer problem by using general semaphores S, F, and E. The
semaphore S is the mutual exclusion semaphore initialized to 1. The semaphore F corresponds to the number of free slots in
the buffer and is initialized to N. The semaphore E corresponds to the number of elements in the buffer and is initialized to 0.

Producer Process Consumer Process


Produce an item; Wait(E);
Wait(F); Wait(S);
Remove an item from the
Wait(S);
buffer;
Append the item to the
Signal(S);
buffer;
Signal(S); Signal(F);
Signal(E); Consume the item;

Which of the following interchange operations may result in a deadlock?

I. Interchanging Wait (F) and Wait (S) in the Producer process


II. Interchanging Signal (S) and Signal (F) in the Consumer process

A) I only
B) II only
C) Neither I nor II
D) Both I and II

gate2006-it operating-system process-synchronization normal

4.154 Process Synchronization: GATE2005-IT_42 top gateoverflow.in/3789

Two concurrent processes P1 and P2 use four shared resources R1, R2, R3 and R4, as shown below.

P1 P2
Compute: Compute;
Use R1; Use R1;
Use R2; Use R2;
Use R3; Use R3;.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 250 of 852

Use R4;
P1 Use R4;
P2

Both processes are started at the same time, and each resource can be accessed by only one process at a time The following
scheduling constraints exist between the access of resources by the processes:

P2 must complete use of R1 before P1 gets access to R1.


P1 must complete use of R2 before P2 gets access to R2.
P2 must complete use of R3 before P1 gets access to R3.
P1 must complete use of R4 before P2 gets access to R4.

There are no other scheduling constraints between the processes. If only binary semaphores are used to enforce the above
scheduling constraints, what is the minimum number of binary semaphores needed?

A) 1
B) 2
C) 3
D) 4

gate2005-it operating-system process-synchronization normal

4.155 Process Synchronization: GATE2005-IT_41 top gateoverflow.in/3788

Given below is a program which when executed spawns two concurrent processes :
semaphore X : = 0 ;
/* Process now forks into concurrent processes P1 & P2 */

P1 P2
repeat forever repeat forever
V (X) ; P(X) ;
Compute ; Compute ;
P(X) ; V(X) ;

Consider the following statements about processes P1 and P2:

I. It is possible for process P1 to starve.


II. It is possible for process P2 to starve.

Which of the following holds?

A) Both I and II are true.


B) I is true but II is false.
C) II is true but I is false

D) Both I and II are false.

gate2005-it operating-system process-synchronization normal

4.156 Process Synchronization: GATE1994_27 top gateoverflow.in/2523

a. Draw a precedence graph for the following sequential code. The statements are numbered from S1 to S6
S1 read n
S2 i := 1
S3 if i > n next
S4 a(i) := i+1
S5 i := i+1
S6 next : write a(i)

b. Can this graph be converted to a concurrent program using parbegin-parend construct only?

gate1994 operating-system process-synchronization normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 251 of 852

4.157 Process Synchronization: GATE1996_1.19 top gateoverflow.in/2723

A critical section is a program segment

A. which should run in a certain amount of time


B. which avoids deadlocks
C. where shared resources are accessed
D. which must be enclosed by a pair of semaphore operations, P and V

gate1996 operating-system process-synchronization easy

4.158 Process Synchronization: GATE2010_23 top gateoverflow.in/2202

Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values
of shared boolean variables S1 and S2 are randomly assigned.

Method used by P1 Method used by P2

while (S1==S2); while (S1!=S2);


Critical Section Critical Section
S1=S2; S2 = not(S1)

Which one of the following statements describes the properties achieved?

(A) Mutual excusion but not progress

(B) Progress but not mutual exclusion

(C) Neither mutual exclusion nor progress

(D) Both mutual exclusion and progress

gate2010 operating-system process-synchronization normal

4.159 Process Synchronization: GATE2001_2.22 top gateoverflow.in/740

Consider Peterson's algorithm for mutual exclusion between two concurrent processes i and j. The program executed by
process is shown below.
repeat
flag[i] = true;
turn = j;
while (P) do no-op;
Enter critical section, perform actions, then
exit critical section
Flag[i] = false;
Perform other non-critical section actions.
Until false;

For the program to guarantee mutual exclusion, the predicate P in the while loop should be

A. flag[j] = true and turn = i


B. flag[j] = true and turn = j
C. flag[i] = true and turn = j
D. flag[i] = true and turn = i

gate2001 operating-system process-synchronization normal

4.160 Process Synchronization: GATE2014-2_31 top gateoverflow.in/1990

Consider the procedure below for the Producer-Consumer


problem which uses semaphores:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 252 of 852

semaphore n = 0;
semaphore s = 1;

void producer()
{
while(true)
{
produce();
semWait(s);
addToBuffer();
semSignal(s);
semSignal(n);
}
}

void consumer()
{
while(true)
{
semWait(s);
semWait(n);
removeFromBuffer();
semSignal(s);
consume();
}
}

Which one of the following is TRUE?

(A) The producer will be able to add an item to the buffer, but the consumer can never consume it.

(B) The consumer will remove no more than one item from the buffer.

(C) Deadlock occurs if the consumer succeeds in acquiring semaphore s when the buffer is empty.

(D) The starting value for the semaphore n must be 1 and not 0 for deadlock-free operation.

gate2014-2 operating-system process-synchronization normal

4.161 Process Synchronization: GATE2000_20 top gateoverflow.in/691

(a) Fill in the boxes below to get a solution for the reader-writer problem, using a single binary semaphore, mutex (initialized
to 1) and busy waiting. Write the box numbers (1, 2 and 3), and their contents in your answer book.

int R = 0, W = 0;

Reader () {
wait (mutex);
if (W == 0) {
R = R + 1;
______________(1)
}
else {
______________(2)
L1: goto L1;
}
..../* do the read*/
wait (mutex);
R = R - 1;
signal (mutex);
}

Writer () {
wait (mutex);
if () { _________ (3)
signal (mutex);
goto L2;
}
W=1;
signal (mutex);
L2: ...../*do the write*/
wait( mutex);
W=0;
signal (mutex);
}

(b) Can the above solution lead to starvation of writers?

gate2000 operating-system process-synchronization normal

4.162 Process Synchronization: GATE2013_39 top gateoverflow.in/1550

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 253 of 852

A certain computation generates two arrays a and b such that a[i] = f(i) for 0 i < n and b[i] = g(a[i]) for 0 i < n.
Suppose this computation is decomposed into two concurrent processes X and Y such that X computes the array a and Y
computes the array b. The processes employ two binary semaphores R and S, both initialized to zero. The array a is shared
by the two processes. The structures of the processes are shown below.

Process X:
private i;
for (i=0; i< n; i++) {

a[i] = f(i);

ExitX(R, S);
}

Process Y:
private i;
for (i=0; i< n; i++) {
EntryY(R, S);

b[i] = g(a[i]);
}

Which one of the following represents the CORRECT implementations of ExitX and EntryY?

(A)
ExitX(R, S) {

P(R);
V(S);

EntryY(R, S) {
P(S);

V(R);

(B) ExitX(R, S) {
V(R);

V(S);
}

EntryY(R, S) {

P(R);
P(S);

(C) ExitX(R, S) {

P(S);
V(R);

EntryY(R, S) {
V(S);

P(R);
}

(D) ExitX(R, S) {

V(R);

P(S);
}

EntryY(R, S) {

V(S);
P(R);

gate2013 operating-system process-synchronization normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 254 of 852

4.163 Process Synchronization: GATE2003-80 top gateoverflow.in/964

Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the
processes P and Q is shown below.

Process P: Process Q:
while(1) { while(1) {
W: Y:
print '0'; print '1';
print '0'; print '1';
X: Z:
} }

Synchronization statements can be inserted only at points W, X, Y, and Z

Which of the following will always lead to an output staring with 001100110011?

A. P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1

B. P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1, and T initially 0

C. P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1

D. P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S initially 1 , and T initially 0

gate2003 operating-system process-synchronization normal

4.164 Process Synchronization: GATE2006-78 top gateoverflow.in/1853

Barrier is a synchronization construct where a set of processes synchronizes globally i.e., each process in the set arrives at
the barrier and waits for all others to arrive and then all processes leave the barrier. Let the number of processes in the set
be three and S be a binary semaphore with the usual P and V functions. Consider the following C implementation of a barrier
with line numbers shown on left.

void barrier (void) {

P(S);
process_arrived++;
V(S);
while (process_arrived !=3);
5. P(S);
process_left++;
if (process_left==3) {
process_arrived = 0;
process_left = 0;
10. }
V(S);

The variables process_arrived and process_left are shared among all processes and are initialized to zero. In a concurrent
program all the three processes call the barrier function when they need to synchronize globally.

The above implementation of barrier is incorrect. Which one of the following is true?

A. The barrier implementation is wrong due to the use of binary semaphore S


B. The barrier implementation may lead to a deadlock if two barrier in invocations are used in immediate succession.
C. Lines 6 to 10 need not be inside a critical section
D. The barrier implementation is correct if there are only two processes instead of three.

gate2006 operating-system process-synchronization normal

4.165 Process Synchronization: GATE2012_32 top gateoverflow.in/1750

Fetch_And_Add(X,i) is an atomic Read-Modify-Write instruction that reads the value of memory location X, increments it by
the value i, and returns the old value of X. It is used in the pseudocode shown below to implement a busy-wait lock. L is an
unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any non-zero value
corresponds to the lock being not available.
AcquireLock(L){
while (Fetch_And_Add(L,1))
L = 1;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 255 of 852

ReleaseLock(L){
L = 0;
}

This implementation

(A) fails as L can overflow


(B) fails as L can take on a non-zero value when the lock is actually available
(C) works correctly but may starve some processes
(D) works correctly without starvation

gate2012 operating-system process-synchronization normal

4.166 Process Synchronization: GATE2002_20 top gateoverflow.in/873

The following solution to the single producer single consumer problem uses semaphores for synchronization.

#define BUFFSIZE 100


buffer buf[BUFFSIZE];
int first = last = 0;
semaphore b_full = 0;
semaphore b_empty = BUFFSIZE
void producer()
{
while(1) {
produce an item;
p1:.................;
put the item into buff (first);
first = (first+1)%BUFFSIZE;
p2: ...............;
}
}

void consumer()
{
while(1) {
c1:............
take the item from buf[last];
last = (last+1)%BUFFSIZE;
c2:............;
consume the item;
}
}

a. Complete the dotted part of the above solution.

b. Using another semaphore variable, insert one line statement each immediately after p1, immediately before p2,
immediately after c1 and immediately before c2 so that the program works correctly for multiple producers and
consumers

gate2002 operating-system process-synchronization normal

4.167 Process Synchronization: GATE2006_61 top gateoverflow.in/1839

The atomic fetch-and-set x, y instruction unconditionally sets the memory location x to 1 and fetches the old value of x n y
without allowing any intervening access to the memory location x. Consider the following implementation of P and V
functions on a binary semaphore S.

void P (binary_semaphore *s) {


unsigned y;
unsigned *x = &(s->value);
do {
fetch-and-set x, y;
} while (y);
}

void V (binary_semaphore *s) {


S->value = 0;
}

Which one of the following is true?

(A) The implementation may not work if context switching is disabled in P


(B) Instead of using fetch-and set, a pair of normal load/store can be used
(C) The implementation of V is wrong
(D) The code does not implement a binary semaphore

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 256 of 852

gate2006 operating-system process-synchronization normal

4.168 Process Synchronization: GATE2002_18 top gateoverflow.in/871

a. Draw the process state transition diagram of an OS in which (i) each process is in one of the five states: created, ready,
running, blocked (i.e., sleep or wait), or terminated, and (ii) only non-preemptive scheduling is used by the OS. Label
the transitions appropriately.
b. The functionality of atomic TEST-AND-SET assembly language instruction is given by the following C function
int TEST-AND-SET (int *x)
{
int y;
A1: y=*x;
A2: *x=1;
A3: return y;
}

i. Complete the following C functions for implementing code for entering and leaving critical sections on the above TEST-
AND-SET instruction.

ii. int mutex=0;


void enter-cs()
{
while(......................);

}
void leave-cs()
{ .........................;
}

iii. Is the above solution to the critical section problem deadlock free and starvation-free?
iv. For the above solution, show by an example that mutual exclusion is not ensured if TEST-AND-SET instruction is not
atomic?

gate2002 operating-system process-synchronization normal

4.169 Process Synchronization: GATE2004_48 top gateoverflow.in/1044

Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY
respectively, both initialized to 1. P and V denote the usual semaphore operators, where P decrements the semaphore
value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows:

P1 : P2 :

While true do { While true do {

L1 :.. L3 :..
L2 :.. L4 :..
X = X + 1; Y = Y + 1;

Y = Y -1; X = Y -1;

V (SX ); V (SY );
V (SY ); } V (SX );

In order to avoid deadlock, the correct operators at L1 , L2 , L3 and L4 are respectively.

A. P (SY ), P (SX ); P (SX ), P (SY )

P (SX ), P (SY ); P (SY ), P (SX )

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 257 of 852

B. P (SX ), P (SY ); P (SY ), P (SX )

C. P (SX ), P (SX ); P (SY ), P (SY )

D. P (SX ), P (SY ); P (SX ), P (SY )

gate2004 operating-system process-synchronization normal

4.170 Process Synchronization: GATE2007_58 top gateoverflow.in/1256

Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by
the processes:

/* P1 */ /* P2 */
while (true) { while (true) {
wants1 = true; wants2 = true;
while (wants2 == true); while (wants1 == true);
/* Critical Section */ /* Critical Section */
wants1 = false; wants2=false;
} }
/* Remainder section */ /* Remainder section */

Here, wants1 and wants2 are shared variables, which are initialized to false.

Which one of the following statements is TRUE about the construct?

A. It does not ensure mutual exclusion.

B. It does not ensure bounded waiting.

C. It requires that processes enter the critical section in strict alteration.

D. It does not prevent deadlocks, but ensures mutual exclusion.

gate2007 operating-system process-synchronization normal

4.171 Process Synchronization: GATE2013_34 top gateoverflow.in/1545

A shared variable x, initialized to zero, is operated on by four concurrent processes W, X, Y, Z as follows. Each of the
processes W and X reads x from memory, increments by one, stores it to memory, and then terminates. Each of the
processes Y and Z reads x from memory, decrements by two, stores it to memory, and then terminates. Each process before
reading x invokes the P operation (i.e., wait) on a counting semaphore S and invokes the V operation (i.e., signal) on the
semaphore S after storing x to memory. Semaphore S is initialized to two. What is the maximum possible value of x after all
processes complete execution?

(A) 2 (B) 1 (C) 1 (D) 2

gate2013 operating-system process-synchronization normal

4.172 Process Synchronization: GATE2000_1.21 top gateoverflow.in/645

Let m[0]....m[4] be mutexes (binary semaphores) and P[0].......P[4] be processes.


Suppose each process P[i] executes the following:
wait (m[i]; wait (m(i+1) mode 4]);
...........
release (m[i]); release (m(i+1) mod 4]);

This could cause

A. Thrashing

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 258 of 852

B. Deadlock
C. Starvation, but not deadlock
D. None of the above

gate2000 operating-system process-synchronization normal

4.173 Process Synchronization: GATE1991_11,a top gateoverflow.in/538

Consider the following scheme for implementing a critical section in a situation with three processes Pi , Pj and Pk .

Pi;
repeat
flag[i] := true;
while flag [j] or flag[k] do
case turn of
j: if flag [j] then
begin
flag [i] := false;
while turn != i do skip;
flag [i] := true;
end;
k: if flag [k] then
begin
flag [i] := false,
while turn != i do skip;
flag [i] := true
end
end
critical section
if turn = i then turn := j;
flag [i] := false
non-critical section
until false;

a. Does the scheme ensure mutual exclusion in the critical section? Briefly explain.

gate1991 process-synchronization normal operating-system

4.174 Process Synchronization: GATE1993_22 top gateoverflow.in/2319

Write a concurrent program using parbegin-parend and semaphores to represent the precedence constraints of the
statements S1 to S6 , as shown in figure below.

gate1993 operating-system process-synchronization normal

4.175 Process Synchronization: GATE2010_45 top gateoverflow.in/2347

The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0=1, S1=0 and S2=0.

Process P0 Process P1 Process P2

while (true) {
wait (S0); wait (S1); wait (S2);
print '0'; release (S0); release (S0);
release (S1);
release (S2);
}

How many times will process P0 print '0'?

(A) At least twice

(B) Exactly twice

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 259 of 852

(C) Exactly thrice

(D) Exactly once

gate2010 operating-system process-synchronization normal

4.176 Process Synchronization: GATE1997_6.8 top gateoverflow.in/2264

Each Process Pi , i = 1....9 is coded as follows


repeat
P(mutex)
{Critical section}
V(mutex)
forever

The code for P10 is identical except it uses V(mutex) in place of P(mutex). What is the largest number of processes that can
be inside the critical section at any moment?

A. 1
B. 2
C. 3
D. None

gate1997 operating-system process-synchronization normal

4.177 Process Synchronization: GATE2009_33 top gateoverflow.in/1319

T h e enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set
instruction as follows:
void enter_CS(X)
{
while(test-and-set(X));
}

void leave_CS(X)
{
X = 0;
}

In the above solution, X is a memory location associated with the CS and is initialized to 0. Now consider the following
statements:

I. The above solution to CS problem is deadlock-free

II. The solution is starvation free

III. The processes enter CS in FIFO order

IV. More than one process can enter CS at the same time

Which of the above statements are TRUE?

A. I only
B. I and II
C. II and III
D. IV only

gate2009 operating-system process-synchronization normal

4.178 Process Synchronization: GATE1999_20 top gateoverflow.in/1519

(a) A certain processor provides a 'test and set' instruction that is used as follows:
TSET register, flag

This instruction atomically copies flag to register and sets flag to 1. Give pseudo-code for implementing the entry and exit

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 260 of 852

code to a critical region using this instruction.

(b) Consider the following solution to the producer-consumer problem using a buffer of size 1. Assume that the initial value
of count is 0. Also assume that the testing of count and assignment to count are atomic operations.

Producer:
Repeat
Produce an item;
if count = 1 then sleep;
place item in buffer.
count = 1;
Wakeup(Consumer);
Forever
Consumer:
Repeat
if count = 0 then sleep;
Remove item from buffer;
count = 0;
Wakeup(Producer);
Consume item;
Forever;

Show that in this solution it is possible that both the processes are sleeping at the same time.

gate1999 operating-system process-synchronization normal

4.179 Resource Allocation: GATE1994_28 top gateoverflow.in/2524

Consider the resource allocation graph in the figure.

a. Find if the system is in a deadlock state

b. Otherwise, find a safe sequence

gate1994 operating-system resource-allocation normal

4.180 Resource Allocation: GATE2005_71 top gateoverflow.in/1394

Suppose n processes, P1 , Pn share m identical resource units, which can be reserved and released one at a time. The
maximum resource requirement of process Pi is si , where si > 0. Which one of the following is a sufficient condition for
ensuring that deadlock does not occur?

A. i, si , < m
B. i, si < n
C. n s
i=1 i
< (m + n)
D. n s
i=1 i
< (m n)

gate2005 operating-system resource-allocation normal

4.181 Resource Allocation: GATE2013_16 top gateoverflow.in/1438

X Y Z

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 261 of 852

Three concurrent processes X , Y , and Z execute three different code segments that access and update certain shared
variables. Process X executes the P operation (i.e., wait) on semaphores a , b and c; process Y executes the P operation
on semaphores b , c and d; process Z executes the P operation on semaphores c, d, and a before entering the respective
code segments. After completing the execution of its code segment, each process invokes the V operation (i.e., signal) on
its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the following represents a
deadlock-free order of invoking the P operations by the processes?

(A) X : P (a)P (b)P (c) Y : P (b)P (c)P (d) Z : P (c)P (d)P (a)
(B) X : P (b)P (a)P (c) Y : P (b)P (c)P (d) Z : P (a)P (c)P (d)
(C) X : P (b)P (a)P (c) Y : P (c)P (b)P (d) Z : P (a)P (c)P (d)
(D) X : P (a)P (b)P (c) Y : P (c)P (b)P (d) Z : P (c)P (d)P (a)

gate2013 operating-system resource-allocation normal

4.182 Resource Allocation: GATE2014-1_31 top gateoverflow.in/1800

An operating system uses the Banker's algorithm for deadlock avoidance when managing the allocation of three resource
types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here,
t h e Allocation matrix shows the current number of resources of each type allocated to each process and the Max
matrix shows the maximum number of resources of each type required by each process during its execution.

Allocation Max
X Y Z X Y Z
P0 0 0 1 8 4 3
P1 3 2 0 6 2 0
P2 2 1 1 3 3 3

There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in a safe state.
Consider the following independent requests for additional resources in the current state:

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z

REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z

Which one of the following is TRUE?

(A) Only REQ1 can be permitted.

(B) Only REQ2 can be permitted.

(C) Both REQ1 and REQ2 can be permitted.

(D) Neither REQ1 nor REQ2 can be permitted.

gate2014-1 operating-system resource-allocation normal

4.183 Resource Allocation: GATE2005-IT_62 top gateoverflow.in/3823

Two shared resources R 1 and R 2 are used by processes P 1 and P 2. Each process has a certain priority for accessing each
resource. Let Tij denote the priority of P i for accessing R j. A process P i can snatch a resource R h from process P j if T ik is
greater than Tjk.
Given the following :

I. T11 > T 21
II. T12 > T 22
III. T11 < T 21
IV. T12 < T 22

Which of the following conditions ensures that P 1 and P 2 can never deadlock?

A) (I) and (IV)


B) (II) and (III)
C) (I) and (II)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 262 of 852

D) None of the above

gate2005-it operating-system resource-allocation normal

4.184 Resource Allocation: GATE2015-2_23 top gateoverflow.in/8114

A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 requests.
Which one of the following values of N could lead to a deadlock?

A. 1
B. 2
C. 3
D. 4

gate2015-2 operating-system resource-allocation easy

4.185 Resource Allocation: GATE2009_30 top gateoverflow.in/1316

Consider a system with 4 types of resources R1 (3 units), R2 (2 units), R3 (3 units), R4 (2 units). A non-preemptive
resource allocation policy is used. At any given instance, a request is not entertained if it cannot be completely satisfied.
Three processes P1, P2, P3 request the resources as follows if executed independently.

Process P3:
Process P1:
Process P2:
t=0: requests 1 unit
t=0: requests 2 units of R2
t=0: requests 2 units of R4
t=1: requests 1 unit of R3 of R3
t=2: requests 2 units
t=3: requests 2 units of R1 t=2: requests 1 unit of R1
of R4
t=5: releases 1 unit of R2 and t=5: releases 2 units
1 unit of R1. t=4: requests 1 unit of R1
of R1
t=7: releases 1 unit of R3 t=7: requests 1 unit
t=6: releases 1 unit of of R2
t=8: requests 2 units of R4 R3
t=8: requests 1 unit
t=10: Finishes t=8: Finishes of R3

t=9: Finishes

Which one of the following statements is TRUE if all three processes run concurrently starting at time t = 0?

A. All processes will finish without any deadlock

B. Only P1 and P2 will be in deadlock

C. Only P1 and P3 will be in deadlock

D. All three processes will be in deadlock

gate2009 operating-system resource-allocation normal

4.186 Resource Allocation: GATE1998_1.32 top gateoverflow.in/1669

A computer has six tape drives, with n processes competing for them. Each process may need two drives. What is the
maximum value of n for the system to be deadlock free?

a. 6
b. 5
c. 4
d. 3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 263 of 852

gate1998 operating-system resource-allocation normal

4.187 Resource Allocation: GATE2007_57 top gateoverflow.in/1255

A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of
each resource type. Consider the following scenario, where the column alloc denotes the number of units of each resource
type allocated to each process, and the column request denotes the number of units of each resource type requested by a
process in order to complete execution. Which of these processes will finish LAST?

alloc request
X Y Z X Y Z
P0 1 2 1 1 0 3
P1 2 0 1 0 1 2
P2 2 2 1 1 2 0

A. P0
B. P1
C. P2
D. None of the above, since the system is in a deadlock

gate2007 operating-system resource-allocation normal

4.188 Resource Allocation: GATE2001_19 top gateoverflow.in/760

Two concurrent processes P1 and P2 want to use to resources R1 and R2 in a mutually exclusive manner. Initially, R1 and R2
are free. The programs executed by the two processes are given below.

Program for P1:

S1: While (R1 is busy) do no-op;


S2: Set R1 busy;
S3: While R2 is busy do no-op;
S4: Set R2 busy;
S5: Use R1 and R2;
S6: Set R1 free;
S7: Set R2 free;

Program for P2:

Q1: While R1 is busy do no-op


Q2: Set R1 busy
Q3: While (R1 is busy) do no-op;
Q4: Set R1 busy
Q5: Use R1 and R2
Q6: Set R2 free
Q7: Set R2 free

a. Is mutual exclusion guaranteed for R1 and R2? If not show a possible interleaving of the statements of P1 and P2 such
mutual exclusion is violated (i.e., both P1 and P2 use R1 and R2 at the same time).
b. Can deadlock occur in the above program? If yes, show a possible interleaving of the statements of P1 and P2 leading
to deadlock.
c. Exchange the statements Q1 and Q3 and statements Q2 and Q4. Is mutual exclusion guaranteed now? Can deadlock
occur?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 264 of 852

gate2001 operating-system resource-allocation normal

4.189 Resource Allocation: GATE1992_02,xi top gateoverflow.in/568

02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

(xi) A computer system has 6 tape devices, with n processes competing for them. Each process may need 3 tape drives. The
maximum value of n for which the system is guaranteed to be deadlock free is:

a. 2
b. 3
c. 4
d. 1

gate1992 operating-system resource-allocation normal

4.190 Resource Allocation: GATE2008-IT_54 top gateoverflow.in/3364

An operating system implements a policy that requires a process to release all resources before making a request for another
resource. Select the TRUE statement from the following:

A) Both starvation and deadlock can occur


B) Starvation can occur but deadlock cannot occur
C) Starvation cannot occur but deadlock can occur
D) Neither starvation nor deadlock can occur

gate2008-it operating-system resource-allocation normal

4.191 Resource Allocation: GATE1997_6.7 top gateoverflow.in/2263

An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of R
such that no deadlocks will ever arise is

A. 3
B. 5
C. 4
D. 6

gate1997 operating-system resource-allocation normal

4.192 Resource Allocation: GATE1993_7.9 top gateoverflow.in/2297

Consider a system having m resources of the same type. These resources are shared by 3 processes A, B and C, which have
peak demands of 3, 4 and 6 respectively. For what value of m deadlock will not occur?

a. 7
b. 9
c. 10
d. 13
e. 15

gate1993 operating-system resource-allocation normal

4.193 Resource Allocation: GATE2008_65 top gateoverflow.in/488

Which of the following is NOT true of deadlock prevention and deadlock avoidance schemes?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 265 of 852

A. In deadlock prevention, the request for resources is always granted if the resulting state is safe

B. In deadlock avoidance, the request for resources is always granted if the resulting state is safe

C. Deadlock avoidance is less restrictive than deadlock prevention

D. Deadlock avoidance requires knowledge of resource requirements a priority

gate2008 operating-system easy resource-allocation

4.194 Resource Allocation: GATE2010_46 top gateoverflow.in/2348

A system has n resources R0 , , Rn1 , and k processes P0 , , Pk1 . The implementation of the resource request logic of each process
Pi is as follows:
if (i%2==0) {
if (i<n) request Ri;
if (i+2 < n) request Ri+2
}

else {
if (i<n) request Rn-i;
if (i+2 <n) request Rn-i-2;
}

In which of the following situations is a deadlock possible?

(A) n = 40, k = 26

(B) n = 21, k = 12

(C) n = 20, k = 10

(D) n = 41, k = 19

gate2010 operating-system resource-allocation normal

4.195 Resource Allocation: GATE1997_75 top gateoverflow.in/19705

An operating system handles requests to resources as follows.

A process (which asks for some resources, uses them for some time and then exits the system) is assigned a unique
timestamp are when it starts. The timestamps are monotonically increasing with time. Let us denote the timestamp of a
process P by TS(P).

When a process P requests for a resource the OS does the following:

i. If no other process is currently holding the resource, the OS awards the resource to P.

ii. If some process Q with TS(Q)

iii. If some process Q with TS(Q)>TSP(P) is holding the resource, the OS restarts Q and awards the resources to P. (Restarting means taking back the
resources held by a process, killing it and starting it again with the same timestamp)

When a process releases a resource, the process with the smallest timestamp (if any) amongst those waiting for the
resource is awarded the resource.

a. Can a deadlock over arise. If yes, show how. If not prove it.

b. Can a process P ever starve? If yes, show how. If not prove it.

gate1997 operating-system resource-allocation

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 266 of 852

4.196 Resource Allocation: GATE2000_2.23 top gateoverflow.in/670

Which of the following is not a valid deadlock prevention scheme?

A. Release all resources before requesting a new resource.


B. Number the resources uniquely and never request a lower numbered resource than the last one requested.
C. Never request a resource after releasing any resource.
D. Request and all required resources be allocated before execution.

gate2000 operating-system resource-allocation normal

4.197 Resource Allocation: GATE2004-IT_63 top gateoverflow.in/3706

In a certain operating system, deadlock prevention is attemped using the following scheme. Each process is assigned a
unique timestamp, and is restarted with the same timestamp if killed. Let P h be the process holding a resource R, P r be a
process requesting for the same resource R, and T(Ph) and T(P r ) be their timestamps respectively. The decision to wait or
preempt one of the processes is based on the following algorithm.

if T(Pr) < T(Ph) then
kill Pr
else wait

Which one of the following is TRUE?

A. The scheme is deadlock-free, but not starvation-free


B. The scheme is not deadlock-free, but starvation-free
C. The scheme is neither deadlock-free nor starvation-free
D. The scheme is both deadlock-free and starvation-free

gate2004-it operating-system resource-allocation normal

4.198 Resource Allocation: GATE2015-3_52 top gateoverflow.in/8561

Consider the following policies for preventing deadlock in a system with mutually exclusive resources.

I. Process should acquire all their resources at the beginning of execution. If any resource is not available, all resources
acquired so far are released.
II. The resources are numbered uniquely, and processes are allowed to request for resources only in increasing resource
numbers
III. The resources are numbered uniquely, and processes are allowed to request for resources only in deccreasing resource
numbers
IV. The resources are numbered uniquely. A processes is allowed to request for resources only for a resource with resource
number larger than its currently held resources

Which of the above policies can be used for preventing deadlock?

A. Any one of I and III but not II or IV


B. Any one of I, III and IV but not II
C. Any one of II and III but not I or IV
D. Any one of I, II, III and IV

gate2015-3 operating-system resource-allocation normal

4.199 Resource Allocation: GATE2006_66 top gateoverflow.in/1844

Consider the following snapshot of a system running n processes. Process i is holding xi instances of a resource R,
1in R i i

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 267 of 852

1 i n . Currently, all instances of R are occupied. Further, for all i, process i has placed a request for an additional
yi instances while holding the xi instances it already has. There are exactly two processes p and q and such that
Yp = Yq = 0. Which one of the following can serve as a necessary condition to guarantee that the system is not approaching
a deadlock?

(A) min(xp , xq ) < maxkp,q yk


(B) xp + xq minkp,q yk
(C) max(xp , xq ) >1
(D) min(xp , xq ) >1

gate2006 operating-system resource-allocation normal

4.200 Resource Allocation: GATE1996_22 top gateoverflow.in/2774

A computer system uses the Bankers Algorithm to deal with deadlocks. Its current state is shown in the table below, where
P0, P1, P2 are processes, and R0, R1, R2 are resources types.

Maximum Need Current Allocation Available


R0 R1 R2 R0 R1 R2 R0 R1 R2
P0 4 1 2 P0 1 0 2 2 2 0
P1 1 5 1 P1 0 3 1
P2 1 2 3 P2 1 0 2

a. Show that the system can be in this state

b. What will the system do on a request by process P0 for one unit of resource type R1?

gate1996 operating-system resource-allocation normal

4.201 Resource Allocation: GATE2014-3_31 top gateoverflow.in/2065

A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system
must have such that deadlocks never arise is _________.

gate2014-3 operating-system resource-allocation numerical-answers easy

4.202 Semaphore: GATE1998_1.31 top gateoverflow.in/1668

A counting semaphore was initialized to 10. Then 6P (wait) operations and 4V (signal) operations were completed on this
semaphore. The resulting value of the semaphore is

A. 0
B. 8
C. 10
D. 12

gate1998 operating-system process-synchronization semaphore easy

4.203 Semaphore: GATE2008_63 top gateoverflow.in/486

The P and V operations on counting semaphores, where s is a counting semaphore, are defined as follows:

s = s 1;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 268 of 852

s = s 1;
P (s) : If s < 0 then wait;

s = s + 1;
V (s) :
If s <= 0 then wake up process waiting on s;

Assume that Pb and Vb the wait and signal operations on binary semaphores are provided. Two binary semaphores xb and yb
are used to implement the semaphore operations P (s) and V (s) as follows:

Pb (xb );
s = s 1;
if (s < 0) {
Vb (xb );
Pb (yb );
P (s) : }
else Vb (xb );

Pb (xb );
s = s + 1;
V (s) :
if (s <= 0)Vb (yb );
Vb (xb );

The initial values of xb and yb are respectively

A. 0 and 0
B. 0 and 1
C. 1 and 0
D. 1 and 1

gate2008 operating-system normal semaphore

4.204 Semaphore: GATE 2016-2-49 top gateoverflow.in/39576

Consider a non-negative counting semaphore S. The operation P (S) decrements S, and V (S) increments S. During an
execution, 20 P (S) operations and 12 V (S) operations are issued in some order. The largest initial value of S for which at
least one P (S) operation will remain blocked is _______

gate2016-2 operating-system semaphore normal numerical-answers

4.205 Semaphore: GATE2006-IT_57 top gateoverflow.in/3601

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 269 of 852

The wait and signal operations of a monitor are implemented using semaphores as follows. In the following,

x is a condition variable,
mutex is a semaphore initialized to 1,
x_sem is a semaphore initialized to 0,
x_count is the number of processes waiting on semaphore x_sem, initially 0, next is a semaphore initialized to 0,
next_count is the number of processes waiting on semaphore next, initially 0.

The body of each procedure that is visible outside the monitor is replaced with the following:

P(mutex);
body of procedure
if (next_count > 0)
V(next);
else
V(mutex);

Each occurrence of x.wait is replaced with the following:


x_count = x_count + 1;
if (next_count > 0)
V(next)
else
V(mutex);
------------------------------------------------------------ E1;
x_count = x_count - 1;

Each occurrence of x.signal is replaced with the following:



if (x_count > 0)
{
next_count = next_count + 1;
------------------- E2;
P(next),
next_count = next_count - 1;
}

For correct implementation of the monitor, statements E1 and E2 are, respectively,

1) P(x_sem), V(next)
2) V(next), P(x_sem)
3) P(next), V(x_sem)
4) P(x_sem), V(x_sem)

gate2006-it operating-system process-synchronization semaphore normal

4.206 Semaphore: TIFR2012-B-10 top gateoverflow.in/25110

Consider the blocked-set semaphore where the signaling process awakens any one of the suspended process; i.e.,

Wait (S): If S > 0 then S S 1, else suspend the execution of this process.
Signal (S): If there are processes that have been suspended on semaphore S, then wake any one of them, else S S+1
Consider the following solution of mutual exclusion problem using blocked-set semaphores.
s := 1;
cobegin
P(1) || P(2) || ..... || P(N)
coend

Where the task body P(i) is

begin
while true do
begin
< non critical section >
Wait (S)
<critical section>
Signal (S)
end
end

Here N is the number of concurrent processors. Which of the following is true?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 270 of 852

a. The program fails to achieve mutual exclusion of critical regions.


b. The program achieves mutual exclusion, but starvation freedom is ensured only for N 2
c. The program does not ensure mutual exclusion if N 3
d. The program achieves mutual exclusion, but allows starvation for any N 2
e. The program achieves mutual exclusion and starvation freedom for any N 1

tifr2012 operating-system process-synchronization semaphore

4.207 Semaphore: GATE1992_02,x top gateoverflow.in/564

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and 15 V operations were
completed on this semaphore. The resulting value of the semaphore is :

(a). 42

(b). 2

(c). 7

(d). 12

gate1992 operating-system semaphore easy

4.208 Shell Script: GATE2005-IT_17 top gateoverflow.in/3762

A student wishes to create symbolic links in a computer system running Unix. Three text files named "file 1", "file 2" and "file
3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file
1 contains information about her hobbies, file 2 contains information about her friends and file 3 contains information about
her courses. The student executes the following sequence of commands from her current working directory
ln -s file 1 file 2
ln -s file 2 file 3

Which of the following types of information would be lost from her file system?
(I) Hobbies (II) Friends (III) Courses

A) (I) and (II) only
B) (II) and (III) only
C) (II) only
D) (I) and (III) only

gate2005-it operating-system shell-script normal

4.209 Threads: GATE2014-1_20 top gateoverflow.in/1787

Which one of the following is FALSE?

(A) User level threads are not scheduled by the kernel.

(B) When a user level thread is blocked, all other threads of its process are blocked.

(C) Context switching between user level threads is faster than context switching between kernel level threads.

(D) Kernel level threads cannot share the code segment.

gate2014-1 operating-system threads normal

4.210 Threads: GATE2007_17 top gateoverflow.in/1215

Consider the following statements about user level threads and kernel level threads. Which one of the following statements is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 271 of 852

FALSE?

A. Context switch time is longer for kernel level threads than for user level threads.

B. User level threads do not need any hardware support.

C. Related kernel level threads can be scheduled on different processors in a multi-processor system.

D. Blocking one kernel level thread blocks all related threads.

gate2007 operating-system threads normal

4.211 Threads: GATE2011_16 top gateoverflow.in/2118

A thread is usually dened as a "light weight process" because an operating system (OS) maintains smaller data structures for a thread than for a process. In
relation to this, which of the following is TRUE?

(A) On per-thread basis, the OS maintains only CPU register state

(B) The OS does not maintain separate stack for each thread

(C) On per-thread basis, the OS does not maintain virtual memory state

(D) On per-thread basis, the OS maintains only scheduling and accounting information

gate2011 operating-system threads normal

4.212 Threads: GATE2004_11 top gateoverflow.in/1008

Consider the following statements with respect to user-level threads and kernel-supported threads

I. context switch is faster with kernel-supported threads

II. for user-level threads, a system call can block the entire process

III. Kernel supported threads can be scheduled independently

IV. User level threads are transparent to the kernel

Which of the above statements are true?

A. (II), (III) and (IV) only


B. (II) and (III) only
C. (I) and (III) only
D. (I) and (II) only

gate2004 operating-system threads normal

4.213 User Modes: GATE2005-IT_19 top gateoverflow.in/3764

A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate
files before terminating the process. When a Ctrl-C input is given to this process, what is the mode in which the signal
handling routine executes?

A) kernel mode
B) superuser mode
C) privileged mode
D) user mode

gate2005-it operating-system user-modes normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 272 of 852

4.214 Virtual Memory: GATE2001_1.21 top gateoverflow.in/714

Consider a virtual memory system with FIFO page replacement policy. For an arbitrary page access pattern, increasing the
number of page frames in main memory will

(A) always decrease the number of page faults

(B) always increase the number of page faults

(C) sometimes increase the number of page faults

(D) never affect the number of page faults

gate2001 operating-system virtual-memory normal

4.215 Virtual Memory: GATE2001_2.21 top gateoverflow.in/739

Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the page size s 4KB, what is the
approximate size of the page table?

A. 16 MB
B. 8 MB
C. 2 MB
D. 24 MB

gate2001 operating-system virtual-memory normal

4.216 Virtual Memory: GATE1996_7 top gateoverflow.in/2759

A demand paged virtual memory system uses 16 bit virtual address, page size of 256 bytes, and has 1 Kbyte of main
memory. LRU page replacement is implemented using list, whose current status (page number is decimal) is

For each hexadecimal address in the address sequence given below,

00FF, 010D, 10FF, 11B0

indicate

i. the new status of the list

ii. page faults, if any, and

iii. page replacements, if any.

gate1996 operating-system virtual-memory normal

4.217 Virtual Memory: GATE2006_63 top gateoverflow.in/1841

A computer system supports 32-bit virtual addresses as well as 32-bit physical addresses. Since the virtual address space is
of the same size as the physical address space, the operating system designers decide to get rid of the virtual memory
entirely. Which one of the following is true?

(A) Efficient implementation of multi-user support is no longer possible

(B) The processor cache organization can be made more efficient now

(C) Hardware support for memory management is no longer needed

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 273 of 852

(D) CPU scheduling can be made more efficient now

gate2006 operating-system virtual-memory normal

4.218 Virtual Memory: GATE2003-78 top gateoverflow.in/788

A processor uses 2-level page tables for virtual to physical address translation. Page tables for both levels are stored in the
main memory. Virtual and physical addresses are both 32 bits wide. The memory is byte addressable. For virtual to physical
address translation, the 10 most significant bits of the virtual address are used as index into the first level page table while
the next 10 bits are used as index into the second level page table. The 12 least significant bits of the virtual address are
used as offset within the page. Assume that the page table entries in both levels of page tables are 4 bytes wide. Further,
the processor has a translation look-aside buffer (TLB), with a hit rate of 96%. The TLB caches recently used virtual page
numbers and the corresponding physical page numbers. The processor also has a physically addressed cache with a hit rate
of 90%. Main memory access time is 10 ns, cache access time is 1 ns, and TLB access time is also 1 ns.

Assuming that no page faults occur, the average time taken to access a virtual address is approximately (to the nearest 0.5
ns)

A. 1.5 ns
B. 2 ns
C. 3 ns
D. 4 ns

gate2003 operating-system normal virtual-memory

4.219 Virtual Memory: GATE2008-IT_41 top gateoverflow.in/3351

Assume that a main memory with only 4 pages, each of 16 bytes, is initially empty. The CPU generates the following
sequence of virtual addresses and uses the Least Recently Used (LRU) page replacement policy.

0, 4, 8, 20, 24, 36, 44, 12, 68, 72, 80, 84, 28, 32, 88, 92

How many page faults does this sequence cause? What are the page numbers of the pages present in the main memory at
the end of the sequence?

A) 6 and 1, 2, 3, 4
B) 7 and 1, 2, 4, 5
C) 8 and 1, 2, 4, 5
D) 9 and 1, 2, 3, 5

gate2008-it operating-system virtual-memory normal

4.220 Virtual Memory: GATE2014-3_33 top gateoverflow.in/2067

Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It
takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the
effective memory access time (in milliseconds) is _________.

gate2014-3 operating-system virtual-memory numerical-answers normal

4.221 Virtual Memory: GATE2011_20 top gateoverflow.in/2122

Let the page fault service time be 10 ms in a computer with average memory access time being 20 ns. If one page fault is
generated for every 106 memory accesses, what is the effective access time for the memory?

(A) 21 ns

(B) 30 ns

(C) 23 ns

35

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 274 of 852

(D) 35 ns

gate2011 operating-system virtual-memory normal

4.222 Virtual Memory: GATE2008_67 top gateoverflow.in/490

A processor uses 36 bit physical address and 32 bit virtual addresses, with a page frame size of 4 Kbytes. Each page table
entry is of size 4 bytes. A three level page table is used for virtual to physical address translation, where the virtual address
is used as follows:

Bits 30-31 are used to index into the first level page table.
Bits 21-29 are used to index into the 2nd level page table.
Bits 12-20 are used to index into the 3rd level page table.
Bits 0-11 are used as offset within the page.

The number of bits required for addressing the next level page table(or page frame) in the page table entry of the first,
second and third level page tables are respectively

a) 20,20,20
b) 24,24,24
c) 24,24,20
d) 25,25,24

gate2008 operating-system virtual-memory normal

4.223 Virtual Memory: GATE1995_1.7 top gateoverflow.in/2594

In a paged segmented scheme of memory management, the segment table itself must have a page table because

A. The segment table is often too large to fit in one page

B. Each segment is spread over a number of pages

C. Segment tables point to page tables and not to the physical locations of the segment

D. The processors description base register points to a page table

gate1995 operating-system virtual-memory normal

4.224 Virtual Memory: GATE2003-79 top gateoverflow.in/43578

A processor uses 2-level page tables for virtual to physical address translation. Page tables for both levels are stored in the
main memory. Virtual and physical addresses are both 32 bits wide. The memory is byte addressable. For virtual to physical
address translation, the 10 most significant bits of the virtual address are used as index into the first level page table while
the next 10 bits are used as index into the second level page table. The 12 least significant bits of the virtual address are
used as offset within the page. Assume that the page table entries in both levels of page tables are 4 bytes wide. Further,
the processor has a translation look-aside buffer (TLB), with a hit rate of 96%. The TLB caches recently used virtual page
numbers and the corresponding physical page numbers. The processor also has a physically addressed cache with a hit rate
of 90%. Main memory access time is 10 ns, cache access time is 1 ns, and TLB access time is also 1 ns.

Suppose a process has only the following pages in its virtual address space: two contiguous code pages starting at virtual
address 0x00000000, two contiguous data pages starting at virtual address 0x00400000, and a stack page starting at virtual
address 0xFFFFF000. The amount of memory required for storing the page tables of this process is

A. 8 KB
B. 12 KB
C. 16 KB
D. 20 KB

gate2003 operating-system normal virtual-memory

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 275 of 852

4.225 Virtual Memory: GATE2013-52 top gateoverflow.in/379

A computer uses 46-bit virtual address, 32-bit physical address, and a threelevel paged page table organization. The page
table base register stores the base address of the first-level table (T1), which occupies exactly one page. Each entry of T1
stores the base address of a page of the second-level table (T2). Each entry of T2 stores the base address of a page of the
third-level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the
computer has a 1 MB 16 way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.

What is the size of a page in KB in this computer?

A. 2
B. 4
C. 8
D. 16

gate2013 operating-system virtual-memory normal

4.226 Virtual Memory: GATE2013-53 top gateoverflow.in/43294

A computer uses 46-bit virtual address, 32-bit physical address, and a threelevel paged page table organization. The page
table base register stores the base address of the first-level table (T1), which occupies exactly one page. Each entry of T1
stores the base address of a page of the second-level table (T2). Each entry of T2 stores the base address of a page of the
third-level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the
computer has a 1 MB 16 way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.

What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the
processor cache of this computer?

A. 2
B. 4
C. 8
D. 16

gate2013 normal operating-system virtual-memory

4.227 Virtual Memory: GATE1991_03,xi top gateoverflow.in/525

Choose the correct alternatives (more than one can be correct) and write the corresponding letters only:

Indicate all the false statements from the statements given below:

(a). The amount of virtual memory available is limited by the availability of the secondary memory

(b). Any implementation of a critical section requires the use of an indivisible machine- instruction ,such as test-and-set.

(c). The use of monitors ensure that no dead-locks will be caused .

(d). The LRU page-replacement policy may cause thrashing for some type of programs.

(e). The best fit techniques for memory allocation ensures that memory will never be fragmented.

gate1991 operating-system virtual-memory normal

4.228 Virtual Memory: GATE2002_19 top gateoverflow.in/872

A computer uses 32-bit virtual address, and 32-bit physical address. The physical memory is byte addressable, and the page
size is 4 kbytes. It is decided to use two level page tables to translate from virtual address to physical address. Equal
number of bits should be used for indexing first level and second level page table, and the size of each table entry is 4 bytes.

a. Give a diagram showing how a virtual address would be translated to a physical address.
b. What is the number of page table entries that can be contained in each page?
c. How many bits are available for storing protection and other information in each page table entry?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 276 of 852

gate2002 operating-system virtual-memory normal

4.229 Virtual Memory: GATE 2016-1-47 top gateoverflow.in/39690

Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a
one-level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is
__________ megabytes.

gate2016-1 operating-system virtual-memory easy numerical-answers

4.230 Virtual Memory: GATE1995_2.16 top gateoverflow.in/2628

In a virtual memory system the address space specified by the address lines of the CUP must be _____ than the physical
memory size and ____ than the secondary storage size.

A. smaller, smaller
B. smaller, larger
C. larger, smaller
D. larger, larger

gate1995 operating-system virtual-memory normal

4.231 Virtual Memory: GATE2001_1.8 top gateoverflow.in/701

Which of the following statements is false?

A. Virtual memory implements the translation of a program's address space into physical memory address space
B. Virtual memory allows each program to exceed the size of the primary memory
C. Virtual memory increases the degree of multiprogramming
D. Virtual memory reduces the context switching overhead

gate2001 operating-system virtual-memory normal

4.232 Virtual Memory: GATE2008-IT_16 top gateoverflow.in/3276

A paging scheme uses a Translation Look-aside Buffer (TLB). A TLB-access takes 10 ns and a main memory access takes 50
ns. What is the effective access time(in ns) if the TLB hit ratio is 90% and there is no page-fault?

A) 54
B) 60
C) 65
D) 75

gate2008-it operating-system virtual-memory normal

4.233 Virtual Memory: GATE2009_34 top gateoverflow.in/1320

A multilevel page table is preferred in comparison to a single level page table for translating virtual address to physical
address because

A. It reduces the memory access time to read or write a memory location.

B. It helps to reduce the size of page table needed to implement the virtual address space of a process

C. It is required by the translation lookaside buffer.

D. It helps to reduce the number of page faults in page replacement algorithms.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 277 of 852

gate2009 operating-system virtual-memory easy

4.234 Virtual Memory: GATE1999_2.11 top gateoverflow.in/1489

Which of the following is/are advantage(s) of virtual memory?

(a) Faster access to memory on an average.

(b) Processes can be given protected address spaces.

(c) Linker can assign addresses independent of where the program will be loaded in physical memory.

(d) Program larger than the physical memory size can be run.

gate1999 operating-system virtual-memory easy

4.235 Virtual Memory: Gate2006_62 top gateoverflow.in/1840

A CPU generates 32-bit virtual addresses. The page size is 4 KB. The processor has a translation look-aside buffer (TLB)
which can hold a total of 128 page table entries and is 4-way set associative. The minimum size of the TLB tag is:

(A) 11 bits
(B) 13 bits
(C) 15 bits
(D) 20 bits

gate2006 operating-system virtual-memory normal

4.236 Virtual Memory: GATE1999_19 top gateoverflow.in/1518

A certain computer system has the segmented paging architecture for virtual memory. The memory is byte addressable.
Both virtual and physical address spaces contain 216 bytes each. The virtual address space is divided into 8 non-overlapping
equal size segments. The memory management unit (MMU) has a hardware segment table, each entry of which contains the
physical address of the page table for the segment. Page tables are stored in the main memory and consists of 2 byte page
table entries.

a. What is the minimum page size in bytes so that the page table for a segment requires at most one page to store it?
Assume that the page size can only be a power of 2.

b. Now suppose that the pages size is 512 bytes. It is proposed to provide a TLB (Transaction look-aside buffer) for
speeding up address translation. The proposed TLB will be capable of storing page table entries for 16 recently
referenced virtual pages, in a fast cache that will use the direct mapping scheme. What is the number of tag bits that
will need to be associated with each cache entry?

c. Assume that each page table entry contains (besides other information) 1 valid bit, 3 bits for page protection and 1
dirty bit. How many bits are available in page table entry for storing the aging information for the page? Assume that
the page size is 512 bytes.

gate1999 operating-system virtual-memory normal

4.237 Virtual Memory: GATE2009_9 top gateoverflow.in/1301

In which one of the following page replacement policies, Belady's anomaly may occur?

A. FIFO
B. Optimal
C. LRU
D. MRU

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 278 of 852

gate2009 operating-system virtual-memory normal

4.238 Virtual Memory: GATE2015-1_12 top gateoverflow.in/8186

Consider a system with byte-addressable memory, 32-bit logical addresses, 4 kilobyte page size and page table entries of 4
bytes each. The size of the page table in the system in megabytes is_________________.

gate2015-1 operating-system virtual-memory easy

4.239 Virtual Memory: GATE2015-2_25 top gateoverflow.in/8120

A computer system implements a 40-bit virtual address, page size of 8 kilobytes, and a 128-entry translation look-aside
buffer (TLB) organized into 32 sets each having 4 ways. Assume that the TLB tag does not store any process id. The
minimum length of the TLB tag in bits is ____.

gate2015-2 operating-system virtual-memory easy

4.240 Virtual Memory: GATE2008-IT_56 top gateoverflow.in/3366

Match the following flag bits used in the context of virtual memory management on the left side with the different purposes
on the right side of the table below.

Name of the bit Purpose


I. Dirty a. Page initialization
II. R/W b. Write-back policy
III. Reference c. Page protection
IV. Valid d. Page replacement policy

A) I-d, II-a, III-b, IV-c


B) I-b, II-c, III-a, IV-d
C) I-c, II-d, III-a, IV-b
D) I-b, II-c, III-d, IV-a

gate2008-it operating-system virtual-memory easy

4.241 Virtual Memory: GATE2009_10 top gateoverflow.in/1302

The essential content(s) in each entry of a page table is / are

A. Virtual page number

B. Page frame number

C. Both virtual page number and page frame number

D. Access right information

gate2009 operating-system virtual-memory easy

4.242 Virtual Memory: GATE2004-IT_66 top gateoverflow.in/3709

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 279 of 852

In a virtual memory system, size of virtual address is 32-bit, size of physical address is 30-bit, page size is 4 Kbyte and size
of each page table entry is 32-bit. The main memory is byte addressable. Which one of the following is the maximum
number of bits that can be used for storing protection and other information in each page table entry?

A) 2
B) 10
C) 12
D) 14

gate2004-it operating-system virtual-memory normal

4.243 Virtual Memory: GATE2003_26 top gateoverflow.in/916

In a system with 32 bit virtual addresses and 1 KB page size, use of one-level page tables for virtual to physical address
translation is not practical because of

A. the large amount of internal fragmentation


B. the large amount of external fragmentation
C. the large memory overhead in maintaining page tables
D. the large computation overhead in the translation process

gate2003 operating-system virtual-memory normal

4.244 Virtual Memory: GATE2015-2_47 top gateoverflow.in/8247

A computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid
bit, a dirty bit, three permission bits, and the translation. If the maximum size of the page table of a process is 24
megabytes, the length of the virtual address supported by the system is _______ bits.

gate2015-2 operating-system virtual-memory normal

4.245 Working Set: GATE2006-IT_12 top gateoverflow.in/3551

In the working-set strategy, which of the following is done by the operating system to prevent thrashing?

I. It initiates another process if there are enough extra frames.


II. It selects a process to suspend if the sum of the sizes of the working-sets exceeds the total number of available frames.

A) I only
B) II only
C) Neither I nor II
D) Both I and II

gate2006-it operating-system process-schedule working-set normal

4.246 GATE1997_3.7 top gateoverflow.in/2238

I/O redirection

A. implies changing the name of a file

B. can be employed to use an existing file as input file for a program

C. implies connecting 2 programs through a pipe

D. None of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 280 of 852

gate1997 operating-system normal

4.247 GATE1997_3.6 top gateoverflow.in/2237

The correct matching for the following pairs is:

(A) Disk Scheduling (1) Round robin


(B) Batch Processing (2) SCAN
(C) Time sharing (3) LIFO
(D) Interrupt processing (4) FIFO

A. A-3 B-4 C-2 D-1

B. A-4 B-3 C-2 D-1

C. A-2 B-4 C-1 D-3

D. A-3 B-4 C-3 D-2

gate1997 operating-system normal

4.248 GATE2004-IT_14 top gateoverflow.in/3655

Which one of the following is NOT shared by the threads of the same process ?

A) Stack
B) Address Space
C) File Descriptor Table
D) Message Queue

gate2004-it operating-system easy

4.249 GATE1994_1.21 top gateoverflow.in/2464

Which one of the following statements is true?

A. Macro definitions cannot appear within other macro definitions in assembly language programs

B. Overlaying is used to run a program which is longer than the address space of a computer

C. Virtual memory can be used to accommodate a program which is longer than the address space of a computer

D. It is not possible to write interrupt service routines in a high level language

gate1994 operating-system normal

4.250 GATE1999_1.11 top gateoverflow.in/1464

System calls are usually invoked by using

A. a software interrupt

B. polling

C. an indirect jump

D. a privileged instruction

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 281 of 852

gate1999 operating-system normal

4.251 GATE1992-12a top gateoverflow.in/591

Draw the precedence graph for the concurrent program given below
S1
parbegin
begin
S2:S4
end;
begin
S3;
parbegin
S5;
begin
S6:S8
end
parend
end;
S7
parend;
S9

gate1992 operating-system normal

4.252 GATE1991_01,xii top gateoverflow.in/508

A given set of processes can be implemented by using only parbegin/parend statement, if the precedence graph of these
processes is ______

gate1991 operating-system normal

4.253 GATE1999_2.10 top gateoverflow.in/1488

A multi-user, multi-processing operating system cannot be implemented on hardware that does not support

A. Address translation
B. DMA for disk transfer
C. At least two modes of CPU execution (privileged and non-privileged)
D. Demand paging

gate1999 operating-system normal

4.254 GATE1991_02,iii top gateoverflow.in/513

Match the pairs in the following questions by writing the corresponding letters only.

(a). Buddy system

(b). Interpretation

(c). Pointer type

(d). Virtual memory

(p). Run time type specification

(q). Segmentation

(r). Memory allocation

(s). Garbage collection

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 282 of 852

gate1991 operating-system normal

4.254 gate 2014 cs top gateoverflow.in/36969

4.255 GATE1998_1.30 top gateoverflow.in/1667

When the result of a computation depends on the speed of the processes involved, there is said to be

(a) cycle stealing

(b) race condition

(a) a time lock

(d) a deadlock

gate1998 operating-system easy

4.256 GATE2001_1.20 top gateoverflow.in/713

Where does the swap space reside?

(A) RAM

(B) Disk

(C) ROM

(D) On-chip cache

gate2001 operating-system easy

4.257 GATE1998_2.16 top gateoverflow.in/1689

The overlay tree for a program is as shown below:

What will be the size of the partition (in physical memory) required to load (and run) this program?

A. 12 KB
B. 14 KB
C. 10 KB
D. 8 KB

gate1998 operating-system normal

4.258 GATE2001_2.20 top gateoverflow.in/738

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 283 of 852

Which of the following does not interrupt a running process?

A. A device
B. Timer
C. Scheduled process
D. Power failure

gate2001 operating-system easy

4.259 GATE2002_2.21 top gateoverflow.in/851

Which combination of the following features will suffice to characterize an OS as a multi-programmed OS?

(A) More than one program may be loaded into main memory at the same time for execution.
(B) If a program waits for certain events such as I/O, another program is immediately scheduled for execution.
(C) If the execution of a program terminates, another program is immediately scheduled for execution.

A. A
B. A and B
C. A and C
D. A, B and C

gate2002 operating-system normal

4.260 GATE1999_1.9 top gateoverflow.in/1462

Listed below are some operating system abstractions (in the left column) and the hardware components (in the right
column)?

(A) Thread 1. Interrupt


(B) Virtual address space 2. Memory
(C) File system 3. CPU
(D) Signal 4. Disk

A. (A) 2 (B) 4 (C) 3 (D) 1


B. (A) 1 (B) 2 (C) 3 (D) 4
C. (A) 3 (B) 2 (C) 4 (D) 1
D. (A) 4 (B) 1 (C) 2 (D) 3

gate1999 operating-system easy

4.261 GATE2001_1.13 top gateoverflow.in/706

A CPU has two modes -- privileged and non-privileged. In order to change the mode from privileged to non-privileged

(A) a hardware interrupt is needed

(B) a software interrupt is needed

(C) a privileged instruction (which does not generate an interrupt) is needed

(D) a non-privileged instruction (which does not generate an interrupt) is needed

gate2001 operating-system normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 284 of 852

4.262 GATE1996_2.17 top gateoverflow.in/2746

The correct matching for the following pairs is

(A) Activation record (1) Linking loader


(B) Location counter (2) Garbage collection
(C) Reference counts (3) Subroutine call
(D) Address relocation (4) Assembler

A. A-3 B-4 C-1 D-2

B. A-4 B-3 C-1 D-2

C. A-4 B-3 C-2 D-1

D. A-3 B-4 C-2 D-1

gate1996 operating-system easy

4.263 GATE2012_8 top gateoverflow.in/40

A process executes the code



fork();
fork();
fork();

The total number of child processes created is

(A) 3
(B) 4
(C) 7
(D) 8

gate2012 operating-system easy

4.264 GATE1996_1.18 top gateoverflow.in/2722

The process state transition diagram in the below figure is representative of

A. a batch operating system

B. an operating system with a preemptive scheduler

C. an operating system with a non-preemptive scheduler

D. a uni-programmed operating system

gate1996 operating-system normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 285 of 852

4.265 GATE2000_2.13 top gateoverflow.in/660

A graphics card has on board memory of 1 MB. Which of the following modes can the card not support?

A. 1600 x 400 resolution with 256 colors on a 17 inch monitor


B. 1600 x 400 resolution with 16 million colors on a 14 inch monitor
C. 800 x 400 resolution with 16 million colors on a 17 inch monitor
D. 800 x 800 resolution with 256 colors on a 14 inch monitor

gate2000 operating-system normal

4.266 GATE2000_2.22 top gateoverflow.in/669

Suppose the time to service a page fault is on the average 10 milliseconds, while a memory access takes 1 microsecond. Then a 99.99% hit
ratio results in average memory access time of

a. 1.9999 milliseconds
b. 1 millisecond
c. 9.999 microseconds
d. 1.9999 microseconds

gate2000 operating-system easy

4.267 GATE2006-IT_13 top gateoverflow.in/3552

The process state transition diagram of an operating system is as given below.

Which of the following must be FALSE about the above operating system?

A) It is a multiprogrammed operating system


B) It uses preemptive scheduling
C) It uses non-preemptive scheduling
D) It is a multi-user operating system

gate2006-it operating-system normal

4.268 GATE2000_1.20 top gateoverflow.in/644

Which of the following need not necessarily be saved on a context switch between processes?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 286 of 852

A. General purpose registers


B. Translation look-aside buffer
C. Program counter
D. All of the above

gate2000 operating-system easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 287 of 852

5 Databases top
5.1 B Tree: GATE2009_44 top gateoverflow.in/1330

The following key values are inserted into a B+ - tree in which order of the internal nodes is 3, and that of the leaf nodes is
2, in the sequence given below. The order of internal nodes is the maximum number of tree pointers in each node, and the
order of leaf nodes is the maximum number of data items that can be stored in it. The B+ - tree is initially empty

10, 3, 6, 8, 4, 2, 1

The maximum number of times leaf nodes would get split up as a result of these insertions is

A. 2
B. 3
C. 4
D. 5

gate2009 databases b-tree normal

5.2 B Tree: GATE1997_19 top gateoverflow.in/2279

A B+ - tree of order d is a tree in which each internal node has between d and 2d key values. An internal node with M key
values has M + 1 children. The root (if it is an internal node) has between 1 and 2d key values. The distance of a node from
the root is the length of the path from the root to the node. All leaves are at the same distance from the root. The height of
the tree is the distance of a leaf from the root.

a. What is the total number of key values in the internal nodes of a B+ -tree with l leaves ( l 2)?
b. What is the maximum number of internal nodes in a B+ - tree of order 4 with 52 leaves?

c. What is the minimum number of leaves in a B+ -tree of order d and height h(h 1)?

gate1997 databases b-tree normal

5.3 B Tree: GATE2007-IT_84 top gateoverflow.in/3536

Consider the B + tree in the adjoining figure, where each node has at most two keys and three links.

Keys K 15 and then K 25 are inserted into this tree in that order. Exactly how many of the following nodes (disregarding the
links) will be present in the tree after the two insertions?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 288 of 852

A) 1
B) 2
C) 3
D) 4

gate2007-it databases b-tree normal

5.4 B Tree: GATE2007-IT_85 top gateoverflow.in/3537

Consider the B tree in the adjoining figure, where each node has at most two keys and three links.

Now the key K 50 is deleted from the B + tree resulting after the two insertions made earlier. Consider the following
statements about the B+ tree resulting after this deletion.

(i) The height of the tree remains the same.


(ii) The node

k20

(disregarding the links) is present in the tree.


(iii) The root node remains unchanged (disregarding the links)1
Which one of the following options is true ?

1) Statements (i) and (ii) are true


2) Statements (ii) and (iii) are true
3) Statements (iii) and (i) are true
4) All the statements are false

gate2007-it databases b-tree normal

5.5 B Tree: GATE1994_14 top gateoverflow.in/2510

Consider B+ - tree of order d shown in figure. (A B+ - tree of order d contains between d and 2d keys in each node)

a. Draw the resulting B+ - tree after 100 is inserted in the figure below.

b. For a B+ - tree of order d with n leaf nodes, the number of nodes accessed during a search is O().

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 289 of 852

gate1994 databases b-tree normal

5.6 B Tree: GATE2005_28 top gateoverflow.in/1364

Which of the following is a key factor for preferring B+ -trees to binary search trees for indexing database relations?

A. Database relations have a large number of records

B. Database relations are sorted on the primary key

C. B+ -trees require less memory than binary search trees

D. Data transfer form disks is in blocks

gate2005 databases b-tree normal

5.7 B Tree: GATE2007_63 top gateoverflow.in/1261

The order of a leaf node in a B + - tree is the maximum number of (value, data record pointer) pairs it can hold. Given
that the block size is 1K bytes, data record pointer is 7 bytes long, the value field is 9 bytes long and a block printer is 6
bytes long, what is the order of the leaf node?

A. 63
B. 64
C. 67
D. 68

gate2007 databases b-tree normal

5.8 B Tree: GATE2001_22 top gateoverflow.in/763

We wish to construct a B+ tree with fan-out (the number of pointers per node) equal to 3 for the following set of key
values:

80, 50, 10, 70, 30, 100, 90

Assume that the tree is initially empty and the values are added in the order given.

a. Show the tree after insertion of 10, after insertion of 30, and after insertion of 90. Intermediate trees need not be
shown.
b. The key values 30 and 10 are now deleted from the tree in that order show the tree after each deletion.

gate2001 databases b-tree normal

5.9 B Tree: GATE2015-2_6 top gateoverflow.in/8052

With reference to the B+ tree index of order 1 shown below, the minimum number of nodes (including the Root node) that
must be fetched in order to satisfy the following query. "Get all records with a search key greater than or equal to 7 and less
than 15" is ______.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 290 of 852

gate2015-2 databases b-tree normal

5.10 B Tree: GATE2002_17 top gateoverflow.in/870

a. The following table refers to search items for a key in B-trees and B+ trees.
Btree B+tree
Successful Unsuccessful Successful Unsuccessful
search search search search
X1 X2 X3 X4
A successful search means that the key exists in the database and unsuccessful means that it is not present in the
database. Each of the entries X1 , X2 , X3 and X4 can have a value of either Constant or Variable. Constant means that
the search time is the same, independent of the specific key value, where variable means that it is dependent on the
specific key value chosen for the search.

Give the correct values for the entries X1 , X2 , X3 and X4 (for example
X1 = Constant, X2 = Constant , X3 = Constant, X4 = Constant).

b. Relation R(A,B) has the following view defined on it:

CREATE VIEW V AS
(SELECT R1.A,R2.B
FROM R AS R1, R as R2
WHERE R1.B=R2.A)

i. The current contents of relation R are shown below. What are the contents of the view V?
A B

1 2

2 3

2 4

4 5

6 7

6 8

9 10

ii. The tuples (2,11) and (11,6) are now inserted into R. What are the additional tuples that are inserted in V?

gate2002 databases b-tree normal

5.11 B Tree: GATE 2016-2-21 top gateoverflow.in/39569

B+ Trees are considered BALANCED because.

A. The lengths of the paths from the root to all leaf nodes are all equal.
B. The lengths of the paths from the root to all leaf nodes differ from each other by at most 1.
C. The number of children of any two non-leaf sibling nodes differ by at most 1.
D. The number of records in any two leaf nodes differ by at most 1.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 291 of 852

gate2016-2 databases b-tree normal

5.12 B Tree: GATE2002_2.23 top gateoverflow.in/853

A B+ - tree index is to be built on the Name attribute of the relation STUDENT. Assume that all the student names are of
length 8 bytes, disk blocks are of size 512 bytes, and index pointers are of size 4 bytes. Given the scenario, what would be
the best choice of the degree (i.e. number of pointers per node) of the B+ - tree?

A. 16
B. 42
C. 43
D. 44

gate2002 databases b-tree normal

5.13 B Tree: GATE2004_52 top gateoverflow.in/1048

The order of an internal node in a B+ tree index is the maximum number of children it can have. Suppose that a child pointer
takes 6 bytes, the search field value takes 14 bytes, and the block size is 512 bytes. What is the order of the internal node?

A. 24
B. 25
C. 26
D. 27

gate2004 databases b-tree normal

5.14 B Tree: GATE2006-IT_61 top gateoverflow.in/3605

In a database file structure, the search key field is 9 bytes long, the block size is 512 bytes, a record pointer is 7 bytes and a
block pointer is 6 bytes. The largest possible order of a non-leaf node in a B+ tree implementing this file structure is

A) 23
B) 24
C) 34
D) 44

gate2006-it databases b-tree normal

5.15 B Tree: GATE2000_21 top gateoverflow.in/692

(a) Suppose you are given an empty B+- tree where each node (leaf and internal) can store up to 5 key values. Suppose
values 1, 2,.....10 are inserted, in order, into the tree. Show the tree pictorially

i. after 6 insertions, and


ii. after all 10 insertions

Do NOT show intermediate stages.

(b) Suppose instead of splitting a node when it is full, we try to move a value to the left sibling. If there is no left sibling, or

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 292 of 852

the left sibling is full, we split the node. Show the tree after values 1, 2,......, 9 have been inserted. Assume, as in (a) that
each node can hold up to 5 keys.

(c) In general, suppose a B+- tree node can hold a maximum of m keys,and you insert a long sequence of keys in
increasing order. Then what approximately is the average number of keys in each leaf level node.

i. in the normal case, and


ii. with the insertion as in (b).

gate2000 databases b-tree normal

5.16 B Tree: GATE1999_1.25 top gateoverflow.in/1478

Which of the following is correct?

A. B-trees are for storing data on disk and B + trees are for main memory.

B. Range queries are faster on B + trees.

C. B-trees are for primary indexes and B + trees are for secondary indexes.

D. The height of a B + tree is independent of the number of records.

gate1999 databases b-tree normal

5.17 B Tree: GATE1999_21 top gateoverflow.in/1520

Consider a B-tree with degree m , that is, the number of children, c, of any internal note (except the root) is such that
m c 2m 1. Derive the maximum and minimum number of records in the leaf nodes for such a B-tree with height
h, h 1. (Assume that the root of a tree is at height 0).

gate1999 databases b-tree normal

5.18 B Tree: GATE2015-3_46 top gateoverflow.in/8555

Consider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, recorder pointer is 10 bytes long and
the block pointer is 8 byte long. The maximum number of keys that can be accommodated in each non-leaf node of the tree
is ______.

gate2015-3 databases b-tree normal

5.19 B Tree: GATE2005-IT_23 top gateoverflow.in/3768

A B-Tree used as an index for a large database table has four levels including the root node. If a new key is inserted in this
index, then the maximum number of nodes that could be newly created in the process are

A) 5
B) 4
C) 3
D) 2

gate2005-it databases b-tree normal

5.20 B Tree: GATE2004-IT_79 top gateoverflow.in/3723

Consider a table T in a relational database with a key field K. A B-tree of order p is used as an access structure on K, where
p denotes the maximum number of tree pointers in a B-tree index node. Assume that K is 10 bytes long; disk block size is
512 bytes; each data pointer PD is 8 bytes long and each block pointer P B is 5 bytes long. In order for each B-tree node to fit
in a single disk block, the maximum value of p is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 293 of 852

1) 20
2) 22
3) 23
4) 32

gate2004-it databases b-tree normal

5.21 B Tree: GATE2008_41 top gateoverflow.in/453

A B-tree of order 4 is built from scratch by 10 successive insertions. What is the maximum number of node splitting
operations that may take place?

A. 3
B. 4
C. 5
D. 6

gate2008 databases b-tree normal

5.22 B Tree: GATE2010_18 top gateoverflow.in/2191

Consider a B+ -tree in which the maximum number of keys in a node is 5. What is the minimum number of keys in any non-root node?

(A) 1

(B) 2

(C) 3

(D) 4

gate2010 databases b-tree easy

5.23 B Tree: GATE2000_1.22 top gateoverflow.in/646

B+ -trees are preferred to binary trees in databases because

A. Disk capacities are greater than memory capacities


B. Disk access is much slower than memory access
C. Disk data transfer rates are much less than memory data transfer rates
D. Disks are more reliable than memory

gate2000 databases b-tree normal

5.24 Concurrency: GATE 2016-2-51 top gateoverflow.in/39590

Consider the following database schedule with two transactions T1 and T2 .

S = r2 (X) ; r1 (X) ; r2 (Y ) ; w1 (X) ; r1 (Y ) ; w2 (X) ; a1 ; a2


Where ri (Z) denotes a read operation by transaction Ti on a variable Z, wi (Z) denotes a write operation by Ti on a
variable Z and ai denotes an abort by transaction Ti .

Which one of the following statements about the above schedule is TRUE?

A. S is non-recoverable.
B. S is recoverable, but has a cascading abort.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 294 of 852

C. S does not have a cascading abort.


D. S is strict.

gate2016-2 databases concurrency transactions normal

5.25 Database Normalization: GATE1994_3.6 top gateoverflow.in/2492

State True or False with reason

There is always a decomposition into Boyce-Codd normal form (BCNF) that is lossless and dependency preserving.

gate1994 databases database-normalization easy

5.26 Database Normalization: GATE2004_50 top gateoverflow.in/1046

The relation scheme Student Performance (name, courseNo, rollNo, grade) has the following functional dependencies:

name, courseNo, grade


rollNo, courseNo grade
name rollNo
rollNo name

The highest normal form of this relation scheme is

A. 2 NF
B. 3 NF
C. BCNF
D. 4 NF

gate2004 databases database-normalization normal

5.27 Database Normalization: GATE1997_6.9 top gateoverflow.in/2265

For a database relation R(a, b, c, d), where the domains a, b, c, d include only atomic values, only the following functional
dependencies and those that can be inferred from them hold

ac
bd
This relation is

A. in first normal form but not in second normal form

B. in second normal form but not in first normal form

C. in third normal form

D. none of the above

gate1997 databases database-normalization normal

5.28 Database Normalization: GATE 2016-1-23 top gateoverflow.in/39646

A database of research articles in a journal uses the following schema.

(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, YEAR, PRICE)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 295 of 852

(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, YEAR, PRICE)


The primary key is ' (VOLUME, NUMBER, STARTPAGE, ENDPAGE)

and the following functional dependencies exist in the schema.

(VOLUME , NUMBER, STARTPAGE, ENDPAGE) TITLE


(VOLUME, NUMBER) YEAR
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) PRICE
The database is redesigned to use the following schemas

(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)


(VOLUME, NUMBER, YEAR)

Which is the weakest normal form that the new database satisfies, but the old one does not?

A. 1NF
B. 2NF
C. 3NF
D. BCNF

gate2016-1 databases database-normalization normal

5.29 Database Normalization: GATE2005_29 top gateoverflow.in/1365

Which one of the following statements about normal forms is FALSE?

A. BCNF is stricter than 3NF

B. Lossless, dependency-preserving decomposition into 3NF is always possible

C. Lossless, dependency-preserving decomposition into BCNF is always possible

D. Any relation with two attributes is in BCNF

gate2005 databases database-normalization easy

5.30 Database Normalization: GATE1999_1.24 top gateoverflow.in/1477

Let R = (A, B, C, D, E, F ) be a relation scheme with the following dependencies C F , E A, EC D, A B. Which


one of the following is a key for R?

A. CD
B. EC
C. AE
D. AC

gate1999 databases database-normalization easy

5.31 Database Normalization: GATE 2016-1-21 top gateoverflow.in/39637

Which of the following is NOT a superkey in a relational schema with attributes V , W , X, Y , Z and primary key V Y ?

V XY Z

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 296 of 852

A. V XY Z
B. V W XZ
C. V W XY
D. V W XY Z

gate2016-1 databases database-normalization easy

5.32 Database Normalization: GATE1998_1.34 top gateoverflow.in/1671

Which normal form is considered adequate for normal relational database design?

A. 2 NF
B. 5 NF
C. 4 NF
D. 3 NF

gate1998 databases database-normalization easy

5.33 Database Normalization: GATE1999_2.7 top gateoverflow.in/1485

Consider the schema R = (S, T , U, V ) and the dependencies S T , T U, U V and V S. Let R = (R1 and R2) be
a decomposition such that R1 R2 . The decomposition is

A. not in 2NF
B. in 2NF but not 3NF
C. in 3NF but not in 2 NF
D. in both 2NF and 3NF

gate1999 databases database-normalization normal

5.34 Database Normalization: GATE2007_62 top gateoverflow.in/1260

Which one of the following statements is FALSE?

A. Any relation with two attributes is in BCNF

B. A relation in which every key has only one attribute is in 2NF

C. A prime attribute can be transitively dependent on a key in a 3 NF relation

D. A prime attribute can be transitively dependent on a key in a BCNF relation

gate2007 databases database-normalization normal

5.35 Database Normalization: GATE2005_78 top gateoverflow.in/1401

Consider a relation scheme R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A B, BC D, E
C, D A}. What are the candidate keys R?

A. AE, BE
B. AE, BE, DE
C. AEH, BEH, BCH

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 297 of 852

D. AEH, BEH, DEH

gate2005 databases database-normalization easy

5.36 Database Normalization: GATE2009-55 top gateoverflow.in/1339

Consider the following relational schema:

Suppliers(sid:integer , sname:string, city:string, street:string)



Parts(pid:integer , pname:string, color:string)

Catalog(sid:integer, pid:integer , cost:real)

Consider the following relational query on the above database:
SELECT S.sname
FROM Suppliers S
WHERE S.sid NOT IN (SELECT C.sid
FROM Catalog C
WHERE C.pid NOT IN (SELECT P.pid
FROM Parts P
WHERE P.color<>'blue'))

Assume that relations corresponding to the above schema are not empty. Which one of the following is the correct
interpretation of the above query?

A. Find the names of all suppliers who have supplied a non-blue part.

B. Find the names of all suppliers who have not supplied a non-blue part.

C. Find the names of all suppliers who have supplied only non-blue part.

D. Find the names of all suppliers who have not supplied only blue parts.

gate2009 databases sql database-normalization normal

5.37 Database Normalization: GATE2003_85 top gateoverflow.in/968

Consider the following functional dependencies in a database.

Date_of_Birth -> Age Age -> Eligibility

Name -> Roll_number Roll_number -> Name


Course_number -> Course_name Course_number ->
Instructor
(Roll_number, Course_number) ->

Grade

The relation (Roll_number, Name, Date_of_birth, Age) is

A. in second normal form but not in third normal form

B. in third normal form but not in BCNF

C. in BCNF

D. in none of the above

gate2003 databases database-normalization normal

5.38 Database Normalization: GATE1995_26 top gateoverflow.in/2665

Consider the relation scheme R(A, B, C) with the following functional dependencies:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 298 of 852

A, B C,
C A

a. Show that the scheme R is in 3NF but not in BCNF.


b. Determine the minimal keys of relation R.

gate1995 databases database-normalization normal

5.39 Database Normalization: GATE2008-IT_62 top gateoverflow.in/3372

Let R (A, B, C, D, E, P, G) be a relational schema in which the following functional dependencies are known to hold: AB
CD, DE P, C E, P C and B G. The relational schema R is

1) in BCNF
2) in 3NF, but not in BCNF
3) in 2NF, but not in 3NF
4) not in 2NF

gate2008-it databases database-normalization normal

5.40 Database Normalization: GATE2008-IT_61 top gateoverflow.in/3371

Let R (A, B, C, D) be a relational schema with the following functional dependencies :


A B, B C,
C D and D B. The decomposition of R into (A, B), (B, C), (B, D)

A) gives a lossless join, and is dependency preserving


B) gives a lossless join, but is not dependency preserving
C) does not give a lossless join, but is dependency preserving
D) does not give a lossless join and is not dependency preserving

gate2008-it databases database-normalization normal

5.41 Database Normalization: GATE2001_1.23 top gateoverflow.in/716

Consider a schema R(A, B, C, D) and functional dependencies A B and C D. Then the decomposition of R into
R1 (AB) and R2 (CD) is

(A) dependency preserving and lossless join

(B) lossless join but not dependency preserving

(C) dependency preserving but not lossless join

(D) not dependency preserving and not lossless join

gate2001 databases database-normalization normal

5.42 Database Normalization: GATE2004-IT_75 top gateoverflow.in/3719

A relation Empdtl is defined with attributes empcode (unique), name, street, city, state and pincode. For any pincode, there
is only one city and state. Also, for any given street, city and state, there is just one pincode. In normalization terms, Empdtl
is a relation in

A. 1NF only
B. 2NF and hence also in 1NF

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 299 of 852

C. 3NF and hence also in 2NF and 1NF


D. BCNF and hence also in 3NF, 2NF an 1NF

gate2004-it databases database-normalization normal

5.43 Database Normalization: GATE2009-56 top gateoverflow.in/43474

Consider the following relational schema:

Suppliers(sid:integer , sname:string, city:string, street:string)



Parts(pid:integer , pname:string, color:string)

Catalog(sid:integer, pid:integer , cost:real)

Assume that, in the suppliers relation above, each supplier and each street within a city has unique name, and (sname, city)
forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate
keys. Which one of the following is TRUE about the above schema?

A. The schema is in BCNF


B. The schema is in 3NF but not in BCNF
C. The schema is in 2 NF but not in 3NF
D. The schema is not in 2NF

gate2009 databases sql database-normalization normal

5.44 Database Normalization: GATE2005-IT_22 top gateoverflow.in/3767

A table has fields Fl, F2, F3, F4, F5 with the following functional dependencies
F1 F3 F2 F4 (F1 . F2) F5
In terms of Normalization, this table is in

1) 1 NF
2) 2 NF
3) 3 NF
4) None of these

gate2005-it databases database-normalization easy

5.45 Database Normalization: GATE2008_69 top gateoverflow.in/492

Consider the following relational schemes for a library database:


Book (Title, Author, Catalog_no, Publisher, Year, Price)
Collection(Title, Author, Catalog_no)

with the following functional dependencies:

I. Title Author Catalog_no


II. Catalog_no Title Author Publisher Year
III. Publisher Title Year Price
Assume { Author, Title } is the key for both schemes. Which of the following statements is true?

A. Both Book and Collection are in BCNF

B. Both Book and Collection are in 3NF only

C. Book is in 2NF and Collection in 3NF

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 300 of 852

D. Both Book and Collection are in 2NF only

gate2008 databases database-normalization normal

5.46 Database Normalization: GATE1998_26 top gateoverflow.in/1741

Consider the following database relations containing the attributes

Book_id
Subject_Category_of_book
Name_of_Author
Nationality_of_Author

With Book_id as the primary key.

a. What is the highest normal form satisfied by this relation?

b. Suppose the attributes Book_title and Author_address are added to the relation, and the primary key is changed to
{Name_of_Author, Book_title}, what will be the highest normal form satisfied by the relation?

gate1998 databases database-normalization normal

5.47 Database Normalization: GATE2001_2.23 top gateoverflow.in/741

R(A,B,C,D) is a relation. Which of the following does not have a lossless join, dependency preserving BCNF decomposition?

A. A B, B CD
B. A B, B C, C D
C. AB C, C AD
D. A BCD

gate2001 databases database-normalization normal

5.48 Database Normalization: GATE2014-1_30 top gateoverflow.in/1797

Given the following two statements:

S1: Every table with two single-valued attributes is in 1NF, 2NF, 3NF and BCNF.

S2: AB C. D E, E C is a minimal cover for the set of functional dependencies AB C, D E, AB E,


E C.
Which one of the following is CORRECT?

(A) S1 is TRUE and S2 is FALSE.

(B) Both S1 and S2 are TRUE.

(C) S1 is FALSE and S2 is TRUE.

(D) Both S1 and S2 are FALSE.

gate2014-1 databases database-normalization normal

5.49 Database Normalization: GATE2002_16 top gateoverflow.in/869

For relation R=(L, M, N, O, P), the following dependencies hold:

M O, NO P , P L L MN

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 301 of 852

M O, NO P , P L and L MN
R is decomposed into R 1 = (L, M, N, P) and R 2 = (M, O).

a. Is the above decomposition a lossless-join decomposition? Explain.


b. Is the above decomposition dependency-preserving? If not, list all the dependencies that are not preserved.
c. What is the highest normal form satisfied by the above decomposition?

gate2002 databases database-normalization normal

5.50 Database Normalization: GATE2002_2.24 top gateoverflow.in/854

Relation R is decomposed using a set of functional dependencies, F, and relation S is decomposed using another set of
functional dependencies, G. One decomposition is definitely BCNF, the other is definitely 3NF, but it is not known which is
which. To make a guaranteed identification, which one of the following tests should be used on the decompositions?
(Assume that the closures of F and G are available).

A. Dependency-preservation
B. Lossless-join
C. BCNF definition
D. 3NF definition

gate2002 databases database-normalization easy

5.51 Er Diagram: GATE2008_82,83 top gateoverflow.in/390

82. Consider the following ER diagram

The minimum number of tables needed to represent M, N, P, R1, R2 is

A. 2
B. 3
C. 4
D. 5

83. Which of the following is a correct attribute set for one of the tables for the correct answer to the above question?

A. {M1, M2, M3, P1}


B. {M1, P1, N1, N2}
C. {M1, P1, N1}
D. {M1, P1}

gate2008 databases er-diagram normal

5.52 Er Diagram: GATE2005_75 top gateoverflow.in/1398

Let E1 and E2 be two entities in an E/R diagram with simple-valued attributes. R1 and R2 are two relationships between
E1 and E2 , where R1 is one-to-many and R2 is many-to-many. R1 and R2 do not have any attributes of their own. What is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 302 of 852

the minimum number of tables required to represent this situation in the relational model?

A. 2
B. 3
C. 4
D. 5

gate2005 databases er-diagram normal

5.53 Er Model: GATE2015-1_41 top gateoverflow.in/8309

Consider an Entity-Relationship (ER) model in which entity sets E 1 and E 2 are connected by an m:n relationship R 12 . E 1 and
E3 are connected by a 1 : n (1 on the side of E 1 and n on the side of E 3 ) relationship R 13 .

E1 has two-singled attributes a 11 and a 12 of which a 11 is the key attribute. E 2 has two singled-valued attributes a 21 and a 22 of
which a21 is the key attribute. E 3 has two single-valued attributes a 31 and a 32 of which a 31 is the key attribute. The
relationships do not have any attributes.

If a relational model is derived from the above ER model, then the minimum number of relations that would be generated if
all relation are in 3NF is________________.

gate2015-1 databases er-model normal

5.54 Er Model: GATE2004-IT_73 top gateoverflow.in/3717

Consider the following entity relationship diagram (ERD), where two entities E1 and E2 have a relation R of cardinality 1 : m.

The attributes of E1 are A11, A12 and A13 where A11 is the key attribute. The attributes of E2 are A21, A22 and A23 where
A21 is the key attribute and A23 is a multi-valued attribute. Relation R does not have any attribute. A relational database
containing minimum number of tables with each table satisfying the requirements of the third normal form (3NF) is designed
from the above ERD. The number of tables in the database is

A) 2
B) 3
C) 5
D) 4

gate2004-it databases er-model normal

5.55 Er Model: GATE2005-IT_21 top gateoverflow.in/3766

Consider the entities 'hotel room', and 'person' with a many to many relationship 'lodging' as shown below:


If we wish to store information about the rent payment to be made by person (s) occupying different hotel rooms, then this
information should appear as an attribute of

A) Person
B) Hotel Room
C) Lodging
D) None of these

gate2005-it databases er-model easy

5.56 Functional Dependencies: GATE2013-55 top gateoverflow.in/43290

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 303 of 852

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F ={CH G, A BC, B CFH, E A,
F EG} is a set of functional dependencies (FDs) so that F + is exactly the set of FDs that hold for R.

The relation R is

A. in 1NF, but not in 2NF.


B. in 2NF, but not in 3NF.
C. in 3NF, but not in BCNF.
D. in BCNF.

gate2013 databases functional-dependencies database-normalization normal

5.57 Functional Dependencies: GATE2006_70 top gateoverflow.in/1848

The following functional dependencies are given:

AB CD, AF D, DE F ,C G, F E, G A
Which one of the following options is false?

(A) {CF } = {ACDEF G}

(B) {BG} = {ABCDG}

(C) {AF } = {ACDEF G}

(D) {AB} = {ABCDG}
gate2006 databases functional-dependencies normal

5.58 Functional Dependencies: GATE2013-54 top gateoverflow.in/1558

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F ={CHG, ABC, BCFH, EA, FEG}
is a set of functional dependencies (FDs) so that F + is exactly the set of FDs that hold for R.

Q.54 How many candidate keys does the relation R have?

(A) 3 (B) 4 (C) 5 (D) 6

gate2013 databases functional-dependencies database-normalization normal

5.59 Functional Dependencies: GATE2005-IT_70 top gateoverflow.in/3833

In a schema with attributes A, B, C, D and E following set of functional dependencies are given

A B
A C
CD E
B D
E A

Which of the following functional dependencies is NOT implied by the above set?

A) CD AC
B) BD CD
C) BC CD
D) AC BC

gate2005-it databases functional-dependencies normal

5.60 Functional Dependencies: GATE2000_2.24 top gateoverflow.in/671

Given the following relation instance.

X Y Z
1 4 2
1 5 3
1 6 3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 304 of 852

3 2 2

Which of the following functional dependencies are satisfied by the instance?

A. XY Z and Z Y
B. YZ X and Y Z
C. YZ X and X Z
D. XZ Y and Y X

gate2000 databases functional-dependencies easy

5.61 Functional Dependencies: GATE2014-1_21 top gateoverflow.in/1788

Consider the relation scheme R = (E, F, G, H, I, J, K, L, M, N) and the set of functional dependencies

{{E, F } {G}, {F } {I, J}, {E, H} {K, L},


{K} {M}, {L} {N}}
on R. What is the key for R?

(A) {E, F }

(B) {E, F , H}

(C) {E, F , H, K, L}

(D) {E}

gate2014-1 databases functional-dependencies normal

5.62 Functional Dependencies: GATE2002_2.25 top gateoverflow.in/855

Form the following instance of a relation schema R(A,B,C), we can conclude that:

A B C
1 1 1
1 1 0
2 3 2
2 3 2

A. A functionally determines B and B functionally determines C


B. A functionally determines B and B does not functionally determine C
C. B does not functionally determine C
D. A does not functionally determine B and B does not functionally determine C

gate2002 databases functional-dependencies

5.63 Functional Dependencies: GATE2015-3_20 top gateoverflow.in/8420

Consider the relation X(P , Q, R, S, T , U) with the following set of functional dependencies

F={
{P , R} {S, T },
{P , S, U} {Q, R}
}
Which of the following is the trivial functional dependency in F + , where F + is closure to F?


{P , R} {S, T }

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 305 of 852

A. {P , R} {S, T }
B. {P , R} {R, T }
C. {P , S} {S}
D. {P , S, U} {Q}

gate2015-3 databases functional-dependencies easy

5.64 Functional Dependencies: GATE2002_1.19 top gateoverflow.in/824

Relation R with an associated set of functional dependencies, F, is decomposed into BCNF. The redundancy (arising out of
functional dependencies) in the resulting set of relations is

A. Zero
B. More than zero but less than that of an equivalent 3NF decomposition
C. Proportional to the size of F +
D. Indeterminate

gate2002 databases functional-dependencies database-normalization normal

5.65 Functional Dependencies: GATE2006-IT_60 top gateoverflow.in/3604

Consider a relation R with five attributes V, W, X, Y, and Z. The following functional dependencies hold:

VY W, WX Z, and ZY V.

Which of the following is a candidate key for R?

A) VXZ
B) VXY
C) VWXY
D) VWXYZ

gate2006-it databases functional-dependencies normal

5.66 Indexing: GATE1998_1.35 top gateoverflow.in/1672

There are five records in a database.

Name Age Occupation Category


Rama 27 CON A
Abdul 22 ENG A
Jennifer 28 DOC B
Maya 32 SER D
Dev 24 MUS C

There is an index file associated with this and it contains the values 1, 3, 2, 5 and 4. Which one of the fields is the index
built from?

A. Age
B. Name
C. Occupation
D. Category

gate1998 databases indexing normal

5.67 Indexing: GATE2008_16 top gateoverflow.in/414

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 306 of 852

A clustering index is defined on the fields which are of type

A. non-key and ordering


B. non-key and non-ordering
C. key and ordering
D. key and non-ordering

gate2008 easy databases indexing

5.68 Indexing: GATE2015-1_24 top gateoverflow.in/8222

A file is organized so that the ordering of the data records is the same as or close to the ordering of data entries in some
index. Than that index is called

A. Dense
B. Sparse
C. Clustered
D. Unclustered

gate2015-1 databases indexing easy

5.69 Indexing: GATE1993_14 top gateoverflow.in/2311

An ISAM (indexed sequential) file consists of records of size 64 bytes each, including key field of size 14 bytes. An address of
a disk block takes 2 bytes. If the disk block size is 512 bytes and there are 16 K records, compute the size of the data and
index areas in terms of number blocks. How many levels of tree do you have for the index?

gate1993 databases indexing normal

5.70 Indexing: GATE2002_2.22 top gateoverflow.in/852

In the index allocation scheme of blocks to a file, the maximum possible size of the file depends on

A. the size of the blocks, and the size of the address of the blocks.
B. the number of blocks used for the index, and the size of the blocks.
C. the size of the blocks, the number of blocks used for the index, and the size of the address of the blocks.
D. None of the above

gate2002 databases indexing normal

5.71 Indexing: GATE2013_15 top gateoverflow.in/1437

An index is clustered, if

(A) it is on a set of fields that form a candidate key.

(B) it is on a set of fields that include the primary key.

(C) the data records of the file are organized in the same order as the data entries of the index.

(D) the data records of the file are organized not in the same order as the data entries of the index.

gate2013 databases indexing normal

5.72 Indexing: GATE2011_39 top gateoverflow.in/2141

Consider a relational table r with sufficient number of records, having attributes A1 , A2 , , An and let 1 p n. Two
Q1 Q2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 307 of 852

queries Q1 and Q2 are given below.

Q1 : A1 ,,Ap (Ap =c (r)) where c is a constant


Q2 : A1 ,,Ap (c1 Ap c2 (r)) where c1 and c2 are constants.

The database can be configured to do ordered indexing on Ap or hashing on Ap . Which of the following statements is TRUE?
(A) Ordered indexing will always outperform hashing for both queries

(B) Hashing will always outperform ordered indexing for both queries

(C) Hashing will outperform ordered indexing on Q1 , but not on Q2

(D) Hashing will outperform ordered indexing on Q2 , but not on Q1

gate2011 databases indexing normal

5.73 Indexing: GATE2008_70 top gateoverflow.in/259

Consider a file of 16384 records. Each record is 32 bytes long and its key field is of size 6 bytes. The file is ordered on a non-
key field, and the file organization is unspanned. The file is stored in a file system with block size 1024 bytes, and the size of
a block pointer is 10 bytes. If the secondary index is built on the key field of the file, and a multi-level index scheme is used
to store the secondary index, the number of first-level and second-level blocks in the multi-level index are
respectively

(A) 8 and 0 (B) 128 and 6 (C) 256 and 4 (D) 512 and 5

gate2008 databases indexing normal

5.74 Multivalued Dependency 4nf: GATE2007-IT_67 top gateoverflow.in/3512

Consider the following implications relating to functional and multivalued dependencies given below, which may or may not
be correct.

i. If A  B and A  C then A BC
ii. If A B and A C then A  BC
iii. If A  BC and A B then A C
iv. If A BC and A B then A  C

Exactly how many of the above implications are valid?

A) 0
B) 1

C) 2

D) 3

gate2007-it databases functional-dependencies multivalued-dependency-4nf normal

5.75 Natural Join: GATE2004_13 Let R1 (A, B, C) and R2 (D, E) be two


relation schema, where the primary key... top gateoverflow.in/16095

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 308 of 852

----SPOILERS------

My doubt is that why option "c" shouldnt be an answer, as join is performed on the C not equal to D, and there will be no
case where C is not equal to d as it satisfies referential integrity constraints. . ?

databases natural-join

5.76 Referential Integrity: GATE2005_76 top gateoverflow.in/1399

The following table has two attributes A and C where A is the primary key and C is the foreign key referencing A with on-
delete cascade.

A C
2 4
3 4
4 3
5 2
7 2
9 5
6 4

The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2, 4) is deleted is:

A. (3, 4) and (6, 4)


B. (5, 2) and (7, 2)
C. (5, 2), (7, 2) and (9, 5)
D. (3, 4), (4, 3) and (6, 4)

gate2005 databases referential-integrity normal

5.77 Referential Integrity: GATE1997_6.10 top gateoverflow.in/2266

Let R(a, b, c) and S(d, e, f) be two relations in which d is the foreign key of S that refers to the primary key of R. Consider
the following four operations R and S

a. Insert into R

b. Insert into S

c. Delete from R

d. Delete from S

Which of the following is true about the referential integrity constraint above?

A. None of (a), (b), (c) or (d) can cause its violation

B. All of (a), (b), (c) and (d) can cause its violation

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 309 of 852

C. Both (a) and (d) can cause its violation

D. Both (b) and (c) can cause its violation

gate1997 databases referential-integrity easy

5.78 Relational Algebra: TIFR2013-B-19 top gateoverflow.in/25872

In a relational database there are three relations:

Customers = C(CName),
Shops = S(SName),
Buys = B(CName, SName).

Which of the following relational algebra expressions returns the names of shops that have no customers at all? [Here is
the projection operator.]

a. SName B
b. S B
c. S SName B
d. S SName ((C S) B)
e. None of the above

tifr2013 databases relational-algebra

5.79 Relational Algebra: GATE1996_27 top gateoverflow.in/2779

A library relational database system uses the following schema

USERS (User#, User Name, Home Town)


BOOKS (Book#, Book Title, Author Name)
ISSUED (Book#, User#, Date)

Explain in one English sentence, what each of the following relational algebra queries is designed to determine

a. User#=6 (User#, Book Title ((USERS ISSUED) BOOKS))


b. Author Name (BOOKS Home Town=Delhi (USERS ISSUED))

gate1996 databases relational-algebra normal

5.80 Relational Algebra: GATE2006-IT_15 top gateoverflow.in/3554

Which of the following relational query languages have the same expressive power?

I. Relational algebra
II. Tuple relational calculus restricted to safe expressions
III. Domain relational calculus restricted to safe expressions

A) II and III only


B) I and II only
C) I and III only
D) I, II and III

gate2006-it databases relational-algebra relational-calculus easy

5.81 Relational Algebra: GATE1995_27 top gateoverflow.in/2666

Consider the relation scheme.

AUTHOR (ANAME, INSTITUTION, ACITY, AGE)


PUBLISHER (PNAME, PCITY)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 310 of 852

BOOK (TITLE, ANAME, PNAME)

Express the following queries using (one or more of) SELECT, PROJECT, JOIN and DIVIDE operations.

a. Get the names of all publishers.

b. Get values of all attributes of all authors who have published a book for the publisher with PNAME=TECHNICAL
PUBLISHERS.

c. Get the names of all authors who have published a book for any publisher located in Madras

gate1995 databases relational-algebra normal

5.82 Relational Algebra: GATE1994_13 top gateoverflow.in/2509

Consider the following relational schema:

COURSES (cno, cname)


STUDENTS (rollno, sname, age, year)
REGISTERED FOR (cno, rollno)

The underlined attributes indicate the primary keys for the relations. The year attribute for the STUDENTS relation indicates
the year in which the student is currently studying (First year, Second year etc.)

a. Write a relational algebra query to print the roll number of students who have registered for cno 322.

b. Write a SQL query to print the age and year of the youngest student in each year.

gate1994 databases relational-algebra sql normal

5.83 Relational Algebra: GATE2007_59 top gateoverflow.in/2428

Information about a collection of students is given by the relation studInfo(studId , name, sex). The relation

enroll(studId
, courseId
) gives which student has enrolled for (or taken) what course(s). Assume that every course is taken
by at least one male and at least one female student. What does the following relational algebra expression represent?

courceId ((studId (sex="female" (studInfo)) courseId (enroll)) enroll)

(A) Courses in which all the female students are enrolled.


(B) Courses in which a proper subset of female students are enrolled.
(C) Courses in which only male students are enrolled.
(D) None of the above

gate2007 databases relational-algebra normal

5.84 Relational Algebra: TIFR2010-B-33 top gateoverflow.in/19246

In a relational database there are three relations:

Customers = C (C Name)
Shops = S (S Name)
Buys = B (C Name, S Name)

Then the Relational Algebra expression ( is the projection operator).

C CName ((C S) B)
returns the names of

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 311 of 852

a. Customers who buy from at least one shop.


b. Customers who buy from at least two shops.
c. Customers who buy from all shops.
d. Customers who do not buy buy anything at all.
e. None of the above.

tifr2010 databases relational-algebra

5.85 Relational Algebra: GATE2015-1_7 top gateoverflow.in/8094

SELECT operation in SQL is equivalent to

A. The selection operation in relational algebra


B. The selection operation in relational algebra, except that SELECT in SQL retains duplicates
C. The projection operation in relational algebra
D. The projection operation in relational algebra, except that SELECT in SQL retains duplicates

gate2015-1 databases sql relational-algebra easy

5.86 Relational Algebra: GATE2000_1.23 top gateoverflow.in/647

Given the relations

employee (name, salary, dept-no), and


department (dept-no, dept-name,address),

which of the following queries cannot be expressed using the basic relational algebra operations (, , , , , , )?
A. Department address of every employee
B. Employees whose name is the same as their department name
C. The sum of all employees' salaries
D. All employees of a given department

gate2000 databases relational-algebra easy

5.87 Relational Algebra: GATE2001_1.24 top gateoverflow.in/717

Suppose the adjacency relation of vertices in a graph is represented in a table Adj (X,Y). Which of the following queries
cannot be expressed by a relational algebra expression of constant length?

(A) List all vertices adjacent to a given vertex

(B) List all vertices which have self loops

(C) List all vertices which belong to cycles of less than three vertices

(D) List all vertices reachable from a given vertex

gate2001 databases relational-algebra normal

5.88 Relational Algebra: GATE2001_1.25 top gateoverflow.in/718

Let r and s be two relations over the relation schemes R and S respectively, and let A be an attribute in R. The relational
algebra expression A=a (r s) is always equal to

(A) A=a (r)

(B) r

(C) A=a (r) s

(D) None of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 312 of 852

gate2001 databases relational-algebra difficult

5.89 Relational Algebra: GATE2008_68 top gateoverflow.in/491

Let R and S be two relations with the following schema

R(P , Q , R1, R2, R3)



S(P , Q , S1, S2)

where {P , Q} is the key for both schemas. Which of the following queries are equivalent?

I. P (R S)
II. P (R) P (S)
III. P (P,Q (R) P,Q (S))
IV. P (P,Q (R) (P,Q (R) P,Q (S)))

A. Only I and II
B. Only I and III
C. Only I, II and III
D. Only I, III and IV

gate2008 databases relational-algebra normal

5.90 Relational Algebra: GATE1992-13a top gateoverflow.in/592

How is redundancy reduced in the following models?

1. Hierarchical
2. Network
3. Relational

gate1992 databases relational-algebra descriptive

5.91 Relational Algebra: GATE1992-13b top gateoverflow.in/43581

Suppose we have a database consisting of the following three relations:

FREQUENTS (CUSTOMER, HOTEL)

SERVES (HOTEL, SNACKS)

LIKES (CUSTOMER, SNACKS)

The first indicates the hotels each customer visits, the second tells which snacks each hotel serves and last indicates which
snacks are liked by each customer. Express the following query in relational algebra:

Print the hotels the serve the snack that customer Rama likes.

gate1992 databases relational-algebra normal

5.92 Relational Algebra: GATE1998_27 top gateoverflow.in/1742

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 313 of 852

Consider the following relational database schemes:

COURSES (Cno.name)
PRE-REQ(Cno, pre-Cno)
COMPLETED (student_no, Cno)

COURSES gives the number and name of all the available courses.

PRE-REQ gives the information about which courses are pre-requisites for a given course.

COMPLETED indicates what courses have been completed by students

Express the following using relational algebra:

List all the courses for which a student with student_no 2310 has completed all the pre-requisites.

gate1998 databases relational-algebra normal

5.93 Relational Calculus: GATE2004_51 top gateoverflow.in/1047

gate2004 databases relational-calculus normal

5.94 Relational Calculus: GATE2004_13 top gateoverflow.in/1010

Let R1 (A, B, C) and R2 ( D , E) be two relation schema, where the primary keys are shown underlined, and let C be a

foreign key in R1 referring to R2 . Suppose there is no violation of the above referential integrity constraint in the
corresponding relation instances r1 and r2 . Which of the following relational algebra expressions would necessarily produce
an empty relation?

A. D (r2 ) C (r1 )

B. C (r1 ) D (r2 )

C. D (r1 CD r2 )

D. C (r1 C=D r2 )

gate2004 databases relational-calculus easy

5.95 Relational Calculus: GATE2003_30 top gateoverflow.in/920

Consider the following SQL query

Select distinct a1 , a2 , , an

from r1 , r2 , , rm

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 314 of 852

where P

For an arbitrary predicate P, this query is equivalent to which of the following relational algebra expressions?

A. a1 ,a2 ,an p (r1 r2 rm )


B. a1 ,a2 ,an p (r1 r2 rm )
C. a1 ,a2 ,an p (r1 r2 rm )
D. a1 ,a2 ,an p (r1 r2 rm )

gate2003 databases relational-calculus normal

5.96 Relational Calculus: GATE2007_60 top gateoverflow.in/1258

Consider the relation employee(name, sex, supervisorName) with name as the key, supervisorName gives the name of the
supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce?

{e. name employee(e) (x) [employee (x) x. supervisorName e. name x. sex = male "]}
A. Names of employees with a male supervisor.
B. Names of employees with no immediate male subordinates.
C. Names of employees with no immediate female subordinates.
D. Names of employees with a female supervisor.

gate2007 databases relational-calculus normal

5.97 Relational Calculus: GATE2009_45 top gateoverflow.in/1331

Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider the following queries on the database:

1. RS (r) RS (RS (r) s RS,S (r))


2. {t t RS (r) u s (v r (u = v[s] t = v [R S]))}
3. {t t RS (r) v r (u s (u = v[s] t = v [R S]))}
4.

Select R.a,R.b
From R,S
Where R.c = S.c

Which of the above queries are equivalent?

(A) 1 and 2

(B) 1 and 3

(C) 2 and 4

(D) 3 and 4

gate2009 databases relational-calculus difficult

5.98 Relational Calculus: GATE2012-51 top gateoverflow.in/43313

Consider the following relations A, B and C:


Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 315 of 852

Id Name Age

12 Arun 60

15 Shreya 24

99 Rohit 11

Id Name Age

15 Shreya 24

25 Hari 40

98 Rohit 20

99 Rohit 11

Id Phone Area

10 2200 02

99 2100 01

How many tuples does the result of the following SQL query contain?

SELECT A.Id
FROM A
WHERE A.Age > ALL (SELECT B.Age
FROM B
WHERE B.Name = Arun)

1. 4
2. 3
3. 0
4. 1

gate2012 databases sql relational-calculus normal

5.99 Relational Calculus: GATE2002_15 top gateoverflow.in/868

A university placement center maintains a relational database of companies that interview students on campus and make job
offers to those successful in the interview. The schema of the database is given below:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 316 of 852

COMPANY(cname, clocation) STUDENT (scrollno, sname,


sdegree)
INTERVIEW (cname, srollno,
OFFER(cname, srollno, osalary
idate)

The COMPANY relation gives the name and location of the company. The STUDENT relation gives the students roll number,
name and the degree program for which the student is registered in the university. The INTERVIEW relation gives the date
on which a student is interviewed by a company. The OFFER relation gives the salary offered to a student who is successful
in a companys interview. The key for each relation is indicated by the underlined attributes

(a) Write a relational algebra expressions (using only the operator , , , ) for the following queries.

i. List the rollnumbers and names of students who attended at least one interview but did not receive any job offer.

ii. List the rollnumbers and names of students who went for interviews and received job offers from every company with
which they interviewed.

b. Write an SQL query to list, for each degree program in which more than five students were offered jobs, the name of the
degree and the average offered salary of students in this degree program.

gate2002 databases relational-calculus normal

5.100 Relational Calculus: GATE1993_23,24 top gateoverflow.in/2320

For questions 1 and 2:

The following relations are used to store data about students, courses, enrollment of students in courses and teachers of
courses. Attributes for primary key in each relation are marked by *.
Students (rollno*, sname, saddr)
courses (cno*, cname)
enroll(rollno*, cno*, grade)
teach(tno*, tname, cao*)

(cno is course number cname is course name, tno is teacher number, tname is teacher name, sname is student name, etc.)

1. Write a SQL query for retrieving roll number and name of students who got A grade in at least one course taught by
teacher names Ramesh for the above relational database.

2. For the relational database given above, the following functional dependencies hold:

rollno sname, sdaddr cno cname

tno tname rollno, cno grade

a. Is the database in 3 rd normal form (3NF)?

b. If yes, prove that it is in 3 NF. If not normalize, the relations so that they are in 3NF (without proving)?

gate1993 databases sql relational-calculus normal

5.101 Relational Calculus: GATE2001_2.24 top gateoverflow.in/742

Which of the rational calculus expression is not safe?

A. {t u R1 (t[A] = u[A]) s R2 (t[A] = s[A])}


{t u R1 (u[A] =" x " s R2 (t[A] = s[A] s[A] = u[A]))}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 317 of 852

B. {t u R1 (u[A] =" x " s R2 (t[A] = s[A] s[A] = u[A]))}


C. {t (t R1 )}
D. {t u R1 (t[A] = u[A]) s R2 (t[A] = s[A])}

gate2001 relational-calculus normal databases

5.102 Relational Calculus: GATE2007-IT_68 top gateoverflow.in/3513

Consider the following relation schemas :

b-Schema = (b-name, b-city, assets)


a-Schema = (a-num, b-name, bal)
d-Schema = (c-name, a-number)

Let branch, account and depositor be respectively instances of the above schemas. Assume that account and depositor
relations are much bigger than the branch relation.

Consider the following query:

c-name (b-city = "Agra" bal < 0 (branch (account depositor)

Which one of the following queries is the most efficient version of the above query ?

A) c-name (bal < 0 (b-city = "Agra" branch account) depositor)


B) c-name (b-city = "Agra" branch (bal < 0 account depositor))
C) c-name (( b-city = "Agra" branch b-city = "Agra" bal < 0 account) depositor)
D) c-name (b-city = "Agra" branch (b-city = "Agra" bal < 0 account depositor))

gate2007-it databases relational-calculus normal

5.103 Relational Calculus: GATE2006-IT_14 top gateoverflow.in/3553

Consider the relations r 1(P, Q, R) and r 2(R, S, T) with primary keys P and R respectively. The relation r 1 contains 2000 tuples
and r2 contains 2500 tuples. The maximum size of the join r 1 r2 is :

A) 2000
B) 2500
C) 4500
D) 5000

gate2006-it databases relational-calculus normal

5.104 Relational Calculus: GATE2008_15 top gateoverflow.in/413

Which of the following tuple relational calculus expression(s) is/are equivalent to t r (P (t))?
1. t r (P (t))
2. t r (P (t))
3. t r (P (t))
4. t r (P (t))

(A) I only
(B) II only
(C) III only
(D) III and IV only

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 318 of 852

gate2008 databases relational-calculus normal

5.105 Relational Calculus: GATE2005_30 top gateoverflow.in/1366

Let r be a relation instance with schema R = (A, B, C, D). We define r1 = A,B,C (R) and r2 = A,D (r). Let s = r1 r2
where denotes natural join. Given that the decomposition of r into r1 and r2 is lossy, which one of the following is TRUE?

A. s r
B. r s = r
C. r s

D. r s=s

gate2005 databases relational-calculus normal

5.106 Relational Calculus: GATE2005-IT_68 top gateoverflow.in/3831

A table 'student' with schema (roll, name, hostel, marks), and another table 'hobby' with schema (roll, hobbyname) contains
records as shown below:

Table: Student
Roll Name Hostel Marks
1798 Manoj Rathod 7 95
2154 Soumic Banerjee 5 68
2369 Gumma Reddy 7 86
2581 Pradeep Pendse 6 92
2643 Suhas Kulkarni 5 78
2711 Nitin Kadam 8 72
2872 Kiran Vora 5 92
2926 Manoj Kunkalikar 5 94
2959 Hemant Karkhanis 7 88
3125 Rajesh Doshi 5 82

Table: hobby
Roll Hobbyname
1798 chess
1798 music

2154 music
2369 swimming
2581 cricket
2643 chess
2643 hockey
2711 volleyball
2872 football
2926 cricket
2959 photography
3125 music
3125 chess

The following SQL query is executed on the above tables:


select hostel
from student natural join hobby
where marks > = 75 and roll between 2000 and 3000;

Relations S and H with the same schema as those of these two tables respectively contain the same information as tuples. A

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 319 of 852

new relation S is obtained by the following relational algebra operation:

S = hostel ((s.roll = H.roll (marks > 75 and roll > 2000 and roll < 3000 (S)) X (H))

The difference between the number of rows output by the SQL statement and the number of tuples in S is

A) 6
B) 4
C) 2
D) 0

gate2005-it databases sql relational-calculus normal

5.107 Relational Calculus: GATE2008-IT_75 top gateoverflow.in/3389

Student (school-id, sch-roll-no, sname, saddress)


School (school-id, sch-name, sch-address, sch-phone)
Enrolment(school-id sch-roll-no, erollno, examname)
ExamResult(erollno, examname, marks)

Consider the following tuple relational calculus query.


{t | E Enrolment t = E.school-id ^
| {x | x Enrolment ^ x.school-id = t ^

( B ExamResult B.erollno = x.erollno ^ B.examname = x.examname ^ B.marks > 35)}| /

| {x | x Enrolment ^ x.school-id = t}| * 100 > 35}


If a student needs to score more than 35 marks to pass an exam, what does the query return?

A) The empty set


B) schools with more than 35% of its students enrolled in some exam or the other
C) schools with a pass percentage above 35% over all exams taken together
D) schools with a pass percentage above 35% over each exam

gate2008-it databases relational-calculus normal

5.108 Relational Calculus: GATE2007-IT_65 top gateoverflow.in/3510

Consider a selection of the form A 100 (r), where r is a relation with 1000 tuples. Assume that the attribute values for A
among the tuples are uniformly distributed in the interval [0, 500]. Which one of the following options is the best estimate of
the number of tuples returned by the given selection query ?

1) 50
2) 100
3) 150
4) 200

gate2007-it databases relational-calculus normal

5.109 Relational Calculus: GATE2002_1.20 top gateoverflow.in/825

With regards to the expressive power of the formal relational query languages, which of the following statements is true?

A. Relational algebra is more powerful than relational calculus


B. Relational algebra has the same power as relational calculus
C. Relational algebra has the same power as safe relational calculus
D. None of the above

gate2002 databases relational-calculus normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 320 of 852

5.110 Relational Calculus: GATE2004_14 top gateoverflow.in/1011

Consider the following relation schema pertaining to a students database:

Students(rollno, name, address)


Enroll(rollno, courseno, coursename)

where the primary keys are shown underlined. The number of tuples in the student and Enroll tables are 120 and 8
respectively. What are the maximum and minimum number of tuples that can be present in (Student * Enroll), where *
denotes natural join?

A. 8, 8
B. 120, 8
C. 960, 8
D. 960, 120

gate2004 databases relational-calculus easy

5.111 Relational Calculus: GATE2013_35 top gateoverflow.in/1546

Consider the following relational schema.

Students(rollno: integer, sname: string)


Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)

Which of the following queries are equivalent to this query in English?

Find the distinct names of all students who score more than 90% in the course numbered 107

(I)
SELECT DISTINCT S.sname
FROM Students as S, Registration as R
WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent >90

(II) sname (courseno=107percent>90 (Registration Students))

(III) {T S Students, R Registration(S. rollno = R. rollno


R. courseno = 107 R. percent > 90 T . sname = S. sname)}

(IV) {SN SR RP (SR , SN Students


SR , 107, RP Registration RP > 90)}

(A) I, II, III and IV

(B) I, II and III only

(C) I, II and IV only

(D) II, III and IV only

gate2013 databases sql relational-calculus normal

5.112 Relational Calculus: GATE1998_2.19 top gateoverflow.in/1692

Which of the following query transformations (i.e., replacing the l.h.s. expression by the r.h.s expression) is incorrect?
R1 and R2 are relations, C 1 and C2 are selection conditions and A 1 and A2 are attributes of R 1.

1
( 2
(R1 )) 2
( 1
(R1 ))

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 321 of 852

A. C1 (C2 (R1 )) C2 (C1 (R1 ))


B. C1 (A1 (R1 )) A1 (C1 (R1 ))
C. C1 (R1 R2 ) C1 (R1 ) C1 (R2 )
D. A1 (C1 (R1 )) C1 (A1 (R1 ))

gate1998 databases relational-calculus normal

5.113 Relational Calculus: GATE2014-3_30 top gateoverflow.in/2064

Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of
the relation employee. Assume that every employee has at least one associated dependent in the dependent relation.

employee (empId, empName, empAge)

dependent(depId, eId, depName, depAge)

Consider the following relational algebra query:

empId (employee) empId (employee (empId=eID)(empAgedepAge) dependent)

The above query evaluates to the set of empIds of employees whose age is greater than that of

(A) some dependent.

(B) all dependents.

(C) some of his/her dependents.

(D) all of his/her dependents.

gate2014-3 databases relational-calculus normal

5.114 Relational Calculus: GATE2012_43 top gateoverflow.in/2151

Suppose R1 (A, B) and R2 (C , D) are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a

foreign key that refers to C in R2 . If data in r1 and r2 satisfy referential integrity constraints, which of the following is
ALWAYS TRUE?

(A) B (r1 ) C (r2 ) =


(B) C (r2 ) B (r1 ) =
(C) B (r1 ) = C (r2 )
(D) B (r1 ) C (r2 )

gate2012 databases relational-calculus normal

5.115 Relational Calculus: GATE2014-3_21 top gateoverflow.in/2055

What is the optimized version of the relation algebra expression A1 (A2 (F1 (F2 (r)))), where A1, A2 are sets of attributes in r with A1 A2 and F1, F2
are Boolean expressions based on the attributes in r?

(A) A1 ( (F1F2) (r))

(B) A1 ( (F1F2) (r))

(C) A2 ( (F1F2) (r))

(D) A2 ( (F1F2) (r))

gate2014-3 databases relational-calculus easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 322 of 852

5.116 Relational Calculus: GATE2012-50 top gateoverflow.in/2180

Consider the following relations A, B and C:

Id Name Age

12 Arun 60

15 Shreya 24

99 Rohit 11

Id Name Age

15 Shreya 24

25 Hari 40

98 Rohit 20

99 Rohit 11

Id Phone Area

10 2200 02

99 2100 01

How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A B is
the same as that of A.

(A B) A.Id>40C.Id<15 C
A. 7
B. 4
C. 5
D. 9

gate2012 databases sql relational-calculus normal

5.117 Relational Calculus: GATE1999_1.19 top gateoverflow.in/1472

The relational algebra expression equivalent to the following tuple calculus expression:
{t t r (t[A] = 10 t[B] = 20)}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 323 of 852

{t t r (t[A] = 10 t[B] = 20)} is


A. (A=10B=20) (r)

B. (A=10) (r) (B=20) (r)

C. (A=10) (r) (B=20) (r)

D. (A=10) (r) (B=20) (r)

gate1999 databases relational-calculus normal

5.118 Sql: GATE2006-IT_84 top gateoverflow.in/3640

Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did
and cid respectively and the records are stored in ascending order of these primary keys as given in the tables. No indexing
is available in the database.

D: Drivers relation
did dname rating age
22 Karthikeyan 7 25
29 Salman 1 33
31 Boris 8 55
32 Amoldt 8 25
58 Schumacher 10 35
64 Sachin 7 35
71 Senna 10 16
74 Sachin 9 35
85 Rahul 3 25
95 Ralph 3 53

R: Reserves relation
did cid day
22 101 10/10/06
22 102 10/10/06
22 103 08/10/06
22 104 07/10/06
31 102 10/11/06
31 103 06/11/06
31 104 12/11/06
64 101 05/09/06
64 102 08/09/06
74 103 08/09/06

C: cars relation
cid cname colour
101 Renault blue
102 Renault red
103 Ferrari green
104 Jaguar red

What is the output of the following SQL query?

select D.dname
from Drivers D
where D.did in (
select R.did

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 324 of 852

from Cars C, Reserves R


where R.cid = C.cid and C.colour = 'red'
intersect
select R.did
from Cars C, Reserves R
where R.cid = C.cid and C.colour = 'green'
)

A) Karthikeyan, Boris
B) Sachin, Salman
C) Karthikeyan, Boris, Sachin
D) Schumacher, Senna

gate2006-it databases sql normal

5.119 Sql: GATE2000_2.25 top gateoverflow.in/672

Given relations r(w, x) and s(y, z) the result of


select distinct w, x
from r, s

is guaranteed to be same as r, provided.

A. r has no duplicates and s is non-empty


B. r and s have no duplicates
C. s has no duplicates and r is non-empty
D. r and s have the same number of tuples

gate2000 databases sql

5.120 Sql: GATE2014-1_54 top gateoverflow.in/1934

Given the following schema:

employees(emp-id, first-name, last-name, hire-date, dept-id, salary)

departments(dept-id, dept-name, manager-id, location-id)

You want to display the last names and hire dates of all latest hires in their respective departments in the location ID 1700.
You issue the following query:

SQL>SELECT last-name, hire-date


FROM employees
WHERE (dept-id, hire-date) IN
(SELECT dept-id, MAX(hire-date)
FROM employees JOIN departments USING(dept-id)
WHERE location-id =1700
GROUP BY dept-id);

What is the outcome?

(A) It executes but does not give the correct result

(B) It executes and gives the correct result.

(C) It generates an error because of pairwise comparison.

(D) It generates an error because of the GROUP BY clause cannot be used with table joins in a sub-query.

gate2014-1 databases sql normal

5.121 Sql: GATE1999_22 top gateoverflow.in/1521

Consider the set of relations

EMP (Employee-no. Dept-no, Employee-name, Salary)


DEPT (Dept-no. Dept-name, Location)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 325 of 852

Write an SQL query to:

a. Find all employees names who work in departments located at Calcutta and whose salary is greater than Rs.50,000.

b. Calculate, for each department number, the number of employees with a salary greater than Rs. 1,00,000

gate1999 databases sql easy

5.122 Sql: GATE2006-IT_85 top gateoverflow.in/3641

Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did
and cid respectively and the records are stored in ascending order of these primary keys as given in the tables. No indexing
is available in the database.

D: Drivers relation

did dname rating age

22 Karthikeyan 7 25

29 Salman 1 33

31 Boris 8 55

32 Amoldt 8 25

58 Schumacher 10 35

64 Sachin 7 35

71 Senna 10 16

74 Sachin 9 35

85 Rahul 3 25

95 Ralph 3 53


R: Reserves relation

did cid day

22 101 10/10/06

22 102 10/10/06

22 103 08/10/06

22 104 07/10/06

31 102 10/11/06

31 103 06/11/06

31 104 12/11/06

64 101 05/09/06

64 102 08/09/06

74 103 08/09/06


C: cars relation

cid cname colour

101 Renault blue

102 Renault red

103 Ferrari green

104 Jaguar red


select D.dname
from Drivers D
where D.did in (
select R.did
from Cars C, Reserves R
where R.cid = C.cid and C.colour = 'red'
intersect
select R.did
from Cars C, Reserves R
where R.cid = C.cid and C.colour = 'green'
)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 326 of 852



Let n be the number of comparisons performed when the above SQL query is optimally executed. If linear search is used to
locate a tuple in a relation using primary key, then n lies in the range

A) 36 - 40
B) 44 - 48
C) 60 - 64
D) 100 - 104

gate2006-it databases sql normal

5.123 Sql: GATE2000_22 top gateoverflow.in/693

Consider a bank database with only one relation

transaction (transno, acctno, date, amount)

The amount attribute value is positive for deposits and negative for withdrawals.

a. Define an SQL view TP containing the information


(acctno,T1.date,T2.amount)
for every pair of transaction T1,T2 and such that T1 and T2 are transaction on the same account and the date of T2 is the date of T1.
b. Using only the above view TP, write a query to find for each account the minimum balance it ever reached (not including the 0 balance
when the account is created). Assume there is at most one transaction per day on each account and each account has at least one
transaction since it was created. To simplify your query, break it up into 2 steps by defining an intermediate view V.

gate2000 databases sql normal

5.124 Sql: GATE2000_2.26 top gateoverflow.in/673

In SQL, relations can contain null values, and comparisons with null values are treated as unknown. Suppose all
comparisons with a null value are treated as false. Which of the following pairs is not equivalent?

A. x = 5 not (not (x = 5))


B. x = 5 x > 4 and x < 6, where x is an integer
C. x 5 not (x = 5)
D. none of the above

gate2000 databases sql normal

5.125 Sql: GATE2004-IT_74 top gateoverflow.in/3718

A relational database contains two tables student and department in which student table has columns roll_no, name and
dept_id and department table has columns dept_id and dept_name. The following insert statements were executed
successfully to populate the empty tables:
Insert into department values (1, 'Mathematics')
Insert into department values (2, 'Physics')
Insert into student values (l, 'Navin', 1)
Insert into student values (2, 'Mukesh', 2)
Insert into student values (3, 'Gita', 1)

How many rows and columns will be retrieved by the following SQL statement?

Select * from student, department

A. 0 row and 4 columns


B. 3 rows and 4 columns
C. 3 rows and 5 columns
D. 6 rows and 5 columns

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 327 of 852

gate2004-it databases sql normal

5.126 Sql: GATE2006_68 top gateoverflow.in/1846

Consider the relation enrolled (student, course) in which (student, course) is the primary key, and the relation paid (student,
amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints.
Given the following four queries:

Query1:

select student from enrolled where student in (select student from paid)

Query2:

select student from paid where student in (select student from enrolled)

Query3:
select E.student from enrolled E, paid P where E.student = P.student

Query4:
select student from paid where exists
(select * from enrolled where enrolled.student = paid.student)

Which one of the following statements is correct?

(A) All queries return identical row sets for any database
(B) Query2 and Query4 return identical row sets for all databases but there exist databases for which Query1 and Query2
return different row sets.
(C) There exist databases for which Query3 returns strictly fewer rows than Query2
(D) There exist databases for which Query4 will encounter an integrity violation at runtime.

gate2006 databases sql normal

5.127 Sql: GATE2006_67 top gateoverflow.in/1845

Consider the relation account (customer, balance) where customer is a primary key and there are no null values. We would
like to rank customers according to decreasing balance. The customer with the largest balance gets rank 1. Ties are not
broke but ranks are skipped: if exactly two customers have the largest balance they each get rank 1 and rank 2 is not
assigned.

Consider these statements about Query1 and Query2.

1. Query1 will produce the same row set as Query2 for some but not all databases.
2. Both Query1 and Query2 are correct implementation of the specification
3. Query1 is a correct implementation of the specification but Query2 is not
4. Neither Query1 nor Query2 is a correct implementation of the specification
5. Assigning rank with a pure relational query takes less time than scanning in decreasing balance order assigning ranks
using ODBC.

Which two of the above statements are correct?

(A) 2 and 5
(B) 1 and 3
(C) 1 and 4
(D) 3 and 5

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 328 of 852

gate2006 databases sql normal

5.128 Sql: GATE1998_7a top gateoverflow.in/1721

Suppose we have a database consisting of the following three relations.

FREQUENTS (student, parlor) giving the parlors each student visits.


SERVES (parlor, ice-cream) indicating what kind of ice-creams each parlor serves.
LIKES (student, ice-cream) indicating what ice-creams each student likes.
(Assume that each student likes at least one ice-cream and frequents at least one parlor)

Express the following in SQL:

Print the students that frequent at least one parlor that serves some ice-cream that they like.

gate1998 databases sql descriptive

5.129 Sql: GATE1991_12,a top gateoverflow.in/539

Suppose a database consist of the following relations:

SUPPLIER (SCODE,SNAME,CITY).
PART (PCODE,PNAME,PDESC,CITY).

PROJECTS (PRCODE,PRNAME,PRCITY).

SPPR (SCODE,PCODE,PRCODE,QTY).

a. Write SQL programs corresponding to the following queries:


i. Print PCODE values for parts supplied to any project in DEHLI by a supplier in DELHI.
ii. Print all triples <CITY, PCODE, CITY> such that a supplier in first city supplies the specified part to a project in the
second city, but do not print the triples in which the two CITY values are same.

gate1991 databases sql normal

5.130 Sql: GATE2004-IT_78 top gateoverflow.in/3722

Consider two tables in a relational database with columns and rows as follows:

Table: Student
Roll_no Name Dept_id
1 ABC 1
2 DEF 1
3 GHI 2
4 JKL 3

Table: Department
Dept_id Dept_name
1 A
2 B
3 C

Roll_no is the primary key of the Student table, Dept_id is the primary key of the Department table and Student.Dept_id is a
foreign key from Department.Dept_id
What will happen if we try to execute the following two SQL statements?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 329 of 852

i. update Student set Dept_id = Null where Roll_on = 1


ii. update Department set Dept_id = Null where Dept_id = 1

A) Both (i) and (ii) will fail


B) (i) will fail but (ii) will succeed
C) (i) will succeed but (ii) will fail
D) Both (i) and (ii) will succeed

gate2004-it databases sql normal

5.131 Sql: GATE2014-2_54 top gateoverflow.in/2021

SQL allows duplicate tuples in relations, and correspondingly denes the multiplicity of tuples in the result of joins. Which one of the following queries always
gives the same answer as the nested query shown below:

select * from R where a in (select S.a from S)

(A)
select R.* from R, S where R.a=S.a

(B)

select distinct R.* from R,S where R.a=S.a

(C)

select R.* from R,(select distinct a from S) as S1 where R.a=S1.a

(D)
select R.* from R,S where R.a=S.a and is unique R

gate2014-2 databases sql normal

5.132 Sql: GATE2006_69 top gateoverflow.in/1847

Consider the relation enrolled (student, course) in which (student, course) is the primary key, and the relation paid (student,
amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Assume that
amounts 6000, 7000, 8000, 9000 and 10000 were each paid by 20% of the students. Consider these query plans (Plan 1 on
left, Plan 2 on right) to list all courses taken by students who have paid more than x

A disk seek takes 4ms, disk data transfer bandwidth is 300 MB/s and checking a tuple to see if amount is greater than x
takes 10s. Which of the following statements is correct?

(A) Plan 1 and Plan 2 will not output identical row sets for all databases
(B) A course may be listed more than once in the output of Plan 1 for some databases
(C) For x = 5000, Plan 1 executes faster than Plan 2 for all databases
(D) For x = 9000, Plan I executes slower than Plan 2 for all databases.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 330 of 852

gate2006 databases sql normal

5.133 Sql: GATE2004-IT_76 top gateoverflow.in/3720

A table T1 in a relational database has the following rows and columns:

roll no. marks


1 10
2 20
3 30
4 Null

The following sequence of SQL statements was successfully executed on table T1.
Update T1 set marks = marks + 5
Select avg(marks) from T1

What is the output of the select statement?

A. 18.75
B. 20
C. 25
D. Null

gate2004-it databases sql normal

5.134 Sql: GATE1997_76 top gateoverflow.in/19838

Consider the following relational database schema:

EMP (eno name, age)

PROJ (pno name)

INVOLVED (eno, pno)

EMP contains information about employees. PROJ about projects and involved about which employees involved in which
projects. The underlined attributes are the primary keys for the respective relations.

a. What is the relational algebra expression containing one or more of {, , x, u, } which is equivalent to SQL query.

select eno from EMP|INVOLVED where EMP.eno=INVOLVED.eno and INVOLVED.pno=3

b. State in English (in not more than 15 words)

What the following relational algebra expressions are designed to determine

i. eno (INV OLV ED) eno ((eno (INV OLV ED) pno (P ROJ) INV OLV ED)

ii. age (EMP ) Eage < EMP . age(E(EMP ) EMP ))


(Note: E(EMP ) conceptually makes a copy of EMP and names it K ( is called the rename operator))

gate1997 databases sql

5.135 Sql: GATE1999_2.25 top gateoverflow.in/1502

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 331 of 852

Which of the following is/are correct?

A. An SQL query automatically eliminates duplicates


B. An SQL query will not work if there are no indexes on the relations
C. SQL permits attribute names to be repeated in the same relation
D. None of the above

gate1999 databases sql easy

5.136 Sql: GATE2011_32 top gateoverflow.in/2134

Consider a database table T containing two columns X and Y each of type integer. After the creation of the table, one
record (X=1, Y=1) is inserted in the table.

Let MX and MY denote the respective maximum values of X and Y among all records in the table at any point in time.
Using MX and MY, new records are inserted in the table 128 times with X and Y values being MX+1, 2*MY+1
respectively. It may be noted that each time after the insertion, values of MX and MY change.

What will be the output of the following SQL query after the steps mentioned above are carried out?
SELECT Y FROM T WHERE X=7;

(A) 127

(B) 255

(C) 129

(D) 257

gate2011 databases sql normal

5.137 Sql: GATE1991_12,b top gateoverflow.in/42998

Suppose a database consist of the following relations:


SUPPLIER (SCODE,SNAME,CITY).

PART (PCODE,PNAME,PDESC,CITY).

PROJECTS (PRCODE,PRNAME,PRCITY).
SPPR (SCODE,PCODE,PRCODE,QTY).

Write algebraic solution to the following :


Get SCODE values for suppliers who supply to both projects PR1 and PR2.
Get PRCODE values for projects supplied by at least one supplier not in the same city.

sql gate1991 normal databases

5.138 Sql: GATE 2016-2-52 top gateoverflow.in/39604

Consider the following database table named water_schemes:

Water_schemes
scheme_no district_name capacity
1 Ajmer 20
1 Bikaner 10
2 Bikaner 10
3 Bikaner 20
1 Churu 10
2 Churu 20
1 Dungargarh 10

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 332 of 852

The number of tuples returned by the following SQL query is _________.

with total (name, capacity) as


select district_name, sum (capacity)
from water_schemes
group by district_name
with total_avg (capacity) as
select avg (capacity)
from total
select name
from total, total_avg
where total.capacity total_avg.capacity

gate2016-2 databases sql normal numerical-answers

5.139 Sql: GATE2004_53 top gateoverflow.in/1049

The employee information in a company is stored in the relation

Employee (name, sex, salary, deptName)

Consider the following SQL query


Select deptName
From Employee
Where sex = M
Group by deptName
Having avg(salary) >
(select avg (salary) from Employee)

It returns the names of the department in which

A. the average salary is more than the average salary in the company

B. the average salary of male employees is more than the average salary of all male employees in the company

C. the average salary of male male employees is more than the average salary of employees in same the department

D. the average salary of male employees is more than the average salary in the company

gate2004 databases sql normal

5.140 Sql: GATE2011_46 top gateoverflow.in/2148

Database table by name Loan_Records is given below.

Borrower Bank_Manager Loan_Amount


Ramesh Sunderajan 10000.00
Suresh Ramgopal 5000.00
Mahesh Sunderajan 7000.00

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 333 of 852

What is the output of the following SQL query?

SELECT count(*)
FROM (
SELECT Borrower, Bank_Manager FROM Loan_Records) AS S
NATURAL JOIN
(SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T
);

(A) 3

(B) 9

(C) 5

(D) 6

gate2011 databases sql normal

5.141 Sql: GATE2005_77 top gateoverflow.in/1400

The relation book (title,price) contains the titles and prices of different books. Assuming that no two books have the same
price, what does the following SQL query list?
select title
from book as B
where (select count(*)
from book as T
where T.price>B.price) < 5

A. Titles of the four most expensive books

B. Title of the fifth most inexpensive book

C. Title of the fifth most expensive book

D. Titles of the five most expensive books

gate2005 databases sql easy

5.142 Sql: GATE2015-1_27 top gateoverflow.in/8225

Consider the following relation:

Student

Roll-No Student name


1 Raj

2 Rohit
3 Raj

Performance

Roll-No Course Marks


1 Math 80
1 English 70
2 Math 75
3 English 80
2 Physics 65
3 Math 80

Consider the following SQL query.


SELECT S. student_Name, Sum(p. Marks)
FROM student S, performance P
WHERE S.Roll_No= P.Roll_No

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 334 of 852

GROUP BY S.STUDENT_Name

The numbers of rows that will be returned by the SQL query is_________________.

gate2015-1 databases sql normal

5.143 Sql: GATE2007_61 top gateoverflow.in/1259

Consider the table employee(empId, name, department, salary) and the two queries Q1 , Q2 below. Assuming that
department 5 has more than one employee, and we want to find the employees who get higher salary than anyone in the
department 5, which one of the statements is TRUE for any arbitrary employee table?

Select e.empId
Q1 : From employee e
Where not exists
(Select * From employee s Where s.department = "5" and s.salary >= e.salary)

Select e.empId
From employee e
Q2 : Where e.salary > Any
(Select distinct salary From employee s Where s.department = "5")

A. Q1 is the correct query

B. Q2 is the correct query

C. Both Q1 and Q2 produce the same answer

D. Neither Q1 nor Q2 is the correct query

gate2007 databases sql normal verbal-ability

5.144 Sql: GATE2010_19 top gateoverflow.in/2194

A relational schema for a train reservation database is given below.

passenger(pid, pname, age)

reservation(pid, class, tid)

Table: Passenger
pid pname Age
0 'Sachin' 65
1 'Rahul' 66
2 'Sourav' 67
3 'Anil' 69

Table: Reservation
pid class tid
0 'AC' 8200
1 'AC' 8201
2 'SC' 8201
5 'AC' 8203
1 'SC' 8204
3 'AC' 8202

What pids are returned by the following SQL query for the above instance of the tables?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 335 of 852

SELECT pid
FROM Reservation
WHERE class='AC' AND
EXISTS (SELECT *
FROM Passenger
WHERE age>65 AND
Passenger.pid=Reservation.pid)

(A) 1, 0

(B) 1, 2

(C) 1, 3

(D) 1, 5

gate2010 databases sql normal

5.145 Sql: GATE2003_86 top gateoverflow.in/969

Consider the set of relations shown below and the SQL query that follows.

Students: (Roll_number, Name, Date_of_birth)

Courses: (Course_number, Course_name, Instructor)

Grades: (Roll_number, Course_number, Grade)


Select distinct Name
from Students, Courses, Grades
where Students.Roll_number=Grades.Roll_number
and Courses.Instructor = 'Korth'
and Courses.Course_number = Grades.Course_number
and Grades.Grade = 'A'

Which of the following sets is computed by the above query?

A. Names of students who have got an A grade in all courses taught by Korth

B. Names of students who have got an A grade in all courses

C. Names of students who have got an A grade in at least one of the courses taught by Korth

D. None of the above

gate2003 databases sql easy

5.146 Sql: GATE2014-3_54 top gateoverflow.in/2089

Consider the following relational schema:

employee(empId,empName,empDept)

customer(custId,custName,salesRepId,rating)

salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at
least one customer. What does the following query return?
SELECT empName FROM employee E
WHERE NOT EXISTS (SELECT custId
FROM customer C
WHERE C.salesRepId = E.empId
AND C.rating <> 'GOOD');

(A) Names of all the employees with at least one of their customers having a GOOD rating.

(B) Names of all the employees with at most one of their customers having a 'GOOD' rating.

(C) Names of all the employees with none of their customers having a 'GOOD' rating.

(D) Names of all the employees with all their customers having a 'GOOD' rating.

gate2014-3 databases sql easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 336 of 852

5.147 Sql: GATE2001_2.25 top gateoverflow.in/743

Consider a relation geq which represents "greater than or equal to", that is, (x, y) geq only if y x.
create table geq
(
ib integer not null,
ub integer not null,
primary key ib,
foreign key (ub) references geq on delete cascade
);

Which of the following is possible if tuple (x,y) is deleted?

A. A tuple (z,w) with z > y is deleted


B. A tuple (z,w) with z > x is deleted
C. A tuple (z,w) with w < x is deleted
D. The deletion of (x,y) is prohibited

gate2001 databases sql normal

5.148 Sql: GATE2005-IT_69 top gateoverflow.in/3832

In an inventory management system implemented at a trading corporation, there are several tables designed to hold all the
information. Amongst these, the following two tables hold information on which items are supplied by which suppliers, and
which warehouse keeps which items along with the stock-level of these items.

Supply = (supplierid, itemcode)


Inventory = (itemcode, warehouse, stocklevel)

For a specific information required by the management, following SQL query has been written

Select distinct STMP.supplierid


From Supply as STMP
Where not unique (Select ITMP.supplierid
From Inventory, Supply as ITMP
Where STMP.supplierid = ITMP.supplierid
And ITMP.itemcode = Inventory.itemcode
And Inventory.warehouse = 'Nagpur');

For the warehouse at Nagpur, this query will find all suppliers who

A) do not supply any item


B) supply exactly one item
C) supply one or more items
D) supply two or more items

gate2005-it databases sql normal

5.149 Sql: GATE2001_21 top gateoverflow.in/762

Consider a relation examinee (regno, name, score), where regno is the primary key to score is a real number.

a. Write a relational algebra using (, , , ) to find the list of names which appear more than once in examinee.
b. Write an SQL query to list the regno of examinees who have a score greater than the average score.
c. Suppose the relation appears (regno, centr_code) specifies the center where an examinee appears. Write an SQL query
to list the centr_code having an examinee of score greater than 80.

gate2001 databases sql normal

5.150 Sql: GATE2008-IT_74 top gateoverflow.in/3388

Student (school-id, sch-roll-no, sname, saddress)


School (school-id, sch-name, sch-address, sch-phone)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 337 of 852

Enrolment(school-id sch-roll-no, erollno, examname)


ExamResult(erollno, examname, marks)

What does the following SQL query output?


SELECT sch-name, COUNT (*)
FROM School C, Enrolment E, ExamResult R
WHERE E.school-id = C.school-id
AND
E.examname = R.examname AND E.erollno = R.erollno
AND
R.marks = 100 AND S.school-id IN (SELECT school-id
FROM student
GROUP BY school-id
HAVING COUNT (*) > 200)
GROUP By school-id

for each school with more than 200 students appearing in exams, the name of the school and the number of 100s scored
A)
by its students
B) for each school with more than 200 students in it, the name of the school and the number of 100s scored by its students
for each school with more than 200 students in it, the name of the school and the number of its students scoring 100 in
C)
at least one exam
D) nothing; the query has a syntax error

gate2008-it databases sql normal

5.151 Sql: GATE2015-3_3 top gateoverflow.in/8396

Consider the following relation

Cinema(theater, address, capacity )

Which of the following options will be needed at the end of the SQL query

SELECT P1.address
FROM Cinema P1

such that it always finds the addresses of theaters with maximum capacity?

A. A. WHERE P1.capacity >= All (select P2.capacity from Cinema P2)

B. B. WHERE P1.capacity >= Any (select P2.capacity from Cinema P2)

C. C. WHERE P1.capacity > All (select max(P2.capacity) from Cinema P2)

D. D. WHERE P1.capacity > Any (select max(P2.capacity) from Cinema P2)

gate2015-3 databases sql normal

5.152 Transactions: GATE2015-2_1 top gateoverflow.in/8047

Consider the following transaction involving two bank accounts x and y.

read(x); x:=x-50; write (x); read(y); y:=y+50; write(y)

The constraint that the sum of the accounts x and y should remain constant is that of

A. Atomicity
B. Consistency
C. Isolation
D. Durability

gate2015-2 databases transactions easy

5.153 Transactions: GATE2005-IT_66 top gateoverflow.in/3828

In a data flow diagram, the segment shown below is identified as having transaction flow characteristics, with p2 identified
as the transaction center

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 338 of 852

A first level architectural design of this segment will result in a set of process modules with an associated invocation
sequence. The most appropriate architecture is

A) p1 invokes p2, p2 invokes either p3, or p4, or p5


B) p2 invokes p1, and then invokes p3, or p4, or p5
A new module Tc is defined to control the transaction flow. This module Tc first invokes pl and then invokes p2. p2 in
C)
turn invokes p3, or p4, or p5
A new module Tc is defined to control the transaction flow. This module Tc invokes p2. p2 invokes p1, and then invokes
D)
p3, or p4, or p5

gate2005-it databases transactions normal

5.154 Transactions: GATE2005-IT_67 top gateoverflow.in/3830

A company maintains records of sales made by its salespersons and pays them commission based on each individual's total
sales made in a year. This data is maintained in a table with following schema:

salesinfo = (salespersonid, totalsales, commission)

In a certain year, due to better business results, the company decides to further reward its salespersons by enhancing the
commission paid to them as per the following formula:

If commission < = 50000, enhance it by 2%


If 50000 < commission < = 100000, enhance it by 4%
If commission > 100000, enhance it by 6%

The IT staff has written three different SQL scripts to calculate enhancement for each slab, each of these scripts is to run as
a separate transaction as follows:

Update salesinfo
T1 Set commission = commission * 1.02
Where commission < = 50000;

Update salesinfo
T2 Set commission = commission * 1.04
Where commission > 50000 and commission is < = 100000;

Update salesinfo
T3 Set commission = commission * 1.06
Where commission > 100000;

Which of the following options of running these transactions will update the commission of all salespersons correctly

1) Execute T1 followed by T2 followed by T3


2) Execute T2, followed by T3; T1 running concurrently throughout
3) Execute T3 followed by T2; T1 running concurrently throughout
4) Execute T3 followed by T2 followed by T1

gate2005-it databases transactions normal

5.155 Transactions: GATE2015-2_46 top gateoverflow.in/8246

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 339 of 852

Consider a simple checkpointing protocol and the following set of operations in the log.

(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);

(checkpoint);

(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2);

If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the
undo list and the redo list?

A. Undo: T3, T1; Redo: T2


B. Undo: T3, T1; Redo: T2, T4
C. Undo: none; Redo: T2, T4, T3, T1
D. Undo: T3, T1, T4; Redo: T2

gate2015-2 databases transactions normal

5.156 Transactions: GATE2015-3_29 top gateoverflow.in/8482

Consider the partial Schedule S involving two transactions T 1 and T 2. Only the read and the write operations have been
shown. The read operation on data item P is denoted by read(P) and write operation on data item P is denoted by
write(P).
Schedule S
Transaction id
Time Instance
T1 T2
1 read(A)
2 write(A)
3 read(C)
4 write(C)
5 read(B)
6 write(B)
7 read(A)
8 commit
9 read(B)

Suppose that the transaction T 1 fails immediately after time instance 9. Which of the following statements is correct?

A. T 2 must be aborted and then both T 1 and T 2 must be re-started to ensure transaction atomicity
B. Schedule S is non-recoverable and cannot ensure transaction atomicity
C. Only T 2 must be aborted and then re-started to ensure transaction atomicity
D. Schedule S is recoverable and can ensure transaction atomicity and nothing else needs to be done

gate2015-3 databases transactions normal

5.157 Transactions: GATE2014-1_29 top gateoverflow.in/1796

Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by r(x) and w(x)
respectively. Which one of them is conflict serializable?

(A) r1 (x) ; r2 (x) ; w1 (x) ; r3 (x) ; w2 (x) ;

(B) r2 (x) ; r1 (x) ; w2 (x) ; r3 (x) ; w1 (x) ;

(C) r3 (x) ; r2 (x) ; r1 (x) ; w2 (x) ; w1 (x) ;

(D) r2 (x) ; w2 (x) ; r3 (x) ; r1 (x) ; w1 (x) ;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 340 of 852

gate2014-1 databases transactions numerical-answers normal

5.158 Transactions: GATE2009_43 top gateoverflow.in/1329

Consider two transactions T1 and T2 , and four schedules S1 , S2 , S3 , S4 , of T1 and T2 as given below:

T1 : R1 [x]W1 [x]W1 [y]


T2 : R2 [x]R2 [y]W2 [y]
S1 : R1 [x]R2 [x]R2 [y]W1 [x]W1 [y]W2 [y]
S2 : R1 [x]R2 [x]R2 [y]W1 [x]W2 [y]W1 [y]
S3 : R1 [x]W1 [x]R2 [x]W1 [y]R2 [y]W2 [y]
S4 : R2 [x]R2 [y]R1 [x]W1 [x]W1 [y]W2 [y]
Which of the above schedules are conflict-serializable?

A. S1 and S2
B. S2 and S3
C. S3 only
D. S4 only

gate2009 databases transactions normal

5.159 Transactions: GATE1999_2.6 top gateoverflow.in/1484

For the schedule given below, which of the following is correct:

1 Read A
2 Read B
3 Write A
4 Read A
5 Write A
6 Write B
7 Read B
8 Write B

A. This schedule is serializable and can occur in a scheme using 2PL protocol

B. This schedule is serializable but cannot occur in a scheme using 2PL protocol

C. This schedule is not serializable but can occur in a scheme using 2PL protocol

D. This schedule is not serializable and cannot occur in a scheme using 2PL protocol

gate1999 databases transactions normal

5.160 Transactions: GATE2012_27 top gateoverflow.in/1612

Consider the following transactions with data items P and Q initialized to zero:

read (P);

T1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 341 of 852

T1 read (Q);
if P = 0 then Q := Q + 1 ;
write (Q).

read (Q);
read (P);
T2 if Q = 0 then P := P + 1 ;
write (P)

Any non-serial interleaving of T1 and T2 for concurrent execution leads to

(A) a serializable schedule


(B) a schedule that is not conflict serializable
(C) a conflict serializable schedule
(D) a schedule for which a precedence graph cannot be drawn

gate2012 databases transactions normal

5.161 Transactions: GATE2007_64 top gateoverflow.in/1262

Consider the following schedules involving two transactions. Which one of the following statements is TRUE?

S1 : r1 (X); r1 (Y ); r2 (X); r2 (Y ); w2 (Y ); w1 (X)


S2 : r1 (X); r2 (X); r2 (Y ); w2 (Y ); r1 (Y ); w1 (X)

A. Both S1 and S2 are conflict serializable.

B. S1 is conflict serializable and S2 is not conflict serializable.

C. S1 is not conflict serializable and S2 is conflict serializable.

D. Both S1 and S2 are not conflict serializable.

gate2007 databases transactions normal

5.162 Transactions: GATE2006_20 top gateoverflow.in/981

Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to
a mortgage payment and then apply a 5% interest.

1. T1 start

2. T1 B old=1200 new=10000

3. T1 M old=0 new=2000

4. T1 commit

5. T2 start

6. T2 B old=10000 new=10500

7. T2 commit

Suppose the database system crashes just before log record 7 is written. When the system is restarted, which one
statement is true of the recovery procedure?

(A) We must redo log record 6 to set B to 10500

(B) We must undo log record 6 to set B to 10000 and then redo log records 2 and 3

(C) We need not redo log records 2 and 3 because transaction T1 has committed

(D) We can apply redo and undo operations in arbitrary order because they are idempotent.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 342 of 852

gate2006 databases transactions normal

5.163 Transactions: GATE2003_29 top gateoverflow.in/919

Which of the following scenarios may lead to an irrecoverable error in a database system?

A. A transaction writes a data item after it is read by an uncommitted transaction


B. A transaction reads a data item after it is read by an uncommitted transaction
C. A transaction reads a data item after it is written by a committed transaction
D. A transaction reads a data item after it is written by an uncommitted transaction

gate2003 databases transactions easy

5.164 Transactions: GATE2003_87 top gateoverflow.in/970

Consider three data items D1, D2, and D3, and the following execution schedule of transactions T1, T2, and T3. In the
diagram, R(D) and W(D) denote the actions reading and writing the data item D respectively.

Which of the following statements is correct?

A. The schedule is serializable as T2; T3; T1

B. The schedule is serializable as T2; T1; T3

C. The schedule is serializable as T3; T2; T1

D. The schedule is not serializable

gate2003 databases transactions normal

5.165 Transactions: GATE 2016-1-51 top gateoverflow.in/39703

Consider the following two phase locking protocol. Suppose a transaction T accesses (for read or write operations), a certain
set of objects {O1 , . . . . Ok }. This is done in the following manner:

Step 1 . T acquires exclusive locks to O1 , . . . . . , Ok in increasing order of their addresses.


Step 2 . The required operations are performed .
Step 3 . All locks are released
This protocol will

A. guarantee serializability and deadlock-freedom


B. guarantee neither serializability nor deadlock-freedom
C. guarantee serializability but not deadlock-freedom
D. guarantee deadlock-freedom but not serializability.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 343 of 852

gate2016-1 databases transactions normal

5.166 Transactions: GATE2014-2_29 top gateoverflow.in/1988

Consider the following schedule S of transactions T1, T2, T3, T4:

T1 T2 T3 T4

Reads(X)

Writes(X)
Commit
Writes(X)
Commit

Writes(Y)
Reads(Z)
Commit

Reads(X)
Reads(Y)
Commit

Which one of the following statements is CORRECT?

(A) S is conflict-serializable but not recoverable

(B) S is not conflict-serializable but is recoverable

(C) S is both conflict-serializable and recoverable

(D) S is neither conflict-serializable not is it recoverable

gate2014-2 databases transactions normal

5.167 Transactions: GATE2008-IT_63 top gateoverflow.in/3374

Consider the following three schedules of transactions T1, T2 and T3. [Notation: In the following NYO represents the action Y
(R for read, W for write) performed by transaction N on object O.]

(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB
(S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC
(S3) 2RZ 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB

Which of the following statements is TRUE?

1) S1, S2 and S3 are all conflict equivalent to each other


2) No two of S1, S2 and S3 are conflict equivalent to each other
3) S2 is conflict equivalent to S3, but not to S1
4) S1 is conflict equivalent to S2, but not to S3

gate2008-it databases transactions normal

5.168 Transactions: GATE2007-IT_66 top gateoverflow.in/3511

Consider the following two transactions : T 1 and T2.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 344 of 852


T1 T2
read (A); read (B);
: :

read (B); read (A);


if A = 0 then B B if B 0 then A A

+ 1; - 1;
write (B); write (A);
Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase locking for
the above transactions?

S1 S2
: lock S(A); : lock S(B);

read (A); read (B);


lock S(B); lock S(A);
1) read (B); read (A);
if A = 0 if B 0
then B B + then A A -

1; 1;
write (B); write (A);
commit; commit;
unlock (A); unlock (B);
unlock (B); unlock (A);

S1 S2
: lock X(A); : lock X(B);

read (A); read (B);


lock X(B); lock X(A);
2) read (B); read (A);
if A = 0 if B 0
then B B + then A A -

1; 1;
write (B); write (A);
unlock (A); unlock (A);
commit; commit;
unlock (B); unlock (A);

S1 S2
: lock S(A); : lock S(B);

read (A); read (B);


lock X(B); lock X(A);
3) read (B); read (A);
if A = 0 if B 0
then B B + then A A -

1; 1;
write (B); write (A);
unlock (A); unlock (B);
commit; commit;
unlock (B); unlock (A);


S1 S2
: lock S(A); : lock S(B);

read (A); read (B);


lock X(B); lock X(A);
4) read (B); read (A);
if A = 0 if B 0
then B B + then A A -

1; 1;
write (B); write (A);
unlock (A); unlock (A);
unlock (B); unlock (B);
commit; commit;

gate2007-it databases transactions normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 345 of 852

5.169 Transactions: GATE2004-IT_77 top gateoverflow.in/3721

Consider the following schedule S of transactions T1 and T2:

T1 T2

Read (A)

Read(A) Temp = 0.2*A

A = A - 10 Write(A)

Read(B)

Write(A)

Read(B) B = B + Temp

B = B + 10 Write(B)

Write(B)

Which of the following is TRUE about the schedule S ?

A. S is serializable only as T1, T2


B. S is serializable only as T2, T1
C. S is serializable both as T1, T2 and T2, T1
D. S is serializable either as T1 or as T2

gate2004-it databases transactions normal

5.170 Transactions: GATE2010_42 top gateoverflow.in/2343

Consider the following schedule for transactions T1, T2 and T3:

T1 T2 T3
Read(X)
Read(Y)
Read(Y)
Write(Y)
Write(X)
Write(X)
Read(X)
Write(X)

Which one of the schedules below is the correct serialization of the above?

(A) T 1 T 3 T 2

(B) T 2 T 1 T 3

(C) T 2 T 3 T 1

(D) T 3 T 1 T 2

gate2010 databases transactions normal

5.171 Transactions: GATE2010_20 top gateoverflow.in/2196

Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 346 of 852

I. 2-phase locking

II. Time-stamp ordering

(A) I only

(B) II only

(C) Both I and II

(D) Neither I nor II

gate2010 databases transactions normal

5.172 Transactions: GATE 2016-1-22 top gateoverflow.in/39644

Which one of the following is NOT a part of the ACID properties of database transactions?

A. Atomicity
B. Consistency
C. Isolation
D. Deadlock-freedom

gate2016-1 databases transactions easy

5.173 Transactions: GATE2014-3_29 top gateoverflow.in/2063

Consider the transactions T 1, T 2, and T 3 and the schedules S1 and S2 given below.
T 1 : r1(X); r1(Z); w1(X); w1(Z)
T 2 : r2(Y ); r2(Z); w2(Z)
T 3 : r3(Y ); r3(X); w3(Y )

S1 : r1(X); r3(Y ); r3(X); r2(Y ); r2(Z); w3(Y ); w2(Z); r1(Z); w1(X); w1(Z)
S2 : r1(X); r3(Y ); r2(Y ); r3(X); r1(Z); r2(Z); w3(Y ); w1(X); w2(Z); w1(Z)
Which one of the following statements about the schedules is TRUE?

(A) Only S1 is conflict-serializable.

(B) Only S2 is conflict-serializable.

(C) Both S1 and S2 are conflict-serializable.

(D) Neither S1 nor S2 is conflict-serializable.

gate2014-3 databases transactions normal

5.174 Transactions: GATE2005-IT_24 top gateoverflow.in/3769

Amongst the ACID properties of a transaction, the 'Durability' property requires that the changes made to the database by a
successful transaction persist

1) Except in case of an Operating System crash


2) Except in case of a Disk crash
3) Except in case of a power failure
4) Always, even if there is a failure of any kind

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 347 of 852

gate2005-it databases transactions easy

5.175 GATE2014-2_30 top gateoverflow.in/1989

Consider a join (relation algebra) between relations r(R) and s(S) using the nested loop method. There are 3 buffers each of size equal to
disk block size, out of which one buffer is reserved for intermediate results. Assuming size(r(R))<size(s(S)) , the join will have fewer number
of
disk block accesses if

(A) relation r(R) is in the outer loop.

(B) relation s(S) is in the outer loop.

(C) join selection factor between r(R) and s(S) is more than 0.5.

(D) join selection factor between r(R) and s(S) is less than 0.5.

gate2014-2 databases normal

5.176 GATE2014-2_21 top gateoverflow.in/1978

The maximum number of superkeys for the relation schema R(E, F, G, H) with E as the key is _____.

gate2014-2 databases numerical-answers easy

5.177 GATE2014-2_22 top gateoverflow.in/1980

Given an instance of the STUDENTS relation as shown as below

StudentID StudentName StudentEmail StudentAge CPI


2345 Shankar Shankar@math X 9.4
1287 Swati swati@ee 19 9.5
7853 Shankar Shankar@cse 19 9.4
9876 Swati swati@mech 18 9.3
8765 Ganesh ganesh@civil 19 8.7

For (StudentName, StudentAge) to be a key for this instance, the value X should NOT be equal to______.

gate2014-2 databases numerical-answers easy

5.178 GATE2012_2 top gateoverflow.in/34

Which of the following is TRUE?

(A) Every relation in 3NF is also in BCNF


(B) A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every key of R
(C) Every relation in BCNF is also in 3NF
(D) No relation can be in both BCNF and 3NF

gate2012 databases easy

5.179 GATE2014-1_22 top gateoverflow.in/1789

Given the following statements:

S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.

S2: Given the table R(a, b, c) where a and b together form the primary key, the following is a valid table definition.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 348 of 852

CREATE TABLE S (
a INTEGER,
d INTEGER,
e INTEGER,
PRIMARY KEY (d),
FOREIGN KEY (a) references R)

Which one of the following statements is CORRECT ?

(A) S1 is TRUE and S2 is FALSE

(B) Both S1 and S2 are TRUE

(C) S1 is FALSE and S2 is TRUE

(D) Both S1 and S2 are FALSE

gate2014-1 databases normal

5.180 GATE1999_1.18 top gateoverflow.in/1471

Consider the join of a relation R with a relation S. If R has m tuples and S has n tuples then the maximum and minimum
sizes of the join respectively are

A. m + n and 0
B. mn and 0
C. m + n and |m n|
D. mn and m + n

gate1999 databases easy

5.181 GATE2012_14 top gateoverflow.in/46

Given the basic ER and relational models, which of the following is INCORRECT?

(A) An attribute of an entity can have more than one value


(B) An attribute of an entity can be composite
(C) In a row of a relational table, an attribute can have more than one value
(D) In a row of a relational table, an attribute can have exactly one value or a NULL value

gate2012 databases normal

5.182 GATE2012_15 top gateoverflow.in/47

Which of the following statements are TRUE about an SQL query?


P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause
Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause
R : All attributes used in the GROUP BY clause must appear in the SELECT clause
S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause

(A) P and R
(B) P and S
(C) Q and R
(D) Q and S

gate2012 databases easy

5.183 GATE2009_49 top gateoverflow.in/1335

Which of the following statements are TRUE?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 349 of 852

I. The context diagram should depict the system as a single bubble.

II. External entities should be identified clearly at all levels of DFDs.

III. Control information should not be represented in a DFD.

IV. A data store can be connected wither to another data store or to an external entity.

A. II and III
B. II and III
C. I and III
D. I, II and III

gate2009 databases normal

5.184 GATE2014-3_22 top gateoverflow.in/2056

A prime
attribute of a relation scheme R is an attribute that appears

(A) in all candidate keys of R

(B) in some candidate key of R

(C) in a foreign key of R

(D) only in the primary key of R

gate2014-3 databases easy

5.185 GATE2011_12 top gateoverflow.in/2114

Consider a relational table with a single record for each registered student with the following attributes:

1. Registration_Num: Unique registration number for each registered student


2. UID: Unique identity number, unique at the national level for each citizen
3. BankAccount_Num: Unique account number at the bank. A student can have multiple accounts or joint accounts. This
attribute stores the primary account number.
4. Name: Name of the student
5. Hostel_Room: Room number of the hostel

Which of the following options is INCORRECT?

(A) BankAccount_Num is a candidate key

(B) Registration_Num can be a primary key

(C) UID is a candidate key if all students are from the same country

(D) If S is a super key such that S UID is NULL then S UID is also a superkey

gate2011 databases normal

5.186 GATE2005-IT_82a top gateoverflow.in/3847

A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk
blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of
records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block
of records for T2 simultaneously at any point in time. No index is available on either table.

If Nested-loop join algorithm is employed to perform the join, with the most appropriate choice of table to be used in outer
loop, the number of block accesses required for reading the data are

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 350 of 852

A) 800000
B) 40080
C) 32020
D) 100

gate2005-it databases normal

5.187 GATE2005-IT_82b top gateoverflow.in/3848

A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk
blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of
records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block
of records for T2 simultaneously at any point in time. No index is available on either table.

If, instead of Nested-loop join, Block nested-loop join is used, again with the most appropriate choice of table in the outer
loop, the reduction in number of block accesses required for reading the data will be

A) 0
B) 30400
C) 38400
D) 798400

gate2005-it databases normal

5.188 gate feb 7 evn top gateoverflow.in/7996

1) A
2) B
3) C
4) D

5.189 GATE2004-IT_21 top gateoverflow.in/3662

Which level of locking provides the highest degree of concurrency in a relational database ?

A) Page
B) Table
C) Row
D) Page, table and row level locking allow the same degree of concurrency

gate2004-it databases normal

5.190 GATE1994_3.11 top gateoverflow.in/2497

State True or False with reason

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 351 of 852

Logical data independence is easier to achieve than physical data independence

gate1994 databases normal

5.191 GATE2010_43 top gateoverflow.in/2344

The following functional dependencies hold for relations R(A, B, C) and S(B, D, E).

BA
AC
The relation R contains 200 tuples and the relation S contains 100 tuples. What is the maximum number of tuples possible
in the natural join R S?

(A) 100

(B) 200

(C) 300

(D) 2000

gate2010 databases normal

5.192 GATE1994_3.7 top gateoverflow.in/2493

An instance of a relational scheme R(A, B, C) has distinct values for attribute A. Can you conclude that A is a candidate
key for R?

gate1994 databases easy

5.193 GATE2015-2_32 top gateoverflow.in/8151

Consider two relations R1 (A, B) with the tuples (1, 5), (3, 7) and R2 (A, C) = (1, 7), (4, 9). Assume that R(A, B, C) is the
full natural outer join of R1 and R2 . Consider the following tuples of the form (A,B,C):

a = (1, 5, null), b = (1, null, 7), c = (3, null, 9), d = (4, 7, null), e = (1, 5, 7),
f = (3, 7, null), g = (4, null, 9).
Which one of the following statements is correct?

A. R contains a, b, e, f, g but not c, d.


B. R contains all a, b, c, d, e, f, g .
C. R contains e, f, g but not a, b .
D. R contains e but not f, g .

gate2015-2 databases normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 352 of 852

6 Theory of Computation top


6.1 Chomsky Normal Form: GATE1992_02,xviii top gateoverflow.in/576

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

If G is a context free grammar and w is a string of length l in L(G), how long is a derivation of w in G, if G is in Chomsky
normal form?

(a). 2l

(b). 2l + 1

(c). 2l 1

(d). l

gate1992 theory-of-computation context-free chomsky-normal-form easy

6.2 Closure Property: GATE2006-IT_32 top gateoverflow.in/3571

Let L be a context-free language and M a regular language. Then the language L M is

A) always regular
B) never regular
C) always a deterministic context-free language
D) always a context-free language

gate2006-it theory-of-computation closure-property easy

6.3 Closure Property: GATE1999_1.5 top gateoverflow.in/1459

Context-free languages are closed under:

A. Union, intersection

B. Union, Kleene closure

C. Intersection, complement

D. Complement, Kleene closure

gate1999 theory-of-computation context-free closure-property easy

6.4 Closure Property: GATE 2016-2-18 top gateoverflow.in/39574

Consider the following types of languages: L1 : Regular, L2 : Context-free, L3 : Recursive, L4 : Recursively enumerable.
Which of the following is/are TRUE ?

I. L3 L4 is recursively enumerable.
II. L2 L3 is recursive.
III. L1 L2 is context-free.

IV. L1 L2 is context-free.
A. I only.
B. I and III only.
C. I and IV only.
D. I, II and III only.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 353 of 852

gate2016-2 theory-of-computation regular-language context-free closure-property normal

6.5 Closure Property: TIFR2013-B-11 top gateoverflow.in/25772

Which of the following statements is FALSE?

a. The intersection of a context free language with a regular language is context free.
b. The intersection of two regular languages is regular.
c. The intersection of two context free languages is context free
d. The intersection of a context free language and the complement of a regular language is context free.
e. The intersection of a regular language and the complement of a regular language is regular.

tifr2013 theory-of-computation closure-property

6.6 Context Free: GATE2007-IT_49 top gateoverflow.in/3491

Consider the following grammars. Names representing terminals have been specified in capital letters.
G1 : stmnt WHILE (expr) stmnt
stmnt OTHER
expr ID
G2 : stmnt WHILE (expr) stmnt
stmnt OTHER
expr expr + expr
expr expr * expr
expr ID

Which one of the following statements is true?

A) G1 is context-free but not regular and G 2 is regular


B) G2 is context-free but not regular and G 1 is regular
C) Both G1 and G 2 are regular
D) Both G1 and G 2 are context-free but neither of them is regular

gate2007-it theory-of-computation context-free normal

6.7 Context Free: GATE2006-IT_4 top gateoverflow.in/3543

In the context-free grammar below, S is the start symbol, a and b are terminals, and denotes the empty string

S aSa | bSb | a | b |

Which of the following strings is NOT generated by the grammar?

A) aaaa

B) baba

C) abba
D) babaaabab

gate2006-it theory-of-computation context-free easy

6.8 Context Free: GATE2004-IT_41 top gateoverflow.in/3684

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 354 of 852

Let M = (K, , , s, F) be a finite state automaton, where

K = {A, B}, = {a, b}, s = A, F = {B},


(A, a) = A, (A, b) = B, (B, a) = B and (B, b) = A

A grammar to generate the language accepted by M can be specified as G = (V, , R, S), where V = K U , and S = A.
Which one of the following set of rules will make L(G) = L(M) ?

A) {A aB, A bA, B bA, B aA, B )


B) {A aA, A bB, B aB, B bA, B )
C) {A bB, A aB, B aA, B bA, B )
D) {A aA, A bA, B aB, B bA, A )

gate2004-it theory-of-computation finite-automata context-free normal

6.9 Context Free: GATE2006-IT_34 top gateoverflow.in/3573

In the context-free grammar below, S is the start symbol, a and b are terminals, and denotes the empty string.

S aSAb |
A bA |

The grammar generates the language

A) ((a + b)* b)*


B) (ambn | m n}
C) (ambn | m = n)
D) a* b*

gate2006-it theory-of-computation context-free normal

6.10 Context Free: GATE2008-IT_34 top gateoverflow.in/3344

Consider a CFG with the following productions.

S AA | B
A 0A | A0 | 1
B 0B00 | 1

S is the start symbol, A and B are non-terminals and 0 and 1 are the terminals. The language generated by this grammar is

A) {0n 102n | n 1}
B) {0i 10j 10k | i, j, k 0} {0 n 102n | n l}
C) {0i 10j | i, j 0} {0 n 102n | n l}
D) The set of all strings over {0, 1} containing at least two 0's

gate2008-it theory-of-computation context-free normal

6.11 Context Free: GATE2001_1.5 top gateoverflow.in/698

Which of the following statements is true?

(A) If a language is context free it can always be accepted by a deterministic push-down automaton

(B) The union of two context free languages is context free

(C) The intersection of two contest free languages is a context free

(D) The complement of a context free language is a context free

gate2001 theory-of-computation context-free easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 355 of 852

6.12 Context Free: GATE1996_2.8 top gateoverflow.in/2737

If L1 and L2 are context free languages and R a regular set, one of the languages below is not necessarily a context free
language. Which one?

A. L1 . L2

B. L1 L2
C. L1 R
D. L1 L2

gate1996 theory-of-computation context-free easy

6.13 Context Free: GATE2005_57 top gateoverflow.in/1380

Consider the languages:

L1 = {wwR w {0, 1} }
L2 = {w#wR w {0, 1} }, where # is a special symbol
L3 = {ww w {0, 1} }
Which one of the following is TRUE?

A. L1 is a deterministic CFL

B. L2 is a deterministic CFL

C. L3 is a CFL, but not a deterministic CFL

D. L3 is a deterministic CFL

gate2005 theory-of-computation context-free easy

6.14 Context Free: GATE2009_12 top gateoverflow.in/1304

S aSa bSb a b

The language generated by the above grammar over the alphabet {a, b} is the set of

(A) all palindromes

(B) all odd length palindromes

(C) strings that begin and end with the same symbol

(D) all even length palindromes

gate2009 theory-of-computation context-free easy

6.15 Context Free: GATE1999_7 top gateoverflow.in/1506

Show that the language

L = {xcx x {0, 1} and c is a terminal symbol}


is not context free. c is not 0 or 1.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 356 of 852

gate1999 theory-of-computation context-free normal

6.16 Context Free: GATE2006_19 top gateoverflow.in/980

Let

L1 = {0n+m 1n 0m n, m 0},
L2 = {0n+m 1n+m 0m n, m 0} and
L3 = {0n+m 1n+m 0n+m n, m 0}.
Which of these languages are NOT context free?

(A) L1 only
(B) L3 only
(C) L1 and L2
(D) L2 and L 3

gate2006 theory-of-computation context-free normal

6.17 Context Free: GATE2003_51 top gateoverflow.in/940

Let G = ({S} , {a, b} , R, S) be a context free grammar where the rule set R is S aSb SS
Which of the following statements is true?

A. G is not ambiguous
B. There exist x, y L(G) such that xy L(G)
C. There is a deterministic pushdown automaton that accepts L(G)
D. We can find a deterministic finite state automaton that accepts L(G)

gate2003 theory-of-computation context-free normal

6.18 Context Free: GATE1996_2.9 top gateoverflow.in/2738

Define a context free languages L {0, 1} , init(L) = {u uv L for some v in {0, 1}} ( in other words, init(L) is the set
of prefixes of L )

Let L = {w w is nonempty and has an equal number of 0s and 1s}


Then init(L) is

A. the set of all binary strings with unequal number of 0s and 1s

B. the set of all binary strings including null string

C. the set of all binary strings with exactly one more 0 than the number of 1s or one more 1 than the number of 0s

D. None of the above

gate1996 theory-of-computation context-free normal

6.19 Context Free: GATE2007-IT_48 top gateoverflow.in/3490

Consider the grammar given below

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 357 of 852

S x B | y A
A x | x S | y A A
B y | y S | y B B

Consider the following strings.

(i) xxyyx
(ii) xxyyxy
(iii) xyxy
(iv) yxxy
(v) yxx
(vi) xyx

Which of the above strings are generated by the grammar ?

A) (i), (ii), and (iii)


B) (ii), (v), and (vi)
C) (ii), (iii), and (iv)
D) (i), (iii), and (iv)

gate2007-it theory-of-computation context-free normal

6.20 Context Free: GATE 2016-2-43 top gateoverflow.in/39605

Consider the following languages:

L1 = {an bm cn+m : m, n 1}

L2 = {an bn c2n : n 1}

Which one of the following is TRUE?

A. Both L1 and L2 are context-free.


B. L1 is context-free while L2 is not context-free.
C. L2 is context-free while L1 is not context-free.
D. Neither L1 nor L2 is context-free.

gate2016-2 theory-of-computation context-free normal

6.21 Context Free: GATE 2016-1-16 top gateoverflow.in/39640

Which of the following languages is generated by the given grammar?

S aS bS
A. {an bm n, m 0}
B. {w {a, b } w has equal number of a's and b's}
C. {an n 0} {bn n 0} {an bn n 0}
D. {a, b}

gate2016-1 theory-of-computation context-free normal

6.22 Context Free: GATE 2016-1-42 top gateoverflow.in/39705

Consider the following context-free grammars;

G1 : S aS B, B b bB
G2 : S aA bB, A aA B , B bB

G1 G2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 358 of 852

Which one of the following pairs of languages is generaed by G1 and G2 ,respectively?

A. {am bn m > 0 or n > 0} and {am bn m > 0 and n > 0}


B. {am bn m > 0 and n > 0} and {am bn m > 0 or n 0}
C. {am bn m 0 or n > 0} and {am bn m > 0 and n > 0}
D. {am bn m 0 and n > 0} and {am bn m > 0 or n > 0}

gate2016-1 theory-of-computation context-free normal

6.23 Context Free: GATE2015-3_32 top gateoverflow.in/8489

Which of the following languages are context-free?

L1 : {am bn an bm m, n 1}
L2 : {am bn am bn m, n 1}
L3 : {am bn m = 2n + 1}

A. L1 and L2 only
B. L1 and L3 only
C. L2 and L3 only
D. L3 only

gate2015-3 theory-of-computation context-free normal

6.24 Context Free: GATE1992_02,xix top gateoverflow.in/572

02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

(xix) Context-free languages are

a. closed under union


b. closed under complementation
c. closed under intersection
d. closed under Kleene closure

gate1992 context-free theory-of-computation normal

6.25 Decidability: GATE2013_41 top gateoverflow.in/1553

Which of the following is/are undecidable?

1. G is a CFG. Is L(G) = ?
2. G is a CFG. Is L(G) = ?
3. M is a Turing machine. Is L(M) regular?
4. A is a DFA and N is an NFA. Is L(A) = L(N)?

(A) 3 only (B) 3 and 4 only (C) 1, 2 and 3 only (D) 2 and 3 only

gate2013 theory-of-computation decidability normal

6.26 Decidability: TIFR2010-B-25 top gateoverflow.in/18745

Which of the following problems is decidable? (Here, CFG means context free grammar and CFL means context free
language.)

G L(G) = R R

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 359 of 852

A. Give a CFG G, find whether L(G) = R, where R is regular set.


B. Given a CFG G, find whether L(G) = {}.
C. Find whether the intersection of two CFLs is empty.
D. Find whether the complement of CFL is a CFL.
E. Find whether CFG G1 and CFG G2 generate the same language, i.e, L (G1 ) = L (G2 ).

tifr2010 theory-of-computation context-free decidability

6.27 Decidability: GATE1996_1.9 top gateoverflow.in/2713

Which of the following statements is false?

A. The Halting Problem of Turing machines is undecidable

B. Determining whether a context-free grammar is ambiguous is undecidable

C. Given two arbitrary context-free grammars G1 and G2 it is undecidable whether L(G1 ) = L(G2 )
D. Given two regular grammars G1 and G2 it is undecidable whether L(G1 ) = L(G2 )

gate1996 theory-of-computation decidability easy

6.28 Decidability: GATE2008_10 top gateoverflow.in/408

Which of the following are decidable?

I. Whether the intersection of two regular languages is infinite


II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free

A. I and II
B. I and IV
C. II and III
D. II and IV

gate2008 theory-of-computation decidability easy

6.29 Decidability: GATE1997_6.5 top gateoverflow.in/2261

Which one of the following is not decidable?

A. Given a Turing machine M , a string s and an integer k, M accepts s within k steps


B. Equivalence of two given Turing machines
C. Language accepted by a given finite state machine is not empty
D. Language generated by a context free grammar is non-empty

gate1997 theory-of-computation decidability easy

6.30 Decidability: GATE2014-3_35 top gateoverflow.in/2069

Which one of the following problems is undecidable?

(A) Deciding if a given context-free grammar is ambiguous.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 360 of 852

(B) Deciding if a given string is generated by a given context-free grammar.

(C) Deciding if the language generated by a given context-free grammar is empty.

(D) Deciding if the language generated by a given context-free grammar is finite.

gate2014-3 theory-of-computation context-free decidability normal

6.31 Decidability: GATE2007_6 top gateoverflow.in/1204

Which of the following problems is undecidable?

A. Membership problem for CFGs


B. Ambiguity problem for CFGs
C. Finiteness problem for FSAs
D. Equivalence problem for FSAs

gate2007 theory-of-computation decidability normal

6.32 Decidability: GATE2012_24 top gateoverflow.in/1608

Which of the following problems are decidable?

1. Does a given program ever produce an output?


2. If L is a context-free language, then, is L also context-free?
3. If L is a regular language, then, L is also regular?
4. If L is a recursive language, then, is Lalso recursive?

(A) 1, 2, 3, 4
(B) 1, 2
(C) 2, 3, 4
(D) 3, 4

gate2012 theory-of-computation decidability normal

6.33 Decidability: GATE2001_2.7 top gateoverflow.in/725

Consider the following problem X.

Given a Turing machine M over the input alphabet , any state q of M and a word w , does the computation of M on w
visit the state of q?

Which of the following statements about X is correct?

A. X is decidable
B. X is undecidable but partially decidable
C. X is undecidable and not even partially decidable
D. X is not a decision problem

gate2001 theory-of-computation decidability normal

6.34 Decidability: GATE2000_2.9 top gateoverflow.in/656

Consider the following decision problems:

(P1) Does a given finite state machine accept a given string?

(P2) Does a given context free grammar generate an infinite number of strings?

Which of the following statements is true?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 361 of 852

A. Both (P1) and (P2) are decidable


B. Neither (P1) nor (P2) is decidable
C. Only (P1) is decidable
D. Only (P2) is decidable

gate2000 theory-of-computation decidability normal

6.35 Decidability: GATE2015-2_21 top gateoverflow.in/8111

Consider the following statements.

I. The complement of every Turing decidable language is Turing decidable


II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable

Which of the above statements is/are true?

A. Only II
B. Only III
C. Only I and II
D. Only I and III

gate2015-2 theory-of-computation decidability easy

6.36 Decidability: GATE 2016-1-17 top gateoverflow.in/39651

Which of the following decision problems are undecidable?

I. Given NFAs N1 and N2 , is L(N1 ) L(N2 ) =


II. Given a CFG G = (N, , P , S) and a string x , does x L(G)} ?
III. Given CFGs G1 and G2 , is L(G1 ) = L(G2 )?
IV. Given a TM M , is L(M) = ?

A. I and IV only
B. II and III only
C. III and IV only
D. II and IV only

gate2016-1 theory-of-computation decidability easy

6.37 Dfa: GATE 2016-2_16 top gateoverflow.in/39562

The number of states in the minimum sized DFA that accepts the language defined by the regular expression.

(0 + 1) (0 + 1)(0 + 1)

is ________.

gate2016-2 theory-of-computation minimal-state-automata dfa normal numerical-answers

6.38 Finite Automata: GATE 2016-2-42 top gateoverflow.in/39591

Consider the following two statements:

I . If all states of an NFA are accepting states then the language accepted by the NFA is .
II . There exists a regular language A such that for all languages B, A B is regular.
Which one of the following is CORRECT?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 362 of 852

A. Only I is true
B. Only II is true
C. Both I and II are true
D. Both I and II are false

gate2016-2 theory-of-computation finite-automata normal

6.39 Finite Automata: GATE2013_33 top gateoverflow.in/1544

Consider the DFA A given below.

Which of the following are FALSE?

1. Complement of L(A) is context-free.


2. L(A) = L((11 0 + 0)(0 + 1) 0 1 )
3. For the language accepted by A, A is the minimal DFA.
4. A accepts all strings over {0, 1} of length at least 2.

(A) 1 and 3 only

(B) 2 and 4 only

(C) 2 and 3 only

(D) 3 and 4 only

gate2013 theory-of-computation finite-automata normal

6.40 Finite Automata: GATE2009_41 top gateoverflow.in/1327

The above DFA accepts the set of all strings over {0,1} that

A. begin either with 0 or 1.

B. end with 0.

C. end with 00.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 363 of 852

D. contain the substring 00.

gate2009 theory-of-computation finite-automata easy

6.41 Finite Automata: GATE2012_12 top gateoverflow.in/44

What is the complement of the language accepted by the NFA shown below?
Assume = {a} and is the empty string.

(A)
(B) {}
(C) a
(D) {a, }

gate2012 finite-automata easy theory-of-computation

6.42 Finite Automata: GATE2005_63 top gateoverflow.in/1386

The following diagram represents a finite state machine which takes as input a binary number from the least significant bit.

Which of the following is TRUE?

A. It computes 1s complement of the input number

B. It computes 2s complement of the input number

C. It increments the input number

D. it decrements the input number

gate2005 theory-of-computation finite-automata easy

6.43 Finite Automata: GATE2014-1_16 top gateoverflow.in/1782

Consider the finite automaton in the following figure:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 364 of 852

What is the set of reachable states for the input string 0011?

(A) {q0 , q1 , q2 }

(B) {q0 , q1 }

(C) {q0 , q1 , q2 , q3 }

(D) {q3 }

gate2014-1 theory-of-computation finite-automata easy

6.44 Finite Automata: GATE1997_21 top gateoverflow.in/2281

Given that L is a language accepted by a finite state machine, show that LP and LR are also accepted by some finite state
machines, where

LP = {s ss L some string s }

LR = {s s obtained by reversing some string in L}


gate1997 theory-of-computation finite-automata proof

6.45 Finite Automata: GATE2005_53 top gateoverflow.in/1376

Consider the machine M:

The language recognized by M is:

A. {w {a, b} | every a in w is followed by exactly two bs}


B. {w {a, b} | every a in w is followed by at least two bs}
C. {w {a, b} | w contains the substring abb}
D. {w {a, b} | w does not contain aa as a substring}

gate2005 theory-of-computation finite-automata normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 365 of 852

6.46 Finite Automata: GATE1998_1.10 top gateoverflow.in/1647

Which of the following set can be recognized by a Deterministic Finite state Automaton?

A. The numbers 1, 2, 4, 8, 2n , written in binary

B. The numbers 1, 2, 4, 8, 2n , written in unary

C. The set of binary string in which the number of zeros is the same as the number of ones.

D. The set {1, 101, 11011, 1110111, }

gate1998 theory-of-computation finite-automata normal

6.47 Finite Automata: GATE1995_2.23 top gateoverflow.in/2636

A finite state machine with the following state table has a single input x and a single out z.
next state, z
present state
x=1 x=0
A D, 0 B, 0
B B, 1 C, 1
C B, 0 D, 1
D B, 1 C, 0

If the initial state is unknown, then the shortest input sequence to reach the final state C is:

A. 01
B. 10
C. 101
D. 110

gate1995 theory-of-computation finite-automata normal

6.48 Finite Automata: GATE2007-IT_71 top gateoverflow.in/3523

Consider the regular expression R = (a + b)* (aa + bb) (a + b)*

Which of the following non-deterministic finite automata recognizes the language defined by the regular expression R? Edges
labeled denote transitions on the empty string.

A)

B)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 366 of 852

C)

D)

gate2007-it theory-of-computation finite-automata normal

6.49 Finite Automata: GATE2015-3_18 top gateoverflow.in/8415

Let L be the language represented by the regular expression 0011 where = {0, 1}. What is the minimum number of
states in a DFA that recognizes L (complement of L)?

A. 4
B. 5
C. 6
D. 8

gate2015-3 theory-of-computation finite-automata normal

6.50 Finite Automata: GATE2007-IT_50 top gateoverflow.in/3492

Consider the following finite automata P and Q over the alphabet {a, b, c}. The start states are indicated by a double arrow
and final states are indicated by a double circle. Let the languages recognized by them be denoted by L(P) and L(Q)
respectively.

The automation which recognizes the language L(P) L(Q) is :

A)

B)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 367 of 852

C)

D)

gate2007-it theory-of-computation finite-automata normal

6.51 Finite Automata: GATE2007-IT_72 top gateoverflow.in/3524

Consider the regular expression R = (a + b)* (aa + bb) (a + b)*

Which deterministic finite automaton accepts the language represented by the regular expression R ?

A)

B)

C)

D)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 368 of 852

gate2007-it theory-of-computation finite-automata normal

6.52 Finite Automata: GATE2006-IT_3 top gateoverflow.in/3542

In the automaton below, s is the start state and t is the only final state.

Consider the strings u = abbaba, v = bab, and w = aabb. Which of the following statements is true?

A) The automaton accepts u and v but not w


B) The automaton accepts each of u, v, and w
C) The automaton rejects each of u, v, and w
D) The automaton accepts u but rejects v and w

gate2006-it theory-of-computation finite-automata normal

6.53 Finite Automata: GATE2006-IT_37 top gateoverflow.in/3576

For a state machine with the following state diagram the expression for the next state S + in terms of the current state S and
the input variables x and y is

A) S+ = S' . y' + S . x
B) S+ = S. x . y' + S' . y . x'
C) S+ = x . y'
D) S+ = S' . y + S . x'

gate2006-it theory-of-computation finite-automata normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 369 of 852

6.54 Finite Automata: GATE2015-1_52 top gateoverflow.in/8362

Consider the DFAs M and N given above. The number of states in a minimal DFA that accept the language L(M) L(N)
is_____________.

gate2015-1 theory-of-computation finite-automata easy

6.55 Finite Automata: GATE2009_27 top gateoverflow.in/1313

Given the following state table of an FSM with two states A and B,one input and one output.

PRESENT PRESENT Next Next


Input Output
STATE A STATE B State A State B

0 0 0 0 0 1
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 1 0 0
0 0 1 0 1 0
0 1 1 0 0 1
1 0 1 0 1 1
1 1 1 0 0 1

If the initial state is A=0 ,B=0 what is the minimum length of an input string which will take the machine to the state
A=0,B=1 with output=1.

(A)3 (B)4 (C)5 (D)6

gate2009 theory-of-computation finite-automata normal

6.56 Finite Automata: GATE2007-IT_47 top gateoverflow.in/3489

Consider the following DFA in which s 0 is the start state and s 1, s3 are the final states.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 370 of 852

What language does this DFA recognize ?

A) All strings of x and y


B) All strings of x and y which have either even number of x and even number of y or odd number or x and odd number of y
C) All strings of x and y which have equal number of x and y
D) All strings of x and y with either even number of x and odd number of y or odd number of x and even number of y

gate2007-it theory-of-computation finite-automata normal

6.57 Finite Automata: GATE2005-IT_37 top gateoverflow.in/3784

Consider the non-deterministic finite automaton (NFA) shown in the figure.

State X is the starting state of the automaton. Let the language accepted by the NFA with Y as the only accepting state be
L1. Similarly, let the language accepted by the NFA with Z as the only accepting state be L2. Which of the following
statements about L1 and L2 is TRUE?

A) L1 = L2
B) L1 L2
C) L2 L1
D) None of the above

gate2005-it theory-of-computation finite-automata normal

6.58 Finite Automata: GATE1994_3.3 top gateoverflow.in/2480

State True or False with one line explanation

A FSM (Finite State Machine) can be designed to add two integers of any arbitrary length (arbitrary number of digits).

gate1994 theory-of-computation finite-automata normal

6.59 Finite Automata: GATE2010_41 top gateoverflow.in/2342

Let w be the any string of length n in {0, 1} . Let L be the set of all substrings of w . What is the minimum number of states in non-
deterministic finite automation that accepts L?

(A) n 1

(B) n

(C) n + 1

(D) 2n1

gate2010 theory-of-computation finite-automata normal

6.60 Finite Automata: GATE 2008 TOC question top gateoverflow.in/36592

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 371 of 852

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 372 of 852

gate2008 theory-of-computation finite-automata

6.61 Finite Automata: GATE1996_12 top gateoverflow.in/2764

Given below are the transition diagrams for two finite state machines M1 and M2 recognizing languages L1 and L2
respectively.

a. Display the transition diagram for a machine that recognizes L1 . L2 , obtained from transition diagrams for M1 and M2
by adding only transitions and no new states.

b. Modify the transition diagram obtained in part (a) obtain a transition diagram for a machine that recognizes (L1 . L2 )
by adding only transitions and no new states.

(Final states are enclosed in double circles).

gate1996 theory-of-computation finite-automata normal

6.62 Finite Automata: GATE2008-IT_36 top gateoverflow.in/3346

Consider the following two finite automata. M 1 accepts L 1 and M 2 accepts L 2.


Which one of the following is TRUE?

A) L1 = L 2
B) L1 L2
C) L1 L2' =
D) L1 L2 L 1

gate2008-it theory-of-computation finite-automata normal

6.63 Finite Automata: GATE2008-IT_32 top gateoverflow.in/3342

If the final states and non-final states in the DFA below are interchanged, then which of the following languages over the
alphabet {a, b} will be accepted by the new DFA?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 373 of 852

A) Set of all strings that do not end with ab


B) Set of all strings that begin with either an a or a b
C) Set of all strings that do not contain the substring ab,
D) The set described by the regular expression b*aa*(ba)*b*

gate2008-it theory-of-computation finite-automata normal

6.64 Finite Automata: GATE1993_27 top gateoverflow.in/2323

Draw the state transition of a deterministic finite state automaton which accepts all strings from the alphabet {a, b}, such
that no string has 3 consecutive occurrences of the letter b.

gate1993 theory-of-computation finite-automata easy

6.65 Finite Automata: GATE2012_46 top gateoverflow.in/2159

Consider the set of strings on {0, 1} in which, every substring of 3 symbols has at most two zeros. For example, 001110 and
011001 are in the language, but 100010 is not. All strings of length less than 3 are also in the language. A partially
completed DFA that accepts this language is shown below.

The missing arcs in the DFA are

(A)
00 01 10 11 q

00 1 0

01 1

10 0

11 0

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 374 of 852

(B)
00 01 10 11 q

00 0 1
01 1

10 0

11 0

(C)
00 01 10 11 q

00 1 0
01 1

10 0

11 0

(D)
00 01 10 11 q

00 1 0
01 1

10 0

11 0

gate2012 theory-of-computation finite-automata normal

6.66 Finite Automata: GATE2003_50 top gateoverflow.in/939

Consider the following deterministic finite state automaton M.

Let S denote the set of seven bit binary strings in which the first, the fourth, and the last bits are 1. The number of strings in
S that are accepted by M is

A. 1
B. 5
C. 7
D. 8

gate2003 theory-of-computation finite-automata normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 375 of 852

6.67 Finite Automata: GATE2004_86 top gateoverflow.in/1080

The following finite state machine accepts all those binary strings in which the number of 1s and 0s are respectively

A. divisible by 3 and 2

B. odd and even

C. even and odd

D. divisible by 2 and 3

gate2004 theory-of-computation finite-automata easy

6.68 Finite Automata: GATE2008_49 top gateoverflow.in/462

Given below are two finite state automata ( indicates the start state and F indicates a final state)

Y:

a b
1 1 2
2 (F) 2 1

Z:

a b
1 2 2
2(F) 1 1

Which of the following represents the product automaton Z Y ?

A.
a b
P S R
Q R S
R(F) Q P
S Q P

B.
a b
P S Q
Q R S
R(F) Q P
S P Q

C.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 376 of 852

a b
P Q S
Q R S
R(F) Q P
S Q P

D.
a b
P S Q
Q S R
R(F) Q P
S Q P

gate2008 normal theory-of-computation finite-automata

6.69 Finite Automata: GATE2008_52 top gateoverflow.in/464

Match the following NFAs with the regular expressions they correspond to


1. + 0(01 1 + 00) 01

2. + 0(10 1 + 00) 0

3. + 0(10 1 + 10) 1

4. + 0(10 1 + 10) 10

A. P-2, Q-1, R-3, S-4


B. P-1, Q-3, R-2, S-4
C. P-1, Q-2, R-3, S-4
D. P-3, Q-2, R-1, S-4

gate2008 theory-of-computation finite-automata normal

6.70 Finite Automata: GATE2003_55 top gateoverflow.in/943

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 377 of 852

Consider the NFA M shown below.

Let the language accepted by M be L. Let L1 be the language accepted by the NFA M1 obtained by changing the accepting
state of M to a non-accepting state and by changing the non-accepting states of M to accepting states. Which of the
following statements is true?

A. L1 = {0, 1} L
B. L1 = {0, 1}
C. L1 L
D. L1 =L

gate2003 theory-of-computation finite-automata normal

6.71 Identify Class Language: GATE2013_32 top gateoverflow.in/1543

Consider the following languages.

L1 = {0p 1q 0r p, q, r 0}
L2 = {0p 1q 0r p, q, r 0, p r}
Which one of the following statements is FALSE?

(A) L2 is context-free.
(B) L1 L2 is context-free.
(C) Complement of L2 is recursive.
(D) Complement of L1 is context-free but not regular.

gate2013 theory-of-computation identify-class-language normal

6.72 Identify Class Language: TIFR2010-B-22 top gateoverflow.in/18622

Let L consist of all binary strings beginning with a 1 such that its value when converted to decimal is divisible by 5. Which of
the following is true?

a. L can be recognized by a deterministic finite state automaton.


b. L can be recognized by a non-deterministic finite state automaton but not by a deterministic finite state automaton.
c. L can be recognized by a deterministic push-down automaton but not by a non-deterministic finite state automaton.
d. L can be recognized by a non-deterministic push-down automaton but not by a deterministic push-down automaton.
e. L cannot be recognized by any push-down automaton.

tifr2010 theory-of-computation identify-class-language

6.73 Identify Class Language: TIFR2015-B-10 top gateoverflow.in/30039

Consider the languages

L1 = {am bn cp (m = n n = p) m + n + p 10}
L2 = {am bn cp (m = n n = p) m + n + p 10}
State which of the following is true?

L1 L2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 378 of 852

A. L1 and L2 are both regular.


B. Neither L1 nor L2 is regular.
C. L1 is regular and L2 is not regular.
D. L1 is not regular and L2 is regular.
E. Both L1 and L2 are infinite.

tifr2015 regular-set identify-class-language

6.74 Identify Class Language: GATE2014-3_36 top gateoverflow.in/2070

Consider the following languages over the alphabet = {0, 1, c}


L1 = {0n 1n n 0}
L2 = {wcwr w {0, 1} }
L3 = {wwr w {0, 1} }
Here, wr is the reverse of the string w. Which of these languages are deterministic Context-free languages?

(A) None of the languages

(B) Only L1

(C) Only L1 and L2

(D) All the three languages

gate2014-3 theory-of-computation identify-class-language context-free normal

6.75 Identify Class Language: TIFR2014-B-13 top gateoverflow.in/27320

L e t L be a given context-free language over the alphabet {a, b}. Construct L1 , L2 as follows. Let
L1 = L {xyx x, y {a, b} }, and L2 = L L. Then,
a. Both L1 and L2 are regular.
b. Both L1 and L2 are context free but not necessarily regular.
c. L1 is regular and L2 is context free.
d. L1 and L2 both may not be context free.
e. L1 is regular but L2 may not be context free.

tifr2014 theory-of-computation identify-class-language

6.76 Identify Class Language: GATE2011_26 top gateoverflow.in/2128

Consider the languages L1, L2 and L3 as given below.


L1 = {0p 1q p, q N},
L2 = {0p 1q p, q N and p = q} and
L3 = {0p 1q 0r p, q, r N and p = q = r}.
Which of the following statements is NOT TRUE?

(A) Push Down Automata (PDA) can be used to recognize L1 and L2

(B) L1 is a regular language

(C) All the three languages are context free

(D) Turing machines can be used to recognize all the languages

gate2011 theory-of-computation identify-class-language normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 379 of 852

6.77 Identify Class Language: TIFR2015-B-8 top gateoverflow.in/29865

Let 1 = {a} be a one letter alphabet and 2 = {a, b} be a two letter alphabet. A language over an alphabet is a set of
finite length words comprising letters of the alphabet. Let L1 and L2 be the set of languages over 1 and 2 respectively.
Which of the following is true about L1 and L2 :

a. Both are finite.


b. Both are countably infinite.
c. L1 is countable but L2 is not.
d. L2 is countable but L1 is not.
e. Neither of them is countable.

tifr2015 identify-class-language

6.78 Identify Class Language: GATE1999_2.4 top gateoverflow.in/1482

Multiple choices may be correct:

If L1 is context free language and L2 is a regular language which of the following is/are false?

A. L1 L2 is not context free

B. L1 L2 is context free

C. L1 is context free
D. L2 is regular

gate1999 theory-of-computation identify-class-language normal

6.79 Identify Class Language: GATE2010_40 top gateoverflow.in/2341

Consider the languages

L1 = { 0i 1j i j},

L2 = { 0i 1j i = j},

L3 = { 0i 1j i = 2j + 1},

L4 = { 0i 1j i 2j}

(A) Only L2 is context free.

(B) Only L2 and L3 are context free.

(C) Only L1 and L2 are context free.

(D) All are context free

gate2010 theory-of-computation context-free identify-class-language normal

6.80 Identify Class Language: TIFR2012-B-18 top gateoverflow.in/25216

Let ai denote a sequence a. a. . . a with i letters and let be the set of natural numbers 1, 2, . . . . Let L1 = {ai b2i i }
= {ai bi i } be two languages. Which of the following is correct?
2
and L2

a. Both L1 and L2 are context-free languages.


L1 L2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 380 of 852

b. L1 is context-free and L2 is recursive but not context-free.


c. Both L1 and L2 are recursive but not context-free.
d. L1 is regular and L2 is context-free.
e. Complement of L2 is context-free.

tifr2012 theory-of-computation identify-class-language

6.81 Identify Class Language: TIFR2010-B-35 top gateoverflow.in/19247

Consider the following languages over the alphabet {0, 1}.

L1 = {x. xR x {0, 1} }

L2 = {x. x x {0, 1} }

Where xR is the reverse of string x; e.g. 011R = 110. Which of the following is true?
a. Both L1 and L2 are regular.
b. L1 is context-free but not regular where as L2 is regualr.
c. Both L1 and L2 are context free and neither is regular.
d. L1 is context free but L2 is not context free.
e. Both L1 and L2 are not context free.

tifr2010 theory-of-computation identify-class-language

6.82 Identify Class Language: GATE1994_19 top gateoverflow.in/2515

(a) Given a set

S = {x there is an x-block of 5's in the decimal expansion of }


(Note: x-block is a maximal block of x successive 5's)

Which of the following statements is true with respect to S? No reason to be given for the answer.

i. S is regular
ii. S is recursively enumerable
iii. S is not recursively enumerable
iv. S is recursive

(b) Given that a language L1 is regular and and that the language L1 L2 is regular, is the language L2 always regular?
Prove your answer.

gate1994 theory-of-computation identify-class-language normal

6.83 Identify Class Language: GATE2005_55 top gateoverflow.in/1378

Consider the languages:

L1 = {an bn cm n, m > 0} and L2 = {an bm cm n, m > 0}


Which one of the following statements is FALSE?

A. L1 L2 is a context-free language
B. L1 L2 is a context-free language
C. L1 and L2 are context-free languages

D. L1 L2 is a context sensitive language


gate2005 theory-of-computation identify-class-language normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 381 of 852

6.84 Minimal State Automata: GATE1997_70 top gateoverflow.in/19700

Following is a state table for time finite state machine.

Next State Output


Present State
Input - 0 Input - 1

A B.1 H.1

B F.1 D.1

C D.0 E.1

D C.0 F.1

E D.1 C.1

F C.1 C.1

G C.1 D.1

H C.0 A.1

a. Find the equivalence partition on the states of the machine.

b. Give the state table for the minimal machine. (Use appropriate names for the equivalent states. For example if states X
and Y are equivalent then use XY as the name for the equivalent state in the minimal machine).

gate1997 theory-of-computation minimal-state-automata

6.85 Minimal State Automata: GATE2011_45 top gateoverflow.in/2147

A deterministic finite automaton (DFA) D with alphabet = {a, b} is given below.

Which of the following finite state machines is a valid minimal DFA which accepts the same languages as D?

(A)

(B)

(C)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 382 of 852

(D)

gate2011 theory-of-computation minimal-state-automata easy

6.86 Minimal State Automata: GATE2001_1.6 top gateoverflow.in/699

Given an arbitrary non-deterministic finite automaton (NFA) with N states, the maximum number of states in an equivalent
minimized DFA at least

(A) N 2

(B) 2N

(C) 2N

(D) N!

gate2001 minimal-state-automata theory-of-computation easy

6.87 Minimal State Automata: GATE2011_42 top gateoverflow.in/2144

Definition of a language L with alphabet {a} is given as following.

L = {ank k > 0, and n is a positive integer constant}

What is the minimum number of states needed in a DFA to recognize L?


(A) k + 1

(B) n + 1

(C) 2n+1

(D) 2k+1

gate2011 theory-of-computation minimal-state-automata normal

6.88 Minimal State Automata: GATE2006_34 top gateoverflow.in/1291

Consider the regular language L = (111 + 11111) . The minimum number of states in any DFA accepting this languages
is:

(A) 3
(B) 5
(C) 8
(D) 9

gate2006 theory-of-computation minimal-state-automata normal

6.89 Minimal State Automata: GATE2007-75 top gateoverflow.in/43514

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 383 of 852

Consider the following Finite State Automaton

The minimum state automaton equivalent to the above FSA has the following number of states

A. 1
B. 2
C. 3
D. 4

normal gate2007 theory-of-computation finite-automata minimal-state-automata

6.90 Minimal State Automata: GATE2002_2.13 top gateoverflow.in/843

The smallest finite automaton which accepts the language {x | length of x is divisible by 3} has

A. 2 states
B. 3 states
C. 4 states
D. 5 states

gate2002 theory-of-computation normal minimal-state-automata

6.91 Minimal State Automata: GATE1996_2.23 top gateoverflow.in/2752

Consider the following state table for a sequential machine. The number of states in the minimized machine will be

Input
0 1
A D, 0 B, 1
B A, 0 C, 1
Present State
C A, 0 B, 1
D A, 1 C, 1
Next state, Output

A. 4
B. 3
C. 2
D. 1

gate1996 theory-of-computation minimal-state-automata normal

6.92 Minimal State Automata: GATE1998_4 top gateoverflow.in/1695

Design a deterministic finite state automaton (using minimum number of states) that recognizes the following language:

L = {w {0, 1} w interpreted as binary number (ignoring the leading zeros) is divisible by five }.
gate1998 theory-of-computation minimal-state-automata normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 384 of 852

6.93 Minimal State Automata: GATE2001_2.5 top gateoverflow.in/723

Consider a DFA over = {a, b} accepting all strings which have number of a's divisible by 6 and number of b's divisible by
8. What is the minimum number of states that the DFA will have?

(A) 8

(B) 14

(C) 15

(D) 48

gate2001 theory-of-computation minimal-state-automata

6.94 Minimal State Automata: GATE2002_21 top gateoverflow.in/874

We require a four state automaton to recognize the regular expression (a/b)*abb

a. Give an NFA for this purpose


b. Give a DFA for this purpose

gate2002 theory-of-computation minimal-state-automata normal

6.95 Minimal State Automata: GATE1997_20 top gateoverflow.in/2280

Construct a finite state machine with minimum number of states, accepting all strings over (a,b) such that the number of a's
is divisible by two and the number of b's is divisible by three.

gate1997 theory-of-computation finite-automata minimal-state-automata normal

6.96 Minimal State Automata: GATE2005-IT_39 top gateoverflow.in/3786

Consider the regular grammar:

S Xa | Ya
X Za
Z Sa |
Y Wa
W Sa

where S is the starting symbol, the set of terminals is {a} and the set of non-terminals is {S, W, X, Y, Z}.
We wish to construct a deterministic finite automaton (DFA) to recognize the same language. What is the minimum number
of states required for the DFA?

A) 2
B) 3
C) 4
D) 5

gate2005-it theory-of-computation minimal-state-automata normal

6.97 Minimal State Automata: GATE1991_17,b top gateoverflow.in/544

Let L be the language of all binary strings in which the third symbol from the right is a 1. Give a non-deterministic finite
automaton that recognizes L . How many states does the minimized equivalent deterministic finite automaton have? Justify
your answer briefly?

gate1991 theory-of-computation minimal-state-automata normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 385 of 852

6.98 Minimal State Automata: GATE2007-74 top gateoverflow.in/1270

Consider the following Finite State Automaton:

74. The language accepted by this automaton is given by the regular expression

A. b a b a b a b

B. (a + b)

C. b a(a + b )

D. b a b a b

gate2007 theory-of-computation minimal-state-automata finite-automata normal

6.99 Minimal State Automata: GATE1998_2.5 top gateoverflow.in/1677

Let L be the set of all binary strings whose last two symbols are the same. The number of states in the minimal state
deterministic finite state automaton accepting L is

A. 2
B. 5
C. 8
D. 3

gate1998 theory-of-computation minimal-state-automata normal

6.100 Minimal State Automata: GATE2007_29 top gateoverflow.in/1227

A minimum state deterministic finite automaton accepting the language


L = {w w {0, 1} , number of 0s and 1s in w are divisible by 3 and 5, respectively} has

A. 15 states
B. 11 states
C. 10 states
D. 9 states

gate2007 theory-of-computation minimal-state-automata normal

6.101 Minimal State Automata: GATE1999_1.4 top gateoverflow.in/1458

Consider the regular expression (0 + 1)(0 + 1) N times. The minimum state finite automaton that recognizes the
language represented by this regular expression contains

A. n states
B. n + 1 states
C. n + 2 states
D. None of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 386 of 852

gate1999 theory-of-computation minimal-state-automata easy

6.102 Minimal State Automata: GATE2015-2_53 top gateoverflow.in/8256

The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0 + 1) (10) is
_____.

gate2015-2 theory-of-computation minimal-state-automata normal

6.103 Myhill Nerode: GATE2006-IT_29 top gateoverflow.in/3568

Consider the regular grammar below

S bS | aA |
A aS | bA

The Myhill-Nerode equivalence classes for the language generated by the grammar are

A) {w (a + b)* | #a(w) is even) and {w (a + b)* | #a(w) is odd}


B) {w (a + b)* | #a(w) is even) and {w (a + b)* | #b(w) is odd}
C) {w (a + b)* | #a(w) = #b(w) and {w (a + b)* | #a(w) #b(w)}
D) {}, {wa | w (a + b)* and {wb | w (a + b)*}

gate2006-it theory-of-computation regular-set myhill-nerode normal

6.104 Pda: GATE1998_13 top gateoverflow.in/1727

Let M = ({q0 , q1 }, {0, 1}, {z0 , X}, , q0 , z0 , ) be a Pushdown automation where is given by
(q0 , 1, z0 ) = {(q0 , xz0 )}
(q0 , , z0 ) = {(q0 , )}
(q0 , 1, X) = {(q0 , XX)}
(q1 , 1, X) = {(q1 , )}
(q0 , 0, X) = {(q1 , X)}
(q0 , 0, z0 ) = {(q0 , z0 )}z
a. What is the language accepted by this PDA by empty stack?

b. Describe informally the working of the PDA

gate1998 theory-of-computation pda descriptive

6.105 Pda: GATE 2015 Set 1 top gateoverflow.in/26961

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 387 of 852

..

theory-of-computation pda

6.106 Pda: GATE2006-IT_33 top gateoverflow.in/3572

Consider the pushdown automaton (PDA) below which runs over the input alphabet (a, b, c). It has the stack alphabet {Z 0,
X} where Z0 is the bottom-of-stack marker. The set of states of the PDA is (s, t, u, f} where s is the start state and f is the
final state. The PDA accepts by final state. The transitions of the PDA given below are depicted in a standard manner. For
example, the transition (s, b, X) (t, XZ 0) means that if the PDA is in state s and the symbol on the top of the stack is X,
then it can read b from the input and move to state t after popping the top of stack and pushing the symbols Z 0 and X (in
that order) on the stack.

(s, a, Z0) (s, XXZ 0)


(s, , Z0) (f, )
(s, a, X) (s, XXX)
(s, b, X) (t, )
(t, b, X) (t,.)
(t, c, X) (u, )
(u, c, X) (u, )
(u, , Z0) (f, )

The language accepted by the PDA is

A) {albmcn | l = m = n}
B) {albmcn | l = m}
C) {albmcn | 2l = m + n}
D) {albmcn | m = n}

gate2006-it theory-of-computation pda normal

6.107 Pda: GATE2015-1_51 top gateoverflow.in/8357

Consider the NPDA

Q = {q0 , q1 , q2 } , = {0, 1} , = {0, 1, } , , q0 , , F = {q2 }


, where (as per usual convention) Q is the set of states, is the input alphabet, is the stack alphabet, is the state
transition function q0 is the initial state, is the initial stack symbol, and F is the set of accepting states. The state
transition is as follows:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 388 of 852

Which one of the following sequences must follow the string 101100 so that the overall string is accepted by the automaton?

A. 10110
B. 10010
C. 01010
D. 01001

gate2015-1 theory-of-computation pda normal

6.108 Pda: GATE1996_13 top gateoverflow.in/2765

Let Q = ({q1 , q2 } , {a, b} , {a, b, } , , , ) be a pushdown automaton accepting by empty stack for the language which is
the set of all nonempty even palindromes over the set {a, b}. Below is an incomplete specification of the transitions .
Complete the specification. The top of the stack is assumed to be at the right end of the string representing stack contents.

1. (q1 , a, ) = {(q1 , a)}


2. (q1 , b, ) = {(q1 , b)}
3. (q1 , a, a) = {(q1 , aa)}
4. (q1 , b, a) = {(q1 , ab)}
5. (q1 , a, b) = {(q1 , ba)}
6. (q1 , b, b) = {(q1 , bb)}
7. (q1 , a, a) = {( , )}
8. (q1 , b, b) = {( , )}
9. (q2 , a, a) = {(q2 , )}
10. (q2 , b, b) = {(q2 , )}
11. (q2 , , ) = {(q2 , )}

gate1996 theory-of-computation pda normal

6.109 Pda: GATE2004-IT_40 top gateoverflow.in/3683

Let M = (K, , , , s, F) be a pushdown automaton, where

K = (s, f), F = {f}, = {a, b}, = {a} and


= {((s, a, ), (s, a)), ((s, b, ), (s, a)), (( s, a, ), (f, )), ((f, a, a), (f, )), ((f, b, a), (f, ))}.

Which one of the following strings is not a member of L(M)?

A) aaa
B) aabab
C) baaba
D) bab

gate2004-it theory-of-computation pda normal

6.110 Pda: GATE2005-IT_38 top gateoverflow.in/3785

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 389 of 852

Let P be a non-deterministic push-down automaton (NPDA) with exactly one state, q, and exactly one symbol, Z, in its stack
alphabet. State q is both the starting as well as the accepting state of the PDA. The stack is initialized with one Z before the
start of the operation of the PDA. Let the input alphabet of the PDA be . Let L(P) be the language accepted by the PDA by
reading a string and reaching its accepting state. Let N(P) be the language accepted by the PDA by reading a string and
emptying its stack.
Which of the following statements is TRUE?

A) L(P) is necessarily * but N(P) is not necessarily *.


B) N(P) is necessarily * but L(P) is not necessarily *.
C) Both L(P) and N(P) are necessarily *.
D) Neither L(P) nor N(P) are necessarily *

gate2005-it theory-of-computation pda normal

6.111 Pda: GATE 2016-1-43 top gateoverflow.in/39732

Consider the transition diagram of a PDA given below with input alphabet = {a, b} and stack alphabet = {X, Z}. Z is
the initial stack symbol. Let L denote the language accepted by the PDA

Which one of the following is TRUE?

A. L = {an bn n 0} and is not accepted by any finite automata


B. L = {an n 0} {an bn n 0} and is not accepted by any deterministic PDA
C. L is not accepted by any Turing machine that halts on every input
D. L = {an n 0} {an bn n 0} and is deterministic context-free

gate2016-1 theory-of-computation pda normal

6.112 Pda: GATE1999_1.6 top gateoverflow.in/377

Let L 1 be the set of all languages accepted by a PDA by final state and L 2 the set of all languages accepted by empty stack.
Which of the following is true?

A) L1 = L 2

B) L1 L2

C) L1 L2

D) None

There are two modes of acceptance of DPDA - final state and empty stack. For languages accepted by empty stack there is a
prefix property. Explain in simple terms about this property and its importance.

pda normal theory-of-computation gate1999

6.113 Pda: GATE1997_6.6 top gateoverflow.in/2262

Which of the following languages over {a, b, c} is accepted by a deterministic pushdown automata?

(A) {wcwR w {a, b} }

(B) {wwR w {a, b, c} }

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 390 of 852

(C) {an bn cn n 0}

(D) {w w is a palindrome over {a, b, c}}

Note: wR is the string obtained by reversing w .

gate1997 theory-of-computation pda easy

6.114 Pda: GATE2006-IT_31 top gateoverflow.in/3570

Which of the following languages is accepted by a non-deterministic pushdown automaton (PDA) but NOT by a deterministic
PDA?

A) {an bn cn n 0}

B) {al bm cn l m or m n}

C) {an bn n 0}
D) {am bn m, n 0}

gate2006-it theory-of-computation pda normal

6.115 Pumping Lemma: GATE2005-IT_40 top gateoverflow.in/3787

A language L satisfies the Pumping Lemma for regular languages, and also the Pumping Lemma for context-free languages.
Which of the following statements about L is TRUE?

A) L is necessarily a regular language.


B) L is necessarily a context-free language, but not necessarily a regular language.
C) L is necessarily a non-regular language.
D) None of the above

gate2005-it theory-of-computation pumping-lemma easy

6.116 Recursive Recursively Enumerable: TIFR2012-B-19 top gateoverflow.in/25218

Which of the following statements is TRUE?

a. Every turning machine recognizable language is recursive.


b. The complement of every recursively enumerable language is recursively enumerable.
c. The complement of a recursive language is recursively enumerable.
d. The complement of a context-free language is context-free.
e. The set of turning machines which do not halt on empty input forms a recursively enumerable set.

tifr2012 theory-of-computation recursive-recursively-enumerable

6.117 Recursive Recursively Enumerable: TIFR2010-B-40 top gateoverflow.in/19048

Which of the following statement is FALSE?

a. All recursive sets are recursively enumerable.


b. The complement of every recursively enumerable sets is recursively enumerable.
c. Every Non-empty recursively enumerable set is the range of some totally recursive function.
d. All finite sets are recursive.
e. The complement of every recursive set is recursive.

tifr2010 theory-of-computation recursive-recursively-enumerable

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 391 of 852

6.118 Recursive Recursively Enumerable: GATE2005_56 top gateoverflow.in/1379

Let L 1 be a recursive language, and let L 2 be a recursively enumerable but not a recursive language. Which one of the
following is TRUE?

A. L1' is recursive and L 2' is recursively enumerable


B. L1' is recursive and L 2' is not recursively enumerable
C. L1' and L 2' are recursively enumerable
D. L1' is recursively enumerable and L 2' is recursive

gate2005 theory-of-computation recursive-recursively-enumerable decidability easy

6.119 Recursive Recursively Enumerable: GATE2015-1_3 top gateoverflow.in/8019

For any two languages L1 and L2 such that L1 is context-free and L2 is recursively enumerable but not recursive, which of
the following is/are necessarily true?

I. L1 ( Compliment of L1 ) is recursive
II. L2 ( Compliment of L2 ) is recursive
III. L1 is context-free
IV. L1 L2 is recursively enumerable

A. I only
B. III only
C. III and IV only
D. I and IV only

gate2015-1 theory-of-computation recursive-recursively-enumerable normal

6.120 Recursive Recursively Enumerable: GATE 2016-1-44 top gateoverflow.in/39721

Let X be a recursive language and Y be a recursively enumerable but not recursive language. Let W and Z be two

languages such that Y reduces to W , and Z reduces to X (reduction means the standard many-one reduction). Which one
of the following statements is TRUE?

A. W can be recursively enumerable and Z is recursive.


B. W can be recursive and Z s recursively enumerable.
C. W is not recursively enumerable and Z is recursive.
D. W is not recursively enumerable and Z is not recursive.

gate2016-1 theory-of-computation recursive-recursively-enumerable easy

6.121 Recursive Recursively Enumerable: GATE 2016-2-44 top gateoverflow.in/39596

Consider the following languages.

L1 = {M M takes at least 2016 steps on some input},


L2 = {M M takes at least 2016 steps on all inputs} and
L3 = {M M accepts },
where for each Turing machine M, M denotes a specific encoding of M . Which one of the following is TRUE?

A. L1 is recursive and L2 , L3 are not recursive


B. L2 is recursive and L1 , L3 are not recursive

L1 , L2 L3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 392 of 852

C. L1 , L2 are recursive and L3 is not recursive


D. L1 , L2 , L3 are recursive

gate2016-2 theory-of-computation recursive-recursively-enumerable normal

6.122 Recursive Recursively Enumerable: GATE2014-2_16 top gateoverflow.in/1972

Let A m B denotes that language A is mapping reducible (also known as many-to-one reducible) to language B. Which one of the following is FALSE?

(A) If A m B and B is recursive then A is recursive.

(B) If A m B and A is undecidable then B is undecidable.

(C) If A m B and B is recursively enumerable then A is recursively enumerable.

(D) If A m B and B is not recursively enumerable then A is not recursively enumerable.

gate2014-2 theory-of-computation recursive-recursively-enumerable decidability normal

6.123 Recursive Recursively Enumerable: GATE2014-2_35 top gateoverflow.in/1994

Let M be the encoding of a Turing machine as a string over = {0, 1}. Let
L = {M M is a Turing machine
that accepts a string of length 2014} .
Then L is

A. decidable and recursively enumerable


B. undecidable but recursively enumerable
C. undecidable and not recursively enumerable
D. decidable but not recursively enumerable

gate2014-2 theory-of-computation recursive-recursively-enumerable decidability normal

6.124 Recursive Recursively Enumerable: GATE2014-1_35 top gateoverflow.in/1810

Let L be a language and L be its complement. Which one of the following is NOT a viable possibility?

(A) Neither L nor L is recursively enumerable (r. e. ).

(B) One of L and L is r.e. but not recursive; the other is not r.e.

(C) Both L and L are r.e. but not recursive.

(D) Both L and L are recursive.

gate2014-1 theory-of-computation recursive-recursively-enumerable decidability easy

6.125 Recursive Recursively Enumerable: GATE2010_17 top gateoverflow.in/2190

Let L1 be the recursive language. Let L2 and L3 be languages that are recursively enumerable but not recursive. Which of the following
statements is not necessarily true?

(A) L2 L1 is recursively enumerable.

(B) L1 L3 is recursively enumerable.

(C) L2 L3 is recursively enumerable.

2 3 is recursively enumerable.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 393 of 852

(D) L2 L3 is recursively enumerable.

gate2010 theory-of-computation recursive-recursively-enumerable decidability normal

6.126 Regular Expressions: GATE2004-IT_7 top gateoverflow.in/3648

Which one of the following regular expressions is NOT equivalent to the regular expression (a + b + c)*?

A) (a* + b* + c*)*
B) (a*b*c*)*
C) ((ab)* + c*)*
D) (a*b* + c*)*

gate2004-it theory-of-computation regular-expressions normal

6.127 Regular Expressions: TIFR2010-B-34 top gateoverflow.in/19047

Let r, s, t be regular expressions. Which of the following identities is correct?

a. (r + s) = r s
b. r(s + t) = rs + t
c. (r + s) = r + s
d. (rs + r) r = r(sr + r)
e. (r s) = (rs)

tifr2010 theory-of-computation regular-expressions

6.128 Regular Expressions: GATE2007-IT_73 top gateoverflow.in/3525

Consider the regular expression R = (a + b)* (aa + bb) (a + b)*

Which one of the regular expressions given below defines the same language as defined by the regular expression R?

A) (a(ba)* + b(ab)*)(a + b) +
B) (a(ba)* + b(ab)*)*(a + b)*
C) (a(ba)* (a + bb) + b(ab)*(b + aa))(a + b)*
D) (a(ba)* (a + bb) + b(ab)*(b + aa))(a + b) +

gate2007-it theory-of-computation regular-expressions normal

6.129 Regular Expressions: GATE2006-IT_5 top gateoverflow.in/3544

Which regular expression best describes the language accepted by the non-deterministic automaton below?

A) (a + b)* a(a + b)b


B) (abb)*
C) (a + b)* a(a + b)* b(a + b)*
D) (a + b)*

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 394 of 852

gate2006-it theory-of-computation regular-expressions normal

6.130 Regular Expressions: GATE2015-2_35 top gateoverflow.in/8159

Consider the alphabet = {0, 1}, the null/empty string and the set of strings X0 , X1 , and X2 generated by the
corresponding non-terminals of a regular grammar. X0 , X1 , and X2 are related as follows.

X0 = 1X1
X1 = 0X1 + 1X2
X2 = 0X1 + {}
Which one of the following choices precisely represents the strings in X0 ?

A. 10(0*+(10)*)1
B. 10(0*+(10)*)*1
C. 1(0+10)*1
D. 10(0+10)*1 +110(0+10)*1

gate2015-2 theory-of-computation regular-expressions grammar normal

6.131 Regular Expressions: GATE1998_3b top gateoverflow.in/2941

Give a regular expression for the set of binary strings where every 0 is immediately followed by exactly k 1's and preceded
by at least k 1s ( k is a fixed integer)

gate1998 theory-of-computation regular-expressions easy

6.132 Regular Expressions: GATE2008-IT_5 top gateoverflow.in/3265

Which of the following regular expressions describes the language over{0, 1} consisting of strings that contain exactly two
1's?

A) (0 + 1) * 11(0 + 1) *
B) 0 * 110 *
C) 0 * 10 * 10 *
D) (0 + 1) * 1(0 + 1) * 1 (0 + 1) *

gate2008-it theory-of-computation regular-expressions easy

6.133 Regular Expressions: GATE1991_03,xiii top gateoverflow.in/527

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only.

Let r = 1(1 + 0) , s = 11 0 and t = 1 0 be three regular expressions. Which one of the following is true?
A. L(s) L(r) and L(s) L(t)
B. L(r) L(s) and L(s) L(t)
C. L(s) L(t) and L(s) L(r)
D. L(t) L(s) and L(s) L(r)
E. None of the above

gate1991 theory-of-computation regular-expressions normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 395 of 852

6.134 Regular Expressions: GATE2005-IT_5 top gateoverflow.in/3749

Which of the following statements is TRUE about the regular expression 01*0?

A) It represents a finite set of finite strings.


B) It represents an infinite set of finite strings.
C) It represents a finite set of infinite strings.
D) It represents an infinite set of infinite strings.

gate2005-it theory-of-computation regular-expressions easy

6.135 Regular Expressions: GATE2000_1.4 top gateoverflow.in/627

Let S and T be languages over = {a. b} represented by the regular expressions (a + b ) and (a + b) , respectively.
Which of the following is true?

(a) S T
(b) T S
(c) S =T
(d) S T =
gate2000 theory-of-computation regular-expressions easy

6.136 Regular Expressions: GATE2010_39 top gateoverflow.in/2340

Let L = {w (0 + 1 ) w has even number of 1s} . i.e., L is the set of all the bit strings with even numbers of 1 s. Which one of the regular expressions
below represents L ?

(A) ( 0 10 1 )

(B) 0 ( 10 10 )

(C) 0 ( 10 1 ) 0

(D) 0 1( 10 1 ) 10

gate2010 theory-of-computation regular-expressions normal

6.137 Regular Expressions: TIFR2015-B-7 top gateoverflow.in/29861

Let a, b, c be regular expressions. Which of the following identities is correct?

a. (a + b ) = a b
b. a(b + c) = ab + c
c. (a + b ) = a + b
d. (ab + a ) a = a(ba + a )
e. None of the above.

tifr2015 theory-of-computation regular-expressions

6.138 Regular Expressions: GATE1997_6.4 top gateoverflow.in/2260

Which one of the following regular expressions over {0, 1} denotes the set of all strings not containing 100 as substring?

(a) 0 (1 + 0)

0 1010

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 396 of 852

(b) 0 1010

(c) 0 1 01

(d) 0 (10 + 1)

gate1997 theory-of-computation regular-expressions normal

6.139 Regular Expressions: GATE1992_02,xvii top gateoverflow.in/575

02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Which of the following regular expression identities is/are TRUE?

(a) r( ) = r

(b) (r s ) = (r + s)

(c) (r + s) = r + s

(d) r s = r + s
gate1992 theory-of-computation regular-expressions easy

6.140 Regular Expressions: GATE2014-1_36 top gateoverflow.in/1914

Which of the regular expressions given below represent the following DFA?

I. 0 1(1 + 00 1)
II. 0 1 1 + 11 0 1
III. (0 + 1) 1

(A) I and II only

(B) I and III only

(C) II and III only

(D) I, II and III

gate2014-1 theory-of-computation regular-expressions finite-automata easy

6.141 Regular Expressions: GATE1998_1.12 top gateoverflow.in/1649

The string 1101 does not belong to the set represented by

(a) 110*(0 + 1)
(b) 1(0 + 1)*101
(c) (10)*(01)*(00 + 11)*
(d) (00 + (11)*0)*

gate1998 theory-of-computation regular-expressions easy

6.142 Regular Expressions: GATE2009_15 top gateoverflow.in/1307

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 397 of 852

Which one of the following languages over the alphabet {0, 1} is described by the regular expression:
(0 + 1) 0(0 + 1) 0(0 + 1) ?

(A) The set of all strings containing the substring 00

(B) The set of all strings containing at most two 0's

(C) The set of all strings containing at least two 0's

(D) The set of all strings that begin and end with either 0 or 1

gate2009 theory-of-computation regular-expressions easy

6.143 Regular Expressions: GATE 2016-1-18 top gateoverflow.in/39647

Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive
0's and two consecutive 1's?

A. (0 + 1) 0011(0 + 1) + (0 + 1) 1100(0 + 1)
B. (0 + 1) (00(0 + 1) 11 + 11(0 + 1) 00)(0 + 1)
C. (0 + 1) 00(0 + 1) + (0 + 1) 11(0 + 1)
D. 00(0 + 1) 11 + 11(0 + 1) 00

gate2016-1 theory-of-computation regular-expressions normal

6.144 Regular Expressions: GATE1998_1.9 top gateoverflow.in/1646

If the regular set A is represented by A = (01 + 1) and the regular set B is represented by B = ((01) 1 ) , which of the
following is true?

(a) A B
(b) B A
(c) A and B are incomparable

(d) A =B
gate1998 theory-of-computation regular-expressions normal

6.145 Regular Expressions: GATE2003_14 top gateoverflow.in/905

The regular expression 0 (10 ) denotes the same set as

(A) (1 0) 1

(B) 0 + (0 + 10)

(C) (0 + 1) 10(0 + 1)

(D) None of the above

gate2003 theory-of-computation regular-expressions easy

6.146 Regular Expressions: GATE2014-3_15 top gateoverflow.in/2049

The length of the shortest string NOT in the language (over = {a, b}) of the following regular expression is _______.

a b (ba) a

gate2014-3 theory-of-computation regular-expressions numerical-answers easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 398 of 852

6.147 Regular Expressions: GATE1994_2.10 top gateoverflow.in/2477

The regular expression for the language recognized by the finite state automaton of figure is ______

gate1994 theory-of-computation finite-automata regular-expressions easy

6.148 Regular Expressions: GATE1996_1.8 top gateoverflow.in/2712

Which two of the following four regular expressions are equivalent? ( is the empty string).

i. (00) ( + 0)
ii. (00)
iii. 0
iv. 0(00)

A. (i) and (ii)


B. (ii) and (iii)
C. (i) and (iii)
D. (iii) and (iv)

gate1996 theory-of-computation regular-expressions easy

6.149 Regular Expressions: GATE1995_1.9 top gateoverflow.in/2596

In some programming language, an identifier is permitted to be a letter followed by any number of letters or digits. If L and
D denote the sets of letters and digits respectively, which of the following expressions defines an identifier?
(a) (L D)+

(b) L(L D)

(c) (LD)

(d) L(LD)

gate1995 theory-of-computation regular-expressions easy

6.150 Regular Set: GATE2006-IT_80 top gateoverflow.in/3624

Let L be a regular language. Consider the constructions on L below:

I. repeat (L) = {ww | w L}


II. prefix (L) = {u | v : uv L}
III. suffix (L) = {v | u : uv L}
IV. half (L) = {u | v : | v | = | u | and uv L}

Which of the constructions could lead to a non-regular language?

A) Both I and IV
B) Only I

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 399 of 852

C) Only IV
D) Both II and III

gate2006-it theory-of-computation regular-set normal

6.151 Regular Set: GATE1998_2.6 top gateoverflow.in/1678

Which of the following statements is false?

(a) Every finite subset of a non-regular set is regular

(b) Every subset of a regular set is regular

(c) Every finite subset of a regular set is regular

(d) The intersection of two regular sets is regular

gate1998 theory-of-computation regular-set easy

6.152 Regular Set: GATE2014-1_15 top gateoverflow.in/1781

Which one of the following is TRUE?

(A) The language L = {an bn n 0} is regular.


(B) The language L = {an n is prime } is regular.
(C) The language L = {w w has 3k + 1 b s for some k N with = {a, b}} is regular.
(D) The language L = {ww w with = {0, 1}} is regular.

gate2014-1 theory-of-computation regular-set normal

6.153 Regular Set: GATE2006-IT_81 top gateoverflow.in/3637

Let L be a regular language. Consider the constructions on L below:

I. repeat (L) = {ww | w L}


II. prefix (L) = {u | v : uv L}
III. suffix (L) = {v | u uv L}
IV. half (L) = {u | v : | v | = | u | and uv L}

Which of the constructions could lead to a non-regular language?

A. Both I and IV
B. Only 1
C. Only IV
D. Both II and III

Which choice of L is best suited to support your answer above?

A) (a + b)*
B) {, a, ab, bab}
C) (ab)*
D) {anbn | n 0}

gate2006-it theory-of-computation regular-set normal

6.154 Regular Set: GATE2008-IT_6 top gateoverflow.in/3266

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 400 of 852

Let N be an NFA with n states and let M be the minimized DFA with m states recognizing the same language. Which of the
following in NECESSARILY true?

A) m 2 n
B) n m
C) M has one accept state
D) m = 2 n

gate2008-it theory-of-computation regular-set normal

6.155 Regular Set: GATE 2016-2-17 top gateoverflow.in/39542

Language L1 is defined by the grammar: S1 aS1 b


Language L2 is defined by the grammar: S2 abS2
Consider the following statements:

P: L1 is regular
Q: L2 is regular

Which one of the following is TRUE?

A. Both P and Q are true.


B. P is true and Q is false.
C. P is false and Q is true.
D. Both P and Q are false.

gate2016-2 theory-of-computation grammar regular-set normal

6.156 Regular Set: GATE2007_31 top gateoverflow.in/1229

Which of the following languages is regular?

A. {wwR w {0, 1}+ }

B. {wwR x x, w {0, 1}+ }

C. {wxwR x, w {0, 1}+ }

D. {xwwR x, w {0, 1}+ }

gate2007 theory-of-computation regular-set normal

6.157 Regular Set: GATE1995_2.24 top gateoverflow.in/2637

Let = {0, 1} , L = and R = {0n 1n n > 0} then the languages L R and R are respectively

(A) regular, regular

(B) not regular, regular

(C) regular, not regular

(D) not regular, not regular

gate1995 theory-of-computation regular-set easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 401 of 852

6.158 Regular Set: GATE1999_6 top gateoverflow.in/1505

a. Given that A is regular and (A B) is regular, does it follow that B is necessarily regular? Justify your answer.

b. Given two finite automata M1, M2, outline an algorithm to decide if L(M1) L(M2). (note: strict subset)

gate1999 theory-of-computation regular-set normal

6.159 Regular Set: GATE2007_7 top gateoverflow.in/1205

Which of the following is TRUE?

A. Every subset of a regular set is regular


B. Every finite subset of a non-regular set is regular
C. The union of two non-regular sets is not regular
D. Infinite union of finite sets is regular

gate2007 theory-of-computation regular-set easy

6.160 Regular Set: TIFR2013-B-6 top gateoverflow.in/25667

Let L and L be languages over the alphabet . The left quotient of L by L is


def
L/L = {w : wx L for some x L }
Which of the following is true?

a. If L/L is regular then L is regular.


b. If L is regular then L/L is regular.
c. If L/L is regular then L is regular.
d. L/L is a subset of L .
e. If L/L and L are regular, then L is regular.

tifr2013 theory-of-computation regular-set

6.161 Regular Set: GATE2006-IT_30 top gateoverflow.in/3569

Which of the following statements about regular languages is NOT true ?

A) Every language has a regular superset


B) Every language has a regular subset
C) Every subset of a regular language is regular
D) Every subset of a finite language is regular

gate2006-it theory-of-computation regular-set easy

6.162 Regular Set: TIFR2014-B-12 top gateoverflow.in/27314

Consider the following three statements:

(i) Intersection of infinitely many regular languages must be regular.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 402 of 852

(ii) Every subset of a regular language is regular.

(iii) If L is regular and M is not regular then L M is necessarily not regular.

Which of the following gives the correct true/false evaluation of the above?

a. true, false, true.


b. false, false, true.
c. true, false, true.
d. false, false, false.
e. true, true, true.

tifr2014 theory-of-computation regular-set

6.163 Regular Set: GATE2006_29 top gateoverflow.in/992

If s is a string over (0+1)* then let n 0(s) denote the number of 0s in s and n 1(s) the number of 1s in s. Which one of the
following languages is not regular?

(A) L = {s (0 + 1) n0 (s) is a 3-digit prime }


(B) L = {s (0 + 1) for every prefix s' of s, n0 (s ) n1 (s ) 2}
(C) L = {s (0 + 1) n0 (s) n1 (s) 4}
(D) L = {s (0 + 1) n0 (s) mod 7 = n1 (s) mod 5 = 0}

gate2006 theory-of-computation regular-set normal

6.164 Regular Set: GATE2001_2.6 top gateoverflow.in/724

Consider the following languages:

L1 = {ww w {a, b} }
L2 = {wwR w {a, b} , wR is the reverse of w}
L3 = {02i i is an integer}
L4 = {0i i is an integer}
2

Which of the languages are regular?

(A) Only L1 and L2

(B) Only L2, L3 and L4

(C) Only L3 and L4

(D) Only L3

gate2001 theory-of-computation regular-set normal

6.165 Regular Set: TIFR2013-B-8 top gateoverflow.in/25670

Which one of the following languages over the alphabet 0, 1 is regular?

a. The language of balanced parentheses where 0, 1 are thought of as (, ) respectively.


b. The language of palindromes, i.e. bit strings x that read the same from left to right as well as right to left.
= {0m : 3 m}
2
c. L
d. The Kleene closure L , where L is the language in (c) above.
e. {0m 1n |1 m n}

tifr2013 theory-of-computation regular-set

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 403 of 852

6.166 Regular Set: GATE2008-IT_35 top gateoverflow.in/3345

Which of the following languages is (are) non-regular?

L1 = {0m1n | 0 m n 10000}
L2 = {w | w reads the same forward and backward}
L3 = {w {0, 1} * | w contains an even number of 0's and an even number of 1's}

A) L2 and L 3 only
B) L1 and L 2 only
C) L3 only
D) L2 only

gate2008-it theory-of-computation regular-set normal

6.167 Regular Set: GATE2008_53 top gateoverflow.in/476

Which of the following are regular sets?

I. {an b2m n 0, m 0}

II. {an bm n = 2m}


III. {an bm n m}
IV. {xcy x, y, {a, b} }

A. I and IV only
B. I and III only
C. I only
D. IV only

gate2008 theory-of-computation regular-set normal

6.168 Regular Set: GATE2001_1.4 top gateoverflow.in/697

Consider the following two statements:

S1 : {02n n 1} is a regular language

S2 : {0m 1n 0m+n m 1 and n 1} is a regular language

Which of the following statement is correct?

(A) Only S1 is correct

(B) Only S2 is correct

(C) Both S1 and S2 are correct

(D) None of S1 and S2 is correct

gate2001 theory-of-computation regular-set easy

6.169 Regular Set: GATE2014-2_15 top gateoverflow.in/1971

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 404 of 852

If L1 = {an n 0} and L2 = {bn n 0} , consider


(I) L1 . L2 is a regular language

(II) L1 . L2 = {an bn n 0}
Which one of the following is CORRECT?

(A) Only (I)

(B) Only (II)

(C) Both (I) and (II)

(D) Neither (I) nor (II)

gate2014-2 theory-of-computation regular-set normal

6.170 Regular Set: GATE2014-2_36 top gateoverflow.in/1995

L e t L1 = {w {0, 1} w has at least as many occurrences of (110) s as (011) s}. Let


L2 = {w {0, 1} w has at least as many occurrences of (000) s as(111) s}. Which one of the following is TRUE?

(A) L1 is regular but not L2

(B) L2 is regular but not L1

(C) Both L1 and L2 are regular

(D) Neither L1 nor L2 are regular

gate2014-2 theory-of-computation regular-set normal

6.171 Regular Set: GATE2000_2.8 top gateoverflow.in/655

What can be said about a regular language L over { a } whose minimal finite state automaton has two states?

1. L must be {a n | n is odd}
2. L must be {a n | n is even}
3. L must be {a n | n 0}
4. Either L must be {a n | n is odd}, or L must be {a n | n is even}

gate2000 theory-of-computation regular-set easy

6.172 Regular Set: GATE2015-2_51 top gateoverflow.in/8254

Which of the following is/are regular languages?

L1 : {wxwR w, x {a, b} and |w|, |x| > 0} , wR is the reverse of string w

L2 : {an bm m n and m, n 0}
L3 : {ap bq cr p, q, r 0}

A. L1 and L3 only
B. L2 only
C. L2 and L3 only
D. L3 only

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 405 of 852

gate2015-2 theory-of-computation regular-set normal

6.173 Regular Set: GATE1996_1.10 top gateoverflow.in/2714

Let L where = {a, b}. Which of the following is true?

(a) L = {x x has an equal number of a's and b's} is regular

(b) L = {an bn n 1} is regular

(c) L = {x x has more number of a's than b's} is regular

(d) L = {am bn m 1, n 1} is regular


gate1996 theory-of-computation regular-set normal

6.174 Turing Machine: GATE2003_54 top gateoverflow.in/355

Define languages L0 and L1 as follows :

L0 = {M, w, 0 M halts on w}

L1 = {M, w, 1 M does not halts on w}

Here M, w, i is a triplet, whose first component M is an encoding of a Turing


Machine, second component w is a string, and third component i is a bit.

Let L = L0 L1 . Which of the following is true ?


A. L is recursively enumerable, but L is not


B. L is recursively enumerable, but L is not
C. Both L and L are recursive
D. Neither L nor L is recursively enumerable

theory-of-computation turing-machine gate2003 difficult

6.175 Turing Machine: GATE2001_7 top gateoverflow.in/748

Let a decision problem X be defined as follows:

X: Given a Turing machine M over and any word w , does M loop forever on w?
You may assume that the halting problem of Turing machine is undecidable but partially decidable.

(a) Show that X is undecidable

(b) Show that X is not even partially decidable

gate2001 theory-of-computation decidability turing-machine easy

6.176 Turing Machine: GATE2003_53 top gateoverflow.in/941

A single tape Turing Machine M has two states q0 and q1, of which q0 is the starting state. The tape alphabet of M is {0, 1,
B} and its input alphabet is {0, 1}. The symbol B is the blank symbol used to indicate end of an input string. The transition
function of M is described in the following table.

0 1 B
q0 q1, 1, R q1, 1, R Halt
q1 q1, 1, R q0, 1, L q0, B, L

The table is interpreted as illustrated below.

The entry (q1, 1, R) in row q0 and column 1 signifies that if M is in state q0 and reads 1 on the current page square, then it

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 406 of 852

writes 1 on the same tape square, moves its tape head one position to the right and transitions to state q1.

Which of the following statements is true about M?

A. M does not halt on any string in (0 + 1)+


B. M does not halt on any string in (00 + 1)
C. M halts on all strings ending in a 0
D. M halts on all strings ending in a 1

gate2003 theory-of-computation turing-machine normal

6.177 Turing Machine: GATE2004_89 top gateoverflow.in/1083

L1 is a recursively enumerable language over . An algorithm A effectively enumerates its words as 1 , 2 , 3 , . Define
another language L2 over {#} as {wi # wj wi , wj L1 , i < j}. Here # is new symbol. Consider the following
assertions.

S1 : L1 is recursive implies L2 is recursive


S2 : L2 is recursive implies L1 is recursive
Which of the following statements is true?

A. Both S1 and S2 are true

B. S1 is true but S2 is not necessarily true

C. S2 is true but S1 is not necessarily true

D. Neither is necessarily true

gate2004 theory-of-computation turing-machine difficult

6.178 Turing Machine: GATE2002_14 top gateoverflow.in/867

The aim of the following question is to prove that the language {M | M is the code of the Turing Machine which, irrespective
of the input, halts and outputs a 1}, is undecidable. This is to be done by reducing from the language {M', x | M' halts on x},
which is known to be undecidable. In parts (a) and (b) describe the 2 main steps in the construction of M. In part (c)
describe the key property which relates the behaviour of M on its input w to the behaviour of M' on x.

a. On input w, what is the first step that M must make?


b. On input w, based on the outcome of the first step, what is the second step M must make?
c. What key property relates the behaviour of M on w to the behaviour of M' on x?

gate2002 theory-of-computation decidability normal turing-machine

6.179 GATE2012_25 top gateoverflow.in/1609

Given the language L = {ab, aa, baa}, which of the following strings are in L ?
1. abaabaaabaa
2. aaaabaaaa
3. baaaaabaaaab
4. baaaaabaa

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 407 of 852

(A) 1, 2 and 3
(B) 2, 3 and 4
(C) 1, 2 and 4
(D) 1, 3 and 4

gate2012 theory-of-computation easy

6.180 GATE2011_8 top gateoverflow.in/2110

Which of the following pairs have DIFFERENT expressive power?

(A) Deterministic finite automata (DFA) and Non-deterministic finite automata (NFA)

(B) Deterministic push down automata (DPDA) and Non-deterministic push down automata (NPDA)

(C) Deterministic single tape Turing machine and Non-deterministic single tape Turing machine

(D) Single tape Turing machine and multi-tape Turing machine

gate2011 theory-of-computation easy

6.181 GATE1997_3.4 top gateoverflow.in/2235

Given = {a, b}, which one of the following sets is not countable?

(a) Set of all strings over


(b) Set of all languages over
(c) Set of all regular languages over
(d) Set of all languages over accepted by Turing machines

gate1997 theory-of-computation normal

6.182 GATE2004_87 top gateoverflow.in/1081

The language {am bn cm+n m, n 1} is


A. regular

B. context-free but not regular

C. context-sensitive but not context free

D. type-0 but not context sensitive

gate2004 theory-of-computation normal

6.183 GATE1998_1.11 top gateoverflow.in/1648

Regarding the power of recognition of languages, which of the following statements is false?

A. The non-deterministic finite-state automata are equivalent to deterministic finite-state automata.

B. Non-deterministic Push-down automata are equivalent to deterministic Push-down automata.

C. Non-deterministic Turing machines are equivalent to deterministic Push-down automata.

D. Non-deterministic Turing machines are equivalent to deterministic Turing machines.

E. Multi-tape Turing machines are available are equivalent to Single-tape Turing machines.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 408 of 852

gate1998 theory-of-computation easy

6.184 GATE2006_33 top gateoverflow.in/996

Let L1 be a regular language, L2 be a deterministic context-free language and L3 a recursively enumerable, but not
recursive, language. Which one of the following statements is false?

(A) L1 L2 is a deterministic CFL


(B) L3 L1 is recursive
(C) L1 L2 is context free
(D) L1 L2 L3 is recursively enumerable
gate2006 theory-of-computation normal

6.185 TIFR2015-B-6 top gateoverflow.in/29860

Let B consist of all binary strings beginning with a 1 whose value when converted to decimal is divisible by 7.

A. B can be recognized by a deterministic finite state automaton.


B. B can be recognized by a non-deterministic finite state automaton but not by a deterministic finite state automaton.
C. B can be recognized by a deterministic push-down automaton but not by a non-deterministic finite state automaton.
D. B can be recognized by a non-deterministic push-down automaton but not by a deterministic push-down automaton.
E. B cannot be recognized by any push down automaton, deterministic or non-deterministic.

tifr2015 theory-of-computation

6.186 GATE2006_30 top gateoverflow.in/993

For s (0 + 1) let d(s) denote the decimal value of s (e.g. d(101) = 5 ). Let
L = {s (0 + 1) d(s) mod 5 = 2 and d(s) mod 7 4}

Which one of the following statements is true?

(A) L is recursively enumerable, but not recursive


(B) L is recursive, but not context-free
(C) L is context-free, but not regular
(D) L is regular

gate2006 theory-of-computation normal

6.187 GATE2008_48 top gateoverflow.in/461

Which of the following statements is false?

A. Every NFA can be converted to an equivalent DFA

B. Every non-deterministic Turing machine can be converted to an equivalent deterministic Turing machine

C. Every regular language is also a context-free language

D. Every subset of a recursively enumerable set is recursive

gate2008 theory-of-computation easy

6.188 TIFR2014-B-14 top gateoverflow.in/27321

Which the following is FALSE?

a. Complement of a recursive language is recursive.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 409 of 852

b. A language recognized by a non-deterministic Turing machine can also be recognized by a deterministic Turing machine.
c. Complement of a context free language can be recognized by a Turing machine.
d. If a language and its complement are both recursively enumerable then it is recursive.
e. Complement of a non-recursive language can never be recognized by any Turing machine.

tifr2014 theory-of-computation

6.189 GATE2008_9 top gateoverflow.in/407

Which of the following is true for the language

{ap p is a prime }?

(A) It is not accepted by a Turing Machine

(B) It is regular but not context-free

(C) It is context-free but not regular

(D) It is neither regular nor context-free, but accepted by a Turing machine

gate2008 theory-of-computation easy

6.190 GATE2013_8 top gateoverflow.in/1417

Consider the languages L1 = and L2 = {a}. Which one of the following represents L1 L2 L1 ?

(A) {}

(B)

(C) a

(D) {, a}

gate2013 theory-of-computation normal

6.191 GATE2005_54 top gateoverflow.in/1377

Let Nf and Np denote the classes of languages accepted by non-deterministic finite automata and non-deterministic push-
down automata, respectively. Let Df and Dp denote the classes of languages accepted by deterministic finite automata and
deterministic push-down automata respectively. Which one of the following is TRUE?

A. Df Nf and Dp Np
B. Df Nf and Dp = Np
C. Df = Nf and Dp = Np
D. Df = Nf and Dp Np

gate2005 theory-of-computation easy

6.192 GATE2009_40 top gateoverflow.in/1326

= L1 L2 , where L1 and L2 are languages as defined below:


Let L
L1 = { m bm c n bm m, n 0}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 410 of 852

L1 = {am bm can bm m, n 0}

L2 = {ai bj ck i, j, k 0}

Then L is

A. Not recursive
B. Regular
C. Context free but not regular
D. Recursively enumerable but not context free.

gate2009 theory-of-computation easy

6.193 gate 1998 top gateoverflow.in/44306

(a) Let G1 = (N, T, P, S1) be a CFG where, N = {S1, A, B} T = {a, b} and P is given by

S1 ->a,S1b

S1-> a B b

S1->a A b

B ->Bb

A ->a A

B ->b

A ->a

What is L(G1)?

(b) Use the grammar in Part (a) to give a CFG L2={a^ib^ja^kb^l|i,j,k,l>=1,i=j or k=l} by adding not more than 5
productions

(c) Is L2 inherently ambiguous?

theory-of-computation

6.194 GATE2003_15 top gateoverflow.in/120

If the strings of a language L can be effectively enumerated in lexicographic (i.e., alphabetic) order, which of the following
statements is true ?

(A) L is Regular

(b) L is context free but not necessarily Regular

(c) L is recursive but not necessarily Regular

(d) L is recursively enumerable but not necessarily Recursive

theory-of-computation gate2003 normal

6.195 GATE2013_17 top gateoverflow.in/1439

Which of the following statements is/are FALSE?

1. For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine.
2. Turing recognizable languages are closed under union and complementation.
3. Turing decidable languages are closed under intersection and complementation.
4. Turing recognizable languages are closed under union and intersection.

(A) 1 and 4 only (B) 1 and 3 only (C) 2 only (D) 3 only

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 411 of 852

gate2013 theory-of-computation normal

6.196 GATE1999_10 top gateoverflow.in/1509

Suppose we have a function HALTS which when applied to any arbitrary function f and its arguments will say TRUE if
function f terminates for those arguments and FALSE otherwise. Example: Given the following function definition.

FACTORIAL (N) = IF (N=0) THEN 1 ELSE N*FACTORIAL (N-1)

Then HALTS (FACTORIAL, 4) = TRUE and HALTS (FACTORIAL, -5) = FALSE

Let us define the function. FUNNY (f) = IF HALTS (f f) THEN not (f f) ELSE TRUE

a. Show that FUNNY terminates for all functions f .

b. use (a) to prove (by contradiction) that it is not possible to have a function like HALTS which for arbitrary functions and
inputs says whether it will terminate on that input or not.

gate1999 theory-of-computation normal

6.197 GATE2003_52 top gateoverflow.in/356

Consider two languages L1 and L2 each on the alphabet . Let f : be a polynomial time computable bijection such
that (x)[x L1 iff f(x) L2 ] . Further, let f 1 be also polynomial time computable.

Which of the following CANNOT be true ?



(A) L1 P and L2 is finite

(B) L1 NP and L2 P

(C) L1 is undecidable and L2 is decidable

(D) L1 is recursively enumerable and L2 is recursive

gate2003 theory-of-computation normal

6.198 GATE2007_30 top gateoverflow.in/1228

The language L = {0i 21i i 0} over the alphabet {0, 1, 2} is:

A. not recursive

B. is recursive and is a deterministic CFL

C. is a regular language

D. is not a deterministic CFL but a CFL

gate2007 theory-of-computation normal

6.199 GATE2008_13 top gateoverflow.in/411

If L and L are recursively enumerable then L is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 412 of 852

A. regular
B. context-free
C. context-sensitive
D. recursive

gate2008 theory-of-computation easy

6.200 GATE1991-17,a top gateoverflow.in/26653

Show that the Turing machines, which have a read only input tape and constant size work tape, recognize precisely the class
of regular languages.

gate1991 theory-of-computation descriptive

6.201 GATE2000-8 top gateoverflow.in/679

A push down automation (pda) is given in the following extended notation of finite state diagram:

The nodes denote the states while the edges denote the moves of the pda. The edge labels are of the form d, s/s' where d is the input symbol
read and s, s' are the stack contents before and after the move. For example the edge labeled 1, s/1.s denotes the move from state q 0 to q 0
in which the input symbol 1 is read and pushed to the stack.

a. Introduce two edges with appropriate labels in the above diagram so that the resulting pda accepts the language
{x2xR x {0, 1} , xR denotes reverse of x }, by empty stack.
b. Describe a non-deterministic pda with three states in the above notation that accept the language {0n 1m n m 2n} by empty stack

gate2000 theory-of-computation

6.202 GATE2001_5 top gateoverflow.in/746

Construct DFA's for the following languages:

(a) L = {w w {a, b} , w has baab as a substring }


(b) L = {w w {a, b} ,
w has an odd number of a's and an odd number of b's }

gate2001 theory-of-computation easy

6.203 GATE1991_03,xiv top gateoverflow.in/528

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Which of the following is the strongest correct statement about a finite language over some finite alphabet ?
(a). It could be undecidable

(b). It is Turing-machine recognizable

(c). It is a context sensitive language.

(d). It is a regular language.

(e). None of the above,

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 413 of 852

gate1991 theory-of-computation easy

6.204 GATE2007-IT_46 top gateoverflow.in/3481

The two grammars given below generate a language over the alphabet {x, y, z}
G1 : S x | z | x S | z S | y B
B y | z | y B | z B
G2 : S y | z | y S | z S | x B
B y | y S
Which one of the following choices describes the properties satisfied by the strings in these languages ?

G1 : No y appears before any x


A)
G2 : Every x is followed by at least one y
G1 : No y appears before any x
B)
G2 : No x appears before any y
G1 : No y appears after any x
C)
G2 : Every x is followed by at least one y
G1 : No y appears after any x
D)
G2 : Every y is followed by at least one x

gate2007-it theory-of-computation normal

6.205 GATE2000_7 top gateoverflow.in/678

a. Construct as minimal finite state machine that accepts the language, over {0,1}, of all strings that contain neither the sub string 00 nor
the sub string 11.
b. Consider the grammar

S aSAb
S
A bA
A

where S, A are non-terminal symbols with S being the start symbol; a, b are terminal symbols and is the empty string. This grammar
generates strings of the form aibj for some i, j 0, where i and j satisfy some condition. What is the condition on the values of i and j?

gate2000 theory-of-computation

6.206 GATE2000_1.5 top gateoverflow.in/628

Let L denote the languages generated by the grammar S 0S0 | 00.


Which of the following is TRUE?

A. L = 0 +
B. L is regular but not 0 +
C. L is context free but not regular
D. L is not context free

gate2000 theory-of-computation easy

6.207 GATE2005-IT_4 top gateoverflow.in/3748

Let L be a regular language and M be a context-free language, both over the alphabet . Let L c and M c denote the
complements of L and M respectively. Which of the following statements about the language Lc Mc is TRUE?

A) It is necessarily regular but not necessarily context-free.
B) It is necessarily context-free.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 414 of 852

C) It is necessarily non-regular.
D) None of the above

gate2005-it theory-of-computation normal

6.208 GATE1992_02,xx top gateoverflow.in/577

02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

In which of the cases stated below is the following statement true?

"For every non-deterministic machine M1 there exists an equivalent deterministic machine M2 recognizing the same
language".

(a). M1 is non-deterministic finite automaton.

(b). M1 is non-deterministic PDA.

(c). M1 is a non-deteministic Turing machine.

(d). For no machines M1 and M2 , the above statement true.

gate1992 theory-of-computation easy

6.209 GATE2004-IT_9 top gateoverflow.in/3650

Which one of the following statements is FALSE?

A) There exist context-free languages such that all the context-free grammars generating them are ambiguous
B) An unambiguous context-free grammar always has a unique parse tree for each string of the language generated by it
C) Both deterministic and non-deterministic pushdown automata always accept the same set of languages
D) A finite set of string from some alphabet is always a regular language

gate2004-it theory-of-computation easy

6.210 GATE1992_16 top gateoverflow.in/595

Which of the following three statements are true? Prove your answer.

(i) The union of two recursive languages is recursive.

(ii) The language {On n is a prime} is not regular.

(iii) Regular languages are closed under infinite union.

gate1992 theory-of-computation normal

6.211 Gate2011_24 top gateoverflow.in/3429

Let P be a regular language and Q be a context-free language such that Q P . (For example, let P be the language represented by the regular expression p q
and Q be { pn q n n N}) . Then which of the following is ALWAYS regular?

(A) P Q

(B) P Q

(C) P

(D) Q

gate2011 theory-of-computation easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 415 of 852

6.212 GATE2001_6 top gateoverflow.in/747

Give a deterministic PDA for the language L = {an cb2n n 1} over the alphabet = {a, b, c}. Specify the acceptance
state.

gate2001 theory-of-computation normal

6.213 GATE1995_2.20 top gateoverflow.in/2632

Which of the following definitions below generate the same language as L , where L = {xn y n such that n 1}?
I. E xEy xy
II. xy (x+ xyy + )
III. x+ y +

A. I only

B. I and II

C. II and III

D. II only

gate1995 theory-of-computation easy

6.214 GATE2003_13 top gateoverflow.in/904

Nobody knows yet if P=NP. Consider the language L defined as follows.

(0 + 1)
L={
if P = NP
otherwise

Which of the following statements is true?

(A) L is recursive

(B) L is recursively enumerable but not recursive

(C) L is not recursively enumerable

(D) Whether L is recursively enumerable or not will be known after we find out if P = NP
gate2003 theory-of-computation normal

6.215 GATE1994_1.16 top gateoverflow.in/2459

Which of the following conversions is not possible (algorithmically)?

A. Regular grammar to context free grammar

B. Non-deterministic FSA to deterministic FSA

C. Non-deterministic PDA to deterministic PDA

D. Non-deterministic Turing machine to deterministic Turing machine

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 416 of 852

gate1994 theory-of-computation easy

6.216 GATE2008_51 top gateoverflow.in/463

Match the following:

Checking that identifiers are declared L = {an bm cn d m n 1, m 1}


E. P.
before their use
Number of formal parameters in the
declaration of a function agrees with
F. Q. X XbX XcX dXf g
the number of actual parameters in a
use of that function
Arithmetic expressions with matched
G.
pairs of parentheses
R. L = {wcw w (a b) }

H. Palindromes S. X bXb cXc

A. E-P, F-R, G-Q, H-S


B. E-R, F-P, G-S, H-Q
C. E-R, F-P, G-Q, H-S
D. E-P, F-R, G-S, H-Q

gate2008 normal theory-of-computation

6.217 GATE2002_2.14 top gateoverflow.in/844

Which of the following is true?

A. The complement of a recursive language is recursive


B. The complement of a recursively enumerable language is recursively enumerable
C. The complement of a recursive language is either recursive or recursively enumerable
D. The complement of a context-free language is context-free

gate2002 theory-of-computation easy

6.218 GATE2002_2.5 top gateoverflow.in/835

The finite state machine described by the following state diagram with A as starting state, where an arc label is and x stands
for 1-bit input and y stands for 2-bit output

A. outputs the sum of the present and the previous bits of the input
B. outputs 01 whenever the input sequence contains 11
C. outputs 00 whenever the input sequence contains 10
D. none of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 417 of 852

gate2002 theory-of-computation normal

6.219 GATE2009_16 top gateoverflow.in/1308

Which one of the following is FALSE?

A. There is a unique minimal DFA for every regular language

B. Every NFA can be converted to an equivalent PDA.

C. Complement of every context-free language is recursive.

D. Every nondeterministic PDA can be converted to an equivalent deterministic PDA.

gate2009 theory-of-computation easy

6.220 GATE2008-IT_33 top gateoverflow.in/3343

Consider the following languages.

L1 = {a i b j ck | i = j, k 1}
L2 = {a i b j | j = 2i, i 0}

Which of the following is true?

A) L1 is not a CFL but L 2 is


B) L1 L2 = and L 1 is non-regular
C) L1 L2 is not a CFL but L 2 is
D) There is a 4-state PDA that accepts L 1, but there is no DPDA that accepts L 2

gate2008-it theory-of-computation normal

6.221 GATE2002_1.7 top gateoverflow.in/811

The language accepted by a Pushdown Automaton in which the stack is limited to 10 items is best described as

A. Context free
B. Regular
C. Deterministic Context free
D. Recursive

gate2002 theory-of-computation easy

6.222 GATE2005-IT_6 top gateoverflow.in/3751

The language {0 n 1n 2n | 1 n 10 6} is

A) regular
B) context-free but not regular.
C) context-free but its complement is not context-free.
D) not context-free.

gate2005-it theory-of-computation easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 418 of 852

7 Computer Networks top


7.1 Application Layer Protocols: GATE2011_4 top gateoverflow.in/2106

Consider the different activities related to email.

m1: Send an email from mail client to mail server


m2: Download an email from mailbox server to a mail client
m3: Checking email in a web browser

Which is the application level protocol used in each activity?

A. m1: HTTP m2: SMTP m3: POP


B. m1: SMTP m2: FTP m3: HTTP
C. m1: SMTP m2: POP m3: HTTP
D. m1: POP m2: SMTP m3: IMAP

gate2011 computer-networks application-layer-protocols easy

7.2 Application Layer Protocols: GATE2006-IT_18 top gateoverflow.in/3557

HELO and PORT, respectively, are commands from the protocols

A) FTP and HTTP


B) TELNET and POP3
C) HTTP and TELNET
D) SMTP and FTP

gate2006-it computer-networks application-layer-protocols normal

7.3 Application Layer Protocols: GATE2005-IT_25 top gateoverflow.in/3770

Consider the three commands : PROMPT, HEAD and RCPT.


Which of the following options indicate a correct association of these commands with protocols where these are used?

A) HTTP, SMTP, FTP


B) FTP, HTTP, SMTP
C) HTTP, FTP, SMTP
D) SMTP, HTTP, FTP

gate2005-it computer-networks application-layer-protocols normal

7.4 Application Layer Protocols: GATE2012_10 top gateoverflow.in/42

The protocol data unit (PDU) for the application layer in the Internet stack is

(A) Segment
(B) Datagram
(C) Message
(D) Frame

gate2012 computer-networks application-layer-protocols easy

7.5 Application Layer Protocols: GATE 2016-1-25 top gateoverflow.in/39628

Which of the following is/are example(s) of stateful application layer protocol?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 419 of 852

i. HTTP
ii. FTP
iii. TCP
iv. POP3

A. (i) and (ii) only


B. (ii) and (iii) only
C. (ii) and (iv) only
D. (iv) only

gate2016-1 computer-networks application-layer-protocols normal

7.6 Application Layer Protocols: GATE2008_14 top gateoverflow.in/412

What is the maximum size of data that the application layer can pass on to the TCP layer below?

A. Any size

B. 216 bytes - size of TCP header

C. 216 bytes

D. 1500 bytes

gate2008 easy computer-networks application-layer-protocols

7.7 Bit Stuffing: GATE2014-3_24 top gateoverflow.in/2058

A bit-stuffing based framing protocol uses an 8-bit delimiter pattern of 01111110. If the output bit-string after stuffing is 01111100101, then the input bit-string is

(A) 0111110100

(B) 0111110101

(C) 0111111101

(D) 0111111111

gate2014-3 computer-networks bit-stuffing

7.8 Bridges: GATE2006_82,83 top gateoverflow.in/1855

Statement for Linked Answer Questions 82 & 83:

Consider the diagram shown below where a number of LANs are connected by (transparent) bridges. In order to avoid
packets looping through circuits in the graph, the bridges organize themselves in a spanning tree. First, the root bridge is
identified as the bridge with the least serial number. Next, the root sends out (one or more) data
units to enable the setting up of the spanning tree of shortest paths from the root bridge to each bridge.

Each bridge identifies a port (the root port) through which it will forward frames to the root bridge. Port conflicts are always
resolved in favour of the port with the lower index value. When there is a possibility of multiple bridges forwarding to the
same LAN (but not through the root port), ties are broken as follows: bridges closest to the root get preference and between
such bridges, the one with the lowest serial number is preferred.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 420 of 852

82. For the given connection of LANs by bridges, which one of the following choices represents the depth first traversal of
the spanning tree of bridges?

(A) B1, B5, B3, B4, B2


(B) B1, B3, B5, B2, B4
(C) B1, B5, B2, B3, B4
(D) B1, B3, B4, B5, B2

83. Consider the correct spanning tree for the previous question. Let host H1 send out a broadcast ping packet. Which of the
following options represents the correct forwarding table on B3?
(A)

(B)

(C)

(D)

gate2006 computer-networks bridges normal

7.9 Communication: GATE2007-IT_64 top gateoverflow.in/3509

A broadcast channel has 10 nodes and total capacity of 10 Mbps. It uses polling for medium access. Once a node finishes
transmission, there is a polling delay of 80 s to poll the next node. Whenever a node is polled, it is allowed to transmit a
maximum of 1000 bytes. The maximum throughput of the broadcast channel is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 421 of 852

A) 1 Mbps
B) 100/11 Mbps
C) 10 Mbps
D) 100 Mbps

gate2007-it computer-networks communication normal

7.10 Communication: GATE2012_44 top gateoverflow.in/2153

Consider a source computer (S) transmitting a file of size 106 bits to a destination computer (D) over a network of two
routers (R1 and R2 ) and three links (L1 , L2 , and L3 ). L1 connects S to R1 ; L2 connects R1 to R2 ; and L3 connects R2 to
D. Let each link be of length 100 km. Assume signals travel over each link at a speed of 108 meters per second. Assume
that the link bandwidth on each link is 1 Mbps. Let the file be broken down into 1000 packets each of size 1000 bits. Find the
total sum of transmission and propagation delays in transmitting the file from S to D?

(A) 1005 ms
(B) 1010 ms
(C) 3000 ms
(D) 3003 ms

gate2012 computer-networks communication normal

7.11 Communication: GATE1997_2.3 top gateoverflow.in/2229

Purpose of a start bit in RS 232 serial communication protocol is

A. to synchronize receiver for receiving every byte


B. to synchronize receiver for receiving a sequence of bytes
C. a parity bit
D. to synchronize receiver for receiving the last byte

gate1997 computer-networks communication normal

7.12 Communication: GATE1993_6.4 top gateoverflow.in/2287

Assume that each character code consists of 8 bits. The number of characters that can be transmitted per second through an
asynchronous serial line at 2400 baud rate, and with two stop bits is

A. 109
B. 216
C. 218
D. 219
E. 240

gate1993 computer-networks communication normal

7.13 Communication: GATE2004_22 top gateoverflow.in/1019

How many 8-bit characters can be transmitted per second over a 9600 baud serial communication link using asynchronous
mode of transmission with one start bit, eight data bits, two stop bits and one parity bit?

A. 600
B. 800
C. 876

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 422 of 852

D. 1200

gate2004 computer-networks communication normal

7.14 Communication: GATE2007-IT_62 top gateoverflow.in/3506

Let us consider a statistical time division multiplexing of packets. The number of sources is 10. In a time unit, a source
transmits a packet of 1000 bits. The number of sources sending data for the first 20 time units is 6, 9, 3, 7, 2, 2, 2, 3, 4, 6,
1, 10, 7, 5, 8, 3, 6, 2, 9, 5 respectively. The output capacity of multiplexer is 5000 bits per time unit. Then the average
number of backlogged of packets per time unit during the given period is

A) 5
B) 4.45
C) 3.45
D) 0

gate2007-it computer-networks communication normal

7.15 Communication: GATE2004-IT_45 top gateoverflow.in/3688

A serial transmission T1 uses 8 information bits, 2 start bits, 1 stop bit and 1 parity bit for each character. A synchronous
transmission T2 uses 3 eight-bit sync characters followed by 30 eight-bit information characters. If the bit rate is 1200
bits/second in both cases, what are the transfer rates of T1 and T2?

A) 100 characters/sec, 153 characters/sec


B) 80 characters/sec, 136 characters/sec
C) 100 characters/sec, 136 characters/sec
D) 80 characters/sec, 153 characters/sec

gate2004-it computer-networks communication normal

7.16 Communication: GATE2002_1.11 top gateoverflow.in/815

In serial data transmission, every byte of data is padded with a '0' in the beginning and one or two '1's at the end of byte
because

A. receiver is to be synchronized for byte reception


B. receiver recovers lost '0's and '1's from these padded bits
C. padded bits are useful in parity computation
D. none of the above

gate2002 computer-networks communication easy

7.17 Congestion Control: GATE2005-IT_73 top gateoverflow.in/3836

On a TCP connection, current congestion window size is Congestion Window = 4 KB. The window size advertised by the
receiver is Advertise Window = 6 KB. The last byte sent by the sender is LastByteSent = 10240 and the last byte
acknowledged by the receiver is LastByteAcked = 8192. The current window size at the sender is

A) 2048 bytes
B) 4096 bytes

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 423 of 852

C) 6144 bytes
D) 8192 bytes

gate2005-it computer-networks congestion-control normal

7.18 Congestion Control: GATE2008_56 top gateoverflow.in/479

In the slow start phase of the TCP congestion algorithm, the size of the congestion window

A. does not increase

B. increase linearly

C. increases quadratically

D. increases exponentially

gate2008 computer-networks congestion-control normal

7.19 Congestion Control: GATE2012_45 top gateoverflow.in/2156

Consider an instance of TCPs Additive Increase Multiplicative Decrease (AIMD) algorithm where the window size at the start
of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS. Assume that a timeout
occurs during the fifth transmission. Find the congestion window size at the end of the tenth transmission.

(A) 8 MSS
(B) 14 MSS
(C) 7 MSS
(D) 12 MSS

gate2012 computer-networks congestion-control normal

7.20 Congestion Control: GATE2014-1_27 top gateoverflow.in/1794

Let the size of congestion window of a TCP connection be 32 KB when a timeout occurs. The round trip time of the connection is 100 msec and the maximum
segment size used is 2 KB. The time taken (in msec) by the TCP connection to get back to 32 KB congestion window is _________.

gate2014-1 computer-networks tcp congestion-control numerical-answers normal

7.21 Crc Polynomial: GATE2005-IT_78 top gateoverflow.in/3842

Consider the following message M = 1010001101. The cyclic redundancy check (CRC) for this message using the divisor
polynomial x5 + x4 + x2 + 1 is :

A) 01110
B) 01011
C) 10101
D) 10110

gate2005-it computer-networks crc-polynomial normal

7.22 Crc Polynomial: GATE2007_68 top gateoverflow.in/1266

3
+1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 424 of 852

The message 11001001 is to be transmitted using the CRC polynomial x3 + 1 to protect it from errors. The message that
should be transmitted is:

A. 11001001000

B. 11001001011

C. 11001010

D. 110010010011

gate2007 computer-networks error-detection crc-polynomial normal

7.23 Cryptography: GATE 2016-2-23 top gateoverflow.in/39555

Anarkali digitally signs a message and sends it to Salim. Verification of the signature by Salim requires.

A. Anarkali's public key.


B. Salim's public key.
C. Salim's private key.
D. Anarkali's private key.

gate2016-2 computer-networks network-security cryptography easy

7.24 Csma Cd: GATE2005-IT_71 top gateoverflow.in/3834

A network with CSMA/CD protocol in the MAC layer is running at 1 Gbps over a 1 km cable with no repeaters. The signal
speed in the cable is 2 x 108 m/sec. The minimum frame size for this network should be

A) 10000 bits
B) 10000 bytes
C) 5000 bits
D) 5000 bytes

gate2005-it computer-networks congestion-control csma-cd normal

7.25 Csma Cd: GATE2015-3_6 top gateoverflow.in/8400

Consider a CSMA/CD network that transmits data at a rate of 100 Mbps ( 108 bits per second) over a 1 km (kilometer) cable
with no repeaters. If the minimum frame size required for this network is 1250 bytes, what is the signal speed (km/sec) in
the cable?

A. 8000
B. 10000
C. 16000
D. 20000

gate2015-3 computer-networks congestion-control csma-cd normal

7.26 Csma Cd: GATE2005-IT_27 top gateoverflow.in/3773

Which of the following statements is TRUE about CSMA/CD

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 425 of 852

A) IEEE 802.11 wireless LAN runs CSMA/CD protocol


B) Ethernet is not based on CSMA/CD protocol
C) CSMA/CD is not suitable for a high propagation delay network like satellite network
D) There is no contention in a CSMA/CD network

gate2005-it computer-networks congestion-control csma-cd normal

7.27 Csma Cd: GATE2008-IT_65 top gateoverflow.in/3376

The minimum frame size required for a CSMA/CD based computer network running at 1 Gbps on a 200m cable with a link
speed of 2 108m/s is

A) 125 bytes
B) 250 bytes
C) 500 bytes
D) None of the above

gate2008-it computer-networks csma-cd normal

7.28 Csma Cd: GATE 2016-2-53 top gateoverflow.in/39589

A network has a data transmission bandwidth of 20 106 bits per second. It uses CSMA/CD in the MAC layer. The
maximum signal propagation time from one node to another node is 40 microseconds. The minimum size of a frame in the
network is __________ bytes.

gate2016-2 computer-networks csma-cd numerical-answers normal

7.29 Distance Vector Routing: GATE2010-54 top gateoverflow.in/2362

Consider a network with 6 routers R1 to R6 connected with links having weights as shown in the following diagram.

All the routers use the distance vector based routing algorithm to update their routing tables. Each router starts with its routing table initialized
to contain an entry for each neighbour with the weight of the respective connecting link. After all the routing tables stabilize, how many links in
the network will never be used for carrying any data?

A. 4
B. 3
C. 2
D. 1

gate2010 computer-networks routing distance-vector-routing normal

7.30 Distance Vector Routing: GATE2007-IT_60 top gateoverflow.in/3504

For the network given in the figure below, the routing tables of the four nodes A, E, D and G are shown. Suppose that F has
estimated its delay to its neighbors, A, E, D and G as 8, 10, 12 and 6 msecs respectively and updates its routing table using

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 426 of 852

distance vector routing technique.

A 8
B 20
C 17
A) D 12
E 10
F 0
G 6
A 21
B 8
C 7
B) D 19
E 14
F 0
G 22
A 8
B 20
C 17
C) D 12
E 10
F 16
G 6
A 8
B 8
C 7
D) D 12
E 10
F 0
G 6

gate2007-it computer-networks distance-vector-routing normal

7.31 Distance Vector Routing: GATE2011-53 top gateoverflow.in/43317

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 427 of 852

Consider a network with five nodes, N1 to N5, as shown as below.

The network uses a Distance Vector Routing protocol. Once the routes have been stabilized, the distance vectors at different
nodes are as following.

N1: (0, 1, 7, 8, 4)

N2: (1, 0, 6, 7, 3)

N3: (7, 6, 0, 2, 6)

N4: (8, 7, 2, 0, 4)

N5: (4, 3, 6, 4, 0)

Each distance vector is the distance of the best known path at that instance to nodes, N1 to N5, where the distance to itself
is 0. Also all links are symmetric and the cost is identical in both directions. In each round, all nodes exchange their distance
vectors with their respective neighbors. Then all nodes update their distance vectors. In between two rounds, any change in
cost of a link will cause the two incident nodes to change only that entry in their distance vectors.

The cost of link N2-N3 reduces to 2 (in both directions). After the next round of updates, the link N1-N2 goes down. N2 will
reflect this change immediately in its distance vector as cost, . After the NEXT ROUND of update, what will be the cost to
N1 in the distance vector of N3?

A. 3
B. 9
C. 10
D.

gate2011 computer-networks routing distance-vector-routing normal

7.32 Distance Vector Routing: GATE2005-IT_29 top gateoverflow.in/3775

Count to infinity is a problem associated with

A) link state routing protocol.


B) distance vector routing protocol.
C) DNS while resolving host name.
D) TCP for congestion control.

gate2005-it computer-networks routing distance-vector-routing normal

7.33 Distance Vector Routing: GATE2011-52 top gateoverflow.in/2160

Consider a network with five nodes, N1 to N5, as shown as below.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 428 of 852

The network uses a Distance Vector Routing protocol. Once the routes have been stabilized, the distance vectors at different
nodes are as following.

N1: (0, 1, 7, 8, 4)

N2: (1, 0, 6, 7, 3)

N3: (7, 6, 0, 2, 6)

N4: (8, 7, 2, 0, 4)

N5: (4, 3, 6, 4, 0)

Each distance vector is the distance of the best known path at that instance to nodes, N1 to N5, where the distance to itself
is 0. Also all links are symmetric and the cost is identical in both directions. In each round, all nodes exchange their distance
vectors with their respective neighbors. Then all nodes update their distance vectors. In between two rounds, any change in
cost of a link will cause the two incident nodes to change only that entry in their distance vectors.

The cost of link N2-N3 reduces to 2 (in both directions). After the next round of updates, what will be the new distance
vector at node, N3?

A. (3, 2, 0, 2, 5)
B. (3, 2, 0, 2, 6)
C. (7, 2, 0, 2, 5)
D. (7, 2, 0, 2, 6)

gate2011 computer-networks routing distance-vector-routing normal

7.34 Distance Vector Routing: GATE2010-55 top gateoverflow.in/43326

Consider a network with 6 routers R1 to R6 connected with links having weights as shown in the following diagram.

Suppose the weights of all unused links are changed to 2 and the distance vector algorithm is used again until all routing
tables stabilize. How many links will now remain unused?

A. 0
B. 1
C. 2
D. 3

gate2010 computer-networks routing distance-vector-routing normal

7.35 Encoding: GATE2006-IT_65 top gateoverflow.in/3609

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 429 of 852

In the 4B/5B encoding scheme, every 4 bits of data are encoded in a 5-bit codeword. It is required that the codewords have
at most 1 leading and at most 1 trailing zero. How many such codewords are possible?

A) 14
B) 16
C) 18
D) 20

gate2006-it computer-networks encoding permutation normal

7.36 Error Detection: GATE1995_1.12 top gateoverflow.in/2599

What is the distance of the following code 000000, 010101, 000111, 011001, 111111?

A. 2
B. 3
C. 4
D. 1

gate1995 computer-networks error-detection normal

7.37 Error Detection: GATE2005-IT_74 top gateoverflow.in/3837

In a communication network, a packet of length L bits takes link L1 with a probability of p 1 or link L2 with a probability of p 2.
Link L1 and L2 have bit error probability of b 1 and b 2 respectively. The probability that the packet will be received without
error via either L1 or L2 is

A) (1 - b1)Lp1 + (1 - b 2)Lp2
B) [1 - (b1 + b 2)L]p1p2
C) (1 - b1)L (1 - b 2)Lp1p2
D) 1 - (b1Lp1 + b 2Lp2)

gate2005-it computer-networks error-detection probability normal

7.38 Error Detection: GATE1992_01,ii top gateoverflow.in/546

Consider a 3-bit error detection and 1-bit error correction hamming code for 4-bit date. The extra parity bits required would
be ___ and the 3-bit error detection is possible because the code has a minimum distance of ____

gate1992 computer-networks error-detection normal

7.39 Error Detection: GATE2009_48 top gateoverflow.in/1334

Let G(x) be the generator polynomial used for CRC checking. What is the condition that should be satisfied by G(x) to detect
odd number of bits in error?

A. G(x) contains more than two terms

B. G(x) does not divide 1 + xk , for any k not exceeding the frame length

C. 1 + x is a factor of G(x)

D. G(x) has an odd number of terms.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 430 of 852

gate2009 computer-networks error-detection normal

7.40 Error Detection: GATE2007-IT_43 top gateoverflow.in/3478

An error correcting code has the following code words: 00000000, 00001111, 01010101, 10101010, 11110000. What is the
maximum number of bit errors that can be corrected ?

A) 0
B) 1
C) 2
D) 3

gate2007-it computer-networks error-detection normal

7.41 Ethernet: GATE2004_54 top gateoverflow.in/1050

A and B are the only two stations on an Ethernet. Each has a steady queue of frames to send. Both A and B attempt to
transmit a frame, collide, and A wins the first backoff race. At the end of this successful transmission by A, both A and B
attempt to transmit and collide. The probability that A wins the second backoff race is

A. 0.5
B. 0.625
C. 0.75
D. 1.0

gate2004 computer-networks ethernet probability normal

7.42 Ethernet: GATE2013_36 top gateoverflow.in/1547

Determine the maximum length of the cable (in km) for transmitting data at a rate of 500 Mbps in an Ethernet LAN with
frames of size 10,000 bits. Assume the signal speed in the cable to be 2,00,000 km/s.

(A) 1 (B) 2 (C) 2.5 (D) 5

gate2013 computer-networks ethernet normal

7.43 Ethernet: GATE 2016-2-24 top gateoverflow.in/39543

In an Ethernet local area network, which one of the following statements is TRUE?

A. A station stops to sense the channel once it starts transmitting a frame.


B. The purpose of the jamming signal is to pad the frames that are smaller than the minimum frame size.
C. A station continues to transmit the packet even after the collision is detected.
D. The exponential back off mechanism reduces the probability of collision on retransmissions.

gate2016-2 computer-networks ethernet normal

7.44 Firewall: GATE2011_2 top gateoverflow.in/2104

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 431 of 852

A layer-4 firewall (a device that can look at all protocol headers up to the transport layer) CANNOT

A. block entire HTTP traffic during 9:00PM and 5:00AM


B. block all ICMP traffic
C. stop incoming traffic from specific IP address but allow outgoing traffic to the same IP address
D. block TCP traffic from a specific user on a multi-user system during 9:00PM to 5:00AM

gate2011 computer-networks network-security firewall normal

7.45 Hamming Code: GATE1994_9 top gateoverflow.in/2505

Following 7 bit single error correcting hamming coded message is received.

Determine if the message is correct (assuming that at most 1 bit could be corrupted). If the message contains an error find
the bit which is erroneous and gives correct message.

gate1994 computer-networks error-detection hamming-code normal

7.46 Icmp: GATE2005-IT_26 top gateoverflow.in/3772

Traceroute reports a possible route that is taken by packets moving from some host A to some other host B. Which of the
following options represents the technique used by traceroute to identify these hosts

By progressively querying routers about the next router on the path to B using ICMP packets, starting with the first
A)
router
By requiring each router to append the address to the ICMP packet as it is forwarded to B. The list of all routers en-route
B)
to B is returned by B in an ICMP reply packet
By ensuring that an ICMP reply packet is returned to A by each router en-route to B, in the ascending order of their hop
C)
distance from A
D) By locally computing the shortest path from A to B

gate2005-it computer-networks icmp application-layer-protocols normal

7.47 Ip Packet: GATE 2016-1-53 top gateoverflow.in/39712

An IP datagram of size 1000 bytes arrives at a router. The router has to forward this packet on a link whose MTU (maximum
transmission unit) is 100 bytes. Assume that the size of the IP header is 20 bytes.

The number of fragments that the IP datagram will be divided into for transmission is________.

gate2016-1 computer-networks ip-packet normal numerical-answers

7.48 Ip Packet: GATE2014-3_25 top gateoverflow.in/2059

Host A (on TCP/IP v4 network A) sends an IP datagram D to host B (also on TCP/IP v4 network B). Assume that no error
occurred during the transmission of D. When D reaches B, which of the following IP header field(s) may be different from
that of the original datagram D?

(i) TTL (ii) Checksum (iii) Fragment Offset

(A) (i) only

(B) (i) and (ii) only

(C) (ii) and (iii) only

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 432 of 852

(D) (i), (ii) and (iii)

gate2014-3 computer-networks ip-packet normal

7.49 Ip Packet: GATE2004-IT_86 top gateoverflow.in/3730

In the TCP/IP protocol suite, which one of the following is NOT part of the IP header?

A) Fragment Offset
B) Source IP address
C) Destination IP address
D) Destination port number

gate2004-it computer-networks ip-packet normal

7.50 Ip Packet: GATE2015-2_52 top gateoverflow.in/8255

Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry
data up to 1500 bytes (i.e. MTU = 1500 bytes). Size of UDP header is 8 bytes and size of IP header is 20 bytes. There is no
option field in IP header. How many total number of IP fragments will be transmitted and what will be the contents of offset
field in the last fragment?

A. 6 and 925
B. 6 and 7400
C. 7 and 1110
D. 7 and 8880

gate2015-2 computer-networks ip-packet normal

7.51 Ip Packet: GATE2015-1_22 top gateoverflow.in/8220

Which of the following fields of an IP header is NOT modified by a typical IP router?

A. Check sum
B. Source address
C. Time to Live (TTL)
D. Length

gate2015-1 computer-networks ip-packet easy

7.52 Ip Packet: GATE2014-3_28 top gateoverflow.in/2062

An IP router with a Maximum Transmission Unit (MTU) of 1500 bytes has received an IP packet of size 4404 bytes with an IP header of length 20 bytes. The values
of the relevant fields in the header of the third IP fragment generated by the router for this packet are

(A) MF bit: 0, Datagram Length: 1444; Offset: 370

(B) MF bit: 1, Datagram Length: 1424; Offset: 185

(C) MF bit: 1, Datagram Length: 1500; Offset: 370

(D) MF bit: 0, Datagram Length: 1424; Offset: 2960

gate2014-3 computer-networks ip-packet normal

7.53 Ip Packet: GATE2010_15 top gateoverflow.in/2188

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 433 of 852

One of the header elds in an IP datagram is the Time-to-Live (TTL) eld. Which of the following statements best explains the need for this
field?

(A) It can be used to prioritize packets.

(B) It can be used to reduce delays.

(C) It can be used to optimize throughput.

(D) It can be used to prevent packet looping.

gate2010 computer-networks ip-packet easy

7.54 Ipv4: GATE2004-56 top gateoverflow.in/1052

Consider three IP networks A, B and C. Host HA in network A sends messages each containing 180 bytes of application
data to a host HC in network C. The TCP layer prefixes 20 byte header to the message. This passes through an intermediate
network B. The maximum packet size, including 20 byte IP header, in each network is:

A: 1000 bytes
B: 100 bytes
C: 1000 bytes

The network A and B are connected through a 1 Mbps link, while B and C are connected by a 512 Kbps link (bps = bits per
second).

Assuming that the packets are correctly delivered, how many bytes, including headers, are delivered to the IP layer at the
destination for one application message, in the best case? Consider only data packets.

A. 200
B. 220
C. 240
D. 260

gate2004 computer-networks ipv4 tcp normal

7.55 Ipv4: GATE2014-3_27 top gateoverflow.in/2061

Every host in an IPv4 network has a 1 -second resolution real-time clock with battery backup. Each host needs to generate up to 1000 unique identiers per
second. Assume that each host has a globally unique IPv4 address. Design a 50-bit globally unique ID for this purpose. After what period (in seconds) will the
identifiers generated by a host wrap around?

gate2014-3 computer-networks ipv4 numerical-answers normal

7.56 Ipv4: GATE2012_23 top gateoverflow.in/1606

In the IPv4 addressing format, the number of networks allowed under Class C addresses is

(A) 214
(B) 27
(C) 221
(D) 224

gate2012 computer-networks ipv4 easy

7.57 Ipv4: GATE2004-57 top gateoverflow.in/43572

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 434 of 852

Consider three IP networks A, B and C. Host HA in network A sends messages each containing 180 bytes of application
data to a host HC in network C. The TCP layer prefixes 20 byte header to the message. This passes through an intermediate
network B. The maximum packet size, including 20 byte IP header, in each network is:

A: 1000 bytes
B: 100 bytes
C: 1000 bytes

The network A and B are connected through a 1 Mbps link, while B and C are connected by a 512 Kbps link (bps = bits per
second).

What is the rate at which application data is transferred to host HC ? Ignore errors, acknowledgements, and other
overheads.

A. 325.5 Kbps
B. 354.5 Kbps
C. 409.6 Kbps
D. 512.0 Kbps

gate2004 computer-networks ipv4 tcp normal

7.58 Ipv4: GATE2006_05 top gateoverflow.in/884

For which one of the following reasons does internet protocol(IP) use the time-to-live(TTL) field in IP datagram header?

A. Ensure packets reach destination within that time


B. Discard packets that reach later than that time
C. Prevent packets from looping indefinitely
D. Limit the time for which a packet gets queued in intermediate routers

gate2006 computer-networks ipv4 ip-packet easy

7.59 Ipv4: GATE2013_37 top gateoverflow.in/1548

In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400 and the fragment offset value is
300. The position of the datagram, the sequence numbers of the first and the last bytes of the payload, respectively are

(A) Last fragment, 2400 and 2789


(B) First fragment, 2400 and 2759
(C) Last fragment, 2400 and 2759
(D) Middle fragment, 300 and 689

gate2013 computer-networks ipv4 normal

7.60 Ipv4: GATE2003_27 top gateoverflow.in/917

Which of the following assertions is FALSE about the Internet Protocol (IP)?

A. It is possible for a computer to have multiple IP addresses


B. IP packets from the same source to the same destination can take different routes in the network
C. IP ensures that a packet is discarded if it is unable to reach its destination within a given number of hops
D. The packet source cannot set the route of an outgoing packets; the route is determined only by the routing tables in the
routers on the way

gate2003 computer-networks ipv4 normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 435 of 852

7.61 Lan Technologies: GATE2005-IT_28 top gateoverflow.in/3774

Which of the following statements is FALSE regarding a bridge?

A) Bridge is a layer 2 device


B) Bridge reduces collision domain
C) Bridge is used to connect two or more LAN segments
D) Bridge reduces broadcast domain

gate2005-it computer-networks lan-technologies normal

7.62 Lan Technologies: GATE2004-IT_27 top gateoverflow.in/3668

A host is connected to a Department network which is part of a University network. The University network, in turn, is part of
the Internet. The largest network in which the Ethernet address of the host is unique is

A) the subnet to which the host belongs


B) the Department network
C) the University network
D) the Internet

gate2004-it computer-networks lan-technologies ethernet normal

7.63 Lan Technologies: GATE2006-IT_66 top gateoverflow.in/3610

A router has two full-duplex Ethernet interfaces each operating at 100 Mb/s. Ethernet frames are at least 84 bytes long
(including the Preamble and the Inter-Packet-Gap). The maximum packet processing time at the router for wirespeed
forwarding to be possible is (in microseconds)

A) 0.01
B) 3.36
C) 6.72
D) 8

gate2006-it computer-networks lan-technologies ethernet normal

7.64 Lan Technologies: GATE2007_65 top gateoverflow.in/1263

There are n stations in slotted LAN. Each station attempts to transmit with a probability p in each time slot. What is the
probability that ONLY one station transmits in a given time slot?

A. np(1 p)n1

B. (1 p)n1

C. p(1 p)n1

D. 1 (1 p)n1

gate2007 computer-networks lan-technologies probability normal

7.65 Lan Technologies: GATE2003_83 top gateoverflow.in/966

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 436 of 852

A 2km long broadcast LAN has 107 bps bandwidth and uses CSMA/CD. The signal travels along the wire at 2 108 m/s.
What is the minimum packet size that can be used on this network?

A. 50 bytes
B. 100 bytes
C. 200 bytes
D. None of the above

gate2003 computer-networks lan-technologies normal

7.66 Lan Technologies: GATE2014-2_25 top gateoverflow.in/1983

In the diagram shown below, L1 is an Ethernet LAN and L2 is a Token-Ring LAN. An IP packet originates from sender S and traverses to R, as shown. The links
within each ISP and across the two ISPs, are all point-to-point optical links. The initial value of the TTL eld is 32. The maximum possible value of the TTL eld
when R receives the datagram is _______.

gate2014-2 computer-networks numerical-answers lan-technologies ethernet token-ring normal

7.67 Link State Routing: GATE2014-1_23 top gateoverflow.in/1790

Consider the following three statements about link state and distance vector routing protocols, for a large network with 500
network nodes and 4000 links.

[S1] The computational overhead in link state protocols is higher than in distance vector protocols.

[S2] A distance vector protocol (with split horizon) avoids persistent routing loops, but not a link state protocol.

[S3] After a topology change, a link state protocol will converge faster than a distance vector protocol.

Which one of the following is correct about S1, S2, and S3 ?

(A) S1, S2, and S3 are all true.

(B) S1, S2, and S3 are all false.

(C) S1 and S2 are true, but S3 is false.

(D) S1 and S3 are true, but S2 is false.

gate2014-1 computer-networks routing distance-vector-routing link-state-routing normal

7.68 Mac Protocol: GATE2015-2_8 top gateoverflow.in/8056

A link has transmission speed of 106 bits/sec. It uses data packets of size 1000 bytes each. Assume that the
acknowledgement has negligible transmission delay, and that its propagation delay is the same as the data propagation
delay. Also assume that the processing delays at nodes are negligible. The efficiency of the stop-and-wait protocol in this
setup is exactly 25%. The value of the one way propagation delay (in milliseconds) is_____.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 437 of 852

gate2015-2 computer-networks mac-protocol stop-and-wait normal

7.69 Mac Protocol: GATE2004-IT_85 top gateoverflow.in/3729

Consider a simplified time slotted MAC protocol, where each host always has data to send and transmits with probability p =
0.2 in every slot. There is no backoff and one frame can be transmitted in one slot. If more than one host transmits in the
same slot, then the transmissions are unsuccessful due to collision. What is the maximum number of hosts which this
protocol can support, if each host has to be provided a minimum through put of 0.16 frames per time slot?

A) 1
B) 2
C) 3
D) 4

gate2004-it computer-networks congestion-control mac-protocol normal

7.70 Mac Protocol: GATE2005-IT_75 top gateoverflow.in/3838

In a TDM medium access control bus LAN, each station is assigned one time slot per cycle for transmission. Assume that the
length of each time slot is the time to transmit 100 bits plus the end-to-end propagation delay. Assume a propagation speed
of 2 x 108 m/sec. The length of the LAN is 1 km with a bandwidth of 10 Mbps. The maximum number of stations that can be
allowed in the LAN so that the throughput of each station can be 2/3 Mbps is


1) 3
2) 5
3) 10
4) 20

gate2005-it computer-networks mac-protocol normal

7.71 Mac Protocol: GATE2005_74 top gateoverflow.in/1397

Suppose the round trip propagation delay for a 10 Mbps Ethernet having 48-bit jamming signal is 46.4 s. The minimum
frame size is:

A. 94
B. 416
C. 464
D. 512

gate2005 computer-networks mac-protocol normal debated

7.72 Manchester Encoding: GATE2007_19 top gateoverflow.in/1217

In Ethernet when Manchester encoding is used, the bit rate is:

A. Half the baud rate

B. Twice the baud rate

C. Same as the baud rate

D. None of the above

gate2007 computer-networks ethernet manchester-encoding normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 438 of 852

7.73 Manchester Encoding: GATE2007-IT_61 top gateoverflow.in/3505

In the waveform (a) given below, a bit stream is encoded by Manchester encoding scheme. The same bit stream is encoded
in a different coding scheme in wave form (b). The bit stream and the coding scheme are

A) 1000010111 and Differential Manchester respectively


B) 0111101000 and Differential Manchester respectively
C) 1000010111 and Integral Manchester respectively
D) 0111101000 and Integral Manchester respectively

gate2007-it computer-networks communication manchester-encoding normal

7.74 Network Flow: GATE1992_01,v top gateoverflow.in/550

(v) A simple and reliable data transfer can be accomplished by using the 'handshake protocol'. It accomplishes reliable data
transfer because for every data item sent by the transmitter _____.

gate1992 computer-networks network-flow easy

7.75 Network Flow: GATE2004-IT_87 top gateoverflow.in/3731

A TCP message consisting of 2100 bytes is passed to IP for delivery across two networks. The first network can carry a
maximum payload of 1200 bytes per frame and the second network can carry a maximum payload of 400 bytes per frame,
excluding network overhead. Assume that IP overhead per packet is 20 bytes. What is the total IP overhead in the second
network for this transmission?

A) 40 bytes
B) 80 bytes
C) 120 bytes
D) 160 bytes

gate2004-it computer-networks network-flow normal

7.76 Network Flow: GATE2006-IT_67 top gateoverflow.in/3611

A link of capacity 100 Mbps is carrying traffic from a number of sources. Each source generates an on-off traffic stream;
when the source is on, the rate of traffic is 10 Mbps, and when the source is off, the rate of traffic is zero. The duty cycle,
which is the ratio of on-time to off-time, is 1 : 2. When there is no buffer at the link, the minimum number of sources that
can be multiplexed on the link so that link capacity is not wasted and no data loss occurs is S 1. Assuming that all sources are
synchronized and that the link is provided with a large buffer, the maximum number of sources that can be multiplexed so
that no data loss occurs is S2. The values of S 1 and S 2 are, respectively,

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 439 of 852

A) 10 and 30
B) 12 and 25
C) 5 and 33
D) 15 and 22

gate2006-it computer-networks network-flow normal

7.77 Network Flow: GATE1992_02,v top gateoverflow.in/560

02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

(v). Start and stop bis don not contain an 'information' but are used in serial communication

(a). Error detection

(b). Error correction

(c). Synchronization

(d). Slowing down the communications

gate1992 easy computer-networks network-flow

7.78 Network Flow: GATE2005-IT_72 top gateoverflow.in/3835

A channel has a bit rate of 4 kbps and one-way propagation delay of 20 ms. The channel uses stop and wait protocol. The
transmission time of the acknowledgement frame is negligible. To get a channel efficiency of at least 50%, the minimum
frame size should be

A) 80 bytes
B) 80 bits
C) 160 bytes
D) 160 bits

gate2005-it computer-networks network-flow stop-and-wait normal

7.79 Network Flow: GATE2004-IT_80 top gateoverflow.in/3724

In a data link protocol, the frame delimiter flag is given by 0111. Assuming that bit stuffing is employed, the transmitter
sends the data sequence 01110110 as

A) 01101011
B) 011010110
C) 011101100
D) 0110101100

gate2004-it computer-networks network-flow normal

7.80 Network Layering: GATE2004_15 top gateoverflow.in/1012

Choose the best matching between Group 1 and Group 2

Group - 1 Group -2
1. Ensures reliable transport of data over a
P. Data link layer
physical point-to-point link
Q. Network layer 2. Encodes/decodes data for physical transmission
3. Allows end-to-end communication between two
R. Transport layer
processes
4. Routes data from one network node to the next

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 440 of 852

A. P-1, Q-4, R-3


B. P-2, Q-4, R-1
C. P-2, Q-3, R-1
D. P-1, Q-3, R-2

gate2004 computer-networks network-layering normal

7.81 Network Layering: GATE2003_28 top gateoverflow.in/918

Which of the following functionality must be implemented by a transport protocol over and above the network protocol?

A. Recovery from packet losses


B. Detection of duplicate packets
C. Packet delivery in the correct order
D. End to end connectivity

gate2003 computer-networks network-layering easy

7.82 Network Layering: GATE2007_70 top gateoverflow.in/1268

Match the following:

(P) SMTP (1) Application layer


(Q) BGP (2) Transport layer
(R) TCP (3) Data link layer
(S) PPP (4) Network layer
(5) Physical layer

P - 2, Q - 1, R - 3, S - 5

P - 1, Q - 4, R - 2, S - 3

P - 1, Q - 4, R - 2, S - 5

P - 2, Q - 4, R - 1, S - 3

gate2007 computer-networks network-layering network-protocols easy

7.83 Network Layering: GATE2013_14 top gateoverflow.in/1436

Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many
times each packet has to visit the network layer and the data link layer during a transmission from S to D.

(A) Network layer 4 times and Data link layer 4 times

(B) Network layer 4 times and Data link layer 3 times

(C) Network layer 4 times and Data link layer 6 times

(D) Network layer 2 times and Data link layer 6 times

gate2013 computer-networks network-layering normal

7.84 Network Protocols: GATE2007_20 top gateoverflow.in/1218

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 441 of 852

Which one of the following uses UDP as the transport protocol?

A. HTTP
B. Telnet
C. DNS
D. SMTP

gate2007 computer-networks network-protocols application-layer-protocols easy

7.85 Network Protocols: GATE2007-IT_69 top gateoverflow.in/3514

Consider the following clauses:

i. Not inherently suitable for client authentication.


ii. Not a state sensitive protocol.
iii. Must be operated with more than one server.
iv. Suitable for structured message organization.
v. May need two ports on the serve side for proper operation.

The option that has the maximum number of correct matches is

1) IMAP-(i), FTP-(ii), HTTP-(iii), DNS-(iv), POP3-(v)


2) FTP-(i), POP3-(ii), SMTP-(iii), HTTP-(iv), IMAP-(v)
3) POP3-(i), SMTP-(ii), DNS-(iii), IMAP-(iv), HTTP-(v)
4) SMTP-(i), HTTP-(ii), IMAP-(iii), DNS-(iv), FTP-(v)

gate2007-it computer-networks network-protocols normal

7.86 Network Protocols: GATE 2016-1-24 top gateoverflow.in/39639

Which one of the following protocols is NOT used to resolve one form of address to another one?

A. DNS
B. ARP
C. DHCP
D. RARP

gate2016-1 computer-networks network-protocols normal

7.87 Network Protocols: GATE2008-IT_68 top gateoverflow.in/3382

Which of the following statements are TRUE?

(S1) TCP handles both congestion and flow control


(S2) UDP handles congestion but not flow control
(S3) Fast retransmit deals with congestion but not flow control
(S4) Slow start mechanism deals with both congestion and flow control

1) S1, S2 and S3 only


2) S1 and S3 only
3) S3 and S4 only
4) S1, S3 and S4 only

gate2008-it computer-networks network-protocols normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 442 of 852

7.88 Network Protocols: GATE2015-1_17 top gateoverflow.in/8214

In one of the pairs of protocols given below , both the protocols can use multiple TCP connections between the same client
and the server. Which one is that?

A. HTTP, FTP
B. HTTP, TELNET
C. FTP, SMTP
D. HTTP, SMTP

gate2015-1 computer-networks network-protocols normal

7.89 Network Security: GATE2007-IT_70 top gateoverflow.in/3515

Your are given the following four bytes :

10100011 00110111 11101001 10101011

Which of the following are substrings of the base 64 encoding of the above four bytes ?

A) zdp
B) fpq
C) qwA
D) oze

gate2007-it computer-networks network-security normal

7.90 Network Security: GATE2015-1_21 top gateoverflow.in/8244

Suppose that everyone in a group on N people wants to communicate secretly with the N - 1 others using symmetric Key
cryptographic system. The communication between any two person should not be decodable by the others in the group. The
numbers of keys required in the system as a whole to satisfy the confidentiality requirement is

A. 2N
B. N(N - 1)
C. N(N - 1)/2
D. (N - 1)2

gate2015-1 computer-networks network-security normal

7.91 Network Security: TIFR2011-B-36 top gateoverflow.in/20918

Consider malware programs. Which of the following is true?

a. A worm is a parasite.
b. A virus cannot affect a linux operating system.
c. A trojan can be in the payload of only a worm.
d. A worm and virus are self replicating programs.
e. There is no difference between a virus and a worm.

tifr2011 computer-networks network-security

7.92 Network Security: GATE2014-1_24 top gateoverflow.in/1791

Which of the following are used to generate a message digest by the network security protocols?

(P) RSA (Q) SHA-1 (R) DES (S) MD5

(A) P and R only

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 443 of 852

(B) Q and R only

(C) Q and S only

(D) R and S only

gate2014-1 computer-networks network-security normal

7.93 Network Security: GATE2007-IT_15 top gateoverflow.in/3448

Consider the following two statements:

i. A hash function (these are often used for computing digital signatures) is an injective function.
ii. A. encryption technique such as DES performs a permutation on the elements of its input alphabet.

Which one of the following options is valid for the above two statements?

A) Both are false


B) Statement (i) is true and the other is false
C) Statement (ii) is true and the other is false
D) Both are true

gate2007-it computer-networks network-security normal

7.94 Network Security: GATE 2016-1-52 top gateoverflow.in/39694

Consider that B wants to send a message m that is digitally signed to A. Let the pair of private and public keys for A and B
+
be denoted by Kx and Kx for x = A, B, respectively. Let Kx (m) represent the operation of encrypting m with a key
Kx and H(m) represent the message digest. Which one of the following indicates the CORRECT way of sending the
message m along with the digital signature to A?

A. {m, KB + (H(m))}
B. {m, KB (H(m))}
C. {m, KA (H(m))}
+
D. {m, KA (m)}

gate2016-1 computer-networks network-security easy

7.95 Network Security: GATE2005-IT_79 top gateoverflow.in/3843

Suppose that two parties A and B wish to setup a common secret key (D-H key) between themselves using the Diffie-
Hellman key exchange technique. They agree on 7 as the modulus and 3 as the primitive root. Party A chooses 2 and party
B chooses 5 as their respective secrets. Their D-H key is

A) 3
B) 4
C) 5
D) 6

gate2005-it computer-networks network-security normal

7.96 Network Security: GATE2014-2_27 top gateoverflow.in/1986

An IP machine Q has a path to another IP machine H via three IP routers R1, R2, and R3.

Q R1 R2 R3 H

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 444 of 852

H acts as an HTTP server, and Q connects to H via HTTP and downloads a file. Session layer encryption is used, with DES as
the shared key encryption protocol. Consider the following four pieces of information:

[I1] The URL of the file downloaded by Q


[I2] The TCP port numbers at Q and H
[I3] The IP addresses of Q and H
[I4] The link layer addresses of Q and H
Which of I1, I2, I3, and I4 can an intruder learn through sniffing at R2 alone?

(A) Only I1 and I2

(B) Only I1

(C) Only I2 and I3

(D) Only I3 and I4

gate2014-2 computer-networks network-security normal

7.97 Network Security: GATE2013_13 top gateoverflow.in/1435

Using public key cryptography, X adds a digital signature to message M , encrypts < M, >, and sends it to Y , where it
is decrypted. Which one of the following sequences of keys is used for the operations?

(A) Encryption: Xs private key followed by Ys private key; Decryption: Xs public key followed by Ys public key

(B) Encryption: Xs private key followed by Ys public key; Decryption: Xs public key followed by Ys private key

(C) Encryption: Xs public key followed by Ys private key; Decryption: Ys public key followed by Xs private key

(D) Encryption: Xs private key followed by Ys public key; Decryption: Ys private key followed by Xs public key

gate2013 computer-networks network-security normal

7.98 Network Security: GATE2009_46 top gateoverflow.in/1332

In the RSA public key cryptosystem, the private and public keys are (e, n) and (d, n) respectively, where n = p q and p
and q are large primes. Besides, n is public and p and q are private. Let M be an integer such that 0 < M < n and
(n) = (p 1)(q 1). Now consider the following equations.
I. M
= M e mod n
M = (M )d mod n
II. ed 1 mod n
III. ed 1 mod (n)
IV. M
= M e mod (n)
M = (M )d mod (n)
Which of the above equations correctly represents RSA cryptosystem?

A. I and II
B. I and III
C. II and IV
D. III and IV

gate2009 computer-networks network-security normal

7.99 Network Security: GATE2008-IT_70 top gateoverflow.in/3384

The total number of keys required for a set of n individuals to be able to communicate with each other using secret key and

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 445 of 852

public key cryptosystems, respectively are:

A) n(n-1) and 2n
B) 2n and ((n(n - 1))/2)
C) ((n(n - 1))/2) and 2n
D) ((n(n - 1))/2) and n

gate2008-it computer-networks network-security normal

7.100 Network Security: GATE2004-IT_84 top gateoverflow.in/3728

Consider a parity check code with three data bits and four parity check bits. Three of the code words are 0101011, 1001101
and 1110001. Which of the following are also code words?
I. 0010111 II. 0110110 III. 1011010 IV. 0111010

A) I and III
B) I, II and III
C) II and IV
D) I, II, III and IV

gate2004-it computer-networks network-security normal

7.101 Network Security: GATE2004-IT_25 top gateoverflow.in/3666

A sender is employing public key cryptography to send a secret message to a receiver. Which one of the following
statements is TRUE?

A) Sender encrypts using receiver's public key
B) Sender encrypts using his own public key
C) Receiver decrypts using sender's public key
D) Receiver decrypts using his own public key

gate2004-it computer-networks network-security normal

7.102 Network Switching: GATE2005_73 top gateoverflow.in/1396

In a packet switching network, packets are routed from source to destination along a single path having two intermediate
nodes. If the message size is 24 bytes and each packet contains a header of 3 bytes, then the optimum packet size is:

A. 4
B. 6
C. 7
D. 9

gate2005 computer-networks network-switching normal

7.103 Network Switching: GATE2004-IT_22 top gateoverflow.in/3663

Which one of the following statements is FALSE?

A) Packet switching leads to better utilization of bandwidth resources than circuit switching
B) Packet switching results in less variation in delay than circuit switching
C) Packet switching requires more per-packet processing than circuit switching

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 446 of 852

D) Packet switching can lead to reordering unlike in circuit switching


gate2004-it computer-networks network-switching normal

7.104 Network Switching: GATE2014-2_26 top gateoverflow.in/1985

Consider the store and forward packet switched network given below. Assume that the bandwidth of each link is 106 bytes / sec. A user on host A sends a le of
size 103 bytes to host B through routers R1 and R2 in three dierent ways. In the rst case a single packet containing the complete le is transmitted from A to B.
In the second case, the le is split into 10 equal parts, and these packets are transmitted from A to B. In the third case, the le is split into 20 equal parts and
these packets are sent from A to B. Each packet contains 100 bytes of header information along with the user data. Consider only transmission time and ignore
processing, queuing and propagation delays. Also assume that there are no errors during transmission. Let T1, T2 and T3 be the times taken to transmit the le in
the first, second and third case respectively. Which one of the following is CORRECT?

(A) T < T2 < T3

(B) T 1 > T2 > T3

(C) T 2 = T 3, T 3 < T 1

(D) T 1 = T 3, T 3 > T 2

gate2014-2 computer-networks network-switching normal

7.105 Osi Protocol: GATE2014-3_23 top gateoverflow.in/2057

In the following pairs of OSI protocol layer/sub-layer and its functionality, the INCORRECT pair is

(A) Network layer and Routing

(B) Data Link Layer and Bit synchronization

(C) Transport layer and End-to-end process communication

(D) Medium Access Control sub-layer and Channel sharing

gate2014-3 computer-networks network-layering osi-protocol easy

7.106 Routers Bridge Hubs Switches: GATE2004_16 top gateoverflow.in/1013

Which of the following is NOT true with respect to a transparent bridge and a router?

A. Both bridge and router selectively forward data packets

B. A bridge uses IP addresses while a router uses MAC addresses

C. A bridge builds up its routing table by inspecting incoming packets

D. A router can connect between a LAN and a WAN

gate2004 computer-networks routers-bridge-hubs-switches normal

7.107 Routing: GATE2014-3_26 top gateoverflow.in/2060

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 447 of 852

An IP router implementing Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router's routing table has the following
entries:

Prefix Output Interface Identifier


131.16.0.0/ 12 3
131.28.0.0/ 14 5
131.19.0.0/ 16 2
131.22.0.0/ 15 1

The identifier of the output interface on which this packet will be forwarded is ______.

gate2014-3 computer-networks routing normal

7.108 Routing: GATE2008-IT_67 top gateoverflow.in/3381

Two popular routing algorithms are Distance Vector(DV) and Link State (LS) routing. Which of the following are true?

(S1) Count to infinity is a problem only with DV and not LS routing


(S2) In LS, the shortest path algorithm is run only at one node
(S3) In DV, the shortest path algorithm is run only at one node
(S4) DV requires lesser number of network messages than LS

A) S1, S2 and S4 only


B) S1, S3 and S4 only
C) S2 and S3 only
D) S1 and S4 only

gate2008-it computer-networks routing normal

7.109 Routing: GATE2005-IT_85b top gateoverflow.in/3859

Consider a simple graph with unit edge costs. Each node in the graph represents a router. Each node maintains a routing
table indicating the next hop router to be used to relay a packet to its destination and the cost of the path to the destination
through that router. Initially, the routing table is empty. The routing table is synchronously updated as follows. In each
updation interval, three tasks are performed.

i. A node determines whether its neighbours in the graph are accessible. If so, it sets the tentative cost to each accessible
neighbour as 1. Otherwise, the cost is set to .
ii. From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
iii. Each node updates its routing table based on the information received in the previous two steps by choosing the
minimum cost.

Continuing from the earlier problem, suppose at some time t, when the costs have stabilized, node A goes down. The cost
from node F to node A at time (t + 100) is :

A. > 100 but finite


B.
C. 3
D. > 3 and 100

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 448 of 852

gate2005-it computer-networks routing normal

7.110 Routing: GATE2005-IT_85a top gateoverflow.in/3858

Consider a simple graph with unit edge costs. Each node in the graph represents a router. Each node maintains a routing
table indicating the next hop router to be used to relay a packet to its destination and the cost of the path to the destination
through that router. Initially, the routing table is empty. The routing table is synchronously updated as follows. In each
updation interval, three tasks are performed.

i. A node determines whether its neighbours in the graph are accessible. If so, it sets the tentative cost to each accessible
neighbour as 1. Otherwise, the cost is set to .
ii. From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
iii. Each node updates its routing table based on the information received in the previous two steps by choosing the
minimum cost.

For the graph given above, possible routing tables for various nodes after they have stabilized, are shown in the following
options. Identify the correct table.

Table for node A
A - -
B B 1
1) C C 1
D B 3
E C 3
F C 4
Table for node C
A A 1
B B 1
2) C - -
D D 1
E E 1
F E 3
Table for node B
A A 1
B - -
3) C C 1
D D 1
E C 2
F D 2
Table for node D
A B 3
B B 1
4) C C 1
D - -
E E 1
F F 1

gate2005-it computer-networks routing normal

7.111 Routing: GATE2014-2_23 top gateoverflow.in/1981

Which of the following is TRUE about the interior gateway routing protocols Routing Information Protocol (RIP) and Open Shortest Path First (OSPF)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 449 of 852

(A) RIP uses distance vector routing and OSPF uses link state routing

(B) OSPF uses distance vector routing and RIP uses link state routing

(C) Both RIP and OSPF use link state routing

(D) Both RIP and OSPF use distance vector routing

gate2014-2 computer-networks routing normal

7.112 Routing: GATE2007-IT_63 top gateoverflow.in/3508

A group of 15 routers are interconnected in a centralized complete binary tree with a router at each tree node. Router i
communicates with router j by sending a message to the root of the tree. The root then sends the message back down to
router j. The mean number of hops per message, assuming all possible router pairs are equally likely is

A) 3
B) 4.26
C) 4.53
D) 5.26

gate2007-it computer-networks routing binary-tree normal

7.113 Routing: GATE2005_26 top gateoverflow.in/1362

In a network of LANs connected by bridges, packets are sent from one LAN to another through intermediate bridges. Since
more than one path may exist between two LANs, packets may have to be routed through multiple bridges. Why is the
spanning tree algorithm used for bridge-routing?

A. For shortest path routing between LANs

B. For avoiding loops in the routing paths

C. For fault tolerance

D. For minimizing collisions

gate2005 computer-networks routing normal

7.114 Selective Repeat: GATE 2016-2-55 top gateoverflow.in/39577

Consider a 128 103 bits/second satellite communication link with one way propagation delay of 150 milliseconds. Selective
retransmission (repeat) protocol is used on this link to send data with a frame size of 1 kilobyte. Neglect the transmission
time of acknowledgement. The minimum number of bits required for the sequence number field to achieve 100% utilization
is ________.

gate2016-2 computer-networks selective-repeat normal numerical-answers

7.115 Serial Communication: GATE1998_1.16 top gateoverflow.in/1653

In serial communication employing 8 data bits, a parity bit and 2 stop bits, the minimum band rate required to sustain a
transfer rate of 300 characters per second is

A. 2400 band
B. 19200 band
C. 4800 band
D. 1200 band

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 450 of 852

gate1998 computer-networks communication serial-communication normal

7.116 Serial Communication: GATE2008-IT_18 top gateoverflow.in/3278

How many bytes of data can be sent in 15 seconds over a serial link with baud rate of 9600 in asynchronous mode with odd
parity and two stop bits in the frame?

A) 10,000 bytes
B) 12,000 bytes
C) 15,000 bytes
D) 27,000 bytes

gate2008-it computer-networks communication serial-communication normal

7.117 Sliding Window: GATE2004-IT_83 top gateoverflow.in/3727

A 20 Kbps satellite link has a propagation delay of 400 ms. The transmitter employs the "go back n ARQ" scheme with n set
to 10. Assuming that each frame is 100 bytes long, what is the maximum data rate possible?

1) 5 Kbps
2) 10 Kbps
3) 15 Kbps
4) 20 Kbps

gate2004-it computer-networks sliding-window normal

7.118 Sliding Window: GATE2008-IT_64 top gateoverflow.in/3375

A 1Mbps satellite link connects two ground stations. The altitude of the satellite is 36,504 km and speed of the signal is 3
108 m/s. What should be the packet size for a channel utilization of 25% for a satellite link using go-back-127 sliding window
protocol? Assume that the acknowledgment packets are negligible in size and that there are no errors during communication.

A) 120 bytes
B) 60 bytes
C) 240 bytes
D) 90 bytes

gate2008-it computer-networks sliding-window normal

7.119 Sliding Window: GATE2006_46 top gateoverflow.in/1822

Station A needs to send a message consisting of 9 packets to Station B using a sliding window (window size 3) and go-back-
n error control strategy. All packets are ready and immediately available for transmission. If every 5 th packet that
A transmits gets lost (but no acks from B ever get lost), then what is the number of packets that A will transmit for sending
the message to B?

(A) 12
(B) 14
(C) 16
(D) 18

gate2006 computer-networks sliding-window normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 451 of 852

7.120 Sliding Window: GATE2004-IT_81 top gateoverflow.in/3725

In a sliding window ARQ scheme, the transmitter's window size is N and the receiver's window size is M. The minimum
number of distinct sequence numbers required to ensure correct operation of the ARQ scheme is

A) min (M, N)
B) max (M, N)
C) M + N
D) MN

gate2004-it computer-networks sliding-window normal

7.121 Sliding Window: GATE2004-IT_88 top gateoverflow.in/3732

Suppose that the maximum transmit window size for a TCP connection is 12000 bytes. Each packet consists of 2000 bytes.
At some point of time, the connection is in slow-start phase with a current transmit window of 4000 bytes. Subsequently, the
transmitter receives two acknowledgements. Assume that no packets are lost and there are no time-outs. What is the
maximum possible value of the current transmit window?

A) 4000 bytes
B) 8000 bytes
C) 10000 bytes
D) 12000 bytes

gate2004-it computer-networks sliding-window normal

7.122 Sliding Window: GATE2006_44 top gateoverflow.in/1820

Station A uses 32 byte packets to transmit messages to Station B using a sliding window protocol. The round trip delay
between A and B is 80 milliseconds and the bottleneck bandwidth on the path between A and B is 128 kbps. What is
the optimal window size that A should use?

(A) 20

(B) 40

(C) 160

(D) 320

gate2006 computer-networks sliding-window normal

7.123 Sliding Window: GATE2005_25 top gateoverflow.in/1361

The maximum window size for data transmission using the selective reject protocol with n bit frame sequence numbers
is:

(a) 2n (b) 2n1 (c) 2n 1 (d) 2n2


gate2005 computer-networks sliding-window easy

7.124 Sliding Window: GATE2006-IT_64 top gateoverflow.in/3608

Suppose that it takes 1 unit of time to transmit a packet (of fixed size) on a communication link. The link layer uses a
window flow control protocol with a window size of N packets. Each packet causes an ack or a nak to be generated by the
receiver, and ack/nak transmission times are negligible. Further, the round trip time on the link is equal to N units. Consider
time i > N. If only acks have been received till time i(no naks), then the goodput evaluated at the transmitter at time i(in

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 452 of 852

packets per unit time) is

A) 1 - N/i
B) i/(N + i)
C) 1
D) 1 - e (i/N)

gate2006-it computer-networks sliding-window normal

7.125 Sliding Window: GATE2007_69 top gateoverflow.in/1267

The distance between two stations M and N is L kilometers. All frames are K bits long. The propagation delay per
kilometer is t seconds. Let R bits/second be the channel capacity. Assuming that the processing delay is negligible, the
minimum number of bits for the sequence number field in a frame for maximum utilization, when the
sliding window protocol is used, is:

2LtR+2K
A. log2 K

2LtR
B. log2 K

2LtR+K
C. log2 K

2LtR+2K
D. log2 2K

gate2007 computer-networks sliding-window normal

7.126 Sliding Window: GATE2003_84 top gateoverflow.in/967

Host A is sending data to host B over a full duplex link. A and B are using the sliding window protocol for flow control. The
send and receive window sizes are 5 packets each. Data packets (sent only from A to B) are all 1000 bytes long and the
transmission time for such a packet is 50 s. Acknowledgement packets (sent only from B to A) are very small and require
negligible transmission time. The propagation delay over the link is 200 s. What is the maximum achievable throughput in
this communication?

A. 7.69 106 bps

B. 11.11 106 bps

C. 12.33 106 bps

D. 15.00 106 bps

gate2003 computer-networks sliding-window normal

7.127 Sliding Window: GATE2014-1_28 top gateoverflow.in/1795

Consider a selective repeat sliding window protocol that uses a frame size of 1 KB to send data on a 1.5 Mbps link with a
one-way latency of 50 msec. To achieve a link utilization of 60%, the minimum number of bits required to represent the
sequence number field is ________.

gate2014-1 computer-networks sliding-window numerical-answers normal

7.128 Sliding Window: GATE2015-3_28 top gateoverflow.in/8481

Consider a network connecting two systems located 8000 kilometers apart. The bandwidth of the network is 500 106 bits
per second. The propagation speed of the media is 4 106 meters per second. It is need to design a Go-Back- N sliding
7

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 453 of 852

window protocol for this network. The average packet size is 107 bits. The network is to be used to its full capacity. Assume
that processing delays at nodes are negligible. Then, the minimum size in bits of the sequence number field has to be
______.

gate2015-3 computer-networks sliding-window normal numerical-answers

7.129 Sliding Window: GATE2009-57 top gateoverflow.in/1340

Frames of 1000 bits are sent over a 106 bps duplex link between two hosts. The propagation time is 25ms. Frames are to be
transmitted into this link to maximally pack them in transit (within the link).

What is the minimum number of bits (I) that will be required to represent the sequence numbers distinctly? Assume that no
time gap needs to be given between transmission of two frames.

A. I=2
B. I=3
C. I=4
D. I=5

gate2009 computer-networks sliding-window normal

7.130 Sliding Window: GATE2009-58 top gateoverflow.in/43470

Frames of 1000 bits are sent over a 106 bps duplex link between two hosts. The propagation time is 25ms. Frames are to be
transmitted into this link to maximally pack them in transit (within the link).

Let I be the minimum number of bits (I) that will be required to represent the sequence numbers distinctly assuming that no
time gap needs to be given between transmission of two frames.

Suppose that the sliding window protocol is used with the sender window size of 2l , where I is the numbers of bits as
mentioned earlier and acknowledgements are always piggy backed. After sending 2I frames, what is the minimum time the
sender will have to wait before starting transmission of the next frame? (Identify the closest choice ignoring the frame
processing time.)

A. 16ms
B. 18ms
C. 20ms
D. 22ms

gate2009 computer-networks sliding-window normal

7.131 Sockets: GATE2014-2_24 top gateoverflow.in/1982

Which of the following socket API functions converts an unconnected active TCP socket into a passive socket?

(A) connect

(B) bind

(C) listen

(D) accept

gate2014-2 computer-networks sockets easy

7.132 Sockets: GATE2008_17 top gateoverflow.in/415

Which of the following system calls results in the sending of SYN packets?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 454 of 852

A. socket

B. bind

C. listen

D. connect

gate2008 normal computer-networks sockets

7.133 Sockets: GATE2008_59 top gateoverflow.in/482

A client process P needs to make a TCP connection to a server process S. Consider the following situation: the server process
S executes a socket(), a bind() and a listen() system call in that order, following which it is preempted. Subsequently, the
client process P executes a socket() system call followed by connect() system call to connect to the server process S. The
server process has not executed any accept() system call. Which one of the following events could take place?

A. connect() system call returns successfully

B. connect() system call blocks

C. connect() system call returns an error

D. connect() system call results in a core dump

gate2008 computer-networks sockets normal

7.134 Sockets: GATE2015-2_20 top gateoverflow.in/8108

Identify the correct order in which a server process must invoke the function calls accept, bind, listen, and recv according to
UNIX socket API.

A. listen, accept, bind, recv


B. bind, listen, accept, recv
C. bind, accept, listen, recv
D. accept, listen, bind, recv

gate2015-2 computer-networks sockets easy

7.135 Stop And Wait: GATE 2016-1-55 top gateoverflow.in/39696

A sender uses the Stop-and-Wait ARQ protocol for reliable transmission of frames. Frames are of size 1000 bytes and the
transmission rate at the sender is 80 Kbps (1 Kbps = 1000 bits/second). Size of an acknowledgement is 100 bytes and the
transmission rate at the receiver is 8 Kbps. The one-way propagation delay is 100 milliseconds.

Assuming no frame is lost, the sender throughout is ________ bytes/ second.

gate2016-1 computer-networks stop-and-wait normal numerical-answers

7.136 Stop And Wait: GATE2006-IT_68 top gateoverflow.in/3612

On a wireless link, the probability of packet error is 0.2. A stop-and-wait protocol is used to transfer data across the link.
The channel condition is assumed to be independent from transmission to transmission. What is the average number of
transmission attempts required to transfer 100 packets?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 455 of 852

A) 100
B) 125
C) 150
D) 200

gate2006-it computer-networks sliding-window stop-and-wait normal

7.137 Stop And Wait: GATE2015-1_53 top gateoverflow.in/8363

Suppose that the stop-and-wait protocol is used on a link with a bit rate of 64 kilobits per second and 20 milliseconds
propagation delay. Assume that the transmission time for the acknowledgement and the processing time at nodes are
negligible. Then the minimum frame size in bytes to achieve a link utilization of at least 50% is_________________.

gate2015-1 computer-networks stop-and-wait normal

7.138 Subnetting: GATE2007_67 top gateoverflow.in/1265

The address of a class B host is to be split into subnets with a 6-bit subnet number. What is the maximum number of
subnets and the maximum number of hosts in each subnet?

A. 62 subnets and 262142 hosts.

B. 64 subnets and 262142 hosts.

C. 62 subnets and 1022 hosts.

D. 64 subnets and 1022 hosts.

gate2007 computer-networks subnetting easy

7.139 Subnetting: GATE2015-2_41 top gateoverflow.in/8213

Consider the following routing table at an IP router:

Network No Net Mask Next Hop


128.96.170.0 255.255.254.0 Interface 0
128.96.168.0 255.255.254.0 Interface 1
128.96.166.0 255.255.254.0 R2
128.96.164.0 255.255.252.0 R3
0.0.0.0 Default R4

For each IP address in Group I Identify the correct choice of the next hop from Group II using the entries from the routing
table above.

Group I Group II
i) 128.96.171.92 a) Interface 0
ii) 128.96.167.151 b) Interface 1
iii) 128.96.163.151 c) R2
iv) 128.96.164.121 d) R3
e) R4

A. i-a, ii-c, iii-e, iv-d


B. i-a, ii-d, iii-b, iv-e
C. i-b, ii-c, iii-d, iv-e
D. i-b, ii-c, iii-e, iv-d

gate2015-2 computer-networks subnetting easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 456 of 852

7.140 Subnetting: GATE2015-3_38 top gateoverflow.in/8497

In the network 200.10.11.144/27, the fourth octet (in decimal) of the last IP address of the network which can be assigned
to a host is _____.

gate2015-3 computer-networks subnetting normal

7.141 Subnetting: GATE2008_57 top gateoverflow.in/480

If a class B network on the Internet has a subnet mask of 255.255.248.0, what is the maximum number of hosts per
subnet?

A. 1022
B. 1023
C. 2046
D. 2047

gate2008 computer-networks subnetting easy

7.142 Subnetting: GATE2006_45 top gateoverflow.in/1821

Two computers C1 and C2 are configured as follows. C1 has IP address 203.197.2.53 and netmask 255.255.128.0. C2 has
IP address 203.197.75.201 and netmask 255.255.192.0. Which one of the following statements is true?

(A) C1 and C2 both assume they are on the same network


(B) C2 assumes C1 is on same network, but C1 assumes C2 is on a different network
(C) C1 assumes C2 is on same network, but C2 assumes C1 is on a different network
(D) C1 and C2 both assume they are on different networks.

gate2006 computer-networks subnetting normal

7.143 Subnetting: GATE2005-IT_76 top gateoverflow.in/3839

A company has a class C network address of 204.204.204.0. It wishes to have three subnets, one with 100 hosts and two
with 50 hosts each. Which one of the following options represents a feasible set of subnet address/subnet mask pairs?

204.204.204.128/255.255.255.192
1) 204.204.204.0/255.255.255.128
204.204.204.64/255.255.255.128
204.204.204.0/255.255.255.192
2) 204.204.204.192/255.255.255.128
204.204.204.64/255.255.255.128
204.204.204.128/255.255.255.128
3) 204.204.204.192/255.255.255.192
204.204.204.224/255.255.255.192
204.204.204.128/255.255.255.128
4) 204.204.204.64/255.255.255.192
204.204.204.0/255.255.255.192

gate2005-it computer-networks subnetting normal

7.144 Subnetting: GATE2008-IT_85 top gateoverflow.in/3409

Host X has IP address 192.168.1.97 and is connected through two routers R1 and R2 to another host Y with IP address
192.168.1.80. Router R1 has IP addresses 192.168.1.135 and 192.168.1.110. R2 has IP addresses 192.168.1.67 and
192.168.1.155. The netmask used in the network is 255.255.255.224.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 457 of 852

Which IP address should X configure its gateway as?

A) 192.168.1.67
B) 192.168.1.110
C) 192.168.1.135
D) 192.168.1.155

gate2008-it computer-networks subnetting normal

7.145 Subnetting: GATE2006-IT_70 top gateoverflow.in/3614

A subnetted Class B network has the following broadcase address : 144.16.95.255. Its subnet mask

A) is necessarily 255.255.224.0
B) is necessarily 255.255.240.0
C) is necessarily 255.255.248.0.
D) could be any one of 255.255.224.0, 255.255.240.0, 255.255.248.0

gate2006-it computer-networks subnetting normal

7.146 Subnetting: GATE2012_34 top gateoverflow.in/1752

An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20.
The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the
remaining with itself. Which of the following is a valid allocation of addresses to A and B?

(A) 245.248.136.0/21 and 245.248.128.0/22


(B) 245.248.128.0/21 and 245.248.128.0/22
(C) 245.248.132.0/22 and 245.248.132.0/21
(D) 245.248.136.0/24 and 245.248.132.0/21

gate2012 computer-networks subnetting normal

7.147 Subnetting: GATE2006-IT_63 top gateoverflow.in/3607

A router uses the following routing table:

A packet bearing a destination address 144.16.68.117 arrives at the router. On which interface will it be forwarded?

A) eth0
B) eth1
C) eth2
D) eth3

gate2006-it computer-networks subnetting normal

7.148 Subnetting: GATE2008-IT_84 top gateoverflow.in/3408

Host X has IP address 192.168.1.97 and is connected through two routers R1 and R2 to another host Y with IP address

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 458 of 852

192.168.1.80. Router R1 has IP addresses 192.168.1.135 and 192.168.1.110. R2 has IP addresses 192.168.1.67 and
192.168.1.155. The netmask used in the network is 255.255.255.224.

Given the information above, how many distinct subnets are guaranteed to already exist in the network?

A) 1
B) 2

C) 3

D) 6

gate2008-it computer-networks subnetting normal

7.149 Subnetting: GATE2004-IT_26 top gateoverflow.in/3667

A subnet has been assigned a subnet mask of 255.255.255.192. What is the maximum number of hosts that can belong to
this subnet?

A) 14
B) 30
C) 62
D) 126

gate2004-it computer-networks subnetting normal

7.150 Subnetting: GATE2003_82 top gateoverflow.in/965

The subnet mask for a particular network is 255.255.31.0. Which of the following pairs of IP addresses could belong to this
network?

A. 172.57.88.62 and 172.56.87.233

B. 10.35.28.2 and 10.35.29.4

C. 191.203.31.87 and 191.234.31.88

D. 128.8.129.43 and 128.8.161.55

gate2003 computer-networks subnetting normal

7.151 Subnetting: GATE2010_47 top gateoverflow.in/2349

Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91 respectively and they both use same netmask N. Which of the
values of N given below should not be used if A and B should belong to the same network?

(A) 255.255.255.0

(B) 255.255.255.128

(C) 255.255.255.192

(D) 255.255.255.224

gate2010 computer-networks subnetting easy

7.152 Subnetting: GATE2005_27 top gateoverflow.in/1363

An organization has a class B network and wishes to form subnets for 64 departments. The subnet mask would be:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 459 of 852

A. 255.255.0.0

B. 255.255.64.0

C. 255.255.128.0

D. 255.255.252.0

gate2005 computer-networks subnetting normal

7.153 Subnetting: GATE2004_55 top gateoverflow.in/1051

The routing table of a router is shown below:

Destination Subnet Mask Interface


128.75.43.0 255.255.255.0 Eth0
128.75.43.0 255.255.255.128 Eth1
192.12.17.5 255.255.255.255 Eth3
Default Eth2

On which interface will the router forward packets addressed to destinations 128.75.43.16 and 192.12.17.10 respectively?

A. Eth1 and Eth2


B. Eth0 and Eth2
C. Eth0 and Eth3
D. Eth1 and Eth3

gate2004 computer-networks subnetting normal

7.154 Tcp: GATE2007-IT_14 top gateoverflow.in/3447

Consider a TCP connection in a state where there are no outstanding ACKs. The sender sends two segments back to back.
The sequence numbers of the first and second segments are 230 and 290 respectively. The first segment was lost, but the
second segment was received correctly by the receiver. Let X be the amount of data carried in the first segment (in bytes),
and Y be the ACK number sent by the receiver.
The values of X and Y (in that order) are

A) 60 and 290
B) 230 and 291
C) 60 and 231
D) 60 and 230

gate2007-it computer-networks tcp normal

7.155 Tcp: GATE2009_47 top gateoverflow.in/1333

While opening a TCP connection, the initial sequence number is to be derived using a time-of-day (ToD) clock that keeps
running even when the host is down. The low order 32 bits of the counter of the ToD clock is to be used for the initial
sequence numbers. The clock counter increments once per milliseconds. The maximum packet lifetime is given to be 64s.

Which one of the choices given below is closest to the minimum permissible rate at which sequence numbers used for
packets of a connection can increase?

A. 0.015/s
B. 0.064/s
C. 0.135/s
D. 0.327/s

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 460 of 852

gate2009 computer-networks tcp normal

7.156 Tcp: GATE2004-IT_23 top gateoverflow.in/3664

Which one of the following statements is FALSE?

A) TCP guarantees a minimum communication rate


B) TCP ensures in-order delivery
C) TCP reacts to congestion by reducing sender window size
D) TCP employs retransmission to compensate for packet loss

gate2004-it computer-networks tcp normal

7.157 Tcp: GATE2015-3_22 top gateoverflow.in/8425

Consider the following statements.

I. TCP connections are full duplex


II. TCP has no option for selective acknowledgement
III. TCP connections are message streams

A. Only I is correct
B. Only I and III are correct
C. Only II and III are correct
D. All of I, II and III are correct

gate2015-3 computer-networks tcp normal

7.158 Tcp: GATE2015-1_19 top gateoverflow.in/8217

Suppose two hosts use a TCP connection to transfer a large file . Which of the following statements is/are FALSE with respect
to the TCP connection?

I. If the sequence number of a segment is m, then the sequence number of the subsequent segment is always m+1.
II. If the estimated round trip time at any given point of time is t sec, the value of the retransmission timeout is always set
to greater than or equal to t sec.
III. The size of the advertised window never changes during the course of the TCP connection.
IV. The number of unacknowledged bytes at the sender is always less than or equal to the advertised window.

A. III only
B. I and III only
C. I and IV only
D. II and IV only

gate2015-1 computer-networks tcp normal

7.159 Tcp: GATE2004-IT_28 top gateoverflow.in/3669

In TCP, a unique sequence number is assigned to each

A) byte
B) word
C) segment
D) message

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 461 of 852

gate2004-it computer-networks tcp normal

7.160 Tcp: GATE2007-IT_13 top gateoverflow.in/3446

Consider the following statements about the timeout value used in TCP.

i. The timeout value is set to the RTT (Round Trip Time) measured during TCP connection establishment for the entire
duration of the connection.
ii. Appropriate RTT estimation algorithm is used to set the timeout value of a TCP connection.
iii. Timeout value is set to twice the propagation delay from the sender to the receiver.

Which of the following choices hold?

A) (i) is false, but (ii) and (iii) are true


B) (i) and (iii) are false, but (ii) is title
C) (i) and (ii) are false, but (iii) is true
D) (i), (ii) and (iii) are false

gate2007-it computer-networks tcp normal

7.161 Tcp: GATE2012_22 top gateoverflow.in/1605

Which of the following transport layer protocols is used to support electronic mail?

(A) SMTP
(B) IP
(C) TCP
(D) UDP

gate2012 computer-networks tcp easy

7.162 Token Bucket: GATE 2016-1-54 top gateoverflow.in/39720

For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 1 mega
byte and the maximum output rate is 20 mega bytes per second. Tokens arrive at a rate to sustain output at a rate of 10
mega bytes per second. The token bucket is currently full and the machine needs to send 12 mega bytes of data. The
minimum time required to transmit the data is _____________ seconds.

gate2016-1 computer-networks token-bucket normal numerical-answers

7.163 Udp: GATE2006-IT_69 top gateoverflow.in/3613

A program on machine X attempts to open a UDP connection to port 5376 on a machine Y, and a TCP connection to port
8632 on machine Z. However, there are no applications listening at the corresponding ports on Y and Z. An ICMP Port
Unreachable error will be generated by

A) Y but not Z
B) Z but not Y
C) Neither Y nor Z
D) Both Y and Z

gate2006-it computer-networks tcp udp normal

7.164 Udp: GATE2005_23 top gateoverflow.in/1359

Packets of the same session may be routed through different paths in:

A. TCP, but not UDP


B. TCP and UDP

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 462 of 852

C. UDP, but not TCP


D. Neither TCP nor UDP

gate2005 computer-networks tcp udp easy

7.165 Udp: GATE2013_12 top gateoverflow.in/1421

The transport layer protocols used for real time multimedia, file transfer, DNS and email, respectively are

(A) TCP, UDP, UDP and TCP

(B) UDP, TCP, TCP and UDP

(C) UDP, TCP, UDP and TCP

(D) TCP, UDP, TCP and UDP

gate2013 computer-networks tcp udp easy

7.166 Wifi: GATE 2016-2-54 top gateoverflow.in/39593

For the IEEE 802.11 MAC protocol for wireless communication, which of the following statements is/are TRUE?

(I) At least three non-overlapping channels are available for transmissions.

(II) The RTS-CTS mechanism is used for collision detection.

(III) Unicast frames are ACKed.

A. All I, II, and III


B. I and III only
C. II and III only
D. II only

gate2016-2 computer-networks wifi normal

7.167 GATE2008-IT_69 top gateoverflow.in/3383

The three way handshake for TCP connection establishment is shown below.

Which of the following statements are TRUE?


(S1) Loss of SYN + ACK from the server will not establish a connection
(S2) Loss of ACK from the client cannot establish the connection

(S3) The server moves LISTEN SYN_RCVD SYN_SENT ESTABLISHED in the state machine on no packet loss
(S4) The server moves LISTEN SYN_RCVD ESTABLISHED in the state machine on no packet loss.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 463 of 852

A) S2 and S3 only
B) S1 and S4 only
C) S1 and S3 only
D) S2 and S4 only

gate2008-it computer-networks normal

7.168 GATE2008-IT_66 top gateoverflow.in/3380

Data transmitted on a link uses the following 2D parity scheme for error detection:
Each sequence of 28 bits is arranged in a 47 matrix (rows r 0 through r 3, and columns d 7 through d 1) and is padded with a
column d0 and row r 4 of parity bits computed using the Even parity scheme. Each bit of column d 0 (respectively, row r 4)
gives the parity of the corresponding row (respectively, column). These 40 bits are transmitted over the data link.

The table shows data received by a receiver and has n corrupted bits. What is the minimum possible value of n?

A) 1
B) 2
C) 3
D) 4

gate2008-it computer-networks normal

7.169 GATE2008-IT_20 top gateoverflow.in/3280

Provide the best matching between the entries in the two columns given in the table below:

I. Proxy Server a. Firewall


II. Kazaa, DC++ b. Caching
III. Slip c. P2P
IV. DNS d. PPP

A) I-a, II-d, III-c, IV-b


B) I-b, II-d, III-c, IV-a
C) I-a, II-c, III-d, IV-b
D) I-b, II-c, III-d, IV-a

gate2008-it computer-networks normal

7.170 GATE2005_24 top gateoverflow.in/1360

The address resolution protocol (ARP) is used for:

(a) Finding the IP address from the DNS

(b) Finding the IP address of the default gateway

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 464 of 852

(c) Finding the IP address that corresponds to a MAC address

(d) Finding the MAC address that corresponds to an IP address

gate2005 computer-networks normal

7.171 GATE1992_03,v top gateoverflow.in/582

Start and stop bits do not contain any "information" but are used in serial communication for

(a). Error detection

(b). Error correction

(c). Synchronization

(d). Slowing down the communications.

gate1992 computer-networks easy

7.172 GATE2007-IT_18 top gateoverflow.in/3451

A firewall is to be configured to allow hosts in a private network to freely open TCP connections and send packets on open
connections. However, it will only allow external hosts to send packets on existing open TCP connections or connections that
are being opened (by internal hosts) but not allow them to open TCP connections to hosts in the private network. To achieve
this the minimum capability of the firewall should be that of

A) A combinational circuit
B) A finite automaton
C) A pushdown automaton with one stack
D) A pushdown automaton with two stacks

gate2007-it computer-networks theory-of-computation normal

7.173 GATE2006-IT_19 top gateoverflow.in/3558

Which of the following statements is TRUE?

A) Both Ethernet frame and IP packet include checksum fields


B) Ethernet frame includes a checksum field and IP packet includes a CRC field
C) Ethernet frame includes a CRC field and IP packet includes a checksum field
D) Both Ethernet frame and IP packet include CRC fields

gate2006-it computer-networks normal

7.174 gate top gateoverflow.in/38411

A 1Mbps satellite link connects two ground stations. The altitude of the satellite is 6000 km and speed of the signal is 3
10^8 m/s. What should be the packet size for a channel utilization of 50% for a satellite link using go-back-63 sliding
window protocol? Assume that the acknowledgment packets are negligible in size and that there are no errors during
communication.

7.175 GATE2015-3_36 top gateoverflow.in/8495

Two hosts are connected via a packet switch with 107 bits per second links. Each link has a propagation delay of 20
microseconds. The switch begins forwarding a packet 35 microseconds after it receives the same. If 10000 bits of data are to
be transmitted between the two hosts using a packet size of 5000 bits, the time elapsed between the transmission of the

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 465 of 852

first bit of data and the reception of the last bit of the data in microseconds is ______.

gate2015-3 computer-networks normal numerical-answers

7.176 GATE2015-2_34 top gateoverflow.in/8154

Assume that the bandwidth for a TCP connection is 1048560 bits/sec. Let be the value of RTT in milliseconds (rounded off
to the nearest integer) after which the TCP window scale option is needed. Let be the maximum possible window size with
window scale option. Then the values of and are

A. 63 milliseconds, 65535 214


B. 63 milliseconds, 65535 216
C. 500 milliseconds, 65535 214
D. 500 milliseconds, 65535 216

gate2015-2 computer-networks difficult

7.177 GATE2005-IT_77 top gateoverflow.in/3840

Assume that "host1.mydomain.dom" has an IP address of 145.128.16.8. Which of the following options would be most
appropriate as a subsequence of steps in performing the reverse lookup of 145.128.16.8? In the following options "NS" is an
abbreviation of "nameserver".

A) Query a NS for the root domain and then NS for the "dom" domains
B) Directly query a NS for "dom" and then a NS for "mydomain.dom" domains
C) Query a NS for in-addr.arpa and then a NS for 128.145.in-addr.arpa domains
D) Directly query a NS for 145.in-addr.arpa and then a NS for 128.145.in-addr.arpa domains

gate2005-it computer-networks normal

7.178 GATE 2016-2-25 top gateoverflow.in/39572

Identify the correct sequence in which the following packets are transmitted on the network by a host when a browser
requests a webpage from a remote server, assuming that the host has just been restarted.

A. HTTP GET request, DNS query, TCP SYN


B. DNS query, HTTP GET request, TCP SYN
C. DNS query, TCP SYN, HTTP GET request.
D. TCP SYN, DNS query, HTTP GET request.``

gate2016-2 computer-networks normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 466 of 852

8 Digital Logic top


8.1 Adder: GATE 2016-2-07 top gateoverflow.in/39575

Consider an eight-bit ripple-carry adder for computing the sum of A and B, where A and B are integers represented in 2's
complement form. If the decimal value of A is one, the decimal value of B that leads to the longest latency for the sum to
stabilize is ___________

gate2016-2 digital-logic adder normal numerical-answers

8.2 Adder: GATE 2016-1-33 top gateoverflow.in/39688

Consider a carry look ahead adder for adding two n-bit integers, built using gates of fan-in at most two. The time to perform
addition using this adder is

A. (1)
B. (log(n))
C. (n)
D. (n))

gate2016-1 digital-logic adder normal

8.3 Adder: GATE2004_45 top gateoverflow.in/15054

Q) A 4-bit carry look ahead adder, which adds two 4-bit numbers, is designed using AND, OR, NOT, NAND, NOR gates only.
Assuming that all the inputs are available in both complemented and uncomplemented forms and the delay of each gate is
one time unit, what is the overall propagation delay of the adder? Assume that the carry network has been implemented
using two-level AND-OR logic.

(a) 4 time units

(b) 6 time units

(c) 10 time units

(d) 12 time units

can you explain ?

gate2004 digital-logic adder

8.4 Boolean Algebra: TIFR2010-B-21 top gateoverflow.in/18621

For x {0, 1}, let x denote the negation of x, that is

x = {
1 iff x = 0
0 iff x = 1
.

If x {0, 1}n , then x denotes the component wise negation of x; that is:

( x)i = ( xi i [1..n])

Consider a circuit C, computing a function f : {0, 1}n {0, 1} using AND (), OR (),and NOT () gates. Let D be the
circuit obtained from C by replacing each AND gate by an OR gate and replacing each OR gate by an AND. Suppose D
computes the function g . Which of the following is true for all inputs x?

g(x) = f(x)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 467 of 852

a. g(x) = f(x)
b. g(x) = f(x) f(x)
c. g(x) = f(x) f(x)
d. g(x) = f(x)
e. None of the above.

tifr2010 digital-logic boolean-algebra

8.5 Boolean Algebra: GATE 2016-2-08 top gateoverflow.in/39540

Let, x1 x2 x3 x4 = 0 where x1 , x2 , x3 , x4 are Boolean variables, and is the XOR operator.


Which one of the following must always be TRUE?

A. x1 x2 x3 x4 = 0
B. x1 x3 + x2 = 0
C. x1 x3 = x2 x4
D. x1 + x2 + x3 + x4 =0

gate2016-2 digital-logic boolean-algebra normal

8.6 Boolean Algebra: GATE2000_2.10 top gateoverflow.in/657

The simultaneous equations on the Boolean variables x, y, z and w,

x+y+z = 1
xy = 0
xz + w = 1
xy + zw = 0
have the following solution for x, y, z and w, respectively:

A. 0 1 0 0
B. 1 1 0 1
C. 1 0 1 1
D. 1 0 0 0

gate2000 digital-logic boolean-algebra easy

8.7 Boolean Expressions: GATE2002_2.3 top gateoverflow.in/833

Let f(A, B) = A + B. Simplified expression for function f(f(x + y, y), z) is


A. x + z
B. xyz
C. xy + z
D. None of the above

gate2002 digital-logic boolean-expressions normal

8.8 Boolean Expressions: GATE 2016-1-06 top gateoverflow.in/39629

Consider the Boolean operator # with the following properties :


,x#x=0 and x# x
x#0=x, x#1= x =1. Then x#y is equivalent to

x + y

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 468 of 852

A. xy + x
y
B. xy + x
y

y + xy
C. x
D. xy + x y

gate2016-1 digital-logic boolean-expressions easy

8.9 Boolean Expressions: GATE2004-IT_44 top gateoverflow.in/3687

The function ABC + ABC + ABC + ABC + ABC is equivalent to

A) AC + AB + AC
B) AB + AC + AC
C) AB + AC + AB
D) AB + AC + AB

gate2004-it digital-logic boolean-expressions easy

8.10 Boolean Expressions: GATE1995_2.5 top gateoverflow.in/2617

What values of A, B, C and D satisfy the following simultaneous Boolean equations?


A + AB = 0, AB = AC, AB + AC + CD = C D
A. A = 1, B = 0, C = 0, D = 1
B. A = 1, B = 1, C = 0, D = 0
C. A = 1, B = 0, C = 1, D = 1
D. A = 1, B = 0, C = 0, D = 0

gate1995 digital-logic boolean-expressions easy

8.11 Boolean Expressions: GATE2015-2_37 top gateoverflow.in/8162

The number of min-terms after minimizing the following Boolean expression is _______.

[D'+AB'+A'C+AC'D+A'C'D]'

gate2015-2 digital-logic boolean-expressions normal

8.12 Boolean Expressions: GATE2008-IT_37 top gateoverflow.in/3347

Consider the following state diagram and its realization by a JK flip flop

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 469 of 852

The combinational circuit generates J and K in terms of x, y and Q.


The Boolean expressions for J and K are :

A) x

y and x

y
B) x

y and x y
C) x y and x

y
D) x y and x y

gate2008-it digital-logic boolean-expressions normal

8.13 Booths Algorithm: GATE1996_1.23 top gateoverflow.in/2727

Booths algorithm for integer multiplication gives worst performance when the multiplier pattern is

A. 101010 .. 1010

B. 100000 .. 0001

C. 111111 .. 1111

D. 011111 .. 1110

gate1996 digital-logic booths-algorithm normal

8.14 Booths Algorithm: GATE2006-IT_38 top gateoverflow.in/3577

When multiplicand Y is multiplied by multiplier X = x n - 1xn-2 ....x 0 using bit-pair recoding in Booth's algorithm, partial
products are generated according to the following table.

Row xi+1 xi xi-1 Partial Product


1 0 0 0 0
2 0 0 1 Y
3 0 1 0 Y
4 0 1 1 2Y
5 1 0 0 ?
6 1 0 1 -Y
7 1 1 0 -Y
8 1 1 1 ?

The partial products for rows 5 and 8 are

A) 2Y and Y
B) -2Y and 2Y
C) -2Y and 0

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 470 of 852

D) 0 and Y

gate2006-it digital-logic booths-algorithm normal

8.15 Booths Algorithm: GATE2008-IT_42 top gateoverflow.in/3352

The two numbers given below are multiplied using the Booth's algorithm.

Multiplicand : 0101 1010 1110 1110


Multiplier: 0111 0111 1011 1101

How many additions/Subtractions are required for the multiplication of the above two numbers?

A) 6
B) 8
C) 10
D) 12

gate2008-it digital-logic booths-algorithm normal

8.16 Booths Algorithm: GATE2005-IT_8 top gateoverflow.in/3753

Using Booth's Algorithm for multiplication, the multiplier -57 will be recoded as

A. 0 -1 0 0 1 0 0 -1
B. 1 1 0 0 0 1 1 1
C. 0 -1 0 0 1 0 0 0
D. 0 1 0 0 -1 0 0 1

gate2005-it digital-logic booths-algorithm normal

8.17 Booths Coding: GATE1999_1.20 top gateoverflow.in/1473

Booth's coding in 8 bits for the decimal number 57 is

A. 0-100+1000
B. 0-100+100-1
C. 0-1+100-10+1
D. 00-10+100-1

gate1999 digital-logic number-representation booths-coding normal

8.18 Canonical Normal Form: GATE2015-3_44 top gateoverflow.in/8504

Given the function F = P + QR, where F is a function in three Boolean variables P , Q and R and P =!P , consider the
following statements.

(S1)F = (4, 5, 6)
(S2)F = (0, 1, 2, 3, 7)
(S3)F = (4, 5, 6)
(S4)F = (0, 1, 2, 3, 7)
Which of the following is true?

A. (S1)-False, (S2)-True, (S3)-True, (S4)-False

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 471 of 852

B. (S1)-True, (S2)-False, (S3)-False, (S4)-True


C. (S1)-False, (S2)-False, (S3)-True, (S4)-True
D. (S1)-True, (S2)-True, (S3)-False, (S4)-False

gate2015-3 digital-logic canonical-normal-form normal

8.19 Canonical Normal Form: GATE2015-3_43 top gateoverflow.in/8503

The total number of prime implicants of the function f(w, x, y, z) = (0, 2, 4, 5, 6, 10) is __________.
gate2015-3 digital-logic canonical-normal-form normal numerical-answers

8.20 Canonical Normal Form: GATE2010_6 top gateoverflow.in/2177

The minterm expansion of f(P, Q, R) = PQ + QR + P R is

(A) m2 + m4 + m6 + m7

(B) m0 + m1 + m3 + m5

(C) m0 + m1 + m6 + m7

(D) m2 + m3 + m4 + m5

gate2010 digital-logic canonical-normal-form normal

8.21 Canonical Normal Form: TIFR2015-B-9 top gateoverflow.in/30030

A Boolean expression is an expression made out of propositional letters (such as p, q, r) and operators , and ; e.g.
p (q r). An expression is said to be in sum of product form (also called disjunctive normal form) if all occur just
before letters and no occurs in scope of ; e.g. (p q) (p q). The expression is said to be in product of sum form
(also called conjunctive normal form) if all negations occur just before letters and no occurs in the scope of ; e.g.
(p q) (p q). Which of the following is not correct?
A. Every Boolean expression is equivalent to an expression is sum of product form.
B. Every Boolean expression is equivalent to an expression in product of sum form.
C. Every Boolean expression is equivalent to an expression without operator.
D. Every Boolean expression is equivalent to an expression without operator.
E. Every Boolean expression is equivalent to an expression without operator.

tifr2015 canonical-normal-form

8.22 Canonical Normal Form: GATE2008_8 top gateoverflow.in/406

Given f1 , f3 and f in canonical sum of products form (in decimal) for the circuit

f1 = m(4, 5, 6, 7, 8)
f3 = m(1, 6, 15)
f = m(1, 6, 8, 15)
then f2 is

m(4, 6)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 472 of 852

A. m(4, 6)

B. m(4, 8)

C. m(6, 8)

D. m(4, 6, 8)

gate2008 digital-logic canonical-normal-form easy

8.23 Canonical Normal Form: GATE2002_2.1 top gateoverflow.in/831

Consider the following logic circuit whose inputs are functions f1 , f2 , f3 and output is f

Given that

f1 (x, y, z) = (0, 1, 3, 5)
f2 (x, y, z) = (6, 7), and
f(x, y, z) = (1, 4, 5).
f3 is

A. (1, 4, 5)
B. (6, 7)
C. (0, 1, 3, 5)
D. None of the above

gate2002 digital-logic normal canonical-normal-form circuit-output

8.24 Circuit Output: GATE2006_35 top gateoverflow.in/1292

Consider the circuit above. Which one of the following options correctly represents f (x, y, z)

(A) xz + xy + y z
(B) xz + xy + yz

(C) xz + xy + yz

(D) xz + xy + y z

gate2006 digital-logic circuit-output normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 473 of 852

8.25 Circuit Output: GATE1994_1.8 top gateoverflow.in/2445

The logic expression for the output of the circuit shown in figure below is:


A. AC + BC + CD

B. AC + BC + CD

C. ABC + C D

D. A B + B C + CD

gate1994 digital-logic circuit-output normal

8.26 Circuit Output: GATE2014-3_45 top gateoverflow.in/2079

The above synchronous sequential circuit built using JK ip-ops is initialized with Q2 Q1 Q0 = 000 . The state sequence for this circuit for the next 3 clock cycles
is

(A) 001, 010, 011

(B) 111, 110, 101

(C) 100, 110, 111

(D) 100, 011, 001

gate2014-3 digital-logic circuit-output normal

8.27 Circuit Output: GATE1993_6.3 top gateoverflow.in/17237

For the initial state of 000, the function performed by the arrangement of the J-K flip-flops in figure is:

A. Shift Register
B. Mod- 3 Counter

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 474 of 852

C. Mod- 6 Counter
D. Mod- 2 Counter
E. None of the above

gate1993 digital-logic circuit-output normal

8.28 Circuit Output: GATE1993_19 top gateoverflow.in/2316

A control algorithm is implemented by the NAND gate circuitry given in figure below, where A and B are state variable
implemented by D flip-flops, and P is control input. Develop the state transition table for this controller.

gate1993 digital-logic circuit-output normal

8.29 Circuit Output: GATE2007_36 top gateoverflow.in/1234

The control signal functions of a 4-bit binary counter are given below (where X is dont care):

Clear Clock Load Count Function


1 X X X Clear to 0
0 X 0 0 No change
0 1 X Load input
0 0 1 Count next

The counter is connected as follows:

Assume that the counter and gate delays are negligible. If the counter starts at 0, then it cycles through the following
sequence:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 475 of 852

A. 0, 3, 4
B. 0, 3, 4, 5
C. 0, 1, 2, 3, 4
D. 0, 1, 2, 3, 4, 5

gate2007 digital-logic circuit-output normal

8.30 Circuit Output: GATE1993_6.2 top gateoverflow.in/17235

If the state machine described in figure, should have a stable state, the restriction on the inputs given by

A. a. b = 1
B. a + b = 1
C. a + b = 0

D. a. b = 1

E. a + b =1

gate1993 digital-logic normal circuit-output

8.31 Circuit Output: GATE2005_64 top gateoverflow.in/1387

Consider the following circuit:

The flip-flops are positive edge triggered D FFs. Each state is designated as a two-bit string Q0 Q1 . Let the initial state be 00.
The state transition sequence is

A.

B.

C.

D.

gate2005 digital-logic circuit-output

8.32 Circuit Output: GATE2010_32 top gateoverflow.in/2206

In the sequential circuit shown below, if the initial value of the output Q1 Q0 is 00. What are the next four values of Q1 Q0 ?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 476 of 852

(A) 11,10,01,00

(B) 10,11,01,00

(C) 10,00,01,11

(D) 11,10,00,01

gate2010 digital-logic circuit-output normal

8.33 Circuit Output: GATE2005-IT_43 top gateoverflow.in/3804

Which of the following input sequences will always generate a 1 at the output z at the end of the third cycle?

A B C
0 0 0
A)
1 0 1
1 1 1
A B C
1 0 1
B)
1 1 0
1 1 1
A B C
0 1 1
C)
1 0 1
1 1 1
A B C
0 0 1
D)
1 1 0
1 1 1

gate2005-it digital-logic circuit-output normal

8.34 Circuit Output: GATE2005-IT_10 top gateoverflow.in/3755

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 477 of 852

A two-way switch has three terminals a, b and c. In ON position (logic value 1), a is connected to b, and in OFF position, a is
connected to c. Two of these two-way switches S1 and S2 are connected to a bulb as shown below.

Which of the following expressions, if true, will always result in the lighting of the bulb ?



A. S1.S2
B. S1 + S2

C. S1 S2
D. S1 S2

gate2005-it digital-logic circuit-output normal

8.35 Circuit Output: GATE2010_31 top gateoverflow.in/2205

What is the boolean expression for the output f of the combinational logic circuit of NOR gates given below?


(A) Q + R

(B) P + Q

(C) P + R

(D) P + Q + R

gate2010 digital-logic circuit-output normal

8.36 Circuit Output: GATE2010_9 top gateoverflow.in/2182

The Boolean expression of the output f of the multiplexer shown below is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 478 of 852


(A) P Q R

(B) P Q R

(C) P + Q + R

(D) P + Q + R

gate2010 digital-logic circuit-output easy

8.37 Circuit Output: GATE2006-IT_36 top gateoverflow.in/3575

The majority function is a Boolean function f(x, y, z) that takes the value 1 whenever a majority of the variables x , y, z and
1. In the circuit diagram for the majority function shown below, the logic gates for the boxes labeled P and Q are,
respectively,


A) XOR, AND
B) XOR, XOR
C) OR, OR
D) OR, AND


gate2006-it digital-logic circuit-output normal

8.38 Circuit Output: GATE2011-50 top gateoverflow.in/2157

Consider the following circuit involving three D-type flip-flops used in a certain type of counter configuration.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 479 of 852

If at some instance prior to the occurrence of the clock edge,P , Q and R have a value 0, 1 and 0 respectively, what shall be the value of
P QR after the clock edge?
A. 000
B. 001
C. 010
D. 011

gate2011 digital-logic circuit-output normal

8.39 Circuit Output: GATE2005_15 top gateoverflow.in/1351

Consider the following circuit.

Which one of the following is TRUE?

A. f is independent of X

B. f is independent of Y

C. f is independent of Z

D. None of X, Y , Z is redundant

gate2005 digital-logic circuit-output normal

8.40 Circuit Output: GATE2006_37 top gateoverflow.in/1295

Consider the circuit in the diagram. The operator represents Ex-OR. The D flip-flops are initialized to zeroes (cleared).

The following data: 100110000 is supplied to the data terminal in nine clock cycles. After that the values of q2 q1 q0 are:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 480 of 852

(A) 000
(B) 001
(C) 010
(D) 101

gate2006 digital-logic circuit-output easy

8.41 Circuit Output: GATE1997_5.5 top gateoverflow.in/2256

Consider a logic circuit shown in figure below. The functions f1 , f2 and f (in canonical sum of products form in decimal
notation) are :

f1 (w, x, y, z) = 8, 9, 10
f2 (w, x, y, z) = 7, 8, 12, 13, 14, 15
f(w, x, y, z) = 8, 9

The function f3 is

A. 9, 10

B. 9

C. 1, 8, 9

D. 8, 10, 15

gate1997 digital-logic circuit-output normal

8.42 Circuit Output: GATE2007-IT_45 top gateoverflow.in/3480

The line T in the following figure is permanently connected to the ground.

Which of the following inputs (X1 X2 X3 X4) will detect the fault ?

A) 0000
B) 0111
C) 1111
D) None of these

gate2007-it digital-logic circuit-output normal

8.43 Circuit Output: GATE1999_2.8 top gateoverflow.in/1486

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 481 of 852

Consider the circuit shown below. In a certain steady state, the line Y is at 1 . What are the possible values of A, B and C
in this state?

A. A = 0, B = 0, C = 1
B. A = 0, B = 1, C = 1
C. A = 1, B = 0, C = 1
D. A = 1, B = 1, C = 1

gate1999 digital-logic circuit-output normal

8.44 Circuit Output: GATE1993_6.1 top gateoverflow.in/2288

Identify the logic function performed by the circuit shown in figure.

A. exclusive OR
B. exclusive NOR
C. NAND
D. NOR
E. None of the above

gate1993 digital-logic circuit-output normal

8.45 Circuit Output: GATE2004_61 top gateoverflow.in/1056

Consider the partial implementation of a 2-bit counter using T flip-flops following the sequence 0-2-3-1-0, as shown below.

To complete the circuit, the input X should be

A. Qc2
B. Q2 + Q1
c
C. (Q1 + Q2 )
D. Q1 Q2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 482 of 852

gate2004 digital-logic circuit-output normal

8.46 Circuit Output: GATE1994_11 top gateoverflow.in/2507

Find the contents of the flip-flop Q2 , Q1 and Q0 in the circuit of figure, after giving four clock pulses to the clock terminal.
Assume Q2 Q1 Q0 = 000 initially.

gate1994 digital-logic circuit-output normal

8.47 Circuit Output: GATE2001_2.8 top gateoverflow.in/726

Consider the following circuit with initial state Q0 = Q1 = 0. The D Flip-flops are positive edged triggered and have set up
times 20 nanosecond and hold times 0.

Consider the following timing diagrams of X and C. The clock period of C 40 nanosecond. Which one is the correct plot of
Y?

gate2001 digital-logic circuit-output normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 483 of 852

8.48 Circuit Output: GATE2007-IT_40 top gateoverflow.in/3473

What is the final value stored in the linear feedback shift register if the input is 101101?

A) 0110
B) 1011
C) 1101
D) 1111

gate2007-it digital-logic circuit-output normal

8.49 Circuit Output: GATE2007-IT_38 top gateoverflow.in/3471

The following expression was to be realized using 2-input AND and OR gates. However, during the fabrication all 2-input
AND gates were mistakenly substituted by 2-input NAND gates. (a.b).c + (a'.c).d + (b.c).d + a. d

What is the function finally realized ?

A) 1
B) a' + b' + c' + d'
C) a' + b + c' + d'
D) a' + b' + c + d'

gate2007-it digital-logic circuit-output normal

8.50 Circuit Output: GATE1996_2.22 top gateoverflow.in/2751

Consider the circuit in figure. f implements


A. ABC + ABC + ABC
B. A + B + C

C. A B C

D. AB + BC + CA

gate1996 digital-logic circuit-output easy

8.51 Circuit Output: GATE1996_24 top gateoverflow.in/2776

Consider the synchronous sequential circuit in the below figure

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 484 of 852

a. Draw a state diagram, which is implemented by the circuit. Use the following names for the states corresponding to the
values of flip-flops as given below.
Q1 Q2 Q3 State
0 0 0 S0
0 0 1 S1
- - - -
- - - -
- - - -
S7
1 1 1

b. Given that the initial state of the circuit is S 4 , identify the set of states, which are not reachable.

gate1996 digital-logic circuit-output normal

8.52 Circuit Output: GATE2002_2.2 top gateoverflow.in/832

Consider the following multiplexer where 10, 11, 12, 13 are four data input lines selected by two address line combinations
A1A0=00,01,10,11 respectively and f is the output of the multiplexor. EN is the Enable input.

The function f(x,y,z) implemented by the above circuit is

A. xyz'
B. xy + z
C. x + y
D. None of the above

gate2002 digital-logic circuit-output normal

8.53 Circuit Output: GATE2005_62 top gateoverflow.in/264

Consider the following circuit involving a positive edge triggered D FF.

Consider the following timing diagram. Let Ai represents the logic level on the line a in the i-th clock period.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 485 of 852

Let A represent the compliment of A. The correct output sequence on Y over the clock periods 1 through 5 is:

a. A0 A1 A1 A3 A4
b. A0 A1 A2 A3 A4
c. A1 A2 A2 A3 A4
d. A1 A2 A3 A4 A5

gate2005 digital-logic circuit-output normal

8.54 Circuit Output: GATE2008-IT_9 top gateoverflow.in/3269

What Boolean function does the circuit below realize?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 486 of 852

A) xz + xz
B) xz + xz
C) xy + yz
D) xy + yz

gate2008-it digital-logic circuit-output normal

8.55 Circuit Output: GATE2011-51 top gateoverflow.in/43318

Consider the following circuit involving three D-type flip-flops used in a certain type of counter configuration.

If all the ip-ops were reset to 0 at power on, what is the total number of distinct outputs (states) represented byP QR generated by the
counter?

A. 3
B. 4
C. 5
D. 6

gate2011 digital-logic circuit-output normal

8.56 Circuit Output: GATE1996_2.21 top gateoverflow.in/2750

Consider the circuit in Fig.2.21 which has a four bit binary number b3 b2 b1 b0 as input and a five bit binary number,
d4 d3 d2 d1 d0 as output.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 487 of 852

A. Binary to Hex conversion

B. Binary to BCD conversion

C. Binary to grey code conversion

D. Binary to radix-12 conversion

gate1996 digital-logic circuit-output normal

8.57 Circuit Output: GATE2000_2.12 top gateoverflow.in/659

The following arrangement of master-slave flip flops

has the initial state of P, Q as 0, 1 (respectively). After a clock cycle the output state P, Q is (respectively),

A. 1, 0
B. 1, 1
C. 0, 0
D. 0, 1

gate2000 digital-logic circuit-output normal

8.58 Counter: GATE2015-1_20 top gateoverflow.in/8219

Consider a 4-bit Johnson counter with an initial value of 0000. The counting sequence of this counter is

A. 0, 1, 3, 7, 15, 14, 12, 8, 0


B. 0, 1, 3, 5, 7, 9, 11, 13, 15, 0
C. 0, 2, 4, 6, 8, 10, 12, 14, 0
D. 0, 8, 12, 14, 15, 7, 3, 1, 0

gate2015-1 digital-logic counter easy

8.59 Counter: GATE2005-IT_11 top gateoverflow.in/3756

How many pulses are needed to change the contents of a 8-bit up counter from 10101100 to 00100111 (rightmost bit is the
LSB)?

A. 134
B. 133
C. 124
D. 123

gate2005-it digital-logic counter normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 488 of 852

8.60 Counter: GATE 2016-1-8 top gateoverflow.in/39670

We want to design a synchronous counter that counts the sequence 0 1 0 2 0 3 and then repeats. The minimum
number of J-K flip-flops required to implement this counter is _____________.

gate2016-1 digital-logic counter flip-flop normal numerical-answers

8.61 Counter: GATE2015-2_7 top gateoverflow.in/8054

The minimum number of JK flip-flops required to construct a synchronous counter with the count sequence (0, 0, 1, 1, 2, 2,
3, 3, 0, 0, ...) is _______.

gate2015-2 digital-logic counter normal

8.62 Flip Flop: GATE1991_5,c top gateoverflow.in/26442

Find the maximum clock frequency at which the counter in the figure below can be operated. Assume that the propagation
delay through each flip flop and each AND gate is 10 ns. Also assume that the setup time for the JK inputs of the flip flops
is negligible.

gate1991 digital-logic flip-flop

8.63 Flip Flop: GATE2015-1_37 top gateoverflow.in/8287

A positive edge-triggered D flip-flop is connected to a positive edge-triggered JK flip-flop as follows. The Q output of the D
flip-flop is connected to both the J and K inputs of the JK flip-flop, while the Q output of the JK flip-flop is connected to the
input of the D flip-flop. Initially, the output of the D flip-flop is set to logic one and the output of the JK flip-flop is cleared.
Which one of the following is the bit sequence (including the initial state) generated at the Q output of the JK flip-flop when
the flip-flops are connected to a free-running common clock? Assume that J = K = 1 is the toggle mode and J = K = 0 is the
state holding mode of the JK flip-flops. Both the flip-flops have non-zero propagation delays.

A. 0110110...
B. 0100100...
C. 011101110...
D. 011001100...

gate2015-1 digital-logic flip-flop normal

8.64 Flip Flop: GATE1993_6.3 top gateoverflow.in/17236

For the initial state of 000, the function performed by the arrangement of the J-K flip-flops in figure is:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 489 of 852

A. Shift Register
B. Mod- 3 Counter
C. Mod- 6 Counter
D. Mod- 2 Counter
E. None of the above

gate1993 digital-logic flip-flop

8.65 Flip Flop: GATE1992_04_c top gateoverflow.in/17408

Design a 3-bit counter using D-flip flops such that not more than one flip-flop changes state between any two consecutive
states.

gate1994 digital-logic flip-flop

8.66 Floating Point Representation: GATE2005_85 top gateoverflow.in/1407

Statement for Linked Answer Questions 85A & 85B:

Consider the following floating-point format.

Mantissa is a pure fraction in sign-magnitude form.

(A) The decimal number 0.239 213 has the following hexadecimal representation (without normalization and rounding
off):

A. 0D 24
B. 0D 4D
C. 4D 0D
D. 4D 3D

(B) The normalized representation for the above format is specified as follows. The mantissa has an implicit 1 preceding the
binary (radix) point. Assume that only 0s are padded in while shifting a field.

The normalized representation of the above number (0.239 213 ) is:

A. 0A 20
B. 11 34
C. 49 D0
D. 4A E8

gate2005 digital-logic number-representation floating-point-representation normal

8.67 Floating Point Representation: GATE2003_43 top gateoverflow.in/934

The following is a scheme for floating point number representation using 16 bits.

Bit Position 15 14 .... 9 8 ...... 0


s e m
Sign Exponent Mantissa

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 490 of 852

Let s, e, and m be the numbers represented in binary in the sign, exponent, and mantissa fields respectively. Then the
floating point number represented is:

(1)s (1 + m 29 ) 2e31 ,
{
if the exponent 111111
0, otherwise
What is the maximum difference between two successive real numbers representable in this system?

A. 240
B. 29
C. 222
D. 231

gate2003 digital-logic number-representation floating-point-representation normal

8.68 Floating Point Representation: GATE1997_72 top gateoverflow.in/19702

Following floating point number format is given

f is a fraction represented by a 6-bit mantissa (includes sign bit) in sign magnitude form e is a 4-bit exponent (includes sign
hit) in sign magnitude form n=(f , e) = f , 2e is a floating point number. Let A=54.75 in decimal and B=9.75 in decimal

a. Represent A and B as floating point numbers in the above format.

b. Show the steps involved in floating point addition of A and B

c. What is the percentage error (upto one position beyond decimal point) in the addition operation in (b)?

gate1997 digital-logic floating-point-representation normal

8.69 Functional Completeness: GATE1998_5 top gateoverflow.in/1696

a. The implication gate, shown below has two inputs ( x and y); the output is 1 except when
x = 1 and y = 0, realize f = xy + xy using only four implication gates.

b. Show that the implication gate is functionally complete.

gate1998 digital-logic functional-completeness descriptive

8.70 Gray Code: GATE2006_40 top gateoverflow.in/1816

Consider numbers represented in 4-bit Gray code. Let h3 h2 h1 h0 be the Gray code representation of a number n and let
g3 g2 g1 g0 be the Gray code of (n + 1)(modulo16) value of the number. Which one of the following functions is correct?

(A) g0 (h3 h2 h1 h0 ) = (1, 2, 3, 6, 10, 13, 14, 15)

(B) g1 (h3 h2 h1 h0 ) = (4, 9, 10, 11, 12, 13, 14, 15)

(C) g2 (h3 h2 h1 h0 ) = (2, 4, 5, 6, 7, 12, 13, 15)

(D) g3 (h3 h2 h1 h0 ) = (0, 1, 6, 7, 10, 11, 12, 13)


gate2006 digital-logic number-representation gray-code normal

8.71 Half Adder: GATE2015-2_48 top gateoverflow.in/8250

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 491 of 852

A half adder is implemented with XOR and AND gates. A full adder is implemented with two half adders and one OR gate.
The propagation delay of an XOR gate is twice that of an AND/OR gate. The propagation delay of an AND/OR gate is 1.2
milliseconds. A 4-bit-ripple-carry binary adder is implemented by using four full adders. The total propagation time of this 4-
bit binary adder in microseconds is ______.

gate2015-2 digital-logic half-adder normal

8.72 Ieee Representation: GATE2008_4 top gateoverflow.in/402

In the IEEE floating point representation the hexadecimal value 0x00000000 corresponds to

(A) The normalized value 2127

(B) The normalized value 2126

(C) The normalized value +0

(D) The special value +0

gate2008 digital-logic floating-point-representation ieee-representation easy

8.73 Ieee Representation: GATE2008-IT_7 top gateoverflow.in/3267

The following bit pattern represents a floating point number in IEEE 754 single precision format

1 10000011 101000000000000000000000

The value of the number in decimal form is

A) - 10
B) - 13
C) - 26

D) None of the above

gate2008-it digital-logic number-representation floating-point-representation ieee-representation normal

8.74 K Map: GATE1995_15 top gateoverflow.in/2651

a. Implement a circuit having the following output expression using an inverter and a nand gate


Z = A+B+C
b. What is the equivalent minimal Boolean expression (in sum of products form) for the Karnaugh map given below?

gate1995 digital-logic k-map normal

8.75 K Map: GATE2007-IT_78 top gateoverflow.in/3530

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 492 of 852

Consider the following expression

ad' + (ac)' + bc'd

Which of the following Karnaugh Maps correctly represents the expression?

(A)

c'd' c'd cd cd'


a'b' X X
a'b X X
ab X X X
ab' X X

(B)

c'd' c'd cd cd'


a'b' X X
a'b X
ab X X X
ab' X X X

(C)

c'd' c'd cd cd'


a'b' X X
a'b X X X
ab X X X
ab' X X

(D)

c'd' c'd cd cd'

a'b' X X
a'b X X X
ab X X X
ab' X X X

gate2007-it digital-logic k-map normal

8.76 K Map: GATE2008_5 top gateoverflow.in/403

In the Karnaugh map shown below, X denotes a dont care term. What is the minimal form of the function represented by
the Karnaugh map?

A. b . d + a. d

. + . + . b.
Copyright GATE Overflow. All rights reserved.
GATE Overflow April 2016 493 of 852

B. a. b + b . d + a. b. d
C. b . d + a. b. d

D. a. b + b . d + a. d

gate2008 digital-logic k-map easy

8.77 K Map: GATE2012_30 top gateoverflow.in/1615

What is the minimal form of the Karnaugh map shown below? Assume that X denotes a dont care term

(A) bd
(B) bd + bc
(C) bd + a bc d
(D) bd + bc + c d

gate2012 digital-logic k-map easy

8.78 K Map: GATE1992_01,i top gateoverflow.in/545

The Boolean function in sum of products form where K-map is given below (figure) is _______

gate1992 digital-logic k-map normal

8.79 K Map: GATE1996_2.24 top gateoverflow.in/2753

What is the equivalent Boolean expression in product-of-sums form for the Karnaugh map given in Fig


A. BD + BD

(B + + D)( + C + )
Copyright GATE Overflow. All rights reserved.
GATE Overflow April 2016 494 of 852


B. (B + C + D)(B

+ C + D

)

C. (B + D)(B + D )


D. (B + D )(B + D)

gate1996 digital-logic k-map easy

8.80 K Map: GATE2006-IT_35 top gateoverflow.in/3574

The boolean function for a combinational circuit with four inputs is represented by the following Karnaugh map.

Which of the product terms given below is an essential prime implicant of the function?

A) QRS
B) PQS
C) PQ'S'
D) Q'S'

gate2006-it digital-logic k-map normal

8.81 K Map: GATE1998_2.7 top gateoverflow.in/1679

The function represented by the Karnaugh map is given below is

A. A. B
B. AB + BC + CA

C. B C
D. A. BC

gate1998 digital-logic k-map normal

8.82 K Map: GATE1999_1.8 top gateoverflow.in/1461

Which of the following functions implements the Karnaugh map shown below?

CD
00 01 11 10
AB
00 0 0 1 0
01 X X 1 X
11 0 1 1 0
10 0 1 1 0

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 495 of 852

A. AB + CD
B. D(C + A)
C. AD + AB
D. (C + D)(C + D) + (A + B)

gate1999 digital-logic k-map easy

8.83 K Map: GATE2000-2.11 top gateoverflow.in/658

Which functions does NOT implement the Karnaugh map given below?

a. (w + x)y
b. xy + yw
c. (w + x)(w + y)(x + y)
d. None of the above

gate2000 digital-logic k-map normal

8.84 K Map: GATE2002_1.12 top gateoverflow.in/816

Minimum sum of product expression for f(w,x,y,z) shown in Karnaugh-map below

A. xz + y'z
B. xz' + zx'
C. x'y + zx'
D. None of the above

gate2002 digital-logic k-map normal

8.85 K Map: GATE2007-IT_79 top gateoverflow.in/3531

Consider the following expression

ad' + (ac)' + bc'd

Which of the following expressions does not correspond to the Karnaugh Map obtained for the given expression??

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 496 of 852

A) c'd'+ ad' + abc' + (ac)'d


B) (ac)' + c'd' + ad' + abc'd
C) (ac)' + ad' + abc' + c'd
D) b'c'd' + acd' + (ac)' + abc'

gate2007-it digital-logic k-map normal

8.86 K Map: GATE2001_1.11 top gateoverflow.in/704

Given the following karnaugh map, which one of the following represents the minimal Sum-Of-Products of the map?

(A) XY + Y Z
(B) W X Y + XY + XZ
(C) W X + Y Z + XY

(D) XZ + Y

gate2001 k-map digital-logic normal

8.87 K Map: GATE2003_45 top gateoverflow.in/936

The literal count of a Boolean expression is the sum of the number of times each literal appears in the expression. For
example, the literal count of (xy + xz ) is 4. What are the minimum possible literal counts of the product-of-sum and sum-
of-product representations respectively of the function given by the following Karnaugh map? Here, X denotes "don't care"

A. (11, 9)
B. (9, 13)
C. (9, 10)
D. (11,11)

gate2003 digital-logic k-map normal

8.88 Logic: GATE1991-6,b top gateoverflow.in/26443

Design a 1024 bit serial-in/serial-out unidirectional shift register using a 1K 1 bit RAM with a data input Din , data output

Dout and control input READ/WRITE . You may assume the availability of standard SSI and MSI components such as
gates, registers and counters.

gate1991 digital logic

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 497 of 852

8.89 Memory Interfacing: GATE1995_2.2 top gateoverflow.in/2614

The capacity of a memory unit is defined by the number of words multiplied by the number of bits/word. How many separate
address and data lines are needed for a memory of 4K 16?

A. 10 address, 16 data lines


B. 11 address, 8 data lines
C. 12 address, 16 data lines
D. 12 address, 12 data lines

gate1995 digital-logic memory-interfacing normal

8.90 Min No Gates: GATE2009_6 top gateoverflow.in/1298

What is the minimum number of gates required to implement the Boolean function (AB+C) if we have to use only 2-input
NOR gates?

A. 2
B. 3
C. 4
D. 5

gate2009 digital-logic min-no-gates normal

8.91 Min No Gates: GATE2000_9 top gateoverflow.in/680

Design a logic circuit to convert a single digit BCD number to the number modulo six as follows (Do not detect illegal input):

a. Write the truth table for all bits. Label the input bits I 1, I2, .... with I1 as the least significant bit. Label the output bits R 1, R2.... with R 1
as the least significant bit. Use 1 to signify truth.
b. Draw one circuit for each output bit using, altogether, two two-input AND gates, one two-input OR gate and two NOT gates.

gate2000 digital-logic min-no-gates

8.92 Min No Gates: GATE2004_58 top gateoverflow.in/1053

A circuit outputs a digit in the form of 4 bits. 0 is represented by 0000, 1 by 0001, , 9 by 1001. A combinational circuit is to
be designed which takes these 4 bits as input and outputs 1 if the digit 5, and 0 otherwise. If only AND, OR and NOT
gates may be used, what is the minimum number of gates required?

A. 2
B. 3
C. 4
D. 5

gate2004 digital-logic normal min-no-gates

8.93 Min No Gates: GATE2004-IT_8 top gateoverflow.in/3649

What is the minimum number of NAND gates required to implement a 2-input EXCLUSIVE-OR function without using any

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 498 of 852

other logic gate?



A) 3
B) 4
C) 5
D) 6

gate2004-it digital-logic min-no-gates normal

8.94 Min Sum Of Products Form: GATE1991-5,b top gateoverflow.in/26437

Find the minimum sum of products form of the logic function f(A, B, C, D) = m(0, 2, 8, 10, 15) + d(3, 11, 12, 14) where
m and d represent minterm and don't care term respectively.
gate1991 digital-logic min-sum-of-products-form

8.95 Min Sum Of Products Form: GATE2006_38 top gateoverflow.in/1814

Consider a Boolean function f(w, x, y, z). Suppose that exactly one of its inputs is allowed to change at a time. If the
function happens to be true for two input vectors i1 = w1 , x1 , y1 , z1 and i2 = w2 , x2 , y2 , z2 , we would like the function
to remain true as the input changes from i1 to i2 (i1 and i2 differ in exactly one bit position) without becoming
false momentarily. Let f(w, x, y, z) = (5, 7, 11, 12, 13, 15) . Which of the following cube covers of f will ensure that the
required property is satisfied?

(A) w , xy
xz, wxy z, xyz, wyz

xz, wyz
(B) wxy, w

(C) wxy , xz, wx


z yz

, wyz, wxz, w
(D) wxy xz, xy
z, xyz

gate2006 digital-logic min-sum-of-products-form normal

8.96 Min Sum Of Products Form: GATE2014-3_7 top gateoverflow.in/2041

Consider the following minterm expression for F :

F (P , Q, R, S) = 0, 2, 5, 7, 8, 10, 13, 15

The minterms 2, 7, 8 and 13 are 'do not care' terms. The minimal sum-of-products form for F is
(A) QS + QS

(B) QS + QS

(C) QRS + QRS + QRS + QRS

(D) PQS + PQS + PQS + P QS

gate2014-3 digital-logic min-sum-of-products-form normal

8.97 Min Sum Of Products Form: GATE1997_71 top gateoverflow.in/19701

Let f = (w + y)(x + y)(w + x + z)(w + z)(x + z)


a. Express f as the minimal sum of products. Write only the answer.

b. If the output line is stuck at 0, for how many input combinations will the value of f be correct?

gate1997 digital-logic min-sum-of-products-form

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 499 of 852

8.98 Minimal State Automata: GATE2003_44 top gateoverflow.in/935

A 1-input, 2-output synchronous sequential circuit behaves as follows:

Let zk , nk denote the number of 0s and 1s respectively in initial k bits of the input

(zk + nk = k). The circuit outputs 00 until one of the following conditions holds.
zk nk = 2. In this case, the output at the k-th and all subsequent clock ticks is 10.
nk zk = 2. In this case, the output at the k-th and all subsequent clock ticks is 01.
What is the minimum number of states required in the state transition graph of the above circuit?

A. 5
B. 6
C. 7
D. 8

gate2003 digital-logic finite-automata minimal-state-automata normal

8.99 Modular Arithmetic: GATE 2016-2-29 top gateoverflow.in/39588

The value of the expression 1399 ( mod 17), in the range 0 to 16, is ________.
gate2016-2 digital-logic modular-arithmetic normal numerical-answers

8.100 Multiplexer: GATE 2016-1-30 top gateoverflow.in/39722

Consider the two cascade 2 to 1 multiplexers as shown in the figure .

The minimal sum of products form of the output X is



A). P Q + P QR

B). P Q + QR

C). P Q + P QR


D). Q R + P QR

gate2016-1 digital-logic multiplexer normal

8.101 Multiplexer: GATE1992_04_b top gateoverflow.in/17407

A priority encoder accepts three input signals (A, B and C) and produce a two-bit output (X1 , X0 ) corresponding to the
highest priority active input signal. Assume A has the highest priority followed by B and C has the lowest priority. If none of
the inputs are active the output should be 00, design the priority encoder using 4:1 multiplexers as the main components.

gate1994 digital-logic multiplexer

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 500 of 852

8.102 Multiplexor: GATE1998_1.14 top gateoverflow.in/1651

A multiplexer with a 4 bit data select input is a

A. 4 : 1 multiplexer
B. 2 : 1 multiplexer
C. 16 : 1 multiplexer
D. 8 : 1 multiplexer

gate1998 digital-logic multiplexor easy

8.103 Number Representation: GATE2010_8 top gateoverflow.in/2179

P is a 16-bit signed integer. The 2 's complement representation of P is (F87B)16 . The 2 's complement representation of 8 P is
(A) (C3D8)16

(B) (187B)16

(C) (F878)16

(D) (987B)16

gate2010 digital-logic number-representation normal

8.104 Number Representation: GATE2008-IT_15 top gateoverflow.in/3275

A processor that has carry, overflow and sign flag bits as part of its program status word (PSW) performs addition of the
following two 2's complement numbers 01001101 and 11101001. After the execution of this addition operation, the status of
the carry, overflow and sign flags, respectively will be:

A) 1, 1, 0
B) 1, 0, 0
C) 0, 1, 0
D) 1, 0, 1

gate2008-it digital-logic number-representation normal

8.105 Number Representation: GATE1994_2.7 top gateoverflow.in/2474

Consider n-bit (including sign bit) 2's complement representation of integer numbers. The range of integer values, N , that
can be represented is _____ N _____ .

gate1994 digital-logic number-representation easy

8.106 Number Representation: GATE1995_2.12 top gateoverflow.in/2624

The number of 1's in the binary representation of (3*4096 + 15*256 + 5*16 + 3) are:

(A) 8
(B) 9
(C) 10
(D) 12

gate1995 digital-logic number-representation normal

8.107 Number Representation: GATE1993_6.5 top gateoverflow.in/2286

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 501 of 852

Convert the following numbers in the given bases into their equivalents in the desired bases:

a. (110.101)2 = (x) 10
b. (1118)10 = (y) H

gate1993 digital-logic number-representation normal

8.108 Number Representation: GATE1996_1.25 top gateoverflow.in/2729

Consider the following floating-point number representation.

31 24 23 0

Exponent Mantissa

The exponent is in 2s complement representation and mantissa is in the sign magnitude representation. The range of the
magnitude of the normalized numbers in this representation is

A. 0 to 1
B. 0.5 to 1
C. 223 to 0.5
D. 0.5 to (1 223 )

gate1996 digital-logic number-representation normal

8.109 Number Representation: GATE2006-IT_7 top gateoverflow.in/3546

The addition of 4-bit, two's complement, binary numbers 1101 and 0100 results in

A) 0001 and an overflow


B) 1001 and no overflow
C) 0001 and no overflow
D) 1001 and an overflow

gate2006-it digital-logic number-representation normal

8.110 Number Representation: GATE2004-IT_42 top gateoverflow.in/3685

Using a 4-bit 2's complement arithmetic, which of the following additions will result in an overflow?

i. 1100 + 1100
ii. 0011 + 0111
iii. 1111 + 0111

A) (i) only
B) (ii) only
C) (iii) only
D) (i) and (iii) only

gate2004-it digital-logic number-representation normal

8.111 Number Representation: GATE1995_18 top gateoverflow.in/2655

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 502 of 852

The following is an incomplete Pascal function to convert a given decimal integer (in the range -8 to +7) into a binary integer
in 2s complement representation. Determine the expression A, B, C that complete program.

function TWOSCOMP (N:integer):integer;


var
RAM, EXPONENT:integer;
BINARY :integer;
begin
if(N>=-8) and (N<=+7) then
begin
if N<0 then
N:=A;
BINARY:=0;
EXPONENT:=1;
while N<>0 do
begin
REM:=N mod 2;
BIANRY:=BINARY + B*EXPONENT;
EXPONENT:=EXPONENT*10;
N:=C
end
TWOSCOMP:=BINARY
end
end;

gate1995 digital-logic number-representation normal

8.112 Number Representation: GATE1997_5.4 top gateoverflow.in/2255


Given 224)r = 13)r .
The value of the radix r is:

A. 10
B. 8
C. 5
D. 6

gate1997 digital-logic number-representation normal

8.113 Number Representation: GATE2007-IT_42 top gateoverflow.in/3477

(C012.25)H - (10111001110.101) B =

A) (135103.412)o
B) (564411.412)o
C) (564411.205)o
D) (135103.205)o

gate2007-it digital-logic number-representation normal

8.114 Number Representation: GATE2013_4 top gateoverflow.in/1413

The smallest integer that can be represented by an 8-bit number in 2's complement form is

(A) -256
(B) -128
(C) -127
(D) 0

gate2013 digital-logic number-representation easy

8.115 Number Representation: GATE2003_9 top gateoverflow.in/900

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 503 of 852

Assuming all numbers are in 2s complement representation, which of the following numbers is divisible by 11111011?

A. 11100111

B. 11100100

C. 11010111

D. 11011011

gate2003 digital-logic number-representation normal

8.116 Number Representation: GATE2002_9 top gateoverflow.in/862

Consider the following 32-bit floating-point representation scheme as shown in the format below. A value is specified by 3
fields, a one bit sign field (with 0 for positive and 1 for negative values), a 24 bit fraction field (with the binary point being at
the left end of the fraction bits), and a 7 bit exponent field (in excess-64 signed integer representation, with 16 being the
base of exponentiation). The sign bit is the most significant bit.

a. It is required to represent the decimal value - 7.5 as a normalized floating point number in the given format. Derive the
values of the various fields. Express your final answer in the hexadecimal.
b. What is the largest value that can be represented using this format? Express your answer as the nearest power of 10.

gate2002 digital-logic number-representation normal

8.117 Number Representation: GATE2002_1.21 top gateoverflow.in/826

In 2's complement addition, overflow

A. is flagged whenever there is carry from sign bit addition


B. cannot occur when a positive value is added to a negative value
C. is flagged when the carries from sign bit and previous bit match
D. None of the above

gate2002 digital-logic number-representation normal

8.118 Number Representation: TIFR2011-A-16 top gateoverflow.in/20253

A variable that takes thirteen possible values can be communicated using?

a. Thirteen bits.
b. Three bits.
c. log2 13 bits.
d. Four bits.
e. None of the above.

tifr2011 number-representation

8.119 Number Representation: GATE2004_19 top gateoverflow.in/1016

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 504 of 852

If 73x (in base-x number system) is equal to 54y (in base y-number system), the possible values of x and y are

A. 8, 16
B. 10, 12
C. 9, 13
D. 8, 11

gate2004 digital-logic number-representation easy

8.120 Number Representation: GATE2004_66 top gateoverflow.in/1060

Let A = 1111 1010 and B = 0000 1010 be two 8-bit 2s complement numbers. Their product in 2s complement is

A. 1100 0100
B. 1001 1100
C. 1010 0101
D. 1101 0101

gate2004 digital-logic number-representation easy

8.121 Number Representation: GATE2004-IT_43 top gateoverflow.in/3686

The number (123456) 8 is equivalent to

A) (A72E)16 and (22130232) 4


B) (A72E)16 and (22131122) 4
C) (A73E)16 and (22130232) 4
D) (A62E)16 and (22120232) 4

gate2004-it digital-logic number-representation normal

8.122 Number Representation: GATE2002_1.15 top gateoverflow.in/819

The 2's complement representation of the decimal value -15 is

A. 1111
B. 11111
C. 111111
D. 10001

gate2002 digital-logic number-representation easy

8.123 Number Representation: GATE2002_1.14 top gateoverflow.in/818

The decimal value 0.25

A. is equivalent to the binary value 0.1


B. is equivalent to the binary value 0.01
C. is equivalent to the binary value 0.00111...

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 505 of 852

D. cannot be represented precisely in binary

gate2002 digital-logic number-representation easy

8.124 Number Representation: GATE 2016-1-07 top gateoverflow.in/39649

T h e 16 -bit 2 s complement representation of an integer is 1111 1111 1111 0101; its decimal representation is
______________.

gate2016-1 digital-logic number-representation normal numerical-answers

8.125 Number Representation: GATE1991_01,iii top gateoverflow.in/500

Consider the number given by the decimal expression:

163 9 + 162 7 + 16 5 + 3

The number of 1s in the unsigned binary representation of the number is ______

gate1991 digital-logic number-representation normal

8.126 Number Representation: GATE2008_6 top gateoverflow.in/404

Let r denote number system radix. The only value(s) of r that satisfy the equation 121r
= 11 , is/are
r

(A) decimal 10

(B) decimal 11

(C) decimal 10 and 11

(D) any value > 2

gate2008 digital-logic number-representation normal

8.127 Number Representation: GATE 2016-2-09 top gateoverflow.in/39546

Let X be the number of distinct 16-bit integers in 2 s complement representation. Let Y be the number of distinct 16-bit
integers in sign magnitude representation Then X Y is______.

gate2016-2 digital-logic number-representation normal numerical-answers

8.128 Number Representation: GATE2000_1.6 top gateoverflow.in/629

The number 43 in 2's complement representation is

A. 01010101
B. 11010101
C. 00101011
D. 10101011

gate2000 digital-logic number-representation easy

8.129 Number Representation: GATE2001-2.10 top gateoverflow.in/728

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 506 of 852

The 2's complement representation of (-539) 10 in hexadecimal is

(a) ABE

(b) DBC

(c) DE5

(d) 9E7

gate2001 digital-logic number-representation easy

8.130 Number Representation: GATE2000_2.14 top gateoverflow.in/661

Consider the values of A = 2.0 x 1030 , B = -2.0 x 1030 , C = 1.0, and the sequence

X:= A + B Y:= A + C
X:= X + C Y:= Y + B

executed on a computer where floating point numbers are represented with 32 bits. The values for X and Y will be

a. X = 1.0, Y = 1.0
b. X = 1.0, Y = 0.0
c. X = 0.0, Y = 1.0
d. X = 0.0, Y = 0.0

gate2000 digital-logic number-representation normal

8.131 Number Representation: GATE2009_5 top gateoverflow.in/1297

(1217)8 is equivalent to

A. (1217)16
B. (028F )16
C. (2297)10
D. (0B17)16

gate2009 digital-logic number-representation

8.132 Number Representation: GATE2004_28 top gateoverflow.in/1025

What is the result of evaluating the following two expressions using three-digit floating point arithmetic with rounding?

(113. + -111.) + 7.51

113. + (-111. + 7.51)

A. 9.51 and 10.0 respectively

B. 10.0 and 9.51 respectively

C. 9.51 and 9.51 respectively

D. 10.0 and 10.0 respectively

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 507 of 852

gate2004 digital-logic number-representation normal

8.133 Number Representation: GATE1998_2.20 top gateoverflow.in/1693

Suppose the domain set of an attribute consists of signed four digit numbers. What is the percentage of reduction in storage
space of this attribute if it is stored as an integer rather than in character form?

A. 80%
B. 20%
C. 60%
D. 40%

gate1998 digital-logic number-representation normal

8.134 Number Representation: GATE1998_1.17 top gateoverflow.in/1654

The octal representation of an integer is (342)8 . If this were to be treated as an eight-bit integer in an 8085 based
computer, its decimal equivalent is

A. 226
B. -98
C. 76
D. -30

gate1998 digital-logic number-representation normal

8.135 Number Representation: GATE2006_39 top gateoverflow.in/1815

We consider the addition of two 2s complement numbers bn1 bn2 . . . . . b0 and an1 an2 . . . . . a0 . A binary adder for adding
unsigned binary numbers is used to add the two numbers. The sum is denoted by cn1 cn2 . . . . . c0 and the carry-out by
cout . Which one of the following options correctly identifies the overflow condition?

(A) cout (an1 bn1 )


+ a
(B) an1 bn1 cn1 n1 bn1 cn1

(C) cout cn1


(D) an1 bn1 cn1
gate2006 digital-logic number-representation normal

8.136 Number Representation: GATE2014-2_8 top gateoverflow.in/1961

Consider the equation (123 )5 = (x8 )y with x and y as unknown. The number of possible solutions is _____ .

gate2014-2 digital-logic number-representation numerical-answers normal

8.137 Number Representation: GATE2014-2_45 top gateoverflow.in/2011

The value of a float type variable is represented using the single-precision 32-bit oating point format of IEEE-754 standard that uses 1 bit for sign, 8 bits for
biased exponent and 23 bits for mantissa. A float type variable X is assigned the decimal value of 14.25. The representation of X in hexadecimal notation is

(A) C1640000H

(B) 416C0000H

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 508 of 852

(C) 41640000H

(D) C16C0000H

gate2014-2 digital-logic number-representation normal

8.138 Number Representation: GATE2005-IT_47 top gateoverflow.in/3808

(34.4)8 (23.4) 8 evaluates to

A) (1053.6)8
B) (1053.2)8
C) (1024.2)8
D) None of these

gate2005-it digital-logic number-representation normal

8.139 Number Representation: GATE2014-1_8 top gateoverflow.in/1766

The base (or radix) of the number system such that the following equation holds is____________.
312
20
= 13.1

gate2014-1 digital-logic number-representation numerical-answers normal

8.140 Number Representation: GATE2005_17 top gateoverflow.in/1353

The hexadecimal representation of 657 8 is:

(a) 1AF

(b) D78

(c) D71

(d) 32F

gate2005 digital-logic number-representation easy

8.141 Number Representation: GATE2015-3_35 top gateoverflow.in/8494

Consider the equation (43)x = (y3)8 where x and y are unknown. The number of possible solutions is _____

gate2015-3 digital-logic number-representation normal numerical-answers

8.142 Number Representation: GATE2005_16 top gateoverflow.in/1352

The range of integers that can be represented by an n bit 2s complement number system is:

A. 2n1 to (2n1 1)
B. (2n1 1) to (2n1 1)

C. 2n1 to 2n1
( n1 + 1) to ( n1 1)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 509 of 852

D. (2n1 + 1) to (2n1 1)

gate2005 digital-logic number-representation easy

8.143 Number Representation: GATE1999_2.17 top gateoverflow.in/1495

Zero has two representations in

A. Sign magnitude
B. 2's complement
C. 1's complement
D. None of the above

gate1999 digital-logic number-representation easy

8.144 Priority Encoder: GATE1992-4,b top gateoverflow.in/31577

A priority encoder accepts three input signals (A, B and C) and produce a two-bit output (X1 , X0 ) corresponding to the
highest priority active input signal. Assume A has the highest priority followed by B and C has the has the lowest priority. If
none of the inputs are active the output should be 00. Design the priority encoder using 4 : 1 multiplexers as the main
components.

gate1992 digital-logic priority-encoder normal

8.145 Ram: GATE2005-IT_9 top gateoverflow.in/3754

A dynamic RAM has a memory cycle time of 64 nsec. It has to be refreshed 100 times per msec and each refresh takes 100
nsec. What percentage of the memory cycle time is used for refreshing?

A. 10
B. 6.4
C. 1
D. 0.64

gate2005-it digital-logic ram normal

8.146 Ram: GATE2010_7 top gateoverflow.in/2178

A main memory unit with a capacity of 4 megabytes is built using 1M 1-bit DRAM chips. Each DRAM chip has 1K rows of cells with 1K
cells in each row. The time taken for a single refresh operation is 100 nanoseconds. The time required to perform one refresh operation on all
the cells in the memory unit is

(A) 100 nanoseconds

(B) 100 210 nanoseconds

(C) 100 220 nanoseconds

(D) 3200 220 nanosesonds

gate2010 digital-logic ram normal

8.147 GATE2007-IT_7 top gateoverflow.in/3440

Which of the following input sequences for a cross-coupled R-S flip-flop realized with two NAND gates may lead to an
oscillation ?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 510 of 852

A) 11, 00
B) 01, 10
C) 10, 01
D) 00, 11

gate2007-it digital-logic normal

8.148 gate 14-EE 1 top gateoverflow.in/9596

digital-logic

8.149 GATE2004-IT_10 top gateoverflow.in/3651

What is the minimum size of ROM required to store the complete truth table of an 8-bit x 8-bit multiplier?

A) 32 K x 16 bits
B) 64 K x 16 bits
C) 16 K x 32 bits
D) 64 K x 32 bits

gate2004-it digital-logic normal

8.150 GATE1992-04b top gateoverflow.in/43601

A priority encoder accepts three input signals (A, B and C) and produce a two-bit output (X1 , X0 ) corresponding to the
highest priority active input signal. Assume A has the highest priority followed by B and C has the lowest priority. If none of
the inputs are active the output should be 00. design the priority encoder using 4:1 multiplexers as the main components.

gate1992 digital-logic descriptive

8.151 GATE1992-04c top gateoverflow.in/43602

Design a 3-bit counter using D-flip flops such that not more than one flip-flop changes state between any two consecutive
states.

gate1992 normal descriptive digital-logic

8.152 GATE2007-IT_8 top gateoverflow.in/3441

The following circuit implements a two-input AND gate using two 2-1 multiplexers.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 511 of 852

What are the values of X1, X2, X3?

A) X1 = b, X2 = 0, X3 = a
B) X1 = b, X2 = 1, X3 = b
C) X1 = a, X2 = b, X3 = 1
D) X1 = a, X2 = 0, X3 = b

gate2007-it digital-logic normal

8.153 gate 13 - IN top gateoverflow.in/9597

digital-logic

8.154 GATE2005-IT_48 top gateoverflow.in/3809

The circuit shown below implements a 2-input NOR gate using two 2-4 MUX (control signal 1 selects the upper input). What
are the values of signals x, y and z?

A) 1, 0, B
B) 1, 0, A
C) 0, 1, B
D) 0, 1, A

gate2005-it digital-logic normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 512 of 852

8.155 gate delay top gateoverflow.in/38549

how to solve this question?.. please help.. :)

8.156 GATE2003_47 top gateoverflow.in/29098

Consider the following circuit composed of XOR gates and non-inverting buffers.

The non-inverting buffers have delays d1 = 2 ns and d2 = 4 ns as shown in the gure. Both XOR gates and all wires have zero delay. Assume
that all gate inputs, outputs and wires are stable at logic level 0 at time 0. If the following waveform is applied at input A, how many transition(s)
(change of logic levels) occur(s) at B during the interval from 0 to 10 ns ?

(A) 1
(B) 2
(C) 3
(D) 4

digital-logic

8.157 TIFR2015-A-4 top gateoverflow.in/29162

The Boolean function obtained by adding an inverter to each and every input of an AND gate is:
a. OR
b. XOR
c. NAND
d. NOR
e. None of the above.

tifr2015 digital-logic

8.158 GATE2005-IT_7 top gateoverflow.in/3752

(A B) C

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 513 of 852

Which of the following expressions is equivalent to (A B) C

A. (A + B + C)(A + B + C )
B. (A + B + C)(A + B + C)
C. ABC + A(B C) + B(A C)
D. None of these

gate2005-it digital-logic normal

8.159 Gate-14 EE - 2 top gateoverflow.in/9595

digital-logic

8.160 GATE2014-3_8 top gateoverflow.in/2042

Consider the following combinational function block involving four Boolean variables x, y, a, b where x, a, b are inputs and
y is the output.
f(x, a, b, y)
{
if(x is 1) y = a;
else y = b;
}

Which one of the following digital logic blocks is the most suitable for implementing this function?

(A) Full adder

(B) Priority encoder

(C) Multiplexor

(D) Flip-flop

gate2014-3 digital-logic easy

8.161 GATE2004_18 top gateoverflow.in/1015

In an SR latch made by cross-coupling two NAND gates, if both S and R inputs are set to 0, then it will result in

A. Q = 0, Q' = 1
B. Q = 1, Q' = 0
C. Q = 1, Q' = 1
D. Indeterminate states

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 514 of 852

gate2004 digital-logic easy

8.162 GATE2004_59 top gateoverflow.in/1054

Which are the essential prime implicants of the following Boolean function?

f(a, b, c) = ac + ac + bc
a. ac and ac
b. ac and bc
c. ac only.
d. ac and bc

gate2004 digital-logic normal

8.163 GATE2004_60 top gateoverflow.in/1055

gate2004 digital-logic normal

8.164 GATE2004_17 top gateoverflow.in/1014

A Boolean function xy + xy + xy is equivalent to

A. x' + y'
B. x + y
C. x + y'
D. x' + y

gate2004 digital-logic easy

8.165 GATE2003_46 top gateoverflow.in/937

Consider the ALU shown below.

If the operands are in 2s complement representation, which of the following operations can be performed by suitably setting
C0

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 515 of 852

the control lines K and C0 only (+ and denote addition and subtraction respectively)?

A. A + B, and A B, but not A + 1


B. A + B, and A + 1, but not A B
C. A + B, but not A B or A + 1
D. A + B, and A B, and A + 1

gate2003 digital-logic normal

8.166 GATE2006_08 top gateoverflow.in/887

You are given a free running clock with a duty cycle of 50% and a digital waveform f which changes only at the negative
edge of the clock. Which one of the following circuits (using clocked D flip-flops) will delay the phase of f by 180?

(A)

(B)

(C)

(D)

gate2006 digital-logic normal

8.167 GATE2003_11 top gateoverflow.in/902

Consider an array multiplier for multiplying two n bit numbers. If each gate in the circuit has a unit delay, the total delay of
the multiplier is

A. (1)
B. (log n)
C. (n)
D. (n2 )

gate2003 digital-logic normal

8.168 GATE2004_62 top gateoverflow.in/1057

A 4-bit carry look ahead adder, which adds two 4-bit numbers, is designed using AND, OR, NOT, NAND, NOR gates only.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 516 of 852

Assuming that all the inputs are available in both complemented and uncomplemented forms and the delay of each gate is
one time unit, what is the overall propagation delay of the adder? Assume that the carry network has been implemented
using two-level AND-OR logic.

A. 4 time units
B. 6 time units
C. 10 time units
D. 12 time units

gate2004 digital-logic normal

8.169 GATE2007_8 top gateoverflow.in/1206

How many 3-to-8 line decoders with an enable input are needed to construct a 6-to-64 line decoder without using any other
logic gates?

A. 7
B. 8
C. 9
D. 10

gate2007 digital-logic normal

8.170 GATE2007_35 top gateoverflow.in/1233

In a look-ahead carry generator, the carry generate function Gi and the carry propagate function Pi for inputs Ai and Bi
are given by:

Pi = Ai Bi and Gi = Ai Bi
The expressions for the sum bit Si and the carry bit Ci+1 of the look ahead carry adder are given by:

Si = Pi Ci and Ci+1 = Gi + Pi Ci , where C0 is the input carry.


Consider a two-level logic implementation of the look-ahead carry generator. Assume that all Pi and Gi are available for the
carry generator circuit and that the AND and OR gates can have any number of inputs. The number of AND gates and OR
gates needed to implement the look-ahead carry generator for a 4-bit adder with S3 , S2 , S1 , S0 and C4 as its outputs are
respectively:

A. 6, 3
B. 10, 4
C. 6, 4
D. 10, 5

gate2007 digital-logic normal

8.171 GATE2007_48 top gateoverflow.in/1246

Which of the following is TRUE about formulae in Conjunctive Normal Form?

A. For any formula, there is a truth assignment for which at least half the clauses evaluate to true.

B. For any formula, there is a truth assignment for which all the clauses evaluate to true.

C. There is a formula such that for each truth assignment, at most one-fourth of the clauses evaluate to true.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 517 of 852

D. None of the above.

gate2007 digital-logic normal

8.172 GATE2007_34 top gateoverflow.in/1232

Suppose only one multiplexer and one inverter are allowed to be used to implement any Boolean function of n variables.
What is the minimum size of the multiplexer needed?

A. 2n line to 1 line

B. 2n+1 line to 1 line

C. 2n1 line to 1 line

D. 2n2 line to 1 line

gate2007 digital-logic normal

8.173 GATE2007_33 top gateoverflow.in/1231

Define the connective for the Boolean variables X and Y as:

X Y = XY + X Y .
Let Z = X Y . Consider the following expressions P , Q and R.
P : X = Y Z,
Q : Y = X Z,
R: XY Z = 1

Which of the following is TRUE?

(A) Only P and Q are valid. (B) Only Q and R are valid.
(C) Only P and R are valid. (D) All P , Q, R are valid.

gate2007 digital-logic normal

8.174 GATE2007_9 top gateoverflow.in/1207

Consider the following Boolean function of four variables:

f(w, x, y, z) = (1, 3, 4, 6, 9, 11, 12, 14)


The function is

A. independent of one variables.

B. independent of two variables.

C. independent of three variables.

D. dependent on all variables

gate2007 digital-logic normal

8.175 GATE2007_32 top gateoverflow.in/1230

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 518 of 852

Let f(w, x, y, z) = (0, 4, 5, 7, 8, 9, 13, 15). Which of the following expressions are NOT equivalent to f ?
(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

A. P only
B. Q and S
C. R and S
D. S only

gate2007 digital-logic normal

8.176 GATE2002_8 top gateoverflow.in/861

Consider the following circuit. A = a2 a1 a0 and B = b2 b1 b0 are three bit binary numbers input to the circuit. The output is
Z = z3 z2 z1 z0 . R0, R1 and R2 are registers with loading clock shown. The registers are loaded with their input data with the
falling edge of a clock pulse (signal CLOCK shown) and appears as shown. The bits of input number A, B and the full adders
are as shown in the circuit. Assume Clock period is greater than the settling time of all circuits.

(a) For 8 clock pulses on the CLOCK terminal and the inputs A, B as shown, obtain the output Z (sequence of 4-bit values of
Z). Assume initial contents of R0, R1 and R2 as all zeros.

A= 110 011 111 101 000 000 000 000


B= 101 101 011 110 000 000 000 000
Clock No 1 2 3 4 5 6 7 8

(b) What does the circuit implement?

gate2002 digital-logic normal

8.177 GATE2002_7 top gateoverflow.in/860

a. Express the function f(x, y, z) = xy + yz with only one complement operation and one or more AND/OR operations.
Draw the logic circuit implementing the expression obtained, using a single NOT gate and one or more AND/OR gates.
b. Transform the following logic circuit (without expressing its switching function) into an equivalent logic circuit that
employs only 6 NAND gates each with 2-inputs.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 519 of 852

gate2002 digital-logic normal

8.178 GATE1991_03,ii top gateoverflow.in/516

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

(ii). Advantage of synchronous sequential circuits over asynchronous ones is:

(a). faster operation

(b). ease of avoiding problems due to hazards

(c). lower hardware requirement

(d). better noise immunity

(e). none of the above

gate1991 digital-logic normal

8.179 GATE1991-5,a top gateoverflow.in/531

Analyse the circuit in Fig below and complete the following table

a b Qn
0 0
0 1
1 0
1 1

gate1991 digital-logic normal

8.180 GATE1991_06,a top gateoverflow.in/532

a. Using D flip-flop gates, design a parallel-in/serial-out shift register that shifts data from left to right with the following
input lines:

i. Clock CLK

ii. Three parallel data inputs A, B, C

iii. Serial input S



iv. Control input load/SHIFT.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 520 of 852

gate1991 digital-logic difficult

8.181 GATE1991_01,v top gateoverflow.in/503

When two 4 bit numbers A = a3 a2 a1 a0 and B = b3 b2 b1 b0 are multiplied, the digit c1 of the product C is given by
________

gate1991 digital-logic normal

8.182 GATE2008_26 top gateoverflow.in/424

If P , Q, R are Boolean variables, then

(P + Q)(P . Q + P . R)(P. R + Q) simplifies to


A. P . Q

B. P . R

C. P . Q + R

D. P . R + Q

gate2008 easy digital-logic

8.183 GATE2012_7 top gateoverflow.in/39

The decimal value 0.5 in IEEE single precision floating point representation has

(A) fraction bits of 000000 and exponent value of 0


(B) fraction bits of 000000 and exponent value of 1
(C) fraction bits of 100000 and exponent value of 0
(D) no exact representation

gate2012 digital-logic normal

8.184 GATE2012_19 top gateoverflow.in/51

The amount of ROM needed to implement a 4 bit multiplier is

(A) 64 bits
(B) 128 bits
(C) 1 Kbits
(D) 2 Kbits

gate2012 digital-logic normal

8.185 GATE1992_02,i top gateoverflow.in/555

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

The operation which is communicative but not associative is:

A. AND
B. OR
C. EX-OR
D. NAND

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 521 of 852

gate1992 easy digital-logic

8.186 GATE1992_02,ii top gateoverflow.in/556

02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

(ii) All digital circuits can be realized using only

a. Ex-OR gates
b. Multiplexers
c. Half adders
d. OR gates

gate1992 normal digital-logic

8.187 GATE2001_10 top gateoverflow.in/751

(a) Is the 3-variable function f = (0, 1, 2, 4) its self-dual? Justify your answer.
(b) Give a minimal product-of-sum form of the b output of the following excess-3 to BCD converter.

gate2001 digital-logic normal

8.188 GATE2001_11 top gateoverflow.in/752

A sequential circuit takes an input stream of 0's and 1's and produces an output stream of 0's and 1's. Initially it replicates
the input on its output until two consecutive 0's are encountered on the input. From then onward, it produces an output
stream, which is the bit-wise complement of input stream until it encounters two consecutive 1's, whereupon the process
repeats. An example input and output stream is shown below.

The input stream: 101100|01001011 0|11


The desired output 101100|10110100 0|11

J-K master-slave flip-flops are to be used to design the circuit.

(a) Give the state transition diagram

(b) Give the minimized sum-of-product expression for J and K inputs of one of its state flip-flops

gate2001 digital-logic normal

8.189 GATE2001_2.12 top gateoverflow.in/730

Consider the circuit given below with initial state Q0 = 1, Q1 = Q2 = 0. The state of the circuit is given by the value
4Q2 + 2Q1 + Q0

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 522 of 852

Which one of the following is correct state sequence of the circuit?

A. 1, 3, 4, 6, 7, 5, 2
B. 1, 2, 5, 3, 7, 6, 4
C. 1, 2, 7, 3, 5, 6, 4
D. 1, 6, 5, 7, 2, 3, 4

gate2001 digital-logic normal

8.190 GATE2001.2.11 top gateoverflow.in/729

Consider the circuit shown below. The output of a 2:1 Mux is given by the function (ac + bc).

Which of the following is true?

(A) f = X1 + X2
(B) f = X1 X2 + X1X2
(C) f = X1X2 + X1 X2
(D) f = X1 + X2

gate2001 digital-logic normal

8.191 GATE1992_04a top gateoverflow.in/583

Consider addition in two's complement arithmetic. A carry from the most significant bit does not always correspond to an
overflow. Explain what is the condition for overflow in two's complement arithmetic.

gate1992 digital-logic normal

8.192 GATE1992_06,a,b top gateoverflow.in/585

A microprocessor is capable of addressing 1 megabyte of memory with a 20-bit address bus. The system to be designed
requires 256 K bytes of RAM, 256 K bytes of EPROM, 16 I/O devices (memory mapped I/O) and 1 K byte of
EERAM (electrically erasable RAM).

(a) Design a memory map (to reduce decoding logic) and show the decoding logic if the components available are:

Type Size Speed


RAM 6 K x 8 140 ns

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 523 of 852

Type
EPROM Size
256 K x 8 Speed
150 ns
EERAM 256 x 8 500 ns - read, 3 microsec - write

(b) The microprocessor is operating at 12.5 mHz and provides time equivalent to two clock cycles for memory read and
write. Assuming control signals similar to 8085, design the extra logic required for interfacing EERAM.

gate1992 digital-logic descriptive

8.193 GATE2006_36 top gateoverflow.in/1294

Given two three bit numbers a2 a1 a0 and b2 b1 b0 and c the carry in, the function that represents the c arry generate function
when these two numbers are added is:

(A) a2 b2 + a2 a1 b1 + a2 a1 a0 b0 + a2 a0 b1 b0 + a1 b2 b1 + a1 a0 b2 b0 + a0 b2 b1 b0
(B) a2 b2 + a2 b1 b0 + a2 a1 b1 b0 + a1 a0 b2 b1 + a1 a0 b2 + a1 a0 b2 b0 + a2 a0 b1 b0
(C) a2 + b2 + (a2 b2 )(a1 + b1 + (a1 b1 ) + (a0 + b0 ))

(D)a2 b2 + a2a1 b1 + a2a1a0 b0 + a2a0 b1b0 + a1 b2b1 + a1a0 b2b0 + a0 b2b1b0

gate2006 digital-logic normal

8.194 GATE2009_7 top gateoverflow.in/1299

How many 32K 1 RAM chips are needed to provide a memory capacity of 256K-bytes?

A. 8
B. 32
C. 64
D. 128

gate2009 digital-logic easy

8.195 GATE1997_2.1 top gateoverflow.in/2227

Let be defined as x y = x + y. Let z = x y. Value of z x is


A. x + y
B. x
C. 0
D. 1

gate1997 digital-logic normal

8.196 GATE1997_2.5 top gateoverflow.in/2231

An N-bit carry lookahead adder, where N is a multiple of 4, employs ICs 74181 (4 bit ALU) and 74182 ( 4 bit carry lookahead
generator).

The minimum addition time using the best architecture for this adder is

A. proportional to N
log N

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 524 of 852

B. proportional to log N

C. a constant

D. None of the above

gate1997 digital-logic normal

8.197 GATE1997_5.1 top gateoverflow.in/2252

Let f(x, y, z) = x + y x + xz be a switching function. Which one of the following is valid?


A. y x is a prime implicant of f

B. xz is a minterm of f

C. xz is an implicant of f

D. y is a prime implicant of f

gate1997 digital-logic normal

8.198 GATE2011_15 top gateoverflow.in/2117

The minimum number of D flip-flops needed to design a mod-258 counter is

(A) 9

(B) 8

(C) 512

(D) 258

gate2011 digital-logic normal

8.199 GATE2011_14 top gateoverflow.in/2116

The simplified SOP (Sum of Product) from the Boolean expression

(P + Q + R). (P + Q + R). (P + Q + R)
is

(A) (P. Q + R)

(B) (P + Q. R)

(C) ( P. Q + R)

(D) (P. Q + R)

gate2011 digital-logic normal

8.200 GATE2014-3_55 top gateoverflow.in/2090

Let denote the exclusive OR (XOR) operation. Let '1' and '0' denote the binary constants. Consider the following Boolean
expression for F over two variables P and Q:

F (P , Q) = ((1 P ) (P Q)) ((P Q) (Q 0))


The equivalent expression for F is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 525 of 852

(A) P + Q

(B) P + Q

(C) P Q


(D) P Q

gate2014-3 digital-logic normal

8.201 GATE2011_13 top gateoverflow.in/2115

Which one of the following circuits is NOT equivalent to a 2-input XNOR (exclusive NOR) gate?

(A)

(B)

(C)

(D)

gate2011 digital-logic normal

8.202 GATE1993_6.6 top gateoverflow.in/2285

A ROM is used to store the Truth table for a binary multiple unit that will multiply two 4-bit numbers. The size of the ROM
(number of words number of bits) that is required to accommodate the Truth table is M words N bits. Write the values
of M and N .

gate1993 digital-logic normal

8.203 GATE1996_5 top gateoverflow.in/2757

A logic network has two data inputs A and B, and two control inputs C0 and C1 . It implements the function F according to
the following table.

C1 C2 F
0 0
A+B
0 1 A+B
1 0 AB

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 526 of 852

Implement the circuit using one 4 to 1 Multiplexer, one 2-input Exclusive OR gate, one 2-input AND gate, one 2-input OR
gate and one Inverter.

gate1996 digital-logic normal

8.204 GATE2008-IT_1 top gateoverflow.in/3222

A set of Boolean connectives is functionally complete if all Boolean functions can be synthesized using those. Which of the
following sets of connectives is NOT functionally complete?

A) EX-NOR
B) implication, negation
C) OR, negation
D) NAND

gate2008-it digital-logic easy

8.205 GATE1996_1.21 top gateoverflow.in/2725

A ROM is used to store the table for multiplication of two 8-bit unsigned integers. The size of ROM required is

1. 256 16
2. 64 K 8
3. 4 K 16
4. 64 K 16

gate1996 digital-logic normal

8.206 GATE1994_4 top gateoverflow.in/2500

a. Let be a Boolean operation defined as A B = AB + A



B. If C = A B then evaluate and fill in the blanks:
i. A A = ____
ii. C A = ____

b. Solve the following boolean equations for the values of A, B and C:


AB + A

C=1
AC + B = 0

gate1994 digital-logic normal

8.207 GATE1993_9 top gateoverflow.in/2306

Assume that only half adders are available in your laboratory. Show that any binary function can be implemented using half
adders only.

gate1993 digital-logic

8.208 GATE1994_2.1 top gateoverflow.in/2468

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 527 of 852

The number of flip-flops required to construct a binary modulo N counter is __________

gate1994 digital-logic easy

8.209 GATE2012_6 top gateoverflow.in/38

The truth table

X Y (X,Y)

0 0 0

0 1 0

1 0 1

1 1 1

represents the Boolean function

(A) X
(B) X + Y
(C) X Y
(D) Y

gate2012 digital-logic easy

8.210 GATE2014-2_7 top gateoverflow.in/1959

Let k = 2n . A circuit is built by giving the output of an n-bit binary counter as input to an n-to-2n bit decoder. This circuit is equivalent to a

(A) k-bit binary up counter.

(B) k-bit binary down counter.

(C) k--bit ring counter.

(D) k-bit Johnson counter.

gate2014-2 digital-logic normal

8.211 GATE1999_2.9 top gateoverflow.in/1487

Which of the following sets of component(s) is/are sufficient to implement any arbitrary Boolean function?

A. XOR gates, NOT gates

B. 2 to 1 multiplexers

C. AND gates, XOR gates

D. Three-input gates that output (A.B) + C for the inputs A, B and C.

gate1999 digital-logic normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 528 of 852

8.212 GATE1999_2.16 top gateoverflow.in/1494

The number of full and half-adders required to add 16-bit numbers is

A. 8 half-adders, 8 full-adders

B. 1 half-adder, 15 full-adders

C. 16 half-adders, 0 full-adders

D. 4 half-adders, 12 full-adders

gate1999 digital-logic normal

8.213 GATE1999_1.21 top gateoverflow.in/1474

The maximum gate delay for any output to appear in an array multiplier for multiplying two n bit numbers is

A. O(n2 )
B. O(n)
C. O(log n)
D. O(1)

gate1999 digital-logic normal

8.214 GATE1999_1.7 top gateoverflow.in/1460

Which of the following expressions is not equivalent to x?

A. x NAND x
B. x NOR x
C. x NAND 1
D. x NOR 1

gate1999 digital-logic easy

8.215 GATE2005_18 top gateoverflow.in/1354

The switching expression corresponding to f(A, B, C, D) = (1, 4, 5, 9, 11, 12) is:


A. BCD + ACD + ABD

B. ABC + ACD + BCD

C. ACD + ABC + ACD

D. ABD + ACD + BCD

gate2005 digital-logic normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 529 of 852

8.216 GATE2013_5 top gateoverflow.in/1414

In the following truth table, V = 1 if and only if the input is valid.


Inputs Outputs

D0 D1 D2 D3 X0 X1 V

0 0 0 0 x x 0

1 0 0 0 0 0 1

x 1 0 0 0 1 1

x x 1 0 1 0 1

x x x 1 1 1 1

What function does the truth table represent?

(A) Priority encoder (B) Decoder (C) Multiplexer (D) Demultiplexer

gate2013 digital-logic normal

8.217 GATE2013_21 top gateoverflow.in/1532

Which one of the following expressions does NOT represent exclusive NOR of x and y?

(A) xy + x'y' (B) x y' (C) x' y (D) x' y'

gate2013 digital-logic easy

8.218 GATE2013_46 top gateoverflow.in/1555

A RAM chip has a capacity of 1024 words of 8 bits each (1K 8). The number of 2 4 decoders with enable line needed to
construct a 16K 16 RAM from 1K 8 RAM is

(A) 4 (B) 5 (C) 6 (D) 7

gate2013 digital-logic normal

8.219 GATE2014-1_45 top gateoverflow.in/1923

Consider the 4-to-1 multiplexer with two select lines S1 and S0 given below

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 530 of 852

The minimal sum-of-products form of the Boolean expression for the output F of the multiplexer is

(A) P Q + QR + P QR

(B) P Q + P QR + P QR + P QR

(C) P QR + P QR + QR + P QR

(D) P QR

gate2014-1 digital-logic normal

8.220 GATE2014-2_6 top gateoverflow.in/1958

The dual of a Boolean functionF(x1 , x2 , , xn , +, . , ), written as F D is the same expression as that of F with + and swapped. F is said to be self-dual if
F = F D . The number of self-dual functions with n Boolean variables is

(A) 2n

(B) 2n1

(C) 22
n

(D) 22
n1

gate2014-2 digital-logic normal

8.221 GATE2014-1_7 top gateoverflow.in/1764

Consider the following Boolean expression for F:

F (P , Q, R, S) = P Q + PQR + PQRS
The minimal sum of products form of F is

(A) PQ + QR + QS

(B) P + Q + R + S

(C) P + Q + R + S

(D) PR + RPS + P

gate2014-1 digital-logic normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 531 of 852

8.222 GATE1998_16 top gateoverflow.in/1730

Design a synchronous counter to go through the following states:

1, 4, 2, 3, 1, 4, 2, 3, 1, 4 .......

gate1998 digital-logic normal descriptive

8.223 GATE1998_1.13 top gateoverflow.in/1650

What happens when a bit-string is XORed with itself n-times as shown:


[B (B (B (B n times]

A. complements when n is even

B. complements when n is odd

C. divides by 2n always

D. remains unchanged when n is even

gate1998 digital-logic normal

8.224 GATE1998_2.8 top gateoverflow.in/1680

Which of the following operations is commutative but not associative?

A. AND
B. OR
C. NAND
D. EXOR

gate1998 digital-logic easy

8.225 GATE2008-IT_8 top gateoverflow.in/3268

Consider the following Boolean function of four variables

f(A, B, C, D) = (2, 3, 6, 7, 8, 9, 10, 11, 12, 13)

The function is

A) independent of one variable


B) independent of two variables
C) independent of three variable
D) dependent on all the variables

gate2008-it digital-logic normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 532 of 852

9 Verbal Ability top


9.1 Closest Word: gate-2013-ee-1 top gateoverflow.in/40288

Q.56 They were requested not to quarrel with others.


Which one of the following options is the closest in meaning to the word quarrel?
(A) make out (B) call out (C) dig out (D) fall out

gate2013-ee verbal-ability closest-word

9.2 Closest Word: gate2013-ce-3 top gateoverflow.in/40270

Q.58 Which of the following options is the closest in meaning to the word given below: Primeval
(A) Modern (B) Historic
(C) Primitive (D) Antique

gate2013-ce closest-word

9.3 Closest Word: gate-2014-ae-1 top gateoverflow.in/40300

Q.1 A student is required to demonstrate a high level of comprehension of the subject, especially in the
social sciences.
The word closest in meaning to comprehension is
(A) understanding (B) meaning (C) concentration (D) stability

gate-2014-ae closest-word

9.4 English Grammar: gate2013-ce-2 top gateoverflow.in/40269

The professor ordered to the students to go out of the class.

I II III IV

Which of the above underlined parts of the sentence is grammatically incorrect?

a. I
b. II
c. III
d. IV

gate2013-ce english-grammar

9.5 English Grammar: GATE2012-CY-GA-2 top gateoverflow.in/40233

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 533 of 852

Q.57 One of the parts (A, B, C, D) in the sentence given below contains an ERROR. Which one of the
following is INCORRECT?
I requested that he should be given the driving test today instead of tomorrow.
(A) requested that
(B) should be given
(C) the driving test
(D) instead of tomorrow

gate2012-cy aptitude verbal-ability english-grammar

9.6 English Grammar: GATE2012-AR-3 top gateoverflow.in/40224

Choose the grammatically CORRECT sentence:

A. He laid in bed till 8 oclock in the morning.


B. He layed in bed till 8 oclock in the morning.
C. He lain in bed till 8 oclock in the morning.
D. He lay in bed till 8 oclock in the morning.

gate2012-ar aptitude verbal-ability english-grammar easy

9.7 English Grammar: gate-2013-ee-4 top gateoverflow.in/40291

Q.59 Choose the grammatically CORRECT sentence:


(A) Two and two add four.
(B) Two and two become four.
(C) Two and two are four.
(D) Two and two make four.

gate2013-ee english-grammar

9.8 English Grammar: GATE2014-EC02-GA2 top gateoverflow.in/41509

Which of the options given below best completes the following sentence?

She will feel much better if she ___________.

A. Will get some rest


B. Gets some rest
C. Will be getting some rest
D. Is getting some rest

gate2014-ec02 verbal-ability english-grammar normal

9.9 English Grammar: GATE2012-AR-4 top gateoverflow.in/40225

Which one of the parts (A, B, C, D) in the sentence contains an ERROR?


No sooner had the doctor seen the results of the blood test, than he suggested the patient to
see the specialist.
(A) no sooner had
(B) results of the blood test
(C) suggested the patient

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 534 of 852

(D) see the specialist


gate2012-ar aptitude verbal-ability english-grammar

9.10 English Grammar: GATE2016-1-GA01 top gateoverflow.in/39608

Out of the following four sentences, select the most suitable sentence with respect to grammar and usage.

A. I will not leave the place until the minister does not meet me.
B. I will not leave the place until the minister doesn't meet me.
C. I will not leave the place until the minister meet me.
D. I will not leave the place until the minister meets me.

gate2016-1 verbal-ability english-grammar easy

9.11 English Grammar: GATE-2013-AE-GA-2 top gateoverflow.in/40243

Q.57 The Headmaster ___________ to speak to you. Which of the following options is incorrect to complete the above sentence?
(A) is wanting
(B) wants
(C) want
(D) was wanting

gate2013-ae verbal-ability english-grammar

9.12 English Grammar: GATE 2016-2-GA-01 top gateoverflow.in/39529

The man who is now Municipal Commissioner worked as ________________.

(A) the security guard at a university

(B) a security guard at the university

(C) a security guard at university

(D) the security guard at the university

gate2016-2 verbal-ability english-grammar normal

9.13 English Grammar: GATE-2013-AE-GA-4 top gateoverflow.in/40245

All engineering students should learn mechanics, mathematics and how to do computation.

I II III IV

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 535 of 852

Which of the above underlined parts of the sentence is not appropriate?

a. I
b. II
c. III
d. IV

gate2013-ae english-grammar verbal-ability

9.14 Grammatically Incorrect Sentence: GATE2012_59 top gateoverflow.in/2198

Choose the grammatically INCORRECT sentence:

(A) They gave us the money back less the service charges of Three Hundred rupees.
(B) This countrys expenditure is not less than that of Bangladesh.
(C) The committee initially asked for a funding of Fifty Lakh rupees, but later settled for a lesser sum.
(D) This countrys expenditure on educational reforms is very less.

gate2012 verbal-ability grammatically-incorrect-sentence normal

9.15 Grammatically Incorrect Sentence: GATE2013_60 top gateoverflow.in/1564

Choose the grammatically INCORRECT sentence:

(A) He is of Asian origin.


(B) They belonged to Africa.
(C) She is an European.
(D) They migrated from India to Australia.

gate2013 verbal-ability grammatically-incorrect-sentence normal

9.16 Inference: GATE2014-1_GA_7 top gateoverflow.in/775

Geneticists say that they are very close to confirming the genetic roots of psychiatric illnesses such as depression and
schizophrenia, and consequently, that doctors will be able to eradicate these diseases through early identification and gene
therapy.

On which of the following assumptions does the statement above rely?

Select one:

A. Strategies are now available for eliminating psychiatric illnesses

B. Certain psychiatric illnesses have a genetic basis

C. All human diseases can be traced back to genes and how they are expressed

D. In the future, genetics will become the only relevant field for identifying psychiatric illnesses

gate2014-1 verbal-ability inference normal

9.17 Inference: GATE2012_61 top gateoverflow.in/2209

Wanted Temporary, Part-time persons for the post of Field Interviewer to conduct personal interviews to collect
and collate economic data. Requirements: High School-pass, must be available for Day, Evening and Saturday
work. Transportation paid, expenses reimbursed.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 536 of 852

Which one of the following is the best inference from the above advertisement?

(A) Gender-discriminatory
(B) Xenophobic
(C) Not designed to make the post attractive
(D) Not gender-discriminatory

gate2012 verbal-ability inference normal

9.18 Logical Reasoning: gate2013-ee-5 top gateoverflow.in/40292

Q.60 Statement: You can always give me a ring whenever you need.
Which one of the following is the best inference from the above statement?
(A) Because I have a nice caller tune.
(B) Because I have a better telephone facility.
(C) Because a friend in need is a friend indeed.
(D) Because you need not pay towards the telephone bills when you give me a ring.

gate2013-ee logical-reasoning

9.19 Logical Reasoning: GATE 2015 Aptitude Set 4 Q4 top gateoverflow.in/40169

Q.4 Tanya is older than Eric.


Cliff is older than Tanya.
Eric is older than Cliff.
If the first two statements are true, then the third statement is:
(A) True
(B) False
(C) Uncertain
(D) Data insufficient

gate2015aptiset4 aptitude logical-reasoning

9.20 Logical Reasoning: gate2013-ce-10 top gateoverflow.in/40280

Q.65 Abhishek is elder to Savar. Savar is younger to Anshul. Which of the given conclusions is logically valid and is inferred from the above statements?

(A) Abhishek is elder to Anshul

(B) Anshul is elder to Abhishek

(C) Abhishek and Anshul are of the same age

(D) No conclusion follows


gate2013-ce logical-reasoning

9.21 Logical Reasoning: GATE2016-1-GA08 top gateoverflow.in/39617

Consider the following statements relating to the level of poker play of four players P , Q, R and S.

I. P always beats Q
II. R always beats S
III. S loses to P only sometimes.
R Q

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 537 of 852

IV. R always loses to Q

Which of the following can be logically inferred from the above statements?

i. P is likely to beat all the three other players


ii. S is the absolute worst player in the set

A. (i). only
B. (ii) only
C. (i) and (ii) only'
D. neither (i) nor (ii)

gate2016-1 numerical-ability logical-reasoning normal

9.22 Logical Reasoning: GATE-2013-AE-GA-3 top gateoverflow.in/40244

Q.58 Mahatama Gandhi was known for his humility as


(A) he played an important role in humiliating exit of British from India.
(B) he worked for humanitarian causes.
(C) he displayed modesty in his interactions.
(D) he was a fine human being

gate2013-ae verbal-ability logical-reasoning

9.23 Logical Reasoning: GATE 2016-2-GA-08 top gateoverflow.in/39534

All hill-stations have a lake. Ooty has two lakes.

Which of the statement(s) below is/are logically valid and can be inferred from the above sentences?

(i) Ooty is not a hill-station.

(ii) No hill-station can have more than one lake.

A. (i) only.
B. (ii) only.
C. Both (i) and (ii)
D. Neither (i) nor (ii)

gate2016-2 verbal-ability logical-reasoning easy

9.24 Logical Reasoning: GATE2016-1-GA04 top gateoverflow.in/39609

If 'relftaga' means carefree, 'otaga' means careful and 'fertaga' means careless, which of the following could mean
'aftercare'?

A. zentaga
B. tagafer.
C. tagazen.
D. relffer.

gate2016-1 verbal-ability logical-reasoning normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 538 of 852

9.25 Logical Reasoning: GATE2012-AR-8 top gateoverflow.in/40229

Ravi is taller than Arun but shorter than Iqbal. Sam is shorter than Ravi. Mohan is shorter than
Arun. Balu is taller than Mohan and Sam. The tallest person can be

(A) Mohan (B) Ravi (C) Balu (D) Arun


gate2012-ar aptitude logical-reasoning verbal-ability

9.26 Logical Reasoning: GATE-2013-AE-GA-9 top gateoverflow.in/40250

Q.65 All professors are researchers Some scientists are professors Which of the given conclusions is logically valid and is inferred from the above arguments:

(A) All scientists are researchers

(B) All professors are scientists

(C) Some researchers are scientists

(D) No conclusion follows


gate2013-ae verbal-ability logical-reasoning

9.27 Meaning: GATE2015-2_GA_2 top gateoverflow.in/8029

Choose the statement where underlined word is used correctly.

A. The industrialist had a personnel jet.


B. I write my experience in my personnel diary.
C. All personnel are being given the day off.
D. Being religious is a personnel aspect.

gate2015-2 verbal-ability meaning normal

9.28 Meaning: GATE2015-1_GA_7 top gateoverflow.in/8011

Select the alternative meaning of the underlined part of the sentence.

The chain snatchers took to their heels when the police party arrived.

A. Took shelter in a thick jungle


B. Open indiscriminate fire
C. Took to flight
D. Unconditionally surrendered

gate2015-1 verbal-ability meaning easy

9.29 Meaning: GATE2013_56 top gateoverflow.in/1559

Which one of the following options is the closest in meaning to the word given below?

Nadir

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 539 of 852

(A) Highest (B) Lowest (C) Medium (D) Integration

gate2013 verbal-ability meaning normal

9.30 Meaning: GATE2014-EC04-GA3 top gateoverflow.in/41465

While receiving the award, the scientist said, "I feel vindicated". Which of the following is closest in meaning to the word
'vindicated'?

A. Punished
B. Substantiated
C. Appreciated
D. Chastened

gate2014-ec04 verbal-ability meaning normal

9.31 Meaning: GATE2016-1-GA02 top gateoverflow.in/39607

A rewording of something written or spoken is a __________.

A. paraphrase
B. paradox
C. paradigm
D. paraffin

gate2016-1 verbal-ability meaning normal

9.32 Meaning: GATE2014-EC04-GA1 top gateoverflow.in/41463

Which of the following options is the closest in meaning to the word underlined in the sentence below?

In a democracy, everybody has the freedom to disagree with the government.

A. Dissent
B. Descent
C. Decent
D. Decadent

gate2014-ec04 verbal-ability meaning normal

9.33 Meaning: GATE2014-EC04-GA2 top gateoverflow.in/41464

After the discussion, Tom said to me, 'Please revert!'. He expects me to __________.

A. Retract
B. Get back to him
C. Move in reverse
D. Retreat

gate2014-ec04 verbal-ability meaning easy

9.34 Meaning: GATE 2016-2-GA-02 top gateoverflow.in/39531

Nobody knows how the Indian cricket team is going to cope with the difficult and seamer-friendly wickets in Australia.

Choose the option which is closest in meaning to the underlined phrase in the above sentence.

A. Put up with.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 540 of 852

B. Put in with.
C. Put down to.
D. Put up against.

gate2016-2 verbal-ability meaning normal

9.35 Meaning: GATE2014-1_GA_1 top gateoverflow.in/56

Which of the following options is the closest in meaning to the phrase in bold in the
sentence below?

It is fascinating to see life forms **cope with** varied environmental conditions.

(A) Adopt to (B) Adapt to (C) Adept in (D) Accept with

verbal-ability gate2014-1 meaning easy

9.36 Meaning: GATE2012_58 top gateoverflow.in/2197

Which one of the following options is the closest in meaning to the word given below?

Mitigate

(A) Diminish
(B) Divulge
(C) Dedicate
(D) Denote

gate2012 verbal-ability meaning easy

9.37 Meaning: GATE2010_57 top gateoverflow.in/2365

Which of the following options is the closest in meaning to the word given below:

Circuitous

(A) cyclic

(B) indirect

(C) confusing

(D) crooked

gate2010 verbal-ability meaning normal

9.38 Meaning: GATE2014-2_GA_3 top gateoverflow.in/1940

Match the columns.

Column 1 Column 2

1) eradicate P) misrepresent

2) distort Q) soak completely

3) saturate R) use

4) utilize S) destroy utterly

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 541 of 852

(A) 1:S, 2:P, 3:Q, 4:R

(B) 1:P, 2:Q, 3:R, 4:S

(C) 1:Q, 2:R, 3:S, 4:P

(D) 1:S, 2:P, 3:R, 4:Q

gate2014-2 verbal-ability meaning normal

9.39 Meaning: GATE2011_56 top gateoverflow.in/2165

Which of the following options is the closest in the meaning to the word below:

Inexplicable

(A) Incomprehensible

(B) Indelible

(C) Inextricable

(D) Infallible

gate2011 verbal-ability meaning normal

9.40 Most Appropriate Alternative: GATE2012-CY-GA-5 top gateoverflow.in/40236

Q.60 Choose the most appropriate alternative from the options given below to complete the following
sentence:
If the tired soldier wanted to lie down, he ___ the mattress out on the balcony.
(A) should take
(B) shall take
(C) should have taken
(D) will have taken

gate2012-cy aptitude most-appropriate-alternative english-grammar verbal-ability

9.41 Most Appropriate Alternative: GATE-2012-AE-1 top gateoverflow.in/40212

Choose the most appropriate alternative from the options given below to complete the following
sentence:
I ___ to have bought a diamond ring.
(A) have a liking (B) should have liked

(C) would like (D) may like


gate2012-ae aptitude most-appropriate-alternative verbal-ability

9.42 Most Appropriate Alternative: GATE-2012-AE-2 top gateoverflow.in/40213

Choose the most appropriate alternative from the options given below to complete the following
sentence:
Food prices ___ again this month.
(A) have raised (B) have been raising

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 542 of 852

(C) have been rising (D) have arose


gate2012-ae aptitude verbal-ability most-appropriate-alternative

9.43 Most Appropriate Word: GATE2014-EC03-GA2 top gateoverflow.in/41141

The value of one U.S. dollar is 65 Indian Rupees today, compared to 60 last year. The Indian Rupee has _________.

A. Depressed
B. Depreciated
C. Appreciated
D. Stabilized

gate2014-ec03 most-appropriate-word

9.44 Most Appropriate Word: gate2013-ce-4 top gateoverflow.in/40271

Friendship, no matter how _________it is, has its limitations.

A. cordial
B. intimate
C. secret
D. pleasant

gate2013-ce most-appropriate-word

9.45 Most Appropriate Word: gate-2014-ae-2 top gateoverflow.in/40301

Q.2 Choose the most appropriate word from the options given below to complete the following
sentence.
One of his biggest ______ was his ability to forgive.
(A) vice (B) virtues (C) choices (D) strength

gate-2014-ae most-appropriate-word

9.46 Most Appropriate Word: GATE_2011_MN_57 top gateoverflow.in/31522

Q.57 Choose the most appropriate word(s) from the options given below to complete the following
sentence.
We lost confidence in him because he never __________ the grandiose promises he had made.
(A) delivered
(B) delivered on
(C) forgot
(D) reneged on

gate2011-mn verbal-ability most-appropriate-word

9.47 Most Appropriate Word: GATE2012-CY-GA-4 top gateoverflow.in/40235

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 543 of 852

Q.59 Choose the most appropriate word from the options given below to complete the following
sentence:
Given the seriousness of the situation that he had to face, his ___ was impressive.
(A) beggary (B) nomenclature (C) jealousy (D) nonchalance

gate2012-cy aptitude most-appropriate-word

9.48 Most Appropriate Word: GATE 2013-ee-3 top gateoverflow.in/40290

Complete the sentence:

Dare _______________ mistakes.

(A) commit (B) to commit (C) committed (D) committing


gate2013-ee most-appropriate-word easy

9.49 Most Appropriate Word: GATE2012-AR-2 top gateoverflow.in/40223

Choose the most appropriate pair of words from the options given below to complete the following sentence:

The high level of ___ of the questions in the test was ___ by an increase in the period of time allotted for answering them.

A. difficulty, compensated
B. exactitude, magnified
C. aptitude, decreased
D. attitude, mitigated

gate2012-ar aptitude most-appropriate-word verbal-ability normal

9.50 Most Appropriate Word: GATE-2012-AE-4 top gateoverflow.in/40215

Choose the most appropriate alternative from the options given below to complete the following
sentence:
To those of us who had always thought him timid, his ___ came as a surprise.

(A) intrepidity (B) inevitability (C) inability (D) inertness


gate2012-ae aptitude verbal-ability most-appropriate-word

9.51 Most Appropriate Word: GATE2011_59 top gateoverflow.in/2169

Choose the most appropriate word from the options given below to complete the following sentence.

If you are trying to make a strong impression on your audience, you cannot do so by being understated,
tentative or ________.

(A) hyperbolic

(B) restrained

(C) argumentative

(D) indifferent

gate2011 verbal-ability most-appropriate-word normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 544 of 852

9.52 Most Appropriate Word: GATE2010_56 top gateoverflow.in/2364

Choose the most appropriate word from the options given below to complete the following sentence:

His rather casual remarks on politics ________ his lack of seriousness about the subject.

(A) masked

(B) belied

(C) betrayed

(D) suppressed

gate2010 verbal-ability most-appropriate-word normal

9.53 Most Appropriate Word: GATE2010_58 top gateoverflow.in/2366

Choose the most appropriate word from the options given below to complete the following sentence:

If we manage to __________ our natural resources, we would leave a better planet for our children.

(A) uphold

(B) restrain

(C) cherish

(D) conserve

gate2010 verbal-ability most-appropriate-word easy

9.54 Most Appropriate Word: GATE2011_58 top gateoverflow.in/2167

Choose the most appropriate word(s) from the options given below to complete the following sentence.

I contemplated _________ Singapore for my vacation but decided against it.

(A) to visit

(B) having to visit

(C) visiting

(D) for a visit

gate2011 verbal-ability most-appropriate-word easy

9.55 Most Appropriate Word: GATE2014-2_GA_1 top gateoverflow.in/1938

Choose the most appropriate phrase from the options given below to complete the following sentence.

India is a post-colonial country because

(A) it was a former British colony

(B) Indian Information Technology professionals have colonized the world

(C) India does not follow any colonial practices

(D) India has helped other countries gain freedom

gate2014-2 verbal-ability most-appropriate-word easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 545 of 852

9.56 Most Appropriate Word: GATE2014-AG-GA2 top gateoverflow.in/41665

Choose the most appropriate word from the options given below to complete the following sentence. _______ is the key to
their happiness; they are satisfied with what they have.

A. Contentment
B. Ambition
C. Perseverance
D. Hunger

gate2014-ag verbal-ability most-appropriate-word easy

9.57 Most Appropriate Word: GATE2014-AG-GA1 top gateoverflow.in/41660

Choose the most appropriate word from the options given below to complete the following sentence. A person suffering from
Alzheimers disease ______ short-term memory loss.

A. Experienced
B. Has experienced
C. Is experiencing
D. Experiences

gate2014-ag verbal-ability most-appropriate-word normal

9.58 Most Appropriate Word: GATE2011_GG_GA_5 top gateoverflow.in/40206

Choose the most appropriate words from the options given below to complete the following
sentence.
Because she had a reputation for _________ we were surprised and pleased when she greeted
us so _______.
(A) insolence irately
(B) insouciance curtly
(C) graciousness amiably
(D) querulousness affably

gate2011_gg most-appropriate-word verbal-ability

9.59 Most Appropriate Word: GATE2012_60 top gateoverflow.in/2200

Choose the most appropriate alternative from the options given below to complete the following sentence:

Sureshs dog is the one was hurt in the stampede.

(A) that
(B) which
(C) who
(D) whom

gate2012 verbal-ability most-appropriate-word normal

9.60 Most Appropriate Word: GATE2014-EC01-GA3 top gateoverflow.in/41492

Choose the most appropriate word from the options given below to complete the following sentence.

Many ancient cultures attributed disease to supernatural causes. However, modern science has largely helped ________
such notions.

A. Impel

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 546 of 852

B. Dispel
C. Propel
D. Repel

gate2014-ec01 most-appropriate-word

9.61 Most Appropriate Word: GATE2014-EC01-GA1 top gateoverflow.in/41490

Choose the most appropriate phrase from the options given below to complete the following sentence.

The aircraft __________ take off as soon as its flight plan was filed.

A. Is allowed to
B. Will be allowed to
C. Was allowed to
D. Has been allowed to

gate2014-ec01 verbal-ability most-appropriate-word easy

9.62 Most Appropriate Word: GATE2014-1_GA_2 top gateoverflow.in/771

Choose the most appropriate word from the options given below to complete the following sentence.

He could not understand the judges awarding her the first prize, because he thought that her performance was quite
_________.

A. superb

B. medium

C. mediocre

D. exhilarating

gate2014-1 verbal-ability most-appropriate-word easy

9.63 Most Appropriate Word: GATE2014-EC02-GA3 top gateoverflow.in/41510

Choose the most appropriate pair of words from the options given below to complete the following sentence.

She could not ______ the thought of _______ the election to her bitter rival.

A. Bear, loosing
B. Bare, loosing
C. Bear, losing
D. Bare, losing

gate2014-ec02 most-appropriate-word

9.64 Most Appropriate Word: GATE2011_GG_GA_3 top gateoverflow.in/40204

"> Q.58 Choose the most appropriate word from the options given below to complete the following
sentence.
Despite the mixtures ______ nature, we found that by lowering its temperature in the
laboratory we could dramatically reduce its tendency to vaporize.
(A) acerbic
(B) resilient
(C) volatile
(D) heterogeneous

gate2011_gg verbal-ability most-appropriate-word

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 547 of 852

9.65 Number Series: GATE2013-ee-10 top gateoverflow.in/40297

Find the sum to 'n' terms of the series 10 + 84 + 734 +

9(9n +1)
A). 10
+1
9(9n 1)
B). 8
+1
9(9n 1)
C).
8
+n
9(9n 1)
D). 8
+ n2

gate2013-ee numerical-ability number-series

9.66 Odd One: GATE 2016-2-GA-03 top gateoverflow.in/39530

Find the odd one in the following group of words.

mock, deride, praise, jeer

A. Mock
B. Deride
C. Praise
D. Jeer

gate2016-2 verbal-ability odd-one easy

9.67 Odd One: GATE2014-EC02-GA6 top gateoverflow.in/41513

Find the odd one in the following group

Q,W,Z,B B,H,K,M W,C,G,J M,S,V,X

A. Q,W,Z,B
B. B,H,K,M
C. W,C,G,J
D. M,S,V,X

gate2014-ec02 verbal-ability verbal-reasoning odd-one normal

9.68 Opposite: GATE2014-3_GA_3 top gateoverflow.in/2026

Choose the word that is opposite in meaning to the word coherent.

(A) sticky

(B) well-connected

(C) rambling

(D) friendly

gate2014-3 verbal-ability opposite easy

9.69 Opposite: GATE2011_60 top gateoverflow.in/2170

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 548 of 852

Choose the word from the options given below that is most nearly opposite in the meaning to the given word

Amalgamate

(A) merge

(B) split

(C) collect

(D) separate

gate2011 verbal-ability opposite normal

9.70 Passage Reading: GATE2014-2_GA_6 top gateoverflow.in/1943

The old city of Koenigsberg, which had a German majority population before World War 2, is now called Kaliningrad. After the events of the war, Kaliningrad is
now a Russian territory and has a predominantly Russian population. It is bordered by the Baltic Sea on the north and the countries of Poland to the south and
west and Lithuania to the east respectively. Which of the statements below can be inferred from this passage?

(A) Kaliningrad was historically Russian in its ethnic make up

(B) Kaliningrad is a part of Russia despite it not being contiguous with the rest of Russia

(C) Koenigsberg was renamed Kaliningrad, as that was its original Russian name

(D) Poland and Lithuania are on the route from Kaliningrad to the rest of Russia

gate2014-2 verbal-ability passage-reading normal

9.71 Passage Reading: GATE2014-2_GA_7 top gateoverflow.in/1944

The number of people diagnosed with dengue fever (contracted from the bite of a mosquito) in north India is twice the
number diagnosed last year. Municipal authorities have concluded that measures to control the mosquito population have
failed in this region.

Which one of the following statements, if true, does not contradict this conclusion?

(A) A high proportion of the affected population has returned from neighbouring countries where dengue is prevalent

(B) More cases of dengue are now reported because of an increase in the Municipal Office's administrative efficiency

(C) Many more cases of dengue are being diagnosed this year since the introduction of a new and effective diagnostic test

(D) The number of people with malarial fever (also contracted from mosquito bites) has increased this year

gate2014-2 verbal-ability passage-reading normal

9.72 Passage Reading: GATE2012-AR-10 top gateoverflow.in/40231

The documents expose the cynicism of the government officials and yet as the media website
reflects, not a single newspaper has reported on their existence.
Which one of the following inferences may be drawn with the greatest accuracy from the above
passage?
(A) Nobody other than the government officials knew about the existence of the documents.
(B) Newspapers did report about the documents but nobody cared.
(C) Media reports did not show the existence of the documents.
(D) The documents reveal the attitude of the government officials.

gate2012-ar aptitude verbal-ability passage-reading

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 549 of 852

9.73 Passage Reading: GATE2014-1_GA_6 top gateoverflow.in/774

The Palghat Gap (or Palakkad Gap) , a region about 30 km wide in the southern part of the Western Ghats in India, is lower
than the hilly terrain to its north and south. The exact reasons for the formation of this gap are not clear. It results in the
neighbouring regions of Tamil Nadu getting more rainfall from the South West monsoon and the neighbouring regions of
Kerala having higher summer temperatures.

What can be inferred from this passage?

Select one:

A. The Palghat gap is caused by high rainfall and high temperatures in southern Tamil Nadu and Kerala

B. The regions in Tamil Nadu and Kerala that are near the Palghat Gap are low-lying

C. The low terrain of the Palghat Gap has a significant impact on weather patterns in neighbouring parts of Tamil Nadu and
Kerala

D. Higher summer temperatures result in higher rainfall near the Palghat Gap area

gate2014-1 verbal-ability passage-reading normal

9.74 Passage Reading: GATE2013_63 top gateoverflow.in/1567

After several defeats in wars, Robert Bruce went in exile and wanted to commit suicide. Just before committing suicide, he
came across a spider attempting tirelessly to have its net. Time and again, the spider failed but that did not deter it to
refrain from making attempts. Such attempts by the spider made Bruce curious. Thus, Bruce started observing the near-
impossible goal of the spider to have the net. Ultimately, the spider succeeded in having its net despite several failures. Such
act of the spider encouraged Bruce not to commit suicide. And then, Bruce went back again and won many a battle, and the
rest is history.

Which one of the following assertions is best supported by the above information?

(A) Failure is the pillar of success.


(B) Honesty is the best policy.
(C) Life begins and ends with adventures.
(D) No adversity justifies giving up hope.

gate2013 verbal-ability passage-reading normal

9.75 Passage Reading: GATE2014-3_GA_7 top gateoverflow.in/2031

By the beginning of the 20th century, several hypotheses were being proposed, suggesting a paradigm shift in our
understanding of the universe. However, the clinching evidence was provided by experimental measurements of the position
of a star which was directly behind our sun.

Which of the following inference(s) may be drawn from the above passage?

i. Our understanding of the universe changes based on the positions of stars


ii. Paradigm shifts usually occur at the beginning of centuries
iii. Stars are important objects in the universe
iv. Experimental evidence was important in confirming this paradigm shift

(A) (i), (ii) and (iv)

(B) (iii) only

(C) (i) and (iv)

(D) (iv) only

gate2014-3 verbal-ability passage-reading easy

9.76 Passage Reading: GATE2012-CY-GA-6 top gateoverflow.in/40237

Q.61 One of the legacies of the Roman legions was discipline. In the legions, military law prevailed

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 550 of 852

and discipline was brutal. Discipline on the battlefield kept units obedient, intact and fighting,
even when the odds and conditions were against them.
Which one of the following statements best sums up the meaning of the above passage?
(A) Thorough regimentation was the main reason for the efficiency of the Roman legions even in
adverse circumstances.
(B) The legions were treated inhumanly as if the men were animals.
(C) Discipline was the armies inheritance from their seniors.
(D) The harsh discipline to which the legions were subjected to led to the odds and conditions being
against them.

gate2012-cy aptitude verbal-ability passage-reading

9.77 Passage Reading: GATE2011_61 top gateoverflow.in/2171

Few school curricula include a unit on how to deal with bereavement and grief, and yet all students at some
point in their lives suffer from losses through death and parting.

Based on the above passage which topic would not be included in a unit on bereavement?

(A) how to write a letter of condolence

(B) what emotional stages are passed through in the healing process

(C) what the leading causes of death are

(D) how to give support to a grieving friend

gate2011 verbal-ability passage-reading normal

9.78 Passage Reading: GATE2011_GG_GA_10 top gateoverflow.in/40211

In order to develop to full potential, a baby needs to be physically able to respond to the
environment.
It can be inferred from the passage that
(A) Full physical potential is needed in order for a baby to be able to respond to the environment.
(B) It is necessary for a baby to be able to physically respond to the environment for it to develop
its full potential.
(C) Response to the environment of physically able babies needs to be developed to its full
potential.

(D) A physically able baby needs to develop its full potential in order to respond to its environment.

gate2011-gg aptitude logical-reasoning passage-reading

9.79 Passage Reading: GATE-2012-AE-10 top gateoverflow.in/40221

In the early nineteenth century, theories of social evolution were inspired less by Biology than
by the conviction of social scientists that there was a growing improvement in social
institutions. Progress was taken for granted and social scientists attempted to discover its
laws and phases.
Which one of the following inferences may be drawn with the greatest accuracy from the above
passage?
Social scientists
(A) did not question that progress was a fact.
(B) did not approve of Biology.
(C) framed the laws of progress.
(D) emphasized Biology over Social Sciences.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 551 of 852

gate2012-ae verbal-ability passage-reading

9.80 Passage Reading: GATE 2013-ee-7 top gateoverflow.in/40294

Statement: There were different streams of freedom movements in colonial India carried out by the moderates, liberals,
radicals, socialists, and so on.

Which one of the following is the best inference from the above statement?
(A) The emergence of nationalism in colonial India led to our Independence.
(B) Nationalism in India emerged in the context of colonialism.
(C) Nationalism in India is homogeneous.
(D) Nationalism in India is heterogeneous

gate2013-ee passage-reading

9.81 Passage Reading: GATE2014-ae-3 top gateoverflow.in/40302

Rajan was not happy that Sajan decided to do the project on his own. On observing his unhappiness, Sajan explained to
Rajan that he preferred to work independently.

Which one of the statements below is logically valid and can be inferred from the above sentences?

A). Rajan has decided to work only in a group.

B). Rajan and Sajan were formed into a group against their wishes.

C). Sajan had decided to give in to Rajan's request to work with him.

D). Rajan had believed that Sajan and he would be working together.

gate-2014-ae passage-reading logical-reasoning

9.82 Passage Reading: GATE2014-3_GA_6 top gateoverflow.in/2029

A dance programme is scheduled for 10.00 a.m. Some students are participating in the programme and they need to come an hour earlier than the start of the
event. These students should be accompanied by a parent. Other students and parents should come in time for the programme. The instruction you think that is
appropriate for this is

(A) Students should come at 9.00 a.m. and parents should come at 10.00 a.m.

(B) Participating students should come at 9.00 a.m. accompanied by a parent, and other parents and students should come by 10.00 a.m.

(C) Students who are not participating should come by 10.00 a.m. and they should not bring their parents. Participating students should come at 9.00 a.m.

(D) Participating students should come before 9.00 a.m. Parents who accompany them should come at 9.00 a.m. All others should come at 10.00 a.m.

gate2014-3 verbal-ability passage-reading easy

9.83 Passage Reading: GATE2010_63 top gateoverflow.in/2371

Modern warfare has changed from large scale clashes of armies to suppression of civilian populations. Chemical
agents that do their work silently appear to be suited to such warfare; and regretfully, there exist people in
military establishments who think that chemical agents are useful tools for their cause.

Which of the following statements best sums up the meaning of the above passage:

(A) Modern warfare has resulted in civil strife.

(B) Chemical agents are useful in modern warfare.

(C) Use of chemical agents in warfare would be undesirable.

(D) People in military establishments like to use chemical agents in war.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 552 of 852

gate2010 verbal-ability passage-reading normal

9.84 Tense: GATE2013_59 top gateoverflow.in/1563

Were you a bird, you ___________________ in the sky.

(A) would fly (B) shall fly (C) should fly (D) shall have flown

gate2013 verbal-ability tense normal

9.85 Tense: GATE2014-2_GA_2 top gateoverflow.in/1939

Who ___________ was coming to see us this evening?

(A) you said

(B) did you say

(C) did you say that

(D) had you said

gate2014-2 verbal-ability tense normal

9.86 Verbal Reasoning: GATE2016-1-GA07 top gateoverflow.in/39613

Indian currency notes show the denomination indicated in at least seventeen languages. If this is not an indication of the
nation's diversity, nothing else is.

Which of the following can be logically inferred from the above sentences?

A. India is a country of exactly seventeen languages.


B. Linguistic pluralism is the only indicator of a nation's diversity.
C. Indian currency notes have sufficient space for all the Indian languages.
D. Linguistic pluralism is strong evidence of India's diversity.

gate2016-1 verbal-ability verbal-reasoning normal

9.87 Verbal Reasoning: GATE2014-EC03-GA1 top gateoverflow.in/41140

"India is a country of rich heritage and cultural diversity." Which one of the following facts best supports the claim made in
the above sentence?

A. India is a union of 28 states and 7 union territories.


B. India has a population of over 1.1 billion.
C. India is home to 22 official languages and thousands of dialects.
D. The Indian cricket team draws players from over ten states.

gate2014-ec03 verbal-reasoning

9.88 Verbal Reasoning: GATE2014-EC02-GA1 top gateoverflow.in/41507

Choose the most appropriate word from the options given below to complete the following sentence.

Communication and interpersonal skills are ________ important in their own ways.

A. Each
B. Both
C. All
D. Either

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 553 of 852

gate2014-ec02 verbal-ability verbal-reasoning most-appropriate-word normal

9.89 Verbal Reasoning: GATE2014-EC04-GA7 top gateoverflow.in/41469

If 'KCLFTSB' stands for best of luck and 'SHSWDG' stands for 'good wishes', which of the following indicates 'ace the
exam'?

A. MCHTX
B. MXHTC
C. XMHCT
D. XMHTC

gate2014-ec04 verbal-ability verbal-reasoning normal

9.90 Verbal Reasoning: GATE2014-EC01-GA2 top gateoverflow.in/41491

Read the statements:

All women are entrepreneurs.

Some women are doctors.

Which of the following conclusions can be logically inferred from the above statements?

A. All women are doctors


B. All doctors are entrepreneurs
C. All entrepreneurs are women
D. Some entrepreneurs are doctors

gate2014-ec01 verbal-ability mathematical-logic verbal-reasoning easy

9.91 Verbal Reasoning: GATE2014-EC01-GA6 top gateoverflow.in/41495

Find the odd one from the following group:

W,E,K,O I,Q,W,A F,N,T,X N,V,B,D

A. W,E,K,O
B. I,Q,W,A
C. F,N,T,X
D. N,V,B,D

gate2014-ec01 verbal-ability verbal-reasoning normal

9.92 Verbal Reasoning: GATE2014-AG-GA3 top gateoverflow.in/41667

Which of the following options is the closest in meaning to the sentence below?

As a woman, I have no country.

A. Women have no country.


B. Women are not citizens of any country.
C. Womens solidarity knows no national boundaries.
D. Women of all countries have equal legal rights.

gate2014-ag verbal-ability verbal-reasoning normal

9.93 Verbal Reasoning: GATE2014-AG-GA7 top gateoverflow.in/41671

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 554 of 852

Moving into a world of big data will require us to change our thinking about the merits of exactitude. To apply the
conventional mindset of measurement to the digital, connected world of the twenty-first century is to miss a crucial point. As
mentioned earlier, the obsession with exactness is an artefact of the information-deprived analog era. When data was
sparse, every data point was critical, and thus great care was taken to avoid letting any point bias the analysis. From BIG
DATA Viktor Mayer-Schonberger and Kenneth Cukier. The main point of the paragraph is:

A. The twenty-first century is a digital world


B. Big data is obsessed with exactness
C. Exactitude is not critical in dealing with big data
D. Sparse data leads to a bias in the analysis

gate2014-ag verbal-ability verbal-reasoning passage-reading normal

9.94 Word Pairs: GATE-2013-AE-GA-5 top gateoverflow.in/40246

Q.60 Select the pair that best expresses a relationship similar to that expressed in the pair:
water: pipe::
(A) cart: road (B) electricity: wire
(C) sea: beach (D) music: instrument

gate2013-ae verbal-ability word-pairs

9.95 Word Pairs: gate2013-ce-5 top gateoverflow.in/40272

Q.60 Select the pair that best expresses a relationship similar to that expressed in the pair:
Medicine: Health
(A) Science: Experiment (B) Wealth: Peace
(C) Education: Knowledge (D) Money: Happiness

gate2013-ce word-pairs

9.96 Word Pairs: GATE2010_60 top gateoverflow.in/2368

The question below consists of a pair of related words followed by four pairs of words. Select the pair that best expresses the
relation in the original pair.

Unemployed : Worker

(A) fallow : land

(B) unaware : sleeper

(C) wit : jester

(D) renovated : house

gate2010 verbal-ability word-pairs normal

9.97 GATE2014-EC03-GA3 top gateoverflow.in/41142

'Advice' is _________.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 555 of 852

A. A verb
B. A noun
C. An adjective
D. Both a verb and a noun

gate2014-ec03 verbal-ability

9.98 gate2013-ce-9 top gateoverflow.in/40278

Q.64 A firm is selling its product at Rs. 60 per unit. The total cost of production is Rs. 100 and firm is
earning total profit of Rs. 500. Later, the total cost increased by 30%. By what percentage the price
should be increased to maintained the same profit level.
(A) 5 (B) 10 (C) 15 (D) 30

numerical-ability gate2013-ce

9.99 GATE2011_GG_GA_2 top gateoverflow.in/40203

Q.57 Choose the word from the options given below that is most nearly opposite in meaning to the given
word:
Polemical
(A) imitative
(B) conciliatory
(C) truthful
(D) ideological

gate2011_gg verbal-ability

9.100 GATE2012-AR-1 top gateoverflow.in/40222

Which one of the following options is the closest in meaning to the word given below?
Pacify

(A) Excite (B) Soothe (C) Deplete (D) Tire


gate2012-ar aptitude verbal-ability

9.101 GATE2012-CY-GA-3 top gateoverflow.in/40234

Q.58 Which one of the following options is the closest in meaning to the word given below?
Latitude
(A) Eligibility (B) Freedom (C) Coercion (D) Meticulousness

gate2012-cy aptitude verbal-ability

9.102 GATE 2015 Aptitude Set 3 Q10 top gateoverflow.in/39523

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 556 of 852

Q.10 Ms. X will be in Bagdogra from 01/05/2014 to 20/05/2014 and from 22/05/2014 to 31/05/2014. On
the morning of 21/05/2014, she will reach Kochi via Mumbai.
Which one of the statements below is logically valid and can be inferred from the above sentences?
(A) Ms. X will be in Kochi for one day, only in May.
(B) Ms. X will be in Kochi for only one day in May.
(C) Ms. X will be only in Kochi for one day in May.
(D) Only Ms. X will be in Kochi for one day in May.

gate2015aptiset3 gate2015 aptitude

9.103 GATE IN 2011-58 top gateoverflow.in/31273

58. Choose the most appropriate word from the options given below to complete-the following sentence: Under ethical guidelines recently
adopted by the Indian Medical Association, human genes are to be manipulated only to correct diseases for which______________treatments
are unsatisfactory. (A) similar (B) most (C) uncommon (D) available

gate-in-2011 verbal-ability

9.104 GATE IN 2011-59 top gateoverflow.in/31276

59. Choose the word from the options given below that is most nearly opposite in meaning to the given word:

Frequency

(A) periodicity (B) rarity (C) gradualness (D) persistency

gate-in-2011 verbal-ability

9.105 GATE IN 2011-57 top gateoverflow.in/31270

57. The question below consists of a pair of related words followed by four pairs of
words. Select the pair that best expresses the relation in the original pair:
Gladiator: Arena
(A) dancer: stage (B) commuter: train
(C) teacher: classroom (D) lawyer: courtroom

gate-in-2011 verbal-ability

9.106 GATE2015-3_GA_9 top gateoverflow.in/8388

Most experts feel that in spite of possessing all the technical skills required to be a batsman of the highest order, he is
unlikely to be so due to lack of requisite temperament. He was guilty of throwing away his wicket several time after working
hard to lay a strong foundation. His critics pointed out that until he addressed his problem, success at the highest level will
continue to elude him.

Which of the statement(s) below is/are logically valid and can be inferred from the above passage?

i. He was already a successful batsman at the highest level.


ii. He was to improve his temperament in order to become a great batsman.
iii. He failed to make many of his good starts count.
iv. Improving his technical skills will guarantee success.

A. iii and iv
B. ii and iii
C. i, ii and iii
D. ii only

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 557 of 852

gate2015-3 verbal-ability normal

9.107 GATE2015-3_GA_6 top gateoverflow.in/8306

Alexander turned his attention towards India, since he had conquered Persia.

Which one of the statements below is logically valid and can be inferred from the above sentence?

A. Alexander would not have turned his attention towards India had he not conquered Persia.
B. Alexander was not ready to rest on his laurels, and wanted to march to India.
C. Alexander was not completely in control of his army and could command it to move towards India.
D. Since Alexander's kingdom extended to Indian borders after the conquest of Persia, he was keen to move further.

gate2015-3 verbal-ability normal

9.108 GATE2015-3_GA_7 top gateoverflow.in/8308

The head of newly formed government desires to appoint five of the six selected members P, Q, R, S, T and U to portfolios
of Home, Power, Defense, Telecom, and Finance. U does not want any portfolio if S gets one of the five. R wants either Home
or Finance or no portfolio. Q says that if S gets Power or Telecom, then she must get the other one. T insists on a portfolio if
P gets one.

Which is the valid distribution of portfolios?

A. P-Home, Q-Power, R-Defense, S-Telecom, T-Finance


B. R-Home, S-Power, P-Defense, Q-Telecom, T-Finance
C. P-Home, Q-Power, T-Defense, S-Telecom, U-Finance
D. Q-Home, U-Power, T-Defense, R-Telecom, P-Finance

gate2015-3 verbal-ability normal

9.109 GATE IN 2011-60 top gateoverflow.in/31278

60. Choose the most appropriate word from the options given below to complete the
following sentence:
It was her view that the country's problems had been __________ by
foreign technocrats, so that to invite them to come back would be
counter-productive
(A) identified (B) ascertained (C) exacerbated (D) analyzed

gate-in-2011 verbal-ability

9.110 GATE IN 2011-62 top gateoverflow.in/31280

62. The horse has played a little known but very important role in the field of
medicine. Horses were injected with toxins of diseases until their blood built up
immunities. Then a serum was made from their blood. Serums to fight with
diphtheria and tetanus were developed this way.
It can be inferred from the passage, that horses were
(A) given immunity to diseases
(B) generally quite immune to diseases
(C) given medicines to fight toxins
(D) given diphtheria and tetanus serums

gate-in-2011 verbal-ability

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 558 of 852

9.111 GATE 2012 CY Q 57 top gateoverflow.in/32298

Q.60 Choose the most appropriate alternative from the options given below to complete the following
sentence:
If the tired soldier wanted to lie down, he ___ the mattress out on the balcony.
(A) should take
(B) shall take
(C) should have taken
(D) will have taken

gate-cy-2012 verbal-ability

9.112 GATE 2014 Agriculture top gateoverflow.in/36964

X is 1 km northeast of Y. Y is 1 km southeast of Z. W is 1 km west of Z. P is 1 km south of W. Q is 1 km east of P. What is


the distance between X and Q in km?
(A) 1
(B) 2
(C) 3
(D) 2

Ans-C

9.113 GATE_2011_MN_60 top gateoverflow.in/31533

Q.60

Choose the most appropriate word from the options given below to complete the following sentence. The _________ of
eviden ce was on the side of the plaintiff since all but one witness testified that his story was correct.

(A) paucity

(B) propensity

(C) preponderance

(D) accuracy

verbal-ability gate2011-mn

9.114 GATE_MN_2011_58 top gateoverflow.in/31529

Q.58 Choose the word or phrase that best completes the sentence below.
______________ in the frozen wastes of Arctic takes special equipment.
(A) To survive
(B) Surviving
(C) Survival
(D) That survival

verbal-ability gate2011-mn

9.115 GATE_MN_2011_01 top gateoverflow.in/31519

Q.56 Choose the word from the options given below that is most nearly opposite in meaning to the given
word:
Deference
(A) aversion

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 559 of 852

(B) resignation
(C) suspicion
(D) contempt

verbal-ability gate2011-mn

9.116 GATE2015-3_GA_4 top gateoverflow.in/8302

Select the pair of best expresses a relationship similar to that expressed in the pair:

Children : Pediatrician

A. Adult : Orthopaedist
B. Females : Gynaecologist
C. Kidney : Nephrologist
D. Skin : Dermatologist

gate2015-3 verbal-ability easy

9.117 GATE2015-3_GA_3 top gateoverflow.in/8301

Extreme focus on syllabus and studying for tests has become such a dominant concern of Indian student that they close their
minds to anything ___________ to the requirements of the exam.

A. related
B. extraneous
C. outside
D. useful

gate2015-3 verbal-ability normal

9.118 GATE2012_57 top gateoverflow.in/2195

Choose the most appropriate alternative from the options given below to complete the following sentence:

Despite several the mission succeeded in its attempt to resolve the conflict.

(A) attempts
(B) setbacks
(C) meetings
(D) delegations

gate2012 verbal-ability easy

9.119 GATE2015-1_GA_1 top gateoverflow.in/7995

Didn't you buy ____ when you went shopping?

A. any paper
B. much paper
C. no paper
D. a few paper

gate2015-1 verbal-ability easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 560 of 852

9.120 GATE2014-3_GA_2 top gateoverflow.in/2025

If she _______________ how to calibrate the instrument, she _______________ done the experiment.

(A) knows, will have

(B) knew, had

(C) had known, could have

(D) should have known, would have

gate2014-3 verbal-ability easy

9.121 GATE2014-3_GA_1 top gateoverflow.in/2024

While trying to collect an envelope from under the table , Mr. X fell down and

I II III

was losing consciousness.

IV

Which one of the above underlined parts of the sentence is NOT appropriate?

(A) I

(B) II

(C) III

(D) IV

gate2014-3 verbal-ability easy

9.122 GATE2014-1_GA_3 top gateoverflow.in/772

In a press meet on the recent scam, the minister said, "The buck stops here". What did the minister convey by the
statement?

A. He wants all the money

B. He will return the money

C. He will assume final responsibility

D. He will resist all enquiries

gate2014-1 verbal-ability normal

9.123 GATE2013_57 top gateoverflow.in/1560

Complete the sentence:

Universalism is to particularism as diffuseness is to _______________.

(A) specificity (B) neutrality (C) generality (D) adaptation

gate2013 verbal-ability normal

9.124 GATE2015-1_GA_2 top gateoverflow.in/8003

Which of the following options is the closest in meaning of the sentence below?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 561 of 852

She enjoyed herself immensely at the party.

A. She had a terrible time at the party


B. She had a horrible time at the party
C. She had a terrific time at the party
D. She had a terrifying time at the party

gate2015-1 verbal-ability easy

9.125 GATE2015-1_GA_5 top gateoverflow.in/8008

Which one of the following combinations is incorrect?

A. Acquiescence - Submission
B. Wheedle - Roundabout
C. Flippancy - Lightness
D. Profligate - Extravagant

gate2015-1 verbal-ability difficult

9.126 GATE2015-2_GA_10 top gateoverflow.in/8041

Out of the following 4 sentences, select the most suitable sentence with respect to grammar and usage:

A. Since the report lacked needed information, it was of no use to them.


B. The report was useless to them because there were no needed information in it.
C. Since the report did not contain the needed information, it was not real useful to them.
D. Since the report lacked needed information, it would not had been useful to them.

gate2015-2 verbal-ability normal

9.127 GATE2015-3_GA_2 top gateoverflow.in/8300

The Tamil version of __________ John Abraham-starrer Madras Cafe __________ cleared by the Censor Board with no cuts
last week, but the film's distributor _______ no takers among the exhibitors for a release in Tamilnadu _______ this Friday.

A. Mr., was, found, on


B. a, was, found, at
C. the, was, found, on
D. a, being, find at

gate2015-3 verbal-ability normal

9.128 GATE2015-2_GA_4 top gateoverflow.in/8032

A generic term that includes various items of clothing such as a skirt, a pair of trousers and a shirt is

A. fabric
B. textile
C. fibre
D. apparel

gate2015-2 verbal-ability easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 562 of 852

9.129 GATE2015-2_GA_1 top gateoverflow.in/8028

We __________ our friends's birthday and we _________ how to make it up to him.

A. completely forgot --- don't just know


B. forgot completely --- don't just know
C. completely forgot --- just don't know
D. forgot completely --- just don't know

gate2015-2 verbal-ability easy

9.130 GATE2015-1_GA_8 top gateoverflow.in/8012

The given statement is followed by some courses of action. Assuming the statement to be true, decide the correct option.

Statement:

There has been a significant drop in the water level in the lakes supplying water to the city.

Course of action:

I. The water supply authority should impose a partial cut in supply to tackle the situation.
II. The government should appeal to all the residents through mass media for minimal use of water.
III. The government should ban the water supply in lower areas.

A. Statements I and II follow.


B. Statements I and III follow.
C. Statements II and III follow.
D. All the statements follow.

gate2015-1 verbal-ability normal

9.131 GATE 2015 Set 2 top gateoverflow.in/38935

Q.1 Choose the appropriate word/phrase, out of the four options given below, to complete the following
sentence:
Dhoni, as well as the other team members of Indian team, ____________present on the occasion.
(A) were (B) was (C) has (D) have

aptitude verbal-ability

9.132 GATE 2015 Aptitude Set 4 top gateoverflow.in/39191

aptitude verbal-ability

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 563 of 852

9.133 GATE 2015 Aptitude Set 4 Q2 top gateoverflow.in/40167

Q.2 Fill in the blank with the correct idiom/phrase.


That boy from the town was a ____________ in the sleepy village.
(A) dog out of herd (B) sheep from the heap
(C) fish out of water (D) bird from the flock

gate2015aptiset4 aptitude verbal-ability

9.134 GATE 2015 Aptitude Set 4 Q3 top gateoverflow.in/40168

Q.3 Choose the statement where underlined word is used correctly.


(A) When the teacher eludes to different authors, he is being elusive.
(B) When the thief keeps eluding the police, he is being elusive.
(C) Matters that are difficult to understand, identify or remember are allusive.
(D) Mirages can be allusive, but a better way to express them is illusory.

gate2015aptiset4 aptitude verbal-ability

9.135 GATE 2015 Aptitude Set 4 Q1 top gateoverflow.in/40166

Q.1 Choose the appropriate word/phrase, out of the four options given below, to complete the following
sentence:
Apparent lifelessness ____________________ dormant life.
(A) harbours (B) leads to (C) supports (D) affects

gate2015aptiset4 aptitude verbal-ability

9.136 GATE2016-1-GA03 top gateoverflow.in/39606

Archimedes said, "Give me a lever long enough and a fulcrum on which to place it, and I will move the world."

The sentence above is an example of a ____________ statement.

A. figurative
B. collateral
C. literal
D. figurine

gate2016-1 verbal-ability normal

9.137 GATE 2015 Aptitude Set 3 Q3 top gateoverflow.in/39516

Q.3 Choose the correct verb to fill in the blank below:


Let us ___________.
(A) introvert (B) alternate (C) atheist (D) altruist

gate2015aptiset3 gate2015 aptitude

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 564 of 852

9.138 GATE 2015 Aptitude Set 3 Q6 top gateoverflow.in/39519

Q.6 Ram and Shyam shared a secret and promised to each other that it would remain between them.
Ram expressed himself in one of the following ways as given in the choices below. Identify the
correct way as per standard English.
(A) It would remain between you and me.
(B) It would remain between I and you.
(C) It would remain between you and I.
(D) It would remain with me.

gate2015aptiset3 gate2015 aptitude

9.139 GATE 2015 Aptitude Set 4 Q6 top gateoverflow.in/40171

Q.6 Select the appropriate option in place of underlined part of the sentence.
Increased productivity necessary reflects greater efforts made by the employees.
(A) Increase in productivity necessary
(B) Increase productivity is necessary
(C) Increase in productivity necessarily
(D) No improvement required

gate2015aptiset4 aptitude verbal-ability

9.140 GATE 2015 Aptitude Set 4 Q8 top gateoverflow.in/40175

Q.8 In the given figure angle Q is a right angle, PS:QS = 3:1, RT:QT = 5:2 and PU:UR = 1:1. If area of
triangle QTS is 20 cm 2, then the area of triangle PQR in cm 2is ______

gate2015aptiset4 aptitude

9.141 Gate 2015 Aptitude Set 8 Q6 top gateoverflow.in/40181

The word similar in meaning to dreary is


(A) cheerful
(B) dreamy
(C) hard
(D) dismal

gate2015aptiset8 verbal-ability

9.142 Gate 2015 Aptitude Set 8 Q9 top gateoverflow.in/40185

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 565 of 852

Q.9). Read the following table giving sales data of five types of batteries for years 2006 to 2012:

Year Type I Type II Type III Type IV Type V


2006 75 144 114 102 108
2007 90 126 102 84 126
2008 96 114 75 105 135
2009 105 90 150 90 75
2010 90 75 135 75 90
2011 105 60 165 45 120
2012 115 85 160 100 145

Out of the following , which type of battery achieved highest growth between the years 2006 and 2012?
A). Type V

B). Type III

C). Type II

D), Type I

gate2015aptiset8 aptitude

9.143 Gate 2015 Aptitude Set 8 Q top gateoverflow.in/40178

Q.3 Which word is not a synonym for the word vernacular?


(A) regional (B) indigenous (C) indigent (D) colloquial

gate2015aptiset8 aptitude verbal-ability

9.144 Gate 2015 Aptitude Set 8 Q2 top gateoverflow.in/40177

Choose the statement where underlined word is used correctly.

A. The minister insured the victims that everything would be all right.
B. He ensured that the company will not have to bear any loss.
C. The actor got himself ensured against any accident.
D. The teacher insured students of good results.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 566 of 852

gate2015aptiset8 aptitude verbal-ability

9.145 Gate 2015 Aptitude Set 8 Q1 top gateoverflow.in/40176

Q.1 Choose the most appropriate word from the options given below to complete the following
sentence.
The official answered ____________ that the complaints of the citizen would be looked into.
(A) respectably (B) respectfully (C) reputably (D) respectively

gate2015aptiset8 aptitude verbal-ability

9.146 GATE 2015 Apti Set 2 Q 2 top gateoverflow.in/39515

Q.2 Choose the most suitable one word substitute for the following expression:
Connotation of a road or way
(A) Pertinacious (B) Viaticum (C) Clandestine (D) Ravenous

gate2015aptiset3 gate2015 aptitude

9.147 GATE 2015 Aptitude Set 3 Q1 top gateoverflow.in/39514

Q.1 Choose the most appropriate word from the options given below to complete the following
sentence.
If the athlete had wanted to come first in the race, he _______________ several hours every day.
(A) should practise (B) should have practised
(C) practised (D) should be practising

gate2015aptiset3 gate2015 aptitude

9.148 GATE 2015 Aptitude Set 1 Q6 top gateoverflow.in/39494

Q.6 The following question presents a sentence, part of which is underlined. Beneath the sentence you
find four ways of phrasing the underlined part. Following the requirements of the standard written
English, select the answer that produces the most effective sentence.
Tuberculosis, together with its effects, ranks one of the leading causes of death in India.
(A) ranks as one ofthe leading causes of death
(B) rank as one of the leading causes of death
(C) has the rank of one of the leading causes of death
(D) are one of the leading causes of death

gate2015 gate2015aptiset1 aptitude

9.149 GATE 2015 Aptitude Set 1 Q7 top gateoverflow.in/39495

Q.7 Read the following paragraph and choose the correct statement.
Climate change has reduced human security and threatened human well being. An ignored reality
of human progress is that human security largely depends upon environmental security. But on the
contrary, human progress seems contradictory to environmental security. To keep up both at the
required level is a challenge to be addressed by one and all. One of the ways to curb the climate
change may be suitable scientific innovations, while the other may be the Gandhian perspective on
small scale progress with focus on sustainability.
(A) Human progress and security are positively associated with environmental security.
(B) Human progress is contradictory to environmental security.
(C) Human security is contradictory to environmental security.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 567 of 852

(D) Human progress depends upon environmental security


gate2015 gate2015aptiset1 aptitude

9.150 GATE 2015 Aptitude Set 1 Q3 top gateoverflow.in/39491

Q.3 Choose the word most similar in meaning to the given word:
Educe
(A) Exert (B) Educate (C) Extract (D) Extend

gate2015 gate2015aptiset1 aptitude

9.151 GATE 2015 Aptitude Set 1 Q2 top gateoverflow.in/39490

Q.2 Choose the appropriate word/phrase, out of the four options given below, to complete the following
sentence:
Frogs ____________________.
(A) croak (B) roar (C) hiss (D) patter

gate2015 gate2015aptiset1 aptitude

9.152 GATE 2015 Aptitude Set 1 Q1 top gateoverflow.in/39489

Q.1 Choose the most appropriate word from the options given below to complete the following
sentence.
The principal presented the chief guest with a _________________, as token of appreciation.
(A) momento (B) memento (C) momentum (D) moment

gate2015 gate2015aptiset1 aptitude

9.153 GATE 2015 Aptitude Set 1 Q10 top gateoverflow.in/39497

Q.10 Humpty Dumpty sits on a wall every day while having lunch. The wall sometimes breaks. A person
sitting on the wall falls if the wall breaks.
Which one of the statements below is logically valid and can be inferred from the above sentences?
(A) Humpty Dumpty always falls while having lunch
(B) Humpty Dumpty does not fall sometimes while having lunch
(C) Humpty Dumpty never falls during dinner
(D) When Humpty Dumpty does not sit on the wall, the wall does not break

gate2015 gate2015aptiset1 aptitude

9.154 GATE 2015 Aptitude Set 2 Q 1 top gateoverflow.in/39502

Q.1 Choose the appropriate word/phrase, out of the four options given below, to complete the following
sentence:
Dhoni, as well as the other team members of Indian team, ____________present on the occasion.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 568 of 852

(A) were (B) was (C) has (D) have

gate2015 gate2015aptiset2 aptitude

9.155 GATE 2015 Aptitude Set 2 Q 7 top gateoverflow.in/39508

Q.7 Given below are two statements followed by two conclusions. Assuming these statements to be
true, decide which one logically follows.
Statements:
I. All film stars are playback singers.
II. All film directors are film stars.
Conclusions:
I. All film directors are playback singers.
II. Some film stars are film directors.
(A) Only conclusion I follows.
(B) Only conclusion II follows.
(C) Neither conclusion I nor II follows.
(D) Both conclusions I and II follow.

gate2015 gate2015aptiset2 aptitude

9.156 GATE 2015 Aptitude Set 2 Q10 top gateoverflow.in/39511

Q.10 Lamenting the gradual sidelining of the arts in school curricula, a group of prominent artists wrote
to the Chief Minister last year, asking him to allocate more funds to support arts education in
schools. However, no such increase has been announced in this years Budget. The artists expressed
their deep anguish at their request not being approved, but many of them remain optimistic about
funding in the future.
Which of the statement(s) below is/are logically valid and can be inferred from the above
statements?
(i) The artists expected funding for the arts to increase this year.
(ii) The Chief Minister was receptive to the idea of increasing funding for the arts.
(iii) The Chief Minister is a prominent artist.
(iv) Schools are giving less importance to arts education nowadays.
(A) (iii) and (iv) (B) (i) and (iv) (C) (i), (ii) and (iv) (D) (i) and (iii)

gate2015 gate2015aptiset2 aptitude

9.157 GATE 2015 Aptitude Set 2 Q 6 top gateoverflow.in/39507

Q.6 In the following sentence certain parts are underlined and marked P, Q, and R. One of the parts may
contain certain error or may not be acceptable in standard written communication. Select the part
containing an error. Choose D as your answer if there is no error.
The student corrected all the errors that the instructor marked on the answer book.
P Q R
(A) P (B) Q (C) R (D) No Error

gate2015 gate2015aptiset2 aptitude

9.158 GATE 2015 Aptitude Set 2 Q 3 top gateoverflow.in/39504

Q.3 What is the adverb for the given word below?


Misogynous
(A) Misogynousness (B) Misogynity (C) Misogynously (D) Misogynous

gate2015 gate2015aptiset2 aptitude

9.159 GATE 2015 Aptitude Set 2 Q 2 top gateoverflow.in/39503

Q.2 Choose the word most similar in meaning to the given word:
Awkward
(A) Inept (B) Graceful (C) Suitable (D) Dreadful

gate2015 gate2015aptiset2 aptitude

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 569 of 852

9.160 GATE2011_GG_GA_1 top gateoverflow.in/40202

Q.56 Choose the most appropriate word or phrase from the options given below to complete the
following sentence.
The environmentalists hope ________ the lake to its pristine condition.
(A) in restoring
(B) in the restoration of
(C) to restore
(D) restoring

gate2011_gg verbal-ability

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 570 of 852

10 Numerical Ability top


10.1 Bar Charts: GATE2014-EC01-GA9 top gateoverflow.in/41498

The exports and imports (in crores of Rs.) of a country from 2000 to 2007 are given in the following bar chart. If the trade
deficit is defined as excess of imports over exports, in which year is the trade deficit 1/5th of the exports?

A. 2005
B. 2004
C. 2007
D. 2006

gate2014-ec01 numerical-ability data-interpretation bar-charts normal

10.2 Bayes Theorem: GATE2013-AE-GA-10 top gateoverflow.in/40251

In a factory, two machines M1 and M2 manufacture 60% and 40% of the autocomponents respectively. Out of the total
production, 2% of M1 and 3% of M2 are found to be defective. If a randomly drawn autocomponent from the combined lot is
found defective, what is the probability that it was manufactured by M2?

(A) 0.35 (B) 0.45 (C) 0.5 (D) 0.4

gate2013-ae numerical-ability bayes-theorem

10.3 Bayes Theorem: GATE 2014 EC top gateoverflow.in/38256

Q.10 You are given three coins: one has heads on both faces, the second has tails on both faces, and the
third has a head on one face and a tail on the other. You choose a coin at random and toss it, and it
comes up heads. The probability that the other face is tails is
(A) 1/4 (B) 1/3 (C) 1/2 (D) 2/3

In this question they have given answer (B) as 1/3. We can get B if we take

P(C1) = 1/3, P(C2) = 1/3,P(C3) = 1/3

Where C1 has both head / tail & C2 has Head/Head, C3 has tail/tail.

Issue is that if we know that we have got heads , we can actually eliminate P(C3) , we can take it as 0.

Because it is given that we get Head when we toss it. (C3 can't generate head)

If we consider P(C1) = 1/2, P(C2) = 1/2 & P(C3) = 0 then answer I get is (D) 2/3 which is wrong as per GATE key. So please
answer the question & Also let me know why should we consider C3 , if we know surely that coin is not C3.

conditional-probability bayes-theorem gate-aptitude aptitude

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 571 of 852

10.4 Bayes Theorem: GATE2012_63 top gateoverflow.in/2211

An automobile plant contracted to buy shock absorbers from two suppliers X and Y . X supplies 60% and Y supplies 40% of
the shock absorbers. All shock absorbers are subjected to a quality test. The ones that pass the quality test are considered
reliable. Of X s shock absorbers, 96% are reliable. Of Y s shock absorbers, 72% are reliable.

The probability that a randomly chosen shock absorber, which is found to be reliable, is made by Y is

(A) 0.288
(B) 0.334
(C) 0.667
(D) 0.720

gate2012 numerical-ability probability normal bayes-theorem

10.5 Circle: TIFR2011-A-18 top gateoverflow.in/20255

The equation of the tangent to the unit circle at point ( cos , sin ) is.

a. x cos y sin = 1
b. x sin y cos = 1
c. x cos + y sin = 1
d. x sin y cos = 1
e. None of the above.

tifr2011 numerical-ability geometry circle

10.6 Clock Time: TIFR2010-A-2 top gateoverflow.in/18206

The hour hand and the minute hands of a clock meet at noon and again at mid-night. In between they meet N times, where
N is.:
a. 6
b. 11
c. 12
d. 13
e. None of the above.

tifr2010 numerical-ability clock-time

10.7 Clock Time: TIFR2013-A-20 top gateoverflow.in/25502

Consider a well functioning clock where the hour, minute and the seconds needles are exactly at zero. How much time later
will the minutes needle be exactly one minute ahead (1/60 th of the circumference) of the hours needle and the seconds
needle again exactly at zero?

Hint: When the desired event happens both the hour needle and the minute needle have moved an integer multiple of 1/60
th of the circumference.

a. 144 minutes
b. 66 minutes
c. 96 minutes
d. 72 minutes
e. 132 minutes

tifr2013 numerical-ability clock-time

10.8 Clock Time: TIFR2014-A-10 top gateoverflow.in/25998

A person went out between 4pm and 5pm to chat with her friend and returned between 5pm and 6pm. On her return, she
found that the hour-hand and the minute-hand of her (well-functioning) clock had just exchanged their positions with
respect to their earlier positions at the time of her leaving. The person must have gone out to chat at
4

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 572 of 852

a. Twenty five minutes past 4pm.


b. Twenty six and 122/143 minutes past 4pm.
c. Twenty seven and 1/3 minutes past 4pm.
d. Twenty eight minutes past 4pm.
e. None of the above.

tifr2014 numerical-ability clock-time

10.9 Complex Number: TIFR2011-A-13 top gateoverflow.in/20223

3 i
If z = and (z 95 + i67 )97 = z n , then the smallest value of n is?
2

a. 1
b. 10
c. 11
d. 12
e. None of the above.

tifr2011 numerical-ability complex-number

10.10 Complex Number: TIFR2013-A-7 top gateoverflow.in/25429

For any complex number z, arg z defines its phase, chosen to be in the interval 0 argz < 360 . If z1 , z2 and z3 are three
complex numbers with the same modulus but different phases (arg z3 < arg z2 < arg z1 < 180 ), then the quantity

arg(z1 /z2 )
arg[(z1 z3 )/(z2 z3 )]

is a constant, and has the value

a. 2
1
b.
3
c. 1
d. 3
1
e. 2

tifr2013 numerical-ability complex-number

10.11 Conditional Probability: GATE2014-AG-GA10 top gateoverflow.in/41674

10% of the population in a town is HIV + . A new diagnostic kit for HIV detection is available; this kit correctly identifies HIV +
individuals 95% of the time, and HIV individuals 89% of the time. A particular patient is tested using this kit and is found
to be positive. The probability that the individual is actually positive is ______.

gate2014-ag numerical-ability probability conditional-probability normal

10.12 Conditional Probability: GATE 2015 Aptitude Set 4 Q10 top gateoverflow.in/40174

Q.10 A coin is tossed thrice. Let X be the event that head occurs in each of the first two tosses. Let Y be
the event that a tail occurs on the third toss. Let Z be the event that two tails occur in three tosses.
Based on the above information, which one of the following statements is TRUE?
(A) X and Y are not independent (B) Y and Z are dependent
(C) Y and Z are independent (D) X and Z are independent

gate2015aptiset4 aptitude conditional-probability probability

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 573 of 852

10.13 Convergence: TIFR2010-Maths-A-11 top gateoverflow.in/26478

The series

(1)n+1

n=1 n

A. Converges but not absolutely.


B. Converges absolutely.
C. Diverges.
D. None of the above.

tifrmaths2010 number-series convergence

10.14 Cost Market Price: GATE2011_63 top gateoverflow.in/2173

The variable cost (V ) of manufacturing a product varies according to the equation V = 4q, where q is the quantity produced. The xed cost
(F) of production of same product reduces with q according to the equation F = 100/q. How many units should be produced to minimize
the total cost (V + F)?

(A) 5

(B) 4

(C) 7

(D) 6

gate2011 numerical-ability cost-market-price normal

10.15 Cost Market Price: TIFR2012-A-6 top gateoverflow.in/21002

A certain pair of used shoes can be repaired for Rs.1250 and will last for 1 year. A pair of the same kind of shoes can be
purchased new for Rs.2800 and will last for 2 years. The average cost per year of the new shoes is what percent greater
than the cost of repairing the used shoes?

a. 5%
b. 12%
c. 15%
d. 3%
e. 24%

tifr2012 cost-market-price

10.16 Cost Market Price: gate-2014-ae-5 top gateoverflow.in/40304

A foundry has a fixed daily cost of Rs 50, 000 whenever it operates and a variable cost of RS 800Q,where Q is the daily
production in tonnes. What is the cost of production in Rs per tonne for a daily production of 100 tonnes.

gate2014-ae numerical-ability cost-market-price

10.17 Cost Market Price: GATE2012_56 top gateoverflow.in/2193

The cost function for a product in a firm is given by 5q 2 , where q is the amount of production. The firm can sell the product
at a market price of 50 per unit. The number of units to be produced by the firm such that the profit is maximized is

(A) 5
(B) 10
(C) 15

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 574 of 852

(D) 25

gate2012 numerical-ability cost-market-price normal

10.18 Counting: Gate 2015 Aptitude Set 8 Q8 top gateoverflow.in/40183

Q.8 How many four digit numbers can be formed with the 10 digits 0, 1, 2, ..., 9 if no number can start
with 0 and if repetitions are not allowed?

gate2015aptiset8 aptitude counting

10.19 Data Interpretation: GATE2016-1-GA06 top gateoverflow.in/39616

A shaving set company sells 4 different types of razors- Elegance, Smooth, Soft and Executive.

Elegance sells at Rs. 48, Smooth at Rs. 63, Soft at Rs. 78 and Executive at Rs. 173 per piece. The table below shows the
numbers of each razor sold in each quarter of a year.

Quarter/ Product Elegance Smooth Soft Executive


Q1 27300 20009 17602 9999
Q2 25222 19392 18445 8942
Q3 28976 22429 19544 10234
Q4 21012 18229 16595 10109

Which product contributes the greatest fraction to the revenue of the company in that year?

A. Elegance
B. Executive
C. Smooth
D. Soft

gate2016-1 numerical-ability data-interpretation easy

10.20 Data Interpretation: GATE2015-1_GA_9 top gateoverflow.in/8013

The pie chart below has the breakup of the number of students from different departments in an engineering college for the
year 2012. The proportion of male to female students in each department is 5:4. There are 40 males in Electrical
Engineering. What is the difference between the numbers of female students in the civil department and the female students
in the Mechanical department?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 575 of 852

gate2015-1 numerical-ability data-interpretation

10.21 Data Interpretation: GATE 2016-2-GA-10 top gateoverflow.in/39535

A. f(x) = 1 |x 1|
B. f(x) = 1 + |x 1|
C. f(x) = 2 |x 1|
D. f(x) = 2 + |x 1|

gate2016-2 numerical-ability data-interpretation normal

10.22 Data Interpretation: GATE2014-2_GA_9 top gateoverflow.in/1951

The ratio of male to female students in a college for ve years is plotted in the following line graph. If the number of female students doubled in 2009, by what
percent did the number of male students increase in 2009?

gate2014-2 numerical-ability data-interpretation numerical-answers normal

10.23 Data Interpretation: GATE2015-3_GA_10 top gateoverflow.in/8389

The exports and imports (in crores of Rs.) of a country from the year 2000 to 2007 are given in the following bar chart. In
which year is the combined percentage increase in imports and exports the highest?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 576 of 852

gate2015-3 numerical-ability data-interpretation normal

10.24 Data Interpretation: GATE2014-3_GA_9 top gateoverflow.in/2033

The ratio of male to female students in a college for ve years is plotted in the following line graph. If the number of female students in 2011 and 2012 is equal,
what is the ratio of male students in 2012 to male students in 2011?

(A) 1:1

(B) 2:1

(C) 1.5:1

(D) 2.5:1

gate2014-3 numerical-ability data-interpretation normal

10.25 Data Interpretation: GATE2011_62 top gateoverflow.in/2172

P, Q, R and S are four types of dangerous microbes recently found in a human habitat. The area of each circle with its diameter printed in
brackets represents the growth of a single microbe surviving human immunity system within 24 hours of entering the body. The danger to
human beings varies proportionately with the toxicity, potency and growth attributed to a microbe shown in the figure below:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 577 of 852

A pharmaceutical company is contemplating the development of a vaccine against the most dangerous microbe. Which microbe should the
company target in its first attempt?

(A) P

(B) Q

(C) R

(D) S

gate2011 numerical-ability data-interpretation normal

10.26 Directions: GATE2014-AG-GA9 top gateoverflow.in/41673

X is 1 km northeast of Y . Y is 1 km southeast of Z. W is 1 km west of Z. P is 1 km south of W . Q is 1 km east of P .


What is the distance between X and Q in km?

A. 1
B. 2
C. 3
D. 2

gate2014-ag numerical-ability directions normal

10.27 Distance Time: TIFR2012-A-16 top gateoverflow.in/25041

Walking at 4/5 is normal speed a man is 10 minute too late. Find his usual time in minutes.

a. 81
b. 64
c. 52
d. 40
e. It is not possible to determine the usual time from given data.

tifr2012 numerical-ability distance-time

10.28 Distance Time: GATE2014-EC03-GA8 top gateoverflow.in/41460

A man can row at 8 km per hour in still water. If it takes him thrice as long to row upstream, as to row downstream, then
find the stream velocity in km per hour.

gate2014-ec03 numerical-ability distance-time normal

10.29 Distance Time: GATE2014-EC01-GA8 top gateoverflow.in/41497

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 578 of 852

A train that is 280 metres long, travelling at a uniform speed, crosses a platform in 60 seconds and passes a man standing
on the platform in 20 seconds. What is the length of the platform in metres?

gate2014-ec01 numerical-ability distance-time normal numerical-answers

10.30 Distance Time: GATE2014-EC02-GA10 top gateoverflow.in/41518

It takes 30 minutes to empty a half-full tank by draining it at a constant rate. It is decided to simultaneously pump water
into the half-full tank while draining it. What is the rate at which water has to be pumped in so that it gets fully filled in 10
minutes?

A. 4 times the draining rate


B. 3 times the draining rate
C. 2.5 times the draining rate
D. 2 times the draining rate

gate2014-ec02 numerical-ability distance-time normal

10.31 First Order Logic: GATE 2015 Aptitude Set 4 Q7 top gateoverflow.in/40172

Q.7 Given below are two statements followed by two conclusions. Assuming these statements to be
true, decide which one logically follows.
Statements:
I. No manager is a leader.
II. All leaders are executives.
Conclusions:
I. No manager is an executive.
II. No executive is a manager.
(A) Only conclusion I follows.
(B) Only conclusion II follows.
(C) Neither conclusion I nor II follows.
(D) Both conclusions I and II follow.

gate2015aptiset4 aptitude mathematical-logic logical-reasoning first-order-logic

10.32 Fraction: TIFR2014-A-11 top gateoverflow.in/26329

A large community practices birth control in the following peculiar fashion. Each set of parents continues having children until
a son is born; then they stop. What is the ratio of boys to girls in the community if, in the absence of birth control, 51% of
the babies are born male?

a. 51 : 49
b. 1 : 1
c. 49 : 51
d. 51 : 98
e. 98 : 51

tifr2014 numerical-ability fraction

10.33 Functions: GATE2012-AR-7 top gateoverflow.in/40228

Let f(x) = x [x], where x 0 and [x] is the greatest integer not larger than x. Then f(x) is a
(A) monotonically increasing function
(B) monotonically decreasing function
(C) linearly increasing function between two integers
(D) linearly decreasing function between two integers

gate2012-ar aptitude numerical-ability functions

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 579 of 852

10.34 Geometry: TIFR2010-A-17 top gateoverflow.in/18493

Suppose there is a sphere with diameter at least 6 inches. Through this sphere we drill a hole along a diameter. The part of
the sphere lost in the process of drilling the hole looks like two caps joined to a cylinder, where the cylindrical part has
length 6 inches. It turns out that the volume of the remaining portion of the sphere does not depend on the diameter of the
sphere. Using this fact, determine the volume of the remaining part.

1. 24 cu. inches
2. 36 cu. inches
3. 27 cu. inches
4. 32 cu. inches
5. 35 cu. inches

tifr2010 numerical-ability geometry

10.35 Geometry: TIFR-2011-Maths-B-15 top gateoverflow.in/30296

A gardener throws 18 seeds onto an equilateral triangle shaped plot of land with sides of length one metre. Then at least two
seeds are within a distance of 25 centimetres.

TRUE/FALSE

tifrmaths2011 numerical-ability geometry

10.36 Geometry: GATE2015-2_GA_8 top gateoverflow.in/8039

In a triangle PQR, PS is the angle bisector of QP R and QP S = 60 . What is the length of PS?


(q+r)
A. qr
qr
B. q+r
2
C. (q 2 +r )
(q+r)2
D. qr

gate2015-2 numerical-ability geometry difficult

10.37 Geometry: TIFR2015-A-2 top gateoverflow.in/29158

Consider a circle with a circumference of one unit length. Let d < 1/6. Suppose that we independently throw two arcs, each
of length d, randomly on this circumference so that each arc is uniformly distributed along the circle circumference. The arc
attaches itself exactly to the circumference so that arc of length d exactly covers length d of the circumference. What can be
said about the probability that the two arcs do not intersect each other?

a. It equals (1 d)
b. It equals (1 3d)
c. It equals (1 2d)
d. It equals 1
(1 d) (1 d)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 580 of 852

e. It equals (1 d) (1 d)

tifr2015 geometry

10.38 Geometry: GATE 2016-1-GA05 top gateoverflow.in/39610

A cube is built using 64 cubic blocks of side one unit. After it is built, one cubic block is removed from every corner of the
cube. The resulting surface area of the body (in square units) after the removal is ________.

a. 56
b. 64
c. 72
d. 96

gate2016-1 numerical-ability geometry normal

10.39 Geometry: TIFR2013-A-5 top gateoverflow.in/25387

The late painter Maqbool Fida Husain once coloured the surface of a huge hollow steel sphere, of radius 1 metre, using just
two colours, Red and Blue. As was his style however, both the red and blue areas were a bunch of highly irregular
disconnected regions. The late sculptor Ramkinkar Baij then tried to fit in a cube inside the sphere, the eight vertices of the
cube touching only red coloured parts of the surface of the sphere. Assume = 3.14 for solving this problem. Which of the
following is true?

a. Baij is bound to succeed if the area of the red part is 10sq. metres;
b. Baij is bound to fail if the area of the red part is 10sq. metres;
c. Baij is bound to fail if the area of the red part is 11sq. metres;
d. Baij is bound to succeed if the area of the red part is 11sq. metres;
e. None of the above.

tifr2013 geometry numerical-ability

10.40 Geometry: TIFR2012-A-4 top gateoverflow.in/20984

Let ABC be a triangle with n distinct points inside. A triangulation of ABC with respect to the n points is obtained by
connecting as many points as possible, such that no more line segments can be added without intersecting other line
segments. In other words ABC has been partitioned into triangles with end points at the n points or at the vertices A,B,C.
For example, the following figure gives one possible triangulation of ABC with two points inside it.

Although there are many different ways to triangulate ABC with the n points inside, the number of triangles depends only
on n. In the above figure it is five. How many triangles are there in a triangulation of ABC with n points inside it?

a).3n 1

b).n2 +1

n+3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 581 of 852

c).n + 3

d).2n + 1

e).4n 3

tifr2012 numerical-ability geometry

10.41 Geometry: TIFR2011-A-5 top gateoverflow.in/20009

Three distinct points x, y, z lie on a unit circle of the complex plane and satisfy x + y + z = 0. Then x, y, z form the vertices
of .

a. An isosceles but not equilateral triangle.


b. An equilateral triangle.
c. A triangle of any shape.
d. A triangle whose shape can't be determined.
e. None of the above.

tifr2011 numerical-ability geometry

10.42 Geometry: TIFR2015-A-9 top gateoverflow.in/29575

Consider a square of side length 2. We throw five points into the square. Consider the following statements:

(i) There will always be three points that lie on a straight line.

(ii) There will always be a line connecting a pair of points such that two points lie on one side of the line and one point on the
other.

(iii) There will always be a pair of points which are at distance at most 2 from each other.
Which of the above is true:

A. (i) only.
B. (ii) only.
C. (iii) only.
D. (ii) and (iii).
E. None of the above.

tifr2015 geometry

10.43 Geometry: TIFR2012-A-5 top gateoverflow.in/21001

What is the maximum number of points of intersection between the diagonals of a convex octagon (8-vertex planar
polygon)? Note that a polygon is said to be convex if the line segment joining any two points in its interior lies wholly in the
interior of the polygon. Only points of intersection between diagonals that lie in the interior of the octagon are to be
considered for this problem.

a. 55
b. 60
c. 65
d. 70
e. 75

tifr2012 numerical-ability geometry

10.44 Geometry: GATE2014-1_GA_10 top gateoverflow.in/778

When a point inside of a tetrahedron (a solid with four triangular surfaces) is connected by straight lines to its corners, how
many (new) internal planes are created with these lines?

gate2014-1 numerical-ability geometry combinatory normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 582 of 852

10.45 Growth Rate: GATE2014-AG-GA5 top gateoverflow.in/41669

The population of a new city is 5 million and is growing at 20% annually. How many years would it take to double at this
growth rate?

A. 3 4 years
B. 4 5 years
C. 5 6 years
D. 6 7 years

gate2014-ag numerical-ability growth-rate compound-interest normal

10.46 Inference: GATE2010_62 top gateoverflow.in/2370

Hari(H), Gita(G), Irfan(I) and Saira(S) are siblings (i.e., brothers and sisters). All were born on 1 st January. The age
difference between any two successive siblings (that is born one after another) is less than three years. Given the following
facts:

i. Hari's age + Gita's age > Irfan's age + Saira's age


ii. The age difference between Gita and Saira is one year. However Gita is not the oldest and Saira is not the youngest.
iii. There are no twins.

In what order they were born (oldest first)?

(A) HSIG

(B) SGHI

(C) IGSH

(D) IHSG

gate2010 numerical-ability inference normal

10.47 Logical Reasoning: TIFR2013-A-2 top gateoverflow.in/25383

Consider the following two types of elections to determine which of two parties A and B forms the next government in the
2014 Indian elections. Assume for simplicity an Indian population of size 545545(= 545 1001). There are only two parties
A and B and every citizen votes.
TYPE C: The country is divided into 545 constituencies and each constituency has 1001 voters. Elections are held for each
constituency and a party is said to win a constituency if it receive a majority of the vote in that constituency. The party that
wins the most constituencies forms the next government.

TYPE P: There are no constituencies in this model. Elections are held throughout the country and the party that wins the
most votes (among 545545 voters forms the government.

Which of the following is true?

a. If the party forms the govt. by election TYPE C winning at least two-third of the constituencies, then it will also forms
the govt. by election TYPE P.
b. If a party forms govt. by election TYPE C, then it will also form the govt. by election TYPE P.
c. If a party forms govt. by election TYPE P, then it will also form the govt. by election TYPE C.
d. All of the above
e. None of the above.

tifr2013 logical-reasoning

10.48 Logical Reasoning: TIFR2013-A-11 top gateoverflow.in/25433

Let there be a pack of 100 cards numbered 1 to 100. The ith card states: "There are at most i 1 true cards in this pack".
Then how many cards of the pack contain TRUE statements?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 583 of 852

a. 0
b. 1
c. 100
d. 50
e. None of the above.

tifr2013 logical-reasoning

10.49 Logical Reasoning: GATE2014-EC02-GA7 top gateoverflow.in/41515

Lights of four colors (red, blue, green, yellow) are hung on a ladder. On every step of the ladder there are two lights. If one
of the lights is red, the other light on that step will always be blue. If one of the lights on a step is green, the other light on
that step will always be yellow. Which of the following statements is not necessarily correct?

A. The number of red lights is equal to the number of blue lights


B. The number of green lights is equal to the number of yellow lights
C. The sum of the red and green lights is equal to the sum of the yellow and blue lights
D. The sum of the red and blue lights is equal to the sum of the green and yellow lights

gate2014-ec02 numerical-ability logical-reasoning normal

10.50 Logical Reasoning: gate-2014-ae-7 top gateoverflow.in/40307

Q7). Anuj,Bhola ,Chandan ,Dilip , Eswar and Faisal live on different floors in a six -storeyed building (the ground floor is
numbered 1, the floor above it 2, and so on) Anuj lives on an even-numbered floor,Bhola does not live on an odd numbered
floor. Chandan does not live on any of the floors below Faisal's floor .Dilip does not live on floor number 2 . Eswar does not
live on a floor immediately above or immediately below Bhola.Faisal lives three floors above Dilip.Which of the following
floor-person combinations is correct?

Anuj Bhola Chandan Dilip Eswar Faisal


(A) 6 2 5 1 3 4
(B) 2 6 5 1 3 4
(C) 4 2 6 3 1 5
(D) 2 4 6 1 3 5

gate-2014-ae logical-reasoning

10.51 Logical Reasoning: GATE2014-AG-GA6 top gateoverflow.in/41670

In a group of four children, Som is younger to Riaz. Shiv is elder to Ansu. Ansu is youngest in the group. Which of the
following statements is/are required to find the eldest child in the group?

Statements

1. Shiv is younger to Riaz.

2. Shiv is elder to Som.

A. Statement 1 by itself determines the eldest child.


B. Statement 2 by itself determines the eldest child.
C. Statements 1 and 2 are both required to determine the eldest child.
1 2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 584 of 852

D. Statements 1 and 2 are not sufficient to determine the eldest child.

gate2014-ag numerical-ability logical-reasoning normal

10.52 Logical Reasoning: GATE2014-EC01-GA7 top gateoverflow.in/41496

For submitting tax returns, all resident males with annual income below Rs 10 lakh should fill up Form P and all resident
females with income below Rs 8 lakh should fill up Form Q. All people with incomes above Rs 10 lakh should fill up Form R,
except non residents with income above Rs 15 lakhs, who should fill up Form S. All others should fill Form T . An example of
a person who should fill Form T is

A. A resident male with annual income Rs 9 lakh


B. A resident female with annual income Rs 9 lakh
C. A non-resident male with annual income Rs 16 lakh
D. A non-resident female with annual income Rs 16 lakh

gate2014-ec01 numerical-ability logical-reasoning normal

10.53 Logical Reasoning: GATE2014-EC03-GA5 top gateoverflow.in/41144

In which of the following options will the expression P < M be definitely true?
A. M < R > P > S
B. M > S < P < F
C. Q < M < F = P
D. P = A < R < M

gate2014-ec03 logical-reasoning

10.54 Mean: GATE-2012-AE-5 top gateoverflow.in/40216

The arithmetic mean of five different natural numbers is 12. The largest possible value among the
numbers is

(A) 12 (B) 40 (C) 50 (D) 60


gate2012-ae aptitude mean numerical-ability

10.55 Modular Arithmetic: TIFR2010-Maths-B-12 top gateoverflow.in/19668

If n and m are positive integers and n9 = 19m + r, then the possible values for r modulo 19 are.
a. Only 0
b. Only 0, 1.
c. Only 1.
d. None of the above.

tifrmaths2010 numerical-ability modular-arithmetic

10.56 Modular Arithmetic: GATE2012-CY-GA-1 top gateoverflow.in/40232

If (1.001)1259 = 3.52 and (1.001)2062 = 7.85, then (1.001)3321 =


(A) 2.23 (B) 4.33 (C) 11.37 (D) 27.64

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 585 of 852

gate2012-cy aptitude numerical-ability modular-arithmetic

10.57 Modular Arithmetic: TIFR2010-Maths-B-4 top gateoverflow.in/19369

Which of the following statements is false?

a. There exists a natural number which when divided by 3 leaves remainder 1 and which when divided by 4 leaves
remainder 0.
b. There exists a natural number which when divided by 6 leaves remainder 2 and when divided by 9 leaves remainder 1.
c. There exists a natural number which when divided by 7 leaves remainder 1 and when divided by 11 leaves remainder 3.
d. There exists a natural number which when divided by 12 leaves remainder 7 and when divided by 8 leaves remainder 3.

tifrmaths2010 numerical-ability modular-arithmetic

10.58 Most Appropriate Word: GATE-2012-AE-3 top gateoverflow.in/40214

Choose the most appropriate alternative from the options given below to complete the following
sentence:
The administrators went on to implement yet another unreasonable measure, arguing that
the measures were already ___ and one more would hardly make a difference.

(A) reflective (B) utopian (C) luxuriant (D) unpopular


gate2012-ae aptitude most-appropriate-word verbal-ability

10.59 Number Representation: TIFR2012-A-11 top gateoverflow.in/25015

Let N be the sum of all numbers from 1 to 1023 except the five primes numbers: 2, 3, 11, 17, 31. Suppose all numbers are
represented using two bytes (sixteen bits). What is the value of the least significant byte (the least significant eight bits) of
N?
a. 00000000
b. 10101110
c. 01000000
d. 10000000
e. 11000000

tifr2012 numerical-ability number-representation

10.60 Number Representation: GATE2014-3_GA_10 top gateoverflow.in/2034

Consider the equation: (7526)8 (Y )8 = (4364)8 , where (X)N stands for X to the base N . Find Y .

(A) 1634

(B) 1737

(C) 3142

(D) 3162

gate2014-3 numerical-ability number-representation normal digital-logic

10.61 Number Series: TIFR2013-A-8 top gateoverflow.in/25430

Find the sum of the infinite series


1 1 1 1
+ + + +. . . . . .

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 586 of 852

1 1 1 1
135 + 357
+ 579
+ 7911
+. . . . . .

a.
1
b. 2
1
c. 6
d. 1
12
1
e. 14

tifr2013 numerical-ability number-series

10.62 Number Series: GATE2014-EC03-GA4 top gateoverflow.in/41143

The next term in the series 81, 54, 36, 24, is_________.

gate2014-ec03 number-series

10.63 Number Series: TIFR2013-A-15 top gateoverflow.in/25438

={
+1 if x 0
Let sgn(x)
1 if x < 0
What is the value of the following summation?
50
sgn((2i 1)(2i 3) (2i 99))
i=0

a. 0
b. 1
c. +1
d. 25
e. 50

tifr2013 numerical-ability number-series

10.64 Number Series: GATE2014-EC01-GA5 top gateoverflow.in/41494

What is the next number in the series?

12 35 81 173 357 _______.

gate2014-ec01 number-series

10.65 Number Series: GATE2014-3_GA_4 top gateoverflow.in/2027

Which number does not belong in the series below?

2, 5, 10, 17, 26, 37, 50, 64

(A) 17

(B) 37

(C) 64

(D) 26

gate2014-3 numerical-ability number-series easy

10.66 Number Series: TIFR2014-A-7 top gateoverflow.in/25992

n : n = 1, 2, . . .

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 587 of 852

Consider a sequence of non-negative numbers xn : n = 1, 2, . . .. Which of the following statements cannot be true?
a.
n=1 xn = and 2
n=1 xn = .
b.
n=1 xn = and 2
n=1 n < .
x
c.
n=1 xn <
and n=1 x2n < .
d.
n=1 xn 5 and 2
n=1 xn 25.
e.
n=1 xn <
and n=1 x2n = .

tifr2014 numerical-ability number-series

10.67 Number Series: GATE2014-EC03-GA6 top gateoverflow.in/41145

Find the next term in the sequence: 7G, 11K, 13M , _________.

A. 15Q
B. 17Q
C. 15P
D. 17P

gate2014-ec03 number-series logical-reasoning

10.68 Number Series: GATE2014-EC02-GA5 top gateoverflow.in/41512

Fill in the missing number in the series.

2 3 6 15 ___ 157.5 630

gate2014-ec02 number-series

10.69 Number Series: TIFR2011-A-8 top gateoverflow.in/20014

The sum of the first n terms of the series 1, 11, 111, 1111, , is.
1
a. 81 (10n+1 9n 10)
b. 1 (10n 9n)
81
1
c. 9 (10n+1 1)
d. 1 (10n+1 n10n )
9
e. None of the above.

tifr2011 numerical-ability number-series

10.70 Numerical Methods: GATE-2012-AE-8 top gateoverflow.in/40219

If a prime number on division by 4 gives a remainder of 1, then that number can be expressed as
(A) sum of squares of two natural numbers
(B) sum of cubes of two natural numbers
(C) sum of square roots of two natural numbers
(D) sum of cube roots of two natural numbers

gate2012-ae aptitude numerical-methods

10.71 Odd One: GATE 2016-2-GA-04 top gateoverflow.in/39528

Pick the odd one from the following options.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 588 of 852

(A) CADBE (B) JHKIL (C) XVYWZ (D) ONPMQ

gate2016-2 verbal-ability odd-one normal

10.72 Odd One: gate-2014-ae-6 top gateoverflow.in/40306

Q6). Find the odd one in the following group: ALRV X ,EP V ZB,IT ZDF ,OY EIK

A). ALRV X

B). EP V ZB

C). IT ZDF

D). OY EIK

gate-2014-ae odd-one

10.73 Passage Reading: GATE 2016-2-GA-07 top gateoverflow.in/39533

Computers were invented for performing only high-end useful computations. However, it is no understatement that they
have taken over our world today. The internet, for example, is ubiquitous. Many believe that the internet itself is an
unintended consequence of the original invention. With the advent of mobile computing on our phones, a whole new
dimension is now enabled. One is left wondering if all these developments are good or, more importantly, required.

Which of the statement(s) below is/are logically valid and can be inferred from the above paragraph?

(i) The author believes that computers are not good for us.

(ii) Mobile computers and the internet are both intended inventions.

A. (i) only
B. (ii) only
C. Both (i) and (ii)
D. Neither (i) nor (ii)

gate2016-2 verbal-ability passage-reading normal

10.74 Percent: GATE2014-EC04-GA8 top gateoverflow.in/41470

Industrial consumption of power doubled from 2000 2001 to 2010 2011. Find the annual rate of increase in percent
assuming it to be uniform over the years.

A. 5.6
B. 7.2
C. 10.0
D. 12.2

gate2014-ec04 percent normal

10.75 Percent: gate-2014-ae-9 top gateoverflow.in/40309

Q.9 One percent of the people of country X are taller than 6 ft. Two percent of the people of country Y

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 589 of 852

are taller than 6 ft. There are thrice as many people in country X as in country Y. Taking both
countries together, what is the percentage of people taller than 6 ft?
(A) 3.0 (B) 2.5 (C) 1.5 (D) 1.25

gate-2014-ae percent

10.76 Pie Chart: GATE2014-EC04-GA9 top gateoverflow.in/41471

A firm producing air purifiers sold 200 units in 2012. The following pie chart presents the share of raw material, labour,
energy, plant & machinery, and transportation costs in the total manufacturing cost of the firm in 2012. The expenditure on
labour in 2012 is Rs. 4,50,000. In 2013, the raw material expenses increased by 30% and all other expenses increased by
20%. What is the percentage increase in total cost for the company in 2013?

gate2014-ec04 numerical-ability data-interpretation pie-chart

10.77 Pie Chart: GATE2014-EC03-GA7 top gateoverflow.in/41146

The multi-level hierarchical pie chart shows the population of animals in a reserve forest. The correct conclusions from this
information are:

(i) Butterflies are birds

(ii) There are more tigers in this forest than red ants

(iii) All reptiles in this forest are either snakes or crocodiles

(iv) Elephants are the largest mammals in this forest

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 590 of 852

A. (i) and (ii) only


B. (i), (ii), (iii) and (iv)
C. (i), (iii) and (iv) only
D. (i), (ii) and (iii) only

gate2014-ec03 data-interpretation pie-chart

10.78 Pie Chart: GATE2014-EC03-GA7 top gateoverflow.in/41459

The multi-level hierarchical pie chart shows the population of animals in a reserve forest. The correct conclusions from this
information are:

(i) Butterflies are birds

(ii) There are more tigers in this forest than red ants

(iii) All reptiles in this forest are either snakes or crocodiles

(iv) Elephants are the largest mammals in this forest

A. (i) and (ii) only


B. (i), (ii), (iii) and (iv)
C. (i), (iii) and (iv) only
D. (i), (ii) and (iii) only

gate2014-ec03 numerical-ability data-interpretation pie-chart normal

10.79 Pie Chart: GATE2014-EC03-GA9 top gateoverflow.in/41461

A firm producing air purifiers sold 200 units in 2012. The following pie chart presents the share of raw material, labour,
energy, plant & machinery, and transportation costs in the total manufacturing cost of the firm in 2012. The expenditure on
labour in 2012 is Rs.4,50,000. In 2013, the raw material expenses increased by 30% and all other expenses increased by
20%. If the company registered a profit of Rs. 10 lakhs in 2012, at what price (in Rs) was each air purifier sold?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 591 of 852

gate2014-ec03 numerical-ability data-interpretation pie-chart

10.80 Pie Chart: GATE2014-EC02-GA9 top gateoverflow.in/41517

The total exports and revenues from the exports of a country are given in the two charts shown below. The pie chart for
exports shows the quantity of each item exported as a percentage of the total quantity of exports. The pie chart for the
revenues shows the percentage of the total revenue generated through export of each item. The total quantity of exports of
all the items is 500 thousand tonnes and the total revenues are 250 crore rupees. Which item among the following has
generated the maximum revenue per kg?

A. Item 2
B. Item 3
C. Item 6
D. Item 5

gate2014-ec02 numerical-ability data-interpretation pie-chart normal

10.81 Polynomials: GATE2016-1-GA09 top gateoverflow.in/39611

If f(x) = 2x7 + 3x 5, which of the following is a factor of f(x)?

A. (x3 + 8)
B. (x 1)
C. (2x 5)
D. (x + 1)

gate2016-1 numerical-ability polynomials normal

10.82 Probability: GATE2015-1_GA_3 top gateoverflow.in/8004

Given Set A= {2, 3, 4, 5} and Set B= { 11, 12, 13, 14, 15}, two numbers are randomly selected, one from each set. What
is the probability that the sum of the two numbers equals 16?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 592 of 852

A. 0.20
B. 0.25
C. 0.30
D. 0.33

gate2015-1 numerical-ability probability normal

10.83 Probability: GATE-2012-AE-6 top gateoverflow.in/40217

Two policemen, A and B, fire once each at the same time at an escaping convict. The probability
that A hits the convict is three times the probability that B hits the convict. If the probability of the
convict not getting injured is 0.5, the probability that B hits the convict is

(A) 0.14 (B) 0.22 (C) 0.33 (D) 0.40


gate2012-ae aptitude numerical-ability probability

10.84 Probability: gate2013-ee-6 top gateoverflow.in/40293

Q.61 What is the chance that a leap year, selected at random, will contain 53 Saturdays?
(A) 2/7 (B) 3/7 (C) 1/7 (D) 5/7

gate2013-ee numerical-ability probability

10.85 Probability: GATE2012-CY-GA-7 top gateoverflow.in/4173

A and B are friends. They decide to meet between 1:00 pm and 2:00 pm on a given day. There is a condition that whoever
arrives first will not wait for the other for more than 15 minutes. The probability that they will meet on that day is

A. 1/4
B. 1/16
C. 7/16
D. 9/16

gate2012-cy aptitude numerical-ability probability

10.86 Probability: GATE2014-EC03-GA10 top gateoverflow.in/41462

A batch of one hundred bulbs is inspected by testing four randomly chosen bulbs. The batch is rejected if even one of the
bulbs is defective. A batch typically has five defective bulbs. The probability that the current batch is accepted
is__________.

gate2014-ec03 numerical-ability probability numerical-answers normal

10.87 Probability: Gate 2015 Aptitude Set 8 Q5 top gateoverflow.in/40180

Four cards are randomly selected from a pack of 52 cards. If the first two cards are kings, what is
the probability that the third card is a king?

(A) 4/52 (B) 2/50 (C) (1/52)(1/52) (D) (1/52)(1/51) (1/50)

gate2015aptiset8 numerical-ability probability easy

10.88 Probability: GATE2015-1_GA_10 top gateoverflow.in/8014

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 593 of 852

The probabilities that a student passes in mathematics, physics and chemistry are m,p and c respectively. Of these subjects,
the students has 75% chance of passing in at least one, a 50% chance of passing in at least two and a 40% chance of
passing in exactly two. Following relations are drawn in m, p, c:

I. p + m + c = 27/20
II. p + m + c = 13/20
III. (p) x (m) x (c) = 1/10

A. Only relation I is true.


B. Only relation II is true.
C. Relations II and III are true.
D. Relations I and III are true.

gate2015-1 numerical-ability probability

10.89 Probability: GATE AG 2014 4 top gateoverflow.in/38451

Q.4 In any given year, the probability of an earthquake greater than Magnitude 6 occurring in the
Garhwal Himalayas is 0.04. The average time between successive occurrences of such earthquakes
is ____ years.

aptitude probability

10.90 Probability: GATE2014-EC02-GA4 top gateoverflow.in/41511

A regular die has six sides with numbers 1 to 6 marked on its sides. If a very large number of throws show the following
frequencies of occurrence: 1 0.167; 2 0.167; 3 0.152; 4 0.166; 5 0.168; 6 0.180. We call this die:

A. Irregular
B. Biased
C. Gaussian
D. Insufficient

gate2014-ec02 numerical-ability probability normal

10.91 Probability: GATE2014-AG-GA4 top gateoverflow.in/41668

In any given year, the probability of an earthquake greater than Magnitude 6 occurring in the Garhwal Himalayas is 0.04 .
The average time between successive occurrences of such earthquakes is ____ years.

gate2014-ag numerical-ability probability numerical-answers normal

10.92 Proportions: GATE2016-1-GA10 top gateoverflow.in/39612

In a process, the number of cycles to failure decreases exponentially with an increase in load. At a load of 80 units, it takes
100 cycles for failure. When the load is halved, it takes 10000 cycles for failure.The load for which the failure will happen in
5000 cycles is _____________.
A. 40.00
B. 46.02
C. 60.01
D. 92.02

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 594 of 852

gate2016-1 numerical-ability proportions normal

10.93 Quadratic Equations: GATE 2016-2-GA-05 top gateoverflow.in/39532

In a quadratic function, the value of the product of the roots (, ) is 4. Find the value of

n + n

n + n

A. n4
B. 4n
C. 22n1
n1
D. 4

gate2016-2 numerical-ability quadratic-equations normal

10.94 Ratios: GATE2013-AE-GA-1 top gateoverflow.in/40242

If 3 X 5 and 8 Y 11 then which of the following options is TRUE?


A. 3 X 85
5 Y
3
B.
11
Y 58
X
3 X 8
C. 11 Y 5
3 X 8
D. 11
5 Y

gate2013-ae numerical-ability ratios normal

10.95 Ratios: TIFR2014-A-2 top gateoverflow.in/25987

A body at a temperature of 30 Celsius is immersed into a heat bath at 0 Celsius at time t = 0. The body starts cooling at a
rate proportional to the temperature difference. Assuming that the heat bath does not change in temperature throughout the
process, calculate the ratio of the time taken for the body to reach 1 Celsius divided by the time taken for the body to reach
5 Celsius.
a. log 5.
log 29
b. .
log 25
5
c. e .
d. 1 + log6 5.
e. None of the above.

tifr2014 numerical-ability ratios

10.96 Ratios: GATE2014-AG-GA8 top gateoverflow.in/41672

The total exports and revenues from the exports of a country are given in the two pie charts below. The pie chart for exports
shows the quantity of each item as a percentage of the total quantity of exports. The pie chart for the revenues shows the
percentage of the total revenue generated through export of each item. The total quantity of exports of all the items is 5
lakh tonnes and the total revenues are 250 crore rupees. What is the ratio of the revenue generated through export of Item
1 per kilogram to the revenue generated through export of Item 4 per kilogram?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 595 of 852

A. 1 : 2
B. 2 :1
C. 1 : 4
D. 4 :1

gate2014-ag numerical-ability data-interpretation pie-chart ratios normal

10.97 Sequence: GATEEC_01 2014 5 top gateoverflow.in/38453

Q.5 What is the next number in the series? 12 35 81 173 357 ___

aptitude sequence

10.98 Sequence: GATE2014-EC04-GA6 top gateoverflow.in/41468

Find the next term in the sequence: 13M, 17Q, 19S,_______.

A. 21W
B. 21V
C. 23W
D. 23V

gate2014-ec04 numerical-ability sequence normal

10.99 Sequence: TIFR2013-A-19 top gateoverflow.in/25500

Consider a sequence of numbers (n : n = 1, 2, . . . ), such that 1 = 10 and


20n
n+1 = 20+n

for n 1. Which of the following statements is true?


Hint: Consider the sequence of reciprocals.

a. The sequence (n : n = 1, 2, . . . ) converges to zero.


b. n 1 for all n
c. The sequence (n : n = 1, 2, . . . ) is decreasing and converges to 1.
d. The sequence (n : n = 1, 2, . . . ) is decreasing and then increasing. Finally it converges to 1.
e. None of the above.

tifr2013 numerical-ability sequence

10.100 Sequence: GATE2012_65 top gateoverflow.in/2213

Given the sequence of terms, AD CG FK JP, the next term is

(A) OV
(B) OW
(C) PV

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 596 of 852

(D) PW

gate2012 numerical-ability sequence easy

10.101 Sequence: GATE2014-EC04-GA5 top gateoverflow.in/41467

In a sequence of 12 consecutive odd numbers, the sum of the first 5 numbers is 425. What is the sum of the last 5 numbers
in the sequence?

gate2014-ec04 numerical-ability sequence normal

10.102 Sets: GATE 2016-2-GA-06 top gateoverflow.in/39536

Among 150 faculty members in an institute, 55 are connected with each other through Facebook and 85 are connected
through Whatsapp. 30 faculty members do not have Facebook or Whatsapp accounts. The numbers of faculty members
connected only through Facebook accounts is _______.

A. 35
B. 45
C. 65
D. 90

gate2016-2 numerical-ability sets easy

10.103 Speed: gate2013-ee-9 top gateoverflow.in/40296

A car travels 8 km in the first quarter of an hour, 6 km in the second quarter and 16 km in the third quarter. The average
speed of the car in km per hour over the entire journey is

(A) 30 (B) 36 (C) 40 (D) 24


gate2013-ee speed distance-time numerical-ability

10.104 Speed: GATE-2013-AE-GA-6 top gateoverflow.in/40247

Q.61 Velocity of an object fired directly in upward direction is given by  80 32 , where ( time)
is in seconds. When will the velocity be between 32 m/sec and 64 m/sec?
(A) (1, 3/2) (B) (1/2, 1)
(C) (1/2, 3/2) (D) (1, 3)

gate2013-ae numerical-ability speed

10.105 Statistics: GATE2014-EC01-GA4 top gateoverflow.in/41493

The statistics of runs scored in a series by four batsmen are provided in the following table. Who is the most consistent
batsman of these four?

Standard
Batsman Average
deviation
K 31.2 5.21
L 46.0 6.35
M 54.4 6.22
N 17.9 5.90

A. K

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 597 of 852

B. L
C. M
D. N

gate2014-ec01 statistics variance

10.106 Statistics: GATE2012_64 top gateoverflow.in/2212

Which of the following assertions are CORRECT?

P: Adding 7 to each entry in a list adds 7 to the mean of the list

Q: Adding 7 to each entry in a list adds 7 to the standard deviation of the list

R: Doubling each entry in a list doubles the mean of the list

S: Doubling each entry in a list leaves the standard deviation of the list unchanged

(A) P, Q
(B) Q, R
(C) P, R
(D) R, S

gate2012 numerical-ability statistics normal

10.107 System Of Equations: GATE2011_GG_GA_6 top gateoverflow.in/40207

Q.61 The number of solutions for the following system of inequalities is


X1 0
X2 0
X1 + X2 10
2X1 + 2X2 22

(A) 0 (B) infinite (C) 1 (D) 2

gate2011_gg numerical-ability system-of-equations

10.108 GATE2011_GG_GA_8 top gateoverflow.in/40209

Q.63 Three sisters (R, S, and T) received a total of 24 toys during Christmas. The toys were initially
divided among them in a certain proportion. Subsequently, R gave some toys to S which doubled
the share of S. Then S in turn gave some of her toys to T, which doubled Ts share. Next, some of
Ts toys were given to R, which doubled the number of toys that R currently had. As a result of all
such exchanges, the three sisters were left with equal number of toys. How many toys did R have
originally?
(A) 8 (B) 9 (C) 11 (D) 12

gate2011-gg aptitude

10.109 GATE2011_GG_GA_7 top gateoverflow.in/40208

In a class of 300 students in an M.Tech programme, each student is required to take at least one subject from the following
three:

M600: Advanced Engineering Mathematics


C600: Computational Methods for Engineers
E600: Experimental Techniques for Engineers

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 598 of 852

The registration data for the M.Tech class shows that 100 students have taken M600, 200 students have taken C600, and 60
students have taken E600. What is the maximum possible number of students in the class who have taken all the above
three subjects?

(A) 20 (B) 30 (C) 40 (D) 50


gate2011_gg numerical-ability set-theory&algebra

10.110 Gate 2015 Aptitude Set 8 Q7 top gateoverflow.in/40182

Q.7 The given question is followed by two statements; select the most appropriate option that solves the
question.
Capacity of a solution tank A is 70% of the capacity of tank B. How many gallons of solution are in
tank A and tank B?
Statements:
(I) Tank A is 80% full and tank B is 40% full.
(II) Tank A if full contains 14,000 gallons of solution.
(A) Statement I alone is sufficient.
(B) Statement II alone is sufficient.
(C) Either statement I or II alone is sufficient.
(D) Both the statements I and II together are sufficient.

gate2015aptiset8 aptitude numerical-ability

10.111 Gate 2015 Aptitude Set 8 Q4 top gateoverflow.in/40179

Q.4 Mr. Vivek walks 6 meters North-east, then turns and walks 6 meters South-east, both at 60 degrees
to east. He further moves 2 meters South and 4 meters West. What is the straight distance in metres
between the point he started from and the point he finally reached?
(A) 22
(B) 2
(C) 2
(D) 1/2

gate2015aptiset8 aptitude numerical-ability

10.112 GATE2014-EC04-GA4 top gateoverflow.in/41466

Let f(x, y) = xn y m = p. If x is doubled and y is halved, the new value of f is


A. 2nm P
B. 2mn P
C. 2(n m)P
D. 2(m n)P

gate2014-ec04 numerical-ability easy

10.113 GATE2011_GG_GA_9 top gateoverflow.in/40210

The quality of services delivered by a company consists of six factors as shown below in the radar
diagram. The dots in the figure indicate the score for each factor on a scale of 0 to 10. The
standardized coefficient for each factor is given in the parentheses. The contribution of each factor
to the overall service quality is directly proportional to the factor score and its standardized
coefficient.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 599 of 852

The lowest contribution among all the above factors to the overall quality of services delivered by the company is (A) 10%
(B) 20% (C) 24% (D) 40%

gate2011-gg aptitude difficult

10.114 GATE 2015 Aptitude Set 4 Q9 top gateoverflow.in/40173

Q.9 Right triangle PQR is to be constructed in the xy - plane so that the right angle is at P and line PR is
parallel to the x-axis. The x and y coordinates of P, Q, and R are to be integers that satisfy the
inequalities: 4 x 5 and 6 y 16. How many different triangles could be constructed with
these properties?
(A) 110 (B) 1,100 (C) 9,900 (D) 10,000

gate2015aptiset4 aptitude numerical-ability

10.115 Gate 2015 Aptitude Set 8 Q10 top gateoverflow.in/40184

Q.10 There are 16 teachers who can teach Thermodynamics (TD), 11 who can teach Electrical Sciences
(ES), and 5 who can teach both TD and Engineering Mechanics (EM). There are a total of 40
teachers. 6 cannot teach any of the three subjects, i.e. EM, ES or TD. 6 can teach only ES. 4 can
teach all three subjects, i.e. EM, ES and TD. 4 can teach ES and TD. How many can teach both ES
and EM but not TD?
(A) 1 (B) 2 (C) 3 (D) 4

gate2015aptiset8 aptitude set-theory&algebra

10.116 GATE2011_GG_GA_4 top gateoverflow.in/40205

If m students require a total of m pages of stationery in m days, then 100 students will require 100
pages of stationery in

(A) 100 days (B) m /100 days (C) 100/m days (D) m days

gate2011_gg numerical-ability

10.117 GATE2014-EC02-GA8 top gateoverflow.in/41516

The sum of eight consecutive odd numbers is 656. The average of four consecutive even numbers is 87. What is the sum of

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 600 of 852

the smallest odd number and second largest even number?

gate2014-ec02 numerical-ability numerical-answers

10.118 gate2013-ce-6 top gateoverflow.in/40274

gate2013-ce numerical-ability

10.119 gate2013-ce-1 top gateoverflow.in/40268

Q.56 A number is as much greater than 75 as it is smaller than 117. The number is:
(A) 91 (B) 93 (C) 89 (D) 96

gate2013-ce numerical-ability

10.120 GATE-2013-AE-GA-8 top gateoverflow.in/40249

Q 64). If 2X + 9 = 3 then the possible value of X X 2 would be:


A). 30

B). 30

C). 42

D). 42

gate2013-ae numerical-ability

10.121 GATE-2013-AE-GA-7 top gateoverflow.in/40248

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 601 of 852

(A) USA and Japan (B) USA and Australia (C) England and France (D) Japan and Australia

gate2013-ae numerical-ability

10.122 gate2013-ce-7 top gateoverflow.in/40275

Q62). If 4X 7 = 5 then the values of 2 X X is:

A). 2, 1
3
1
B). , 3
2
3
C). 2 , 9

2
D). 3 , 9

gate2013-ce

10.123 gate-2014-ae-4 top gateoverflow.in/40303

Q4). If y = 5x2 + 3 , then the tangent at x = 0,y = 3


A). passes through x = 0, y = 0
B). has a slope of +1

C). is parallel to the x-axis

D). has a slope of 1

gate-2014-ae numerical-ability

10.124 GATE2014-EC04-GA10 top gateoverflow.in/41472

A five digit number is formed using the digits 1, 3, 5, 7 and 9 without repeating any of them. What is the sum of all such
possible five digit numbers?

A. 6666660
B. 6666600
C. 6666666
D. 6666606

gate2014-ec04 numerical-ability normal

10.125 gate-2013-ee-2 top gateoverflow.in/40289

Q.57 In the summer of 2012, in New Delhi, the mean temperature of Monday to Wednesday was 41C
and of Tuesday to Thursday was 43C. If the temperature on Thursday was 15% higher than that of

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 602 of 852

Monday, then the temperature in C on Thursday was


(A) 40 (B) 43 (C) 46 (D) 49

gate2013-ee numerical-ability

10.126 gate2013-ce-8 top gateoverflow.in/40276

Q 63). Following table provides figures(in rupees) on annual expenditure of a firm for two years - 2010 and 2011.
Category 2010 2011
Raw material 5200 6240
Power & fuel 7000 9450

Salary & wages 9000 12600


Plant & machinery 20000 25000
Advertising 15000 19500
Research & Developement 22000 26400

In 2011 , which of the two categories have registered increase by same percentage?

A). Raw material and Salary & wages.

B), Salary & wages and Advertising.

C). Power & fuel and Advertising.

D). Raw material and research & Development.

numerical-ability gate2013-ce

10.127 GATE2012-CY-GA-10 top gateoverflow.in/40241

Q.65 Raju has 14 currency notes in his pocket consisting of only Rs. 20 notes and Rs. 10 notes. The total
money value of the notes is Rs. 230. The number of Rs. 10 notes that Raju has is
(A) 5 (B) 6 (C) 9 (D) 10

gate2012-cy aptitude numerical-ability

10.128 GATE2012-CY-GA-9 top gateoverflow.in/40240

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 603 of 852

Q.64 There are eight bags of rice looking alike, seven of which have equal weight and one is slightly
heavier. The weighing balance is of unlimited capacity. Using this balance, the minimum number
of weighings required to identify the heavier bag is
(A) 2 (B) 3 (C) 4 (D) 8

gate2012-cy aptitude numerical-ability

10.129 GATE-2012-AE-9 top gateoverflow.in/40220

Q.64 Two points (4, p) and (0, q) lie on a straight line having a slope of 3/4. The value of ( p q) is
(A) -3 (B) 0 (C) 3 (D) 4

gate2012-ae numerical-ability

10.130 GATE-2012-AE-7 top gateoverflow.in/40218

Q 62). The total runs scored by four cricketers P , Q, R and S in years 2009 and 2010 are given in the following table;

Player 2009 2010


P 802 1008
Q 765 912
R 429 619
S 501 701

The player with the lowest percentage increase in total runs is

A). P

B). Q

C). R

D). S

gate2012-ae aptitude numerical-ability

10.131 gate-2014-ae-10 top gateoverflow.in/40310

The monthly rainfall chart based on 50 years of rainfall in Agra is shown in the following figure.
Which of the following are true? (k percentile is the value such that k percent of the data fall below
that value)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 604 of 852

(i) On average, it rains more in July than in December


(ii) Every year, the amount of rainfall in August is more than that in January
(iii) July rainfall can be estimated with better confidence than February rainfall
(iv) In August, there is at least 500 mm of rainfall
(A) (i) and (ii) (B) (i) and (iii)
(C) (ii) and (iii) (D) (iii) and (iv)

gate-2014-ae numerical-ability

10.132 GATE2012-AR-5 top gateoverflow.in/40226

Ten teams participate in a tournament. Every team plays each of the other teams twice. The total

number of matches to be played is

(A) 20

(B) 45

(C) 60

(D) 90

gate2012-ar aptitude numerical-ability

10.133 GATE2012-AR-6 top gateoverflow.in/40227

Q.61 A value of x that satisfies the equation log x + log (x 7) = log (x + 11) + log 2 is
(A) 1 (B) 2 (C) 7 (D) 11

gate2012-ar aptitude numerical-ability

10.134 GATE2012-CY-GA-8 top gateoverflow.in/40239

The data given in the following table summarizes the monthly budget of an average household.

Category Amount (Rs)


Food 4000
Clothing 1200

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 605 of 852

Rent 2000
Savings 1500
Other expenses 1800

The approximate percentage of the monthly budget NOT spent on savings is

1. 10%
2. 14%
3. 81%
4. 86%

gate2012-cy aptitude numerical-ability

10.135 GATE2012-AR-9 top gateoverflow.in/40230

A smuggler has 10 capsules in which five are filled with narcotic drugs and the rest contain the
original medicine. All the 10 capsules are mixed in a single box, from which the customs officials
picked two capsules at random and tested for the presence of narcotic drugs. The probability that
the smuggler will be caught is

(A) 0.50 (B) 0.67 (C) 0.78 (D) 0.82


gate2012-ar aptitude numerical-ability

10.136 GATE2013-ee-8 top gateoverflow.in/40295

The set of values of p for which the roots of the equation 3x2 + 2x + p(p 1) = 0 are of opposite sign is

(A) (, 0)
(B) (0, 1)
(C) (1, )
(D) (0, )

gate2013-ee numerical-ability

10.137 gate-2014-ae-8 top gateoverflow.in/40308

Q.8 The smallest angle of a triangle is equal to two thirds of the smallest angle of a quadrilateral. The
ratio between the angles of the quadrilateral is 3:4:5:6. The largest angle of the triangle is twice its
smallest angle. What is the sum, in degrees, of the second largest angle of the triangle and the
largest angle of the quadrilateral?

gate-2014-ae numerical-ability

10.138 TIFR-2015-Maths-B-10 top gateoverflow.in/31927

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 606 of 852

How many finite sequences x1 , x2 , . . . , xm are there such that each xi = 1 or 2, and m
i=1 xi = 10 ?

A. 89
B. 91
C. 92
D. 120

tifrmaths2015

10.139 GATE2015-2_GA_6 top gateoverflow.in/8035

If the list of letters, P, R, S, T, U is an arithmetic sequence, which of the following are also in arithmetic sequence?

I. 2P , 2R, 2S, 2T , 2U
II. P 3, R 3, S 3, T 3, U 3
III. P 2 , R2 , S 2 , T 2 , U 2

A. I only
B. I and II
C. II and III
D. I and III

gate2015-2 numerical-ability normal

10.140 GATE2015-2_GA_7 top gateoverflow.in/8036

Four branches of a company are located at M, N, O and P. M is north of N at a distance of 4 km; P is south of O at a distance
of 2 km; N is southeast of O by 1 km. What is the distance between M and P in km?

A. 5.34
B. 6.74
C. 28.5
D. 45.49

gate2015-2 numerical-ability normal

10.141 GATE2015-3_GA_1 top gateoverflow.in/8298

If ROAD is written as URDG, then SWAN should be written as:

A. VXDQ
B. VZDQ
C. VZDP
D. UXDQ

gate2015-3 numerical-ability easy

10.142 GATE2015-2_GA_5 top gateoverflow.in/8033

Based on the given statements, select the most appropriate option to solve the given question.

What will be the total weight of 10 poles each of same weight?

Statements:

I. One fourth of the weight of the pole is 5 Kg.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 607 of 852

II. The total weight of these poles is 160 Kg more than the total weight of two poles.

A. Statement I alone is not sufficient.


B. Statement II alone is not sufficient.
C. Either I or II alone is sufficient.
D. Both statements I and II together are not sufficient.

gate2015-2 numerical-ability normal

10.143 GATE2015-1_GA_6 top gateoverflow.in/8010

The number of students in a class who have answered correctly, wrongly, or not attempted each question in an exam, are
listed in the table below. The marks for each question are also listed. There is no negative or partial marking.

Answered Not
Q No. Marks Answered Wrongly
Correctly Attempted
1 2 21 17 6
2 3 15 27 2
3 1 11 29 4
4 2 23 18 3
5 5 31 12 1

What is the average of the marks obtained by the class in the examination?

A. 2.290
B. 2.970
C. 6.795
D. 8.795

gate2015-1 numerical-ability easy

10.144 GATE2010_64 top gateoverflow.in/2372

5 skilled workers can build a wall in 20 days; 8 semi-skilled workers can build a wall in 25 days; 10 unskilled workers can build a wall in 30
days. If a team has 2 skilled, 6 semi-skilled and 5 unskilled workers, how long it will take to build the wall?

(A) 20 days

(B) 18 days

(C) 16 days

(D) 15 days

gate2010 numerical-ability normal

10.145 GATE2010_65 top gateoverflow.in/2373

Given digits 2, 2, 3, 3, 3, 4, 4, 4, 4 how many distinct 4 digit numbers greater than 3000 can be formed?

(A) 50

(B) 51

(C) 52

(D) 54

gate2010 numerical-ability combinatory normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 608 of 852

10.146 GATE2015-1_GA_4 top gateoverflow.in/8006

Based on the given statements, select the most appropriate option to solve the given question.

If two floors in a certain building are 9 feet apart, how many steps are there in a set of stairs that extends from the first floor
to the second floor of the building?

Statements:

(I) Each step is 3/4 foot high.

(II) Each step is 1 foot wide.

A. Statements I alone is sufficient, but statement II alone is not sufficient.


B. Statements II alone is sufficient, but statement I alone is not sufficient.
C. Both statements together are sufficient, but neither statement alone is sufficient.
D. Statements I and II together are not sufficient.

gate2015-1 numerical-ability easy

10.147 GATE2015-3_GA_5 top gateoverflow.in/8303

A function f(x) is linear and has a value of 29 at x = 2 and 39 at x = 3. Find its value at x = 5.

A. 59
B. 45
C. 43
D. 35

gate2015-3 numerical-ability normal

10.148 GATE2015-3_GA_8 top gateoverflow.in/8385

Choose the most appropriate equation for the function drawn as thick line, in the plot below.

A. x = y |y|
B. x = (y |y|)
C. x = y + |y|
D. x = (y + |y|)

gate2015-3 numerical-ability normal

10.149 TIFR2010-Maths-A-7 top gateoverflow.in/19353

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 609 of 852






The sequence 7, 7 + 7 , 7 + 7 + 7 , . . . . converges to.

1+33
a.
2
1+32
b.
2
1+30
c. 2
1+29
d. 2

tifrmaths2010 numerical-ability

10.150 TIFR2010-Maths-A-12 top gateoverflow.in/19361

The sum of the roots of the equation x5 + 3x2 + 7 = 0 is.


a. 3
b. 3
7
1
c.
7
d. 0

tifrmaths2010

10.151 TIFR2011-A-15 top gateoverflow.in/20226

The exponent of 3 in the product 100! is

a. 27
b. 33
c. 44
d. 48
e. None of the above.

tifr2011

10.152 TIFR2010-Maths-A-3 top gateoverflow.in/19348

The last digit of 280 is..

a. 2
b. 4
c. 6
d. 8

tifrmaths2010 numerical-ability

10.153 TIFR2010-A-20 top gateoverflow.in/18500

How many integers from 1 to 1000 are divisible by 30 but not by 16?

a. 29
b. 31
c. 32
d. 33
e. 25

tifr2010 numerical-ability

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 610 of 852

10.154 TIFR2010-A-1 top gateoverflow.in/18202

A box contains 731 black balls and 2000 white balls. The following process is to be repeated as long as possible. Arbitrarily
select two balls from the box. If they are of the same color, throw them out and put a black ball into the box ( enough extra
black balls are available to do this). If they are of different color, place the white ball back into the box and throw the black
ball away. Which of the following is correct?

1. The process can be applied indefinitely without any prior bound


2. The process will stop with a single white ball in the box
3. The process will stop with a single black ball in the box
4. The process will stop with the box empty
5. None of the above

tifr2010 numerical-ability

10.155 TIFR2010-A-9 top gateoverflow.in/18385

A table contains 287 entries. When anyone of the entries is requested, it is encoded into a binary string and transmitted. The
number of bits required is.

a. 8
b. 9
c. 10
d. Cannot be determined from the given information.
e. None of the above.

tifr2010 numerical-ability

10.156 TIFR2010-A-14 top gateoverflow.in/18393

A marine biologist wanted to estimate the number of fish in a large lake. He threw a net and found 30 fish in the net. He
marked all these fish and released them into the lake. The next morning he again threw the net and these time caught 40
fish, of which two were found to be marked. The (approximate) number of fish in the lake is:

a. 600
b. 1200
c. 68
d. 800
e. 120

tifr2010 numerical-ability

10.157 GATE2010_61 top gateoverflow.in/2369

If 137 + 276 = 435 how much is 731 + 672?

(A) 534

(B) 1403

(C) 1623

(D) 1513

gate2010 numerical-ability normal

10.158 GATE2010_59 top gateoverflow.in/2367

25 persons are in a room. 15 of them play hockey, 17 of them play football and 10 of them play both hockey and football. Then the number of

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 611 of 852

persons playing neither hockey nor football is:

(A) 2

(B) 17

(C) 13

(D) 3

gate2010 numerical-ability easy

10.159 GATE2013_62 top gateoverflow.in/1566

Out of all the 2-digit integers between 1 and 100, a 2-digit number has to be selected at random. What is the probability
that the selected number is not divisible by 7?

(A) 13/90 (B) 12/90 (C) 78/90 (D) 77/90

gate2013 numerical-ability easy

10.160 GATE2013_64 top gateoverflow.in/1568

A tourist covers half of his journey by train at 60 km/h, half of the remainder by bus at 30 km/h and the rest by cycle at 10
km/h. The average speed of the tourist in km/h during his entire journey is

(A) 36 (B) 30 (C) 24 (D) 18

gate2013 numerical-ability easy

10.161 GATE2013_65 top gateoverflow.in/1569

The current erection cost of a structure is Rs. 13,200. If the labour wages per day increase by 1/5 of the current wages and
the working hours decrease by 1/24 of the current period, then the new cost of erection in Rs. is

(A) 16,500 (B) 15,180 (C) 11,000 (D) 10,120

gate2013 numerical-ability normal

10.162 GATE2013_61 top gateoverflow.in/1565

Find the sum of the expression

1 1 1
1 +2
+ 2 +3
+ +. . . . . . . . . . . . + 80 +1 81
3 +4

(A) 7 (B) 8 (C) 9 (D) 10

gate2013 numerical-ability normal

10.163 GATE2013_58 top gateoverflow.in/1562

What will be the maximum sum of 44, 42, 40, ...... ?

(A) 502 (B) 504 (C) 506 (D) 500

gate2013 numerical-ability easy

10.164 GATE2014-1_GA_4 top gateoverflow.in/773

If (z + 1/z) 2 = 98, compute (z 2 + 1/z 2).

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 612 of 852

gate2014-1 numerical-ability easy

10.165 GATE2014-1_GA_8 top gateoverflow.in/776

Round-trip tickets to a tourist destination are eligible for a discount of 10% on the total fare. In addition, groups of 4 or more
get a discount of 5% on the total fare. If the one way single person fare is Rs 100, a group of 5 tourists purchasing round-
trip tickets will be charged Rs __________

gate2014-1 numerical-ability easy

10.166 GATE2014-1_GA_9 top gateoverflow.in/777

In a survey, 300 respondents were asked whether they own a vehicle or not. If yes, they were further asked to mention
whether they own a car or scooter or both. Their responses are tabulated below. What percent of respondents do not own a
scooter?

Men Women

Car 40 34

Own vehicle Scooter 30 20

Both 60 46

Do not own vehicle 20 50

gate2014-1 numerical-ability normal

10.167 GATE2014-2_GA_4 top gateoverflow.in/1941

What is the average of all multiples of 10 from 2 to 198?

(A) 90

(B) 100

(C) 110

(D) 120

gate2014-2 numerical-ability easy

10.168 GATE2014-2_GA_5 top gateoverflow.in/1942













The value of 12 + 12 + 12 + is

(A) 3.464

(B) 3.932

(C) 4.000

(D) 4.444

gate2014-2 numerical-ability easy

10.169 GATE2011_64 top gateoverflow.in/2174

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 613 of 852

A transporter receives the same number of orders each day. Currently, he has some pending orders (backlog) to be shipped. If he uses 7
trucks, then at the end of the 4th day he can clear all the orders. Alternatively, if he uses only 3 trucks, then all the orders are cleared at the
end of the 10th day. What is the minimum number of trucks required so that there will be no pending order at the end of 5th day?

(A) 4

(B) 5

(C) 6

(D) 7

gate2011 numerical-ability normal

10.170 GATE2011_65 top gateoverflow.in/2175

A container originally contains 10 litres of pure spirit. From this container 1 litre of spirit replaced with 1 litre of water. Subsequently, 1 litre of the mixture is again
replaced with 1 litre of water and this process is repeated one more time. How much spirit is now left in the container?

(A) 7.58 litres

(B) 7.84 litres

(C) 7 litres

(D) 7.29 litres

gate2011 numerical-ability normal

10.171 GATE2012_62 top gateoverflow.in/2210

A political party orders an arch for the entrance to the ground in which the annual convention is being held. The profile of
the arch follows the equation y = 2x 0.1x2 where y is the height of the arch in meters. The maximum possible height of
the arch is

(A) 8 meters
(B) 10 meters
(C) 12 meters
(D) 14 meters

gate2012 numerical-ability normal

10.172 GATE2011_57 top gateoverflow.in/2166

If log(P) = (1/2) log(Q) = (1/3) log(R), then which of the following options is TRUE?

(A) P2 = Q3 R2
2
(B) Q = PR
2
(C) Q = R3 P
2
(D) R = P2 Q

gate2011 numerical-ability normal

10.173 GATE2014-3_GA_8 top gateoverflow.in/2032

The Gross Domestic Product (GDP) in Rupees grew at 7% during 2012-2013. For international comparison, the GDP is compared in US Dollars (USD) after
conversion based on the market exchange rate. During the period 2012-2013 the exchange rate for the USD increased from Rs. 50/ USD to Rs. 60/ USD. India's
GDP in USD during the period 2012-2013

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 614 of 852

(A) increased by 5 %

(B) decreased by 13%

(C) decreased by 20%

(D) decreased by 11%

gate2014-3 numerical-ability normal

10.174 GATE2014-2_GA_8 top gateoverflow.in/1950

If x is real and x2 2x + 3 = 11, then possible values of x3 + x2 x include

(A) 2, 4

(B) 2, 14

(C) 4, 52

(D) 14, 52

gate2014-2 numerical-ability normal

10.175 GATE2014-2_GA_10 top gateoverflow.in/1952

At what time between 6 a. m. and 7 a. m. will the minute hand and hour hand of a clock make an angle closest to 60?

(A) 6: 22 a.m.

(B) 6: 27 a.m.

(C) 6: 38 a.m.

(D) 6: 45 a.m.

gate2014-2 numerical-ability normal

10.176 GATE2014-3_GA_5 top gateoverflow.in/2028

The table below has question-wise data on the performance of students in an examination. The marks for each question are
also listed. There is no negative or partial marking in the examination.

Q Answered Answered Not


Marks
No. Correctly Wrongly Attempted
1 2 21 17 6
2 3 15 27 2
3 2 23 18 3

What is the average of the marks obtained by the class in the examination?

(A) 1.34

(B) 1.74

(C) 3.02

(D) 3.91

gate2014-3 numerical-ability normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 615 of 852

10.177 TIFR2011-A-20 top gateoverflow.in/20260

Let n > 1 be an odd integer. The number of zeros at the end of the number 99n + 1 is.
a. 1
b. 2
c. 3
d. 4
e. None of the above.

tifr2011 numerical-ability

10.178 TIFR2012-A-18 top gateoverflow.in/25043

A large community practices birth control in the following peculiar fashion. Each set of parents continues having children until
a son is born; then they stop. What is the ratio of boys to girls in the community if, in the absence of birth control, 51% of
the babies are born male?

a. 51 : 49
b. 1 : 1
c. 49 : 51
d. 51 : 98
e. 98 : 51

tifr2012 numerical-ability

10.179 GATE 2015 Aptitude Set 1 Q4 top gateoverflow.in/39492

gate2015 gate2015aptiset1 aptitude

10.180 GATE 2015 Aptitude Set 1 Q5 top gateoverflow.in/39493

Q.5 If log x (5/7) = 1/3, then the value of x is


(A) 343/125
(B) 125/343
(C) 25/49
(D) 49/25

gate2015 gate2015aptiset1 aptitude

10.181 GATE 2015 Aptitude Set 1 Q9 top gateoverflow.in/39496

Q.9 A cube of side 3 units is formed using a set of smaller cubes of side 1 unit. Find the proportion of
the number of faces of the smaller cubes visible to those which are NOT visible.
(A) 1 : 4 (B) 1 : 3 (C) 1 : 2 (D) 2 : 3

gate2015 gate2015aptiset1 aptitude

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 616 of 852

10.182 GATE 2015 Aptitude Set 4 top gateoverflow.in/39190

aptitude numerical-ability

10.183 GATE 2015 EC_S03 Q 4 top gateoverflow.in/39081

Q.4 Find the missing sequence in the letter series below:


A, CD, GHI, ?, UVWXY
(A) LMN (B) MNO (C) MNOP (D) NOPQ

aptitude

10.184 GATE2014-1_GA_5 top gateoverflow.in/770

The roots of ax2 +bx+c=0 are real and positive. a , b and c are real. Then ax2 +b|x|+c=0 has

A. no roots

B. 2 real roots

C. 3 real roots

D. 4 real roots

gate2014-1 numerical-ability normal

10.185 GATECE-2011 top gateoverflow.in/36295

Q.64

A firm is selling its product at Rs. 60 per unit. The total cost of production is Rs. 100 and firm is earning total profit of Rs.
500. Later, the total cost increased by 30%. By what percentage should the price be increased to maintained the same profit
level?

A. 5
B. 10
C. 15
D. 30

Here what does PROFIT LEVEL mean? Also, answer the question.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 617 of 852

gatece-2011 numerical-ability

10.186 GATE 2015 Aptitude top gateoverflow.in/38928

Q.7 Given below are two statements followed by two conclusions. Assuming these statements to be
true, decide which one logically follows.
Statements:
I. All film stars are playback singers.
II. All film directors are film stars.
Conclusions:
I. All film directors are playback singers.
II. Some film stars are film directors.
(A) Only conclusion I follows.
(B) Only conclusion II follows.
(C) Neither conclusion I nor II follows.
(D) Both conclusions I and II follow.

Here official GATE 2015 key says that (D) is answer and both conclusions follows.

I) is true, because if any film director is present, then statement is true. If there is no film director present, still statement is
True.

II) Need not be true, because what if domain of Film directors is empty ? What if there is no film director at all ? Then how
can statement II) is true ?

aptitude

10.187 GATE 2015 Aptitude Set 2 Q4 top gateoverflow.in/39505

Q.4 An electric bus has onboard instruments that report the total electricity consumed since the start of
the trip as well as the total distance covered. During a single day of operation, the bus travels on
stretches M, N, O, and P, in that order. The cumulative distances travelled and the corresponding
electricity consumption are shown in the Table below:

Cumulative distance Electricity used


Stretch
(km) (kWh)
M 20 12
N 45 25
O 75 45
P 100 57

M 20 12
N 45 25
O 75 45
P 100 57

The stretch where the electricity consumption per km is minimum is


(A) M (B) N (C) O (D) P

gate2015 gate2015aptiset2 aptitude

10.188 GATE 2015 Aptitude Set 2 Q 5 top gateoverflow.in/39506

Q.5 Ram and Ramesh appeared in an interview for two vacancies in the same department. The
probability of Rams selection is 1/6 and that of Ramesh is 1/8. What is the probability that only
one of them will be selected?
(A) 47/48
(B) 1/4
(C) 13/48

gate2015 gate2015aptiset2 aptitude

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 618 of 852

10.189 GATE 2015 Aptitude Set 3 Q8 top gateoverflow.in/39521

Q.8 From a circular sheet of paper of radius 30 cm, a sector of 10% area is removed. If the remaining
part is used to make a conical surface, then the ratio of the radius and height of the cone is _____

gate2015aptiset3 gate2015 aptitude

10.190 GATE 2015 Aptitude Set 3 Q9 top gateoverflow.in/39522

Q.9 log tan 1 o + log tan 2 o + ..+ log tan 89 o is.


(A) 1 (B) 1/2 (C) 0 (D) 1

gate2015aptiset3 gate2015 aptitude

10.191 GATE 2016-2-GA-09 top gateoverflow.in/39537

In a 2 4 rectangle grid shown below, each cell is rectangle. How many rectangles can be observed in the grid?

A. 21
B. 27
C. 30
D. 36

gate2016-2 numerical-ability normal

10.192 GATE 2015 Aptitude Set 3 Q7 top gateoverflow.in/39520

Q.7 In the following question, the first and the last sentence of the passage are in order and numbered 1
and 6. The rest of the passage is split into 4 parts and numbered as 2, 3, 4, and 5. These 4 parts are
not arranged in proper order. Read the sentences and arrange them in a logical sequence to make a
passage and choose the correct sequence from the given options.
1. On Diwali, the family rises early in the morning.
2. The whole family, including the young and the old enjoy doing this.
3. Children let off fireworks later in the night with their friends.
4. At sunset, the lamps are lit and the family performs various rituals.
5. Father, mother, and children visit relatives and exchange gifts and sweets.
6. Houses look so pretty with lighted lamps all around.
(A) 2,5,3,4 (B) 5,2,4,3 (C) 3,5,4,2 (D) 4,5,2,3

gate2015aptiset3 gate2015 aptitude

10.193 GATE 2015 Aptitude Set 3 Q5 top gateoverflow.in/39518

Q.5 If x > y > 1, which of the following must be true?


i. ln x > ln y ii. ex > ey iii. yx > xy iv. cos x > cos y

(A) (i) and (ii) (B) (i) and (iii)


(C) (iii) and (iv) (D) (ii) and (iv)

gate2015aptiset3 gate2015 aptitude

10.194 GATE 2015 Aptitude Set 2 Q 8 top gateoverflow.in/39509

Q.8 A tiger is 50 leaps of its own behind a deer. The tiger takes 5 leaps per minute to the deers 4. If the

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 619 of 852

tiger and the deer cover 8 metre and 5metre per leap respectively, what distance in metres will the
tiger have to run before it catches the deer?

gate2015 gate2015aptiset2 aptitude

10.195 GATE 2015 Aptitude Set 2 Q9 top gateoverflow.in/39510

Q.9 If a 2 + b 2 + c2 = 1, then ab + bc + ac lies in the interval


(A) [1, 2/3]
(B) [1/2, 1]
(C) [1, 1/2]
(D) [2, 4]

gate2015 gate2015aptiset2 aptitude

10.196 GATE 2015 Aptitude Set 3 Q4 top gateoverflow.in/39517

Q.4 Find the missing sequence in the letter series below:


A, CD, GHI, ?, UVWXY
(A) LMN (B) MNO (C) MNOP (D) NOPQ

gate2015aptiset3 gate2015 aptitude

10.197 GATE_2011_MN_65 top gateoverflow.in/31545

Q.65

Nimbus clouds are dark and ragged, stratus clouds appear dull in colour and cover the entire
sky. Cirrus clouds are thin and delicate, whereas cumulus clouds look like cotton balls.

It can be inferred from the passage that


(A) A cumulus cloud on the ground is called fog
(B) It is easy to predict the weather by studying clouds
(C) Clouds are generally of very different shapes, sizes and mass
(D) There are four basic cloud types: stratus, nimbus, cumulus and cirrus

gate2011-mn verbal-ability

10.198 GATE_2011_MN_63 top gateoverflow.in/31543

L, M and N are waiting in a queue meant for children to enter the zoo. There are 5 children between L and M, and 8 children
between M and N. If there are 3 children ahead of N and 21 children behind L, then what is the minimum number of children
in the queue?

(A) 28 (B) 27 (C) 41 (D) 40

numerical-ability gate2011-mn

10.199 TIFR2014-A-4 top gateoverflow.in/25989

Consider numbers greater than one that satisfy the following properties:

(a) They have no repeated prime factors;

(b) For all primes p 2, p divides the number if and only if p 1 divides the number.
The number of such numbers is

a. 0.
b. 5.
100

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 620 of 852

c. 100.
d. Infinite.
e. None of the above.

tifr2014 numerical-ability difficult

10.200 TIFR2014-A-14 top gateoverflow.in/26392

Let m and n be any two positive integers. Then, which of the following is FALSE?

a. m + 1 divides m2n 1.
b. For any prime p, mp m (mod p).
c. If one of m , n is prime, then there are integers x, y such that mx + ny = 1.
d. If m < n, then m! divides n(n 1)(n 2) (n m + 1).
e. If 2n 1 is prime, then n is prime.

tifr2014 numerical-ability

10.201 TIFR2015-A-3 top gateoverflow.in/29159

< 1. Define Mn (z) = 10 10 n (i1)


Let |z| i=1 z ? what is

i=0 Mi (z) = M0 (z) M1 (z) M2 (z). . . ?
A. Can't be determined.
B. 1/(1 z)
C. 1/(1 + z)
D. 1 z 9
E. None of the above.

tifr2015

10.202 TIFR2013-B-9 top gateoverflow.in/25675

Suppose n straight lines are drawn on a plane. When these lines are removed, the plane falls apart into several connected
components called regions. A region R is said to be convex if it has the following property: whenever two points are in R,
then the entire line segment joining them is in R. Suppose no two of the n lines are parallel. Which of the following is true?

a. O(n) regions are produced, and each region is convex.


b. O(n2 ) regions are produced but they need not all be convex.
c. O(n2 ) regions are produced, and each region is convex.
d. O(n log n) regions are produced, but they need not all be convex.
e. All regions are convex but there may be exponentially many of them.

tifr2013 numerical-ability

10.203 TIFR2013-B-2 top gateoverflow.in/25657

Consider polynomials in a single variable x of degree d. Suppose d < n/2. For such a polynomial p(x), let Cp denote the n-
tuple (P (i))1in . For any two such distinct polynomials p, q, the number of coordinates where the tuples Cp , Cq differ is.

A. At most d
B. At most n d
C. Between d and n d
D. At least n d
E. None of the above.

tifr2013

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 621 of 852

10.204 TIFR2013-A-1 top gateoverflow.in/25382

An infinite two-dimensional pattern is indicated below.

The smallest closed figure made by the lines is called a unit triangle. Within every unit triangle, there is a mouse. At every
vertex there is a laddoo. What is the average number of laddoos per mouse?

a. 3
b. 2
c. 1
d. 1
2
1
e. 3

tifr2013 numerical-ability

10.205 TIFR2013-A-10 top gateoverflow.in/25432

Three men and three rakhsasas arrive together at a ferry crossing to find a boat with an oar, but no boatman. The boat can
carry one or at the most two persons, for example, one man and one rakhsasas, and each man or rakhsasas can row. But if
at any time, on any bank, (including those who maybe are in the boat as it touches the bank) rakhsasas outnumber men,
the former will eat up the latter. If all have to go to the other side without any mishap, what is the minimum number of
times that the boat must cross the river?

a. 7
b. 9
c. 11
d. 13
e. 15

tifr2013 numerical-ability

10.206 TIFR2013-A-12 top gateoverflow.in/25434

Among numbers 1 to 1000 how many are divisible by 3 or 7?

a. 333
b. 142
c. 475
d. 428
e. None of the above.

tifr2013 numerical-ability

10.207 TIFR2015-A-13 top gateoverflow.in/29586

Imagine the first quadrant of the real plane as consisting of unit squares. A typical square has 4 corners:
(i, j), (i + 1, j), (i + 1, j + 1),a n d (i, j + 1), where (i, j) is a pair of non-negative integers. Suppose a line segment l
connecting (0, 0) to (90, 1100) is drawn. We say that l passes through a unit square if it passes through a point in the
interior of the square. How many unit squares does l pass through?

a. 98, 990
9, 900

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 622 of 852
98, 990
b. 9, 900
c. 1, 190
d. 1, 180
e. 1, 010

tifr2015 numerical-ability

10.208 TIFR2015-B-12 top gateoverflow.in/30046

Let tn be the sum of the first n natural numbers, for n > 0. A number is called triangular if it is equal to tn for some n.
Which of the following statements are true:

(i) There exists three successive triangular numbers whose product is a perfect square.

(ii) If the triangular number tn is a perfect square, then so is t4n(n+1) .

(iii) The sum of the reciprocals of the first n triangular numbers is less than 2, i.e.
1 1
1 + 3
+ 16 +. . . . + t1n < 2

a. (i) only.
b. (ii) only.
c. (iii) only.
d. All of the above.
e. None of the above.

tifr2015 numerical-ability normal

10.209 GATE_MN_2011_59 top gateoverflow.in/31531

Q.59

In how many ways 3 scholarships can be awarded to 4 applicants, when each applicant can receive
any number of scholarships?

(A) 4 (B) 12 (C) 64 (D) 81


numerical-ability gate2011-mn

10.210 GATE_MN_2011_61 top gateoverflow.in/31536

Q.61

If (2y+1)/(y+2) < 1, then which of the following alternatives gives the CORRECT range of y?

(A) - 2 < y < 2

(B) - 2 < y < 1

(C) - 3 < y < 1

(D) - 4 < y < 1

numerical-ability gate2011-mn

10.211 GATE_2011_MN_62 top gateoverflow.in/31540

Q.62

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 623 of 852

A student attempted to solve a quadratic equation in x twice. However, in the first attempt, he
incorrectly wrote the constant term and ended up with the roots as (4, 3). In the second attempt, he
incorrectly wrote down the coefficient of x and got the roots as (3, 2). Based on the above
information, the roots of the correct quadratic equation are

(A) (-3, 4)

(B) (3, -4)

(C) (6, 1)

(D) (4, 2)

numerical-ability gate2011-mn

10.212 GATE_IN_61 top gateoverflow.in/31386

gate-in-2011 gate2011-in numerical-ability

10.213 TIFR-2014-Maths-A-20 top gateoverflow.in/31302

3
Let C denote the cube [1, 1] R3 . How many rotations are there in R3 which take C to itself?
a. 6
b. 12
c. 18
d. 24.

tifrmaths2014

10.214 GATE IN 2011-56 top gateoverflow.in/31267

56. There are two candidates P and Q in an election. During the campaign, 40% of the voters promised to vote for P, and
rest for Q. However, on the day of election 15% of the voters went back on their promise to vote for P and instead voted for
Q. 25% of the voters went back on their promise to vote for Q and instead voted for P. Suppose, P lost by 2 votes, then

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 624 of 852

what was the total number of voters? (A) 100 (B) 110 (C) 90 (D) 95

gate-in-2011 numerical-ability

10.215 GATE IN 2011-65 top gateoverflow.in/31281

65. Three friends, R, S and T shared toffee from a bowl. R took l/3 rd of the toffees, but
returned four to the bowl. S took l/4 th of what was left but returned three toffees to the
bowl. T took half of the remainder but returned two back into the bowl. If the bowl had
17 toffees left, how many toffees were originally there in the bowl?
(A) 38 (B) 31 (C) 48 (D) 41

gate-in-2011 numerical-ability

10.216 GATE 2015 Aptitude Set 4 Q5 top gateoverflow.in/40170

Q.5 Five teams have to compete in a league, with every team playing every other team exactly once,
before going to the next round. How many matches will have to be held to complete the league
round of matches?
(A) 20 (B) 10 (C) 8 (D) 5

gate2015aptiset4 aptitude numerical-ability

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 625 of 852

11 Mathematical Logic top


11.1 Boolean Expressions: GATE2014-2_53 top gateoverflow.in/2020

Which one of the following Boolean expressions is NOT a tautology?

(A) (( a b ) ( b c)) ( a c)

(B) ( a c ) ( b (a c))

(C) ( a b c) ( c a)

(D) a (b a)

gate2014-2 mathematical-logic boolean-expressions normal

11.2 Canonical Normal Form: GATE1995_13 top gateoverflow.in/2649

Obtain the principal (canonical) conjunctive normal form of the propositional formula

(p q) (q r)

where is logical and, is inclusive or and is negation.

gate1995 mathematical-logic canonical-normal-form normal

11.3 Differentiability: GATE2014-1_6 top gateoverflow.in/1763

Let the function

sin cos tan



f() = sin( 6 ) cos( 6 ) tan( 6 )

sin( 3 ) cos( 3 ) tan( 3 )

where

[ 6 , 3 ] and f () denote the derivative of f with respect to . Which of the following statements is/are TRUE?

(I) There exists ( , ) such that f () =0


6 3

(II) There exists ( , ) such that f ()



6 3
0

(A) I only

(B) II only

(C) Both I and II

(D) Neither I Nor II

gate2014-1 calculus differentiability normal

11.4 First Order Logic: GATE2008-IT_21 top gateoverflow.in/3282

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 626 of 852

Which of the following first order formulae is logically valid? Here (x) is a first order formula with x as a free variable, and
is a first order formula with no free variable.
A. [ (x, (x))] [x, (x)]
B. [x, (x)] [ (x, (x))]
C. [(x, (x)) ] [x, (x) ]
D. [(x, (x)) ] [x, (x) ]

gate2008-it first-order-logic normal

11.5 First Order Logic: TIFR2012-B-3 top gateoverflow.in/25048

For a person p, let w(p), A(p, y), L(p) and J(p) denote that p is a woman, p admires y, p is a lawyer and p is a judge
respectively. Which of the following is the correct translation in first order logic of the sentence: "All woman who are lawyers
admire some judge"?

a. x : [(w (x) L (x)) (y : (J (y) w (y) A (x, y)))]


b. x : [(w (x) L (x)) (y : (J (y) A (x, y)))]
c. xy : [(w (x) L (x)) (J (y) A (x, y))]
d. yx : [(w (x) L (x)) (J (y) A (x, y))]
e. x : [(w (x) L (x)) (y : (J (y) A (x, y)))]

tifr2012 mathematical-logic first-order-logic

11.6 First Order Logic: GATE2016-2-27 top gateoverflow.in/39618

Which one of the following well-formed formulae in predicate calculus is NOT valid ?

A. (xp(x) xq(x)) (xp(x) xq(x))


B. (xp(x) xq(x)) x(p(x) q(x))
C. x(p(x) q(x)) (xp(x) xq(x))
D. x(p(x) q(x)) (xp(x) xq(x))

gate2016-2 mathematical-logic first-order-logic normal

11.7 First Order Logic: TIFR2010-A-8 top gateoverflow.in/18239

Which of the following is NOT necessarily true? { Notation: The symbol '' ''notes negation; P (x, y) means that for given x
and y, the property P (x, y) is true }.

a. (xyP (x, y)) (yxP (x, y))


b. (xyP (x, y)) (xyP (x, y))
c. (xyP (x, y)) (yxP (x, y))
d. (xyP (x, y)) (yxP (x, y))
e. (xyP (x, y)) (yxP (x, y))

tifr2010 mathematical-logic first-order-logic

11.8 Logical Reasoning: TIFR2010-A-4 top gateoverflow.in/18212

If the bank receipt is forged, then Mr. M is liable. If Mr. M is liable, he will go bankrupt. If the bank will loan him money, he
will not go bankrupt. The bank will loan him money.

Which of the following can be concluded from the above statements?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 627 of 852

a. Mr. M is liable
b. The receipt is not forged
c. Mr. M will go bankrupt
d. The bank will go bankrupt
e. None of the above

tifr2010 logical-reasoning mathematical-logic

11.9 GATE1996_2.3 top gateoverflow.in/2732

Which of the following is false? Read as AND, as OR, as NOT, as one way implication and as two way
implication

A. ((x y) x) y
B. (( x y) ( x y)) x
C. (x (x y))
D. ((x y) ( x y))

gate1996 mathematical-logic normal

11.10 GATE2008-IT_22 top gateoverflow.in/3283

Which of the following is the negation of [ x, (y, ( u, v, y))]

A. [ x, (y, (u, v, y))]


B. [ x, (y, (u, v, y))]
C. [ x, (y, (u, v, y))]
D. [ x, (y, (u, v, y))]

gate2008-it mathematical-logic normal

11.11 GATE2006-IT_21 top gateoverflow.in/3560

Consider the following first order logic formula in which R is a binary relation symbol.

xy (R(x, y) => R(y, x))

The formula is

A) satisfiable and valid


B) satisfiable and so is its negation
C) unsatisfiable but its negation is valid
D) satisfiable but its negation is unsatisfiable

gate2006-it mathematical-logic normal

11.12 GATE2007-IT_21 top gateoverflow.in/3454

Which one of these first-order logic formulae is valid?

A) x(P(x) => Q(x)) => (xP(x) => xQ(x))


B) x(P(x) Q(x)) => (xP(x) => xQ(x))

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 628 of 852

C) x(P(x) Q(x)) <=> (xP(x) xQ(x))


D) xy P(x, y) => yx P(x, y)

gate2007-it mathematical-logic normal

11.13 GATE1994_3.13 top gateoverflow.in/2499

Let p and q be propositions. Using only the Truth Table, decide whether

p q does not imply p q


is True or False.

gate1994 mathematical-logic normal

11.14 GATE1997_3.2 top gateoverflow.in/2233

Which of the following propositions is a tautology?

A. (p q) p
B. p (q p)
C. p (p q)
D. p (p q)

gate1997 mathematical-logic easy

11.15 GATE2011_30 top gateoverflow.in/2132

Which one of the following options is CORRECT given three positive integers x, y and z, and a predicate

P (x) = (x = 1) y (z (x = y z) (y = x) (y = 1))

(A) P(x) being true means that x is a prime number

(B) P(x) being true means that x is a number other than 1

(C) P(x) is always true irrespective of the value of x

(D) P(x) being true means that x has exactly two factors other than 1 and x

gate2011 mathematical-logic normal

11.16 GATE1993_8.2 top gateoverflow.in/2300

The proposition p ( p q) is:


A. a tautology

B. logically equivalent to p q

C. logically equivalent to p q

D. a contradiction

E. none of the above

gate1993 mathematical-logic easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 629 of 852

11.17 GATE1993_18 top gateoverflow.in/2315

Show that proposition C is a logical consequence of the formula

A (A (B C)) (B A)

using truth tables.

gate1993 mathematical-logic normal

11.18 GATE2004-IT_3 top gateoverflow.in/3644

Let a(x, y), b(x, y, ) and c(x, y) be three statements with variables x and y chosen from some universe. Consider the
following statement:

(x)(y)[(a(x, y) b(x, y)) c(x, y)]


Which one of the following is its equivalent?

A) (x)(y)[(a(x, y) b(x, y)) c(x, y)]


B) (x)(y)[(a(x, y) b(x, y)) c(x, y)]
C) (x)(y)[(a(x, y) b(x, y)) c(x, y)]
D) (x)(y)[(a(x, y) b(x, y)) c(x, y)]

gate2004-it mathematical-logic normal

11.19 GATE1995_2.19 top gateoverflow.in/2631

If the proposition p v is true, then the truth value of the proposition p (p q), where is negation, is inclusive
OR and is implication, is

a) True
b) Multiple Values
c) False
d) Cannot be determined

gate1995 mathematical-logic normal

11.20 GATE2002_5b top gateoverflow.in/3915

Determine whether each of the following is a tautology, a contradiction, or neither (" " is disjunction, " " is conjunction, "
" is implication, " " is negation, and " " is biconditional (if and only if).

A. A (A A)
B. (A B) B
C. A ((A B))

gate2002 mathematical-logic easy

11.21 TIFR2012-A-3 top gateoverflow.in/20981

Long ago,in a planet far far away, there lived three races of intelligent inhabitants: the blues (who always tell the truth), the
whites (who always lie), and the pinks (who, when asked a series of questions, start with a lie and then tell the truth and lie
alternately). To three creatures, chosen from the planet and seated facing each other at A, B, and C (see figure), the
following three questions are put:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 630 of 852

(i) What race is your left-hand neighbour?

(ii) What race is your right-hand neighbour?

(iii) What race are you?

Here are their answers:

(A) (i) White (ii) Pink (iii) Blue

(B) (i) Pink (ii) Pink (iii) Blue

(C) (i) White (ii) Blue (iii) Blue

What is the actual race of each of the three creatures?

a. A is Pink, B is White, C is Blue.


b. A is Blue, B is Pink, C is White.
c. A is Pink, B is Blue, C is Pink.
d. A is White, B is Pink, C is Blue.
e. Cannot be determined from the above data.

tifr2012 mathematical-logic

11.22 TIFR2012-A-2 top gateoverflow.in/20939

I f Mr. M is guilty, then no witness is lying unless he is afraid. There is a witness who is afraid. Which of the following
statements is true?

(Hint: Formulate the problem using the following predicates

G Mr. M is guilty
W (x) x is a witness
L(x) x is lying
A(x) x is afraid )
a. Mr. M is guilty.
b. Mr. M is not guilty.
c. From these facts one cannot conclude that Mr. M is guilty.
d. There is a witness who is lying.
e. No witness is lying.

tifr2012 mathematical-logic

11.23 TIFR2014-A-8 top gateoverflow.in/25994

All that glitters is gold. No gold is silver.

Claims:

(1) No silver glitters.

(2) Some gold glitters.

Then, which of the following is TRUE?

a. Only claim 1 follows.


b. Only claim 2 follows.
c. Either claim 1 or claim 2 follows but not both.
1 2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 631 of 852

d. Neither claim 1 nor claim 2 follows.


e. Both claim 1 and claim 2 follow.

tifr2014 mathematical-logic

11.24 GATE1991-15,b top gateoverflow.in/26748

(b)

Consider the following first order formula:

xy : R(x, y)







xy : (R(x, y) R(y, x))








xyz : (R(x, y) R(y, z) R(x, z))







x : R(x, x)

Does it have finite models?

Is it satisfiable? If so, give a countable model for it.

gate1991

11.25 GATE 2016-2-01 top gateoverflow.in/39568

Consider the following expressions:

i. false
ii. Q
iii. true
iv. P Q
v. Q P

The number of expressions given above that are logically implied by P (P Q) is ___________.

gate2016-2 mathematical-logic normal numerical-answers

11.26 TIFR2015-A-5 top gateoverflow.in/29454

What is logically equivalent to "If Kareena and Parineeti go to the shopping mall then it is raining":

a. If Kareena and Parineeti do not go to the shopping mall then it is not raining.
b. If Kareena and Parineeti do not go to the shopping mall then it is raining.
c. If it is raining then Kareena and Parineeti go to the shopping mall.
d. If it is not raining then Kareena and Parineeti do not go to the shopping mall.
e. None of the above.

tifr2015 mathematical-logic

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 632 of 852

11.27 TIFR2011-A-12 top gateoverflow.in/20221

The action for this problem takes place in an island of Knights and Knaves, where Knights always make true statements and
Knaves always make false statements and everybody is either a Knight or a Knave. Two friends A and B lives in a house. The
census taker (an outsider) knocks on the door and it is opened by A. The census taker says ''I need information about you
and your friend. Which if either is a Knight and which if either is a Knave?". "We are both Knaves" says A angrily and slams
the door. What, if any thing can the census taker conclude?

a. A is a Knight and B is a Knave.


b. A is a Knave and B is a Knight.
c. Both are Knaves.
d. Both are Knights.
e. No conclusion can be drawn.

tifr2011 mathematical-logic

11.28 GATE2015-3_24 top gateoverflow.in/8427

In a room there are only two types of people, namely Type 1 and Type 2. Type 1 people always tell the truth and Type 2
people always lie. You give a fair coin to a person in that room, without knowing which type he is from and tell him to toss it
and hide the result from you till you ask for it. Upon asking the person replies the following

"The result of the toss is head if and only if I am telling the truth"

Which of the following options is correct?

A. The result is head


B. The result is tail
C. If the person is of Type 2, then the result is tail
D. If the person is of Type 1, then the result is tail

gate2015-3 mathematical-logic difficult

11.29 GATE2014-3_53 top gateoverflow.in/2087

The CORRECT formula for the sentence, "not all Rainy days are Cold" is

(A) d(Rainy(d) ~Cold(d))

(B) d(~Rainy(d) Cold(d))

(C) d(~Rainy(d) Cold(d))

(D) (Rainy(d) ~Cold(d))

gate2014-3 mathematical-logic easy

11.30 GATE2005-IT_36 top gateoverflow.in/3783

Let P(x) and Q(x) be arbitrary predicates. Which of the following statements is always TRUE?

A. ((x (P (x) Q (x)))) ((xP (x)) (xQ (x)))


B. (x (P (x) Q (x))) ((xP (x)) (xQ (x)))
C. (x (P (x)) x (Q (x))) (x (P (x) Q (x)))
D. (x (P (x)) (x (Q (x)))) (x (P (x) Q (x)))

gate2005-it mathematical-logic normal

11.31 GATE2015-2_3 top gateoverflow.in/8049

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 633 of 852

Consider the following two statements.

S1: If a candidate is known to be corrupt, then he will not be elected

S2: If a candidate is kind, he will be elected

Which one of the following statements follows from S1 and S2 as per sound inference rules of logic?

A. If a person is known to be corrupt, he is kind


B. If a person is not known to be corrupt, he is not kind
C. If a person is kind, he is not known to be corrupt
D. If a person is not kind, he is not known to be corrupt

gate2015-2 mathematical-logic normal

11.32 GATE2015-1_14 top gateoverflow.in/8209

Which one of the following is NOT equivalent to p q?

A. (p q) (p q)
B. (p q) (q p)
C. (p q) ( p q)
D. (p q) (p q)

gate2015-1 mathematical-logic easy

11.33 GATE2015-2_55 top gateoverflow.in/8259

Which one of the following well formed formulae is a tautology?

A. x y R(x, y) y x R(x, y)
B. (x [y R(x, y) S(x, y)]) x y S(x, y)
C. [x y (P (x, y) R(x, y))] [x y (P (x, y) R(x, y))]
D. x y P (x, y) x y P (y, x)

gate2015-2 mathematical-logic normal

11.34 GATE2004-IT_31 top gateoverflow.in/3674

Let p, q, r and s be four primitive statements. Consider the following arguments:

P: [(p v q) (r s) (p v r)] (s q)
Q: [(p q) [q (p r)]] r
R: [[(q r) p] (q v p)] r
S: [p (p r] (q v r)] q

Which of the above arguments are valid?

1) P and Q only
2) P and R only
3) P and S only
4) P, Q, R and S

gate2004-it mathematical-logic normal

11.35 GATE2012_1 top gateoverflow.in/33

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 634 of 852

Consider the following logical inferences.


I1 : If it rains then the cricket match will not be played.


The cricket match was played.
Inference: There was no rain.
I2 : If it rains then the cricket match will not be played.
It did not rain.
Inference: The cricket match was played.

Which of the following is TRUE?



(A) Both I1 and I2 are correct inferences
(B) I1 is correct but I2 is not a correct inference
(C) I1 is not correct but I2 is a correct inference
(D) Both I1 and I2 are not correct inferences

gate2012 mathematical-logic easy

11.36 GATE2014-1_1 top gateoverflow.in/769

Consider the statement

"Not all that glitters is gold

Predicate glitters(x) is true if x glitters and predicate gold (x) is true if x is gold. Which one of the following logical formulae
represents the above statement?

(A) x : glitters(x) gold(x)


(B) x : gold(x) glitters(x)
(C) x : gold(x) glitters(x)
(D) x : glitters(x) gold(x)

gate2014-1 mathematical-logic

11.37 GATE2001_1.3 top gateoverflow.in/696

Consider two well-formed formulas in propositional logic

F 1 : P P F 2 : (P P ) (P P )

Which one of the following statements is correct?

(A) F1 is satisfiable, F2 is valid

(B) F1 unsatisfiable, F2 is satisfiable

(C) F1 is unsatisfiable, F2 is valid

(D) F1 and F2 are both satisfiable

gate2001 mathematical-logic easy

11.38 GATE2000_2.7 top gateoverflow.in/654

Let a, b, c, d be propositions. Assume that the equivalence a ( b V- b) and b c hold. Then the truth-value of the formula (a b) (a
c) d is always

a. True
b. False
c. Same as the truth-value of b
d. Same as the truth-value of d

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 635 of 852

gate2000 mathematical-logic normal

11.39 GATE2009_23 top gateoverflow.in/800

Which one of the following is the most appropriate logical formula to represent the statement?

"Gold and silver ornaments are precious".


The following notations are used:

G(x) : x is a gold ornament


S(x) : x is a silver ornament
P (x) : x is precious

(A) x(P (x) (G(x) S(x)))

(B) x((G(x) S(x)) P (x))

(C) x((G(x) S(x)) P (x))

(D) x((G(x) S(x)) P (x))

gate2009 mathematical-logic easy

11.40 GATE2009_24 top gateoverflow.in/801

The binary operation is defined as follows

P Q P
Q
T T T
T F T
F T F
F F T

Which one of the following is equivalent to P Q?


(A) Q P

(B) P Q
(C) P Q

(D) P Q

gate2009 mathematical-logic easy

11.41 GATE2002_1.8 top gateoverflow.in/812

"If X then Y unless Z" is represented by which of the following formulas in prepositional logic? (" " is negation, " " is
conjunction, and "" is implication)

A. (X Z) Y
B. (X Y ) Z
C. X (Y Z)
(X Y ) Z

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 636 of 852

D. (X Y ) Z

gate2002 mathematical-logic normal

11.42 GATE2009_26 top gateoverflow.in/803

Consider the following well-formed formulae:



I. x(P (x))

II. x(P (x))

III. x(P (x))

IV. x(P (x))

Which of the above are equivalent?

(A) I and III

(B) I and IV

(C) II and III

(D) II and IV

gate2009 mathematical-logic normal

11.43 GATE1992_02,xvi top gateoverflow.in/574

02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Which of the following is/are tautology?

a. a b b c
b. a b b c
c. a b (b c)
d. a b (b c)

gate1992 mathematical-logic easy

11.44 GATE1991-15,a top gateoverflow.in/542

Show that the product of the least common multiple and the greatest common divisor of two positive integers a and b is
a b.

gate1991 mathematical-logic normal

11.45 TIFR2011-A-1 top gateoverflow.in/237

If either wages or prices are raised, there will be inflation. If there is inflation, then either the government must regulate it or
the people will suffer. If the people suffer, the government will be unpopular. Government will not be unpopular. Which of
the following can be validly concluded from the above statements.

A. People will not suffer


B. If the inflation is not regulated, then wages are not raised
C. Prices are not raised
D. If the inflation is not regulated, then the prices are not raised
E. Wages are not raised

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 637 of 852

tifr2011 mathematical-logic normal

11.46 GATE2013_47 top gateoverflow.in/80

Which one of the following is NOT logically equivalent to x(y() z())?

(A) x(z() y())


(B) x(z() y())
(C) x(y() z())
(D) x(y() z())

mathematical-logic normal marks-to-all gate2013

11.47 GATE1992_92,xv top gateoverflow.in/256

Which of the following predicate calculus statements is/are valid?

(1) ((x))P (x) ((x))Q(x) ((x))(P (x) Q(x))

(2) ((x))P (x) ((x))Q(x) ((x))(P (x) Q(x))

(3) ((x))(P (x) Q(x)) ((x))P (x) ((x))Q(x)

(4) ((x))(P (x) Q(x)) ((x))P (x) ((x))Q(x)


gate1992 mathematical-logic normal

11.48 GATE2008_30 top gateoverflow.in/441

Let fsa and pda be two predicates such that fsa(x) means x is a finite state automaton and pda(y) means that y is a
pushdown automaton. Let equivalent be another predicate such that equivalent(a, b) means a and b are equivalent. Which
of the following first order logic statements represent the following?

Each finite state automaton has an equivalent pushdown automaton

(A) (x fsa (x)) (y pda (y) equivalent (x, y))


(B) y (x fsa (x) pda (y) equivalent (x, y))
(C) xy (fsa (x) pda (y) equivalent (x, y))

(D) xy (fsa (y) pda (x) equivalent (x, y))

gate2008 easy mathematical-logic

11.49 GATE1991_03,xii top gateoverflow.in/526

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

If F1 , F2 and F3 are propositional formulae such that F1 F2 F3 and F1 F2 F3 are both tautologies, then which of
the following is true:

(a). Both F1 and F2 are tautologies

(b). The conjunction F1 F2 is not satisfiable


(c). Neither is tautologous

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 638 of 852

(d). Neither is satisfiable

(e). None of the above.

gate1991 mathematical-logic normal

11.50 GATE2008_31 top gateoverflow.in/442

P and Q are two propositions. Which of the following logical expressions are equivalent?
I. P Q
II. (P Q)
III. (P Q) (P Q) (P Q)
IV. (P Q) (P Q) (P Q)

(A) Only I and II

(B) Only I, II and III

(C) Only I, II and IV

(D) All of I, II, III and IV

gate2008 normal mathematical-logic

11.51 GATE2003_32 top gateoverflow.in/922

Which of the following is a valid first order formula? (Here and are first order formulae with x as their only free variable)

(A) ((x)[] (x)[]) (x)[ ]


(B) ((x)[] (x)[ ]
(C) ((x)[ ] (x)[]) (x)[]
(D) (x)[ ] ((x)[]) (x)[])

gate2003 mathematical-logic normal

11.52 GATE2003_33 top gateoverflow.in/923

Consider the following formula and its two interpretations I1 and I2 .

: (x) [Px (y) [Qxy Qyy ]] (x) [Px ]

I1 : Domain: the set of natural numbers


Px = 'x is a prime number'
Qxy = 'y divides x'
I2 : same as I1 except that Px = 'x is a composite number'.
Which of the following statements is true?

(A) I1 satisfies , I2 does not (B) I2 satisfies , I1 does not


(C) Neither I1 nor I2 satisfies (D) Both I1 and I2 satisfies

gate2003 mathematical-logic difficult

11.53 GATE1999_14 top gateoverflow.in/1513

a. Show that the formula [( p q) (q p)] is not a tautology.


b. Let A be a tautology and B any other formula. Prove that (A B) is a tautology.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 639 of 852

gate1999 mathematical-logic normal

11.54 GATE2007_22 top gateoverflow.in/1220

Let Graph(x) be a predicate which denotes that x is a graph. Let Connected(x) be a predicate which denotes that x is
connected. Which of the following first order logic sentences DOES NOT represent the statement:

"Not every graph is connected"


A. x ( Graph(x) Connected(x))

B. x ( Graph(x) Connected(x))

C. x ( Graph(x) Connected(x))

D. x ( Graph(x) Connected(x))

gate2007 mathematical-logic easy

11.55 GATE2013_27 top gateoverflow.in/1538

What is the logical translation of the following statement?

"None of my friends are perfect."

(A) x(F (x) P (x))

(B) x(F (x) P (x))

(C)x(F (x) P (x))

(D)x(F (x) P (x))

gate2013 mathematical-logic easy

11.56 GATE1998_1.5 top gateoverflow.in/1642

What is the converse of the following assertion?

I stay only if you go

A. I stay if you go

B. If I stay then you go

C. If you do not go then I do not stay

D. If I do not stay then you go

gate1998 mathematical-logic easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 640 of 852

11.57 GATE2012_13 top gateoverflow.in/45

What is the correct translation of the following statement into mathematical logic?

Some real numbers are rational

(A) x(real(x) rational(x))


(B) x(real(x) rational(x))
(C) x(real(x) rational(x))
(D) x(rational(x) real(x))

gate2012 mathematical-logic easy

11.58 GATE2014-1_53 top gateoverflow.in/1933

Which one of the following propositional logic formulas is TRUE when exactly two of p, q and r are TRUE?

(A) ((p q) r) (p q r)

(B) ( (p q) r) (p q r)

(C) ((p q) r) (p q r)

(D) ( (p q) r) (p q r)

gate2014-1 mathematical-logic normal

11.59 GATE2005_41 top gateoverflow.in/1166

What is the first order predicate calculus statement equivalent to the following?

"Every teacher is liked by some student"

(A) (x) [teacher (x) (y) [student (y) likes (y, x)]]
(B) (x) [teacher (x) (y) [student (y) likes (y, x)]]
(C) (y)(x) [teacher (x) [student (y) likes (y, x)]]
(D) (x) [teacher (x) (y) [student (y) likes (y, x)]]

gate2005 mathematical-logic easy

11.60 GATE2005_40 top gateoverflow.in/1165

Let P, Q and R be three atomic propositional assertions. Let X denote ( P Q ) R and Y denote (P R) (Q R). Which
one of the following is a tautology?

(A) X Y (B) X Y (C) Y X (D) Y X

gate2005 mathematical-logic normal

11.61 GATE2006_26 top gateoverflow.in/989

Which one of the first order predicate calculus statements given below correctly expresses the following English statement?

Tigers and lions attack if they are hungry or threatened.

(A) x[(tiger(x) lion(x)) {(hungry(x) threatened(x)) attacks(x)}]


(B) x[(tiger(x) lion(x)) {(hungry(x) threatened(x)) attacks(x)}]
(C) x[(tiger(x) lion(x)) {attacks(x) (hungry(x) threatened(x))}]
(D) x[(tiger(x) lion(x)) {(hungry(x) threatened(x)) attacks(x)}]

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 641 of 852

gate2006 mathematical-logic normal

11.62 GATE2003_72 top gateoverflow.in/959

The following resolution rule is used in logic programming.


Derive clause (P Q) from clauses (P R), (Q R)
Which of the following statements related to this rule is FALSE?

(A) ((P R) (Q R)) (P Q) is logically valid.


(B) (P Q) ((P R)) (Q R)) is logically valid.
(C) (P Q) is satisfiable if and only if (P R) (Q R) is satisfiable.
(D) (P Q) FALSE if and only if both P and Q are unsatisfiable.

gate2003 mathematical-logic normal

11.63 GATE2006_27 top gateoverflow.in/990

Consider the following propositional statements:


P1 : ((A B) C)) ((A C) (B C))
P2 : ((A B) C)) ((A C) (B C))

Which one of the following is true?

(A) P1 is a tautology, but not P2


(B) P2 is a tautology, but not P1
(C) P1 and P2 are both tautologies
(D) Both P1 and P2 are not tautologies

gate2006 mathematical-logic normal

11.64 GATE2004_23 top gateoverflow.in/1020

Identify the correct translation into logical notation of the following assertion.

Some boys in the class are taller than all the girls

Note: taller (x, y) is true if x is taller than y.

A. (x)(boy(x) (y)(girl(y) taller(x, y)))


B. (x)(boy(x) (y)(girl(y) taller(x, y)))

C. (x)(boy(x) (y)(girl(y) taller(x, y)))


D. (x)(boy(x) (y)(girl(y) taller(x, y)))

gate2004 mathematical-logic easy

11.65 GATE2010_30 top gateoverflow.in/1156

Suppose the predicate F(x, y, t) is used to represent the statement that person x can fool person y at time t. Which one of
the statements below expresses best the meaning of the formula

xyt(F (x, y, t))


?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 642 of 852

(A) Everyone can fool some person at some time


(B) No one can fool everyone all the time
(C) Everyone cannot fool some person all the time
(D) No one can fool some person at some time

gate2010 mathematical-logic easy

11.66 GATE2004_70 top gateoverflow.in/1064

The following propositional statement is (P (Q R)) ((P Q) R)


A. satisfiable but not valid


B. valid
C. a contradiction
D. None of the above

gate2004 mathematical-logic normal

11.67 GATE2014-3_1 top gateoverflow.in/2035

Consider the following statements:

P: Good mobile phones are not cheap

Q: Cheap mobile phones are not good

L: P implies Q

M: Q implies P

N: P is equivalent to Q

Which one of the following about L, M, and N is CORRECT?

(A) Only L is TRUE.

(B) Only M is TRUE.

(C) Only N is TRUE.

(D) L, M and N are TRUE.

gate2014-3 mathematical-logic easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 643 of 852

12 Probability top
12.1 Bayes Theorem: GATE2012_33 top gateoverflow.in/1751

Suppose a fair six-sided die is rolled once. If the value on the die is 1, 2, or 3, the die is rolled a second time. What is the
probability that the sum total of values that turn up is at least 6?

A. 10/21
B. 5/12
C. 2/3
D. 1/6

gate2012 probability conditional-probability bayes-theorem normal

12.2 Bayes Theorem: GATE2005_51 top gateoverflow.in/1176

Box P has 2 red balls and 3 blue balls and box Q has 3 red balls and 1 blue ball. A ball is selected as follows: (i) select a box
(ii) choose a ball from the selected box such that each ball in the box is equally likely to be chosen. The probabilities of
selecting boxes P and Q are 1/3 and 2/3 respectively. Given that a ball selected in the above process is a red ball, the
probability that it came from the box P is:

(A) 4/19 (B) 5/19 (C) 2/9 (D) 19/30

gate2005 probability conditional-probability bayes-theorem normal

12.3 Binomial Distribution: GATE2006_21 top gateoverflow.in/982

For each element in a set of size 2n, an unbiased coin is tossed. The 2n coin tosses are independent. An element is chosen if
the corresponding coin toss was a head. The probability that exactly n elements are chosen is
2n C
(A) n

4n
2n
Cn
(B)
2n

1
(C) 2n
Cn

1
(D) 2

gate2006 probability binomial-distribution normal

12.4 Binomial Distribution: GATE2005-IT_32 top gateoverflow.in/3778

An unbiased coin is tossed repeatedly until the outcome of two successive tosses is the same. Assuming that the trials are
independent, the expected number of tosses is

A) 3
B) 4
C) 5
D) 6

gate2005-it probability binomial-distribution expectation normal

12.5 Binomial Distribution: GATE2005_52 top gateoverflow.in/1177

A random bit string of length n is constructed by tossing a fair coin n times and setting a bit to 0 or 1 depending on
outcomes head and tail, respectively. The probability that two such randomly generated strings are not identical is:
1 1 1 1
(A) (B) 1 n (C) (D) 1 n
2n n! 2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 644 of 852

gate2005 probability binomial-distribution easy

12.6 Binomial Distribution: GATE2006-IT_22 top gateoverflow.in/3561

When a coin is tossed, the probability of getting a Head is p, 0 < p < 1. Let N be the random variable denoting the number
of tosses till the first Head appears, including the toss where the Head appears. Assuming that successive tosses are
independent, the expected value of N is

A) 1/p
B) 1/(1 p)
C) 1/p2
D) 1/(1 p2 )

gate2006-it probability binomial-distribution expectation normal

12.7 Conditional Probability: TIFR2012-A-1 top gateoverflow.in/20938

Amar and Akbar both tell the truth with probability 3/4 and lie with probability 1/4. Amar watches a test match and talks to
Akbar about the outcome. Akbar, in turn, tells Anthony, "Amar told me that India won". What probability should Anthony
assign to India's win?

a. 9/16
b. 6/16
c. 7/16
d. 10/16
e. None of the above.

tifr2012 probability conditional-probability

12.8 Conditional Probability: TIFR2014-A-6 top gateoverflow.in/25991

Karan tells truth with probability 1/3 and lies with probability 2/3. Independently, Arjun tells truth with probability 3/4 and
lies with probability 1/4. Both watch a cricket match. Arjun tells you that India won, Karan tells you that India lost. What
probability will you assign to Indias win?

a. 1/2
b. 2/3
c. 3/4
d. 5/6
e. 6/7

tifr2014 probability conditional-probability

12.9 Conditional Probability: TIFR2010-A-19 top gateoverflow.in/18499

Karan tells truth with probability 1/3 and lies with probability 2/3. Independently, Arjun tells truth with probability 3/4 and
lies with probability 1/4. Both watch a cricket match. Arjun tells you that India won, Karan tells you that India lost. What
probability will you assign to India's win?

a. 1/2
b. 2/3
c. 3/4
d. 5/6
e. 6/7

tifr2010 probability conditional-probability

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 645 of 852

12.10 Conditional Probability: GATE 2016-2-05 top gateoverflow.in/39541

Suppose that a shop has an equal number of LED bulbs of two different types. The probability of an LED bulb lasting more
than 100 hours given that it is of Type 1 is 0.7 , and given that it is of Type 2 is 0.4 . The probability that an LED bulb chosen
uniformly at random lasts more than 100 hours is _________.

gate2016-2 probability conditional-probability normal

12.11 Conditional Probability: GATE1994_1.4 top gateoverflow.in/2441

Let A and B be any two arbitrary events, then, which one of the following is true?

A. P (A B) = P (A)P (B)
B. P (A B) = P (A) + P (B)
C. P (A B) = P (A B)P (B)
D. P (A B) P (A) + P (B)

gate1994 probability conditional-probability normal

12.12 Expectation: TIFR2014-A-17 top gateoverflow.in/27111

A fair dice (with faces numbered 1, . . . , 6) is independently rolled repeatedly. Let X denote the number of rolls till an even
number is seen and let Y denote the number of rolls till 3 is seen. Evaluate E(Y |X = 2).

5
A. 6 6
B. 6
C. 5 1
2
D. 6 1
3
2
E. 5 3

tifr2014 expectation

12.13 Expectation: GATE2004_74 top gateoverflow.in/1068

An examination paper has 150 multiple choice questions of one mark each, with each question having four choices. Each
incorrect answer fetches -0.25 marks. Suppose 1000 students choose all their answers randomly with uniform probability.
The sum total of the expected marks obtained by all these students is

A. 0
B. 2550
C. 7525
D. 9375

gate2004 probability expectation normal

12.14 Expectation: GATE2013_24 top gateoverflow.in/1535

Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is
1/2. What is the expected number of unordered cycles of length three?

(A) 1/8 (B) 1 (C) 7 (D) 8

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 646 of 852

gate2013 probability expectation normal

12.15 Expectation: GATE2014-2_2 top gateoverflow.in/1954

Each of the nine words in the sentence T he quick brown fox jumps over the lazy dog is written on a separate piece of paper. These nine pieces of paper
are kept in a box. One of the pieces is drawn at random from the box. The expected length of the word drawn is _____________. (The answer should be rounded
to one decimal place.)

gate2014-2 probability expectation numerical-answers easy

12.16 Expectation: TIFR2011-A-6 top gateoverflow.in/20011

Assume that you are flipping a fair coin, i.e. probability of heads or tails is equal. Then the expected number of coin flips
required to obtain two consecutive heads for the first time is.

a. 4
b. 3
c. 6
d. 10
e. 5

tifr2011 probability expectation

12.17 Expectation: GATE2006_18 top gateoverflow.in/979

We are given a set X = {X1 , . . . . . . . . Xn } where Xi = 2i . A sample S X is drawn by selecting each Xi independently
1
with probability Pi = 2
. The expected value of the smallest number in sample S is:

1
(A) n

(B) 2

(C) n

(D) n

gate2006 probability expectation normal

12.18 Expectation: GATE2002_2.10 top gateoverflow.in/840

Consider the following algorithm for searching for a given number x in an unsorted array A[1..n] having n distinct values:

1. Choose an i at random from 1..n


2. If A[i] = x, then Stop else Goto 1;

Assuming that x is present in A, what is the expected number of comparisons made by the algorithm before it terminates?

(A) n

(B) n 1

(C) 2n
n
(D) 2

gate2002 probability expectation normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 647 of 852

12.19 Expectation: TIFR2015-A-6 top gateoverflow.in/29567

Ram has a fair coin, i.e., a toss of the coin results in either head or tail and each event happens with probability exactly half
(1/2). He repeatedly tosses the coin until he gets heads in two consecutive tosses. The expected number of coin tosses that
Ram does is.

A. 2
B. 4
C. 6
D. 8
E. None of the above.

tifr2015 expectation

12.20 Exponential Distribution: GATE2004-IT_33 top gateoverflow.in/3676

Let X and Y be two exponentially distributed and independent random variables with mean and , respectively. If Z = min
(X, Y), then the mean of Z is given by

A) (1/( + ))
B) min (, )
C) (/( + ))
D) +

gate2004-it probability exponential-distribution random-variable normal

12.21 Greedy Algorithm: TIFR2012-B-7 top gateoverflow.in/25107

A bag contains 16 balls of the following colors: 8 red, 4 blue, 2 green, 1 black, and 1 white. Anisha picks a ball randomly
from the bag, and messages Babu its color using a string of zeros and ones. She replaces the ball in the bag, and repeats
this experiment, many times. What is the minimum expected length of the message she has to convey to Babu per
experiment?

a. 3/2
b. log 5
c. 15/8
d. 31/16
e. 2

tifr2012 probability expectation huffman-code greedy-algorithm

12.22 Independent Events: GATE 2015 IN top gateoverflow.in/36890

probability independent-events

12.23 Normal Distribution: GATE2008_29 top gateoverflow.in/427

Let X be a random variable following normal distribution with mean +1 and variance 4. Let Y be another normal variable
with mean 1 and variance unknown. If P (X 1) = P (Y 2) , the standard deviation of Y is
(A) 3 (B) 2 (C) 2 (D) 1

gate2008 random-variable normal-distribution probability normal

12.24 Poisson Distribution: GATE2013_2 top gateoverflow.in/62

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 648 of 852

Suppose p is the number of cars per minute passing through a certain road junction between 5 PM and 6 PM, and p has a
Poisson distribution with mean 3. What is the probability of observing fewer than 3 cars during any given minute in this
interval?

(A) 8/(2e3 )

(B) 9/(2e3 )

(C) 17/(2e3 )

(D) 26/(2e3 )

gate2013 probability poisson-distribution normal

12.25 Poisson Distribution: GATE2007-IT_57 top gateoverflow.in/3499

In a multi-user operating system on an average, 20 requests are made to use a particular resource per hour. The arrival of
requests follows a Poisson distribution. The probability that either one, three or five requests are made in 45 minutes is
given by :

1) 6.9 106 e -20


2) 1.02 106 e -20
3) 6.9 103 e -20
4) 1.02 103 e -20

gate2007-it probability poisson-distribution normal

12.26 Probability: TIFR2010-A-10 top gateoverflow.in/26481

A drawer contains 2 Blue, 4 Red and 2 Yellow balls. No two balls have the same radius. If two balls are randomly selected
from the drawer, what is the probability that they will be of the same colour?

A. 2/7
B. 2/5
C. 3/7
D. 1/2
E. 3/5

tifr2010 probability

12.27 Probability: TIFR2010-A-13 top gateoverflow.in/18392

A cube whose faces are colored is split into 1000 small cubes of equal size. The cubes thus obtained are mixed thoroughly.
The probability that a cube drawn at random will have exactly two colored faces is:

a. 0.096
b. 0.12
c. 0.104
d. 0.24
e. None of the above

tifr2010 probability

12.28 Probability: GATE 2005 Probability and line top gateoverflow.in/33743

Using given data ponts tabulated below a straight line passing through origin is fitted using least squares method the slope
of the line is

x 1 2 3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 649 of 852

y 1.5 2.2 2.7


.9
1
1.1
1.5

probability

12.29 Probability: TIFR2010-B-38 top gateoverflow.in/19050

Suppose three coins are lying on a table, two of them with heads facing up and one with tails facing up. One coin is chosen
at random and flipped. What is the probability that after the flip the majority of the coins(i.e., at least two of them) will have
heads facing up?
1
a. 3
b. 1
8
1
c. 4
1 1
d. 4 + 8
e. 2
3

tifr2010 probability

12.30 Probability: TIFR2010-A-6 top gateoverflow.in/18222

Given 10 tosses of a coin with probability of head = .4 = (1 - the probability of tail), the probability of at least one head is?

a. (.4)10
b. 1 (.4)10
c. 1 (.6)10
d. (.6)10
e. 10(.4)(.6)9

tifr2010 probability

12.31 Probability: GATE 2016-1-04 top gateoverflow.in/39661

A probability density function on the interval [a, 1] is given by 1/x2 and outside this interval the value of the function is zero.
The value of a is _________.

gate2016-1 probability normal numerical-ability

12.32 Probability: GATE 2016-1-29 top gateoverflow.in/39709

Consider the following experiment.

Step 1. Flip a fair coin twice.

Step 2. If the outcomes are (TAILS, HEADS) then output Y and stop.

Step 3. If the outcomes are either (HEADS, HEADS) or (HEADS, TAILS), then output N and stop.
Step 4. If the outcomes are (TAILS, TAILS), then go to Step 1.

The probability that the output of the experiment is Y is (up to two decimal places) ____________.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 650 of 852

gate2016-1 probability normal numerical-answers

12.33 Probability: GATE2004-IT_1 top gateoverflow.in/3642

In a population of N families, 50% of the families have three children, 30% of the families have two children and the
remaining families have one child. What is the probability that a randomly picked child belongs to a family with two children?

A) 3/23
B) 6/23
C) 3/10
D) 3/5

gate2004-it probability normal

12.34 Probability: GATE2005-IT_1 top gateoverflow.in/3745

A bag contains 10 blue marbles, 20 green marbles and 30 red marbles. A marble is drawn from the bag, its colour recorded
and it is put back in the bag. This process is repeated 3 times. The probability that no two of the marbles drawn have the
same colour is

A) 1/36
B) 1/6
C) 1/4
D) 1/3

gate2005-it probability normal

12.35 Probability: TIFR2011-A-3 top gateoverflow.in/20000

The probability of three consecutive heads in four tosses of a fair coin is.
1
a. 4
b. 1
8
c. 1
16
3
d. 16
e. None of the above.

tifr2011 probability

12.36 Probability: GATE2015-1_29 top gateoverflow.in/8253

Consider a LAN with four nodes S 1, S 2, S 3 and S 3. Time is divided into fixed-size slots, and a node can begin its transmission
only at the beginning of a slot. A collision is said to have occurred if more than one node transmit in the same slot. The
probabilities of generation of a frame in a time slot by S 1, S 2, S 3 and S 4 are 0.1, 0.2, 0.3 and 0.4 respectively. The
probability of sending a frame in the first slot without any collision by any of these four stations is__________________.

gate2015-1 probability normal

12.37 Probability: GATE 2005 Probability top gateoverflow.in/33739

A fair coin is tossed three times in succession. If the first toss produces a head,
then the probability of getting exactly two heads in three tosses is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 651 of 852

probability

12.38 Probability: TIFR2013-A-17 top gateoverflow.in/25497

A stick of unit length is broken into two at a point chosen at random. Then, the larger part of the stick is further divided into
two parts in the ratio 4 : 3. What is the probability that the three sticks that are left CANNOT form a triangle?

a. 1/4
b. 1/3
c. 5/6
d. 1/2
e. loge (2)/2

tifr2013 probability

12.39 Probability: TIFR2012-A-20 top gateoverflow.in/25045

There are 1000 balls in a bag, of which 900 are black and 100 are white. I randomly draw 100 balls from the bag. What is
the probability that the 101st ball will be black?

a. 9/10
b. More than 9/10 but less than 1.
c. Less than 9/10 but more than 0.
d. 0
e. 1

tifr2012 probability

12.40 Probability: GATE2006-IT_1 top gateoverflow.in/3538

In a certain town, the probability that it will rain in the afternoon is known to be 0.6. Moreover, meteorological data
indicates that if the temperature at noon is less than or equal to 25C, the probability that it will rain in the afternoon is 0.4.
The temperature at noon is equally likely to be above 25C, or at/below 25C. What is the probability that it will rain in the
afternoon on a day when the temperature at noon is above 25C?

A) 0.4
B) 0.6
C) 0.8
D) 0.9

gate2006-it probability normal

12.41 Probability: TIFR2013-A-4 top gateoverflow.in/25386

A biased coin is tossed repeatedly. Assume that the outcomes of different tosses are independent and probability of heads is
2/3 in each toss. What is the probability of obtaining an even number of heads in 5 tosses, zero being treated as an even
number?

a. 121/243
b. 122/243
c. 124/243
d. 125/243
e. 128/243

tifr2013 probability

12.42 Probability: TIFR2013-A-14 top gateoverflow.in/25437

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 652 of 852

An unbiased die is thrown n times. The probability that the product of numbers would be even is

a. 1/(2n)
b. 1/[(6n)!]
c. 1 6n
d. 6n
e. None of the above.

tifr2013 probability

12.43 Probability: TIFR2013-A-6 top gateoverflow.in/25390

You are lost in the National park of Kabrastan. The park population consists of tourists and Kabrastanis. Tourists comprise
two-thirds of the population the park, and give a correct answer to requests for directions with probability 3/4. The air of
Kabrastan has an amnesaic quality however, and so the answers to repeated questions to tourists are independent, even if
the question and the person are the same. If u ask a Kabrastani for directions, the answer is always wrong.

Suppose you ask a randomly chosen passer by whether the exit from the park is East or West. The answer is East. You then
ask the same person again, and the reply is again East. What is the probability of East being correct?

a. 1/4
b. 1/3
c. 1/2
d. 2/3
e. 3/4

tifr2013 probability

12.44 Probability: TIFR2012-A-19 top gateoverflow.in/25044

An electric circuit between two terminals A and B is shown in the figure below, where the numbers indicate the probabilities
of failure for the various links, which are all independent.

What is the probability that A and B are connected?

a. 6
25
379
b. 400
1
c. 1200
d. 1199
1200
59
e.
60

tifr2012 probability

12.45 Probability: TIFR2012-A-17 top gateoverflow.in/25042

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 653 of 852

A spider is at the bottom of a cliff, and is n inches from the top. Every step it takes brings it one inch closer to the top with
probability 1/3, and one inch away from the top with probability 2/3, unless it is at the bottom in which case, it always gets
one inch closer. What is the expected number of steps for the spider to reach the top as a function of n?

a. It will never reach the top.


b. Linear in n.
c. Polynomial in n.
d. Exponential in n.
e. Double exponential in n.

tifr2012 probability

12.46 Probability: GATE 1999 - Method Of Least Square top gateoverflow.in/33737

Four arbitary points (x1,y1) (x2,Y2) (x3,Y3) (x4,y4) are given is xy plane using Method Of Least Squares If the regression of
y upon x gives the fitted line y=ax+b and regression x upon y gives the fitted line x=cy+d

then

the two fitted lines must coincide


the two fitted lines must NOT coincide
It is possible that ac=0
a must be 1/c

First of All, please explain me what is regression and approach of using Least Squares in such problems

probability

12.47 Probability: TIFR2011-A-9 top gateoverflow.in/20020

You have to play three games with opponents A and B in a specified sequence. You win the series if you win two consecutive
games. A is a stronger player than B. Which sequence maximizes your chance of winning the series?

a. AAB
b. ABA
c. BAB
d. BAA
e. All are the same.

tifr2011 probability

12.48 Probability: TIFR2011-A-19 top gateoverflow.in/26479

Three dice are rolled independently. What is the probability that the highest and the lowest value differ by 4?
1
A.
3
1
B. 6

1
C.
9
5
D. 18

2
E. 9

tifr2011 probability

12.49 Probability: TIFR2015-A-1 top gateoverflow.in/29156

Consider a 6-sided die with all sides not necessarily equally likely such that probability of an even number is
P ({2, 4, 6}) = 1/2, probability of a multiple of 3 is P ({3, 6}) = 1/3 and probability of 1 is P ({1}) = 1/6. Given the above
conditions, choose the strongest (most stringent) condition of the following that must always hold about P ({5}), the

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 654 of 852

probability of 5.

A. P ({5}) = 1/6
B. P ({5}) 1/6
C. P ({5}) 1/6
D. P ({5}) 1/3
E. None of the above.

tifr2015 probability

12.50 Probability: TIFR2012-A-9 top gateoverflow.in/21008

The probability of throwing six perfect dices and getting six different faces is

a. 1 6!/66
b. 6!/66
c. 66
d. 1 66
e. None of the above.

tifr2012 probability

12.51 Probability: TIFR2013-B-10 top gateoverflow.in/25771

Let m, n be positive integers with m a power of 2. Let s = 100n2 log m . Suppose S1 , S2 , , Sm are subsets of 1, 2, , s
such that | Si | = 10n log m and | Si Sj | log m for all 1 i < j m . Such a collection of sets S1 , , Sm is an example
of a so-called Nisan-Wigderson design. We now consider the set membership problem, where we have to store an arbitrary
subset T {1, 2, . . . . , m} , |T | = n as an array A of s bits so that given any integer x, 1 x m , we can discover
whether x T by reading only one bit of A. Consider the following strategy to solve this problem. Array A is initialized to
all zeroes. Given the set T to be stored, we put a one in all the locations of A indexed by the union tT St . Now, given
the integer x, we read a random location in A from Sx and declare that x T if the bit in that location is one. This strategy
gives the correct answer with probability

a. 1 if x T and at most 0.1 if x T .


b. At least 0.9 if x T and at most 0.1 if x T .
c. At least 0.9 if x T and at least 0.9 if x T .
d. 1 if x T and at least 0.9 if x T .
e. At least 0.9 if x T and 1 if x T .

tifr2013 probability

12.52 Probability: TIFR2013-A-13 top gateoverflow.in/25435

Doctors A and B perform surgery on patients in stages III and IV of a disease. Doctor A has performed a 100 surgeries
(on 80 stage III and 20 stage IV patients) and 80 out of her 100 patients have survived ( 78 stage III and 2 stage IV
survivors). Doctor B has also performed 100 surgeries (on 50 stage III and 50 stage IV patients). Her success rate is
60/100 (49 stage III survivors and 11 stage IV survivors). A patient has been advised that she is equally likely to be
suffering from stage III or stage IV of this disease. Which doctor would you recommend to this patient and why?

a. Doctor A since she has a higher success rate


b. Doctor A since she specializes in stage III patients and the success of surgery in stage IV patients is anyway too low
c. Doctor B since she has performed more stage IV surgeries
d. Doctor B since she appears to be more successful
e. There is not enough data since the choice depends on the stage of the disease the patient is suffering from.

tifr2013 probability

12.53 Probability: GATE2007-IT_1 top gateoverflow.in/3432

Suppose there are two coins. The first coin gives heads with probability 5/8 when tossed, while the second coin gives heads

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 655 of 852

with probability 1/4. One of the two coins is picked up at random with equal probability and tossed. What is the probability
of obtaining heads ?

A) 7/8
B) 1/2
C) 7/16
D) 5/32

gate2007-it probability normal

12.54 Probability: GATE2010_26 top gateoverflow.in/1152

Consider a company that assembles computers. The probability of a faulty assembly of any computer is p. The company
therefore subjects each computer to a testing process. This testing process gives the correct result for any computer with a
probability of q. What is the probability of a computer being declared faulty?

(A) pq + (1 - p)(1 - q) (B) (1 - q)p (C) (1 - q)p (D) pq

gate2010 probability easy

12.55 Probability: GATE2004_78 top gateoverflow.in/1072

Tw o n bit binary strings, S1 and S2 are chosen randomly with uniform probability. The probability that the Hamming
distance between these strings (the number of bit positions where the two strings differ) is equal to d is

A. n Cd /2n

B. n Cd /2d

C. d/2n

D. 1/2d

gate2004 probability normal

12.56 Probability: GATE2004_25 top gateoverflow.in/1022

If a fair coin is tossed four times. What is the probability that two heads and two tails will result?

A. 3
8

B. 1
2
5
C. 8

3
D. 4

gate2004 probability easy

12.57 Probability: GATE2010_27 top gateoverflow.in/1153

What is the probability that divisor of 1099 is a multiple of 1096 ?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 656 of 852

(A) 1/625 (B) 4/625 (C) 12/625 (D) 16/625

gate2010 probability normal

12.58 Probability: GATE2007_24 top gateoverflow.in/1222

Suppose we uniformly and randomly select a permutation from the 20! permutations of 1, 2, 3 ... ,20. What is the
probability that 2 appears at an earlier position than any other even number in the selected permutation?

(A) 1 (B) 1 (C) 9! (D) None of these


2 10 20!

gate2007 probability easy

12.59 Probability: GATE1998_3a top gateoverflow.in/1694

Two friends agree to meet at a park with the following conditions. Each will reach the park between 4:00 pm and 5:00 pm
and will see if the other has already arrived. If not, they will wait for 10 minutes or the end of the hour whichever is earlier
and leave. What is the probability that the two will not meet?

gate1998 probability normal

12.60 Probability: GATE1998_1.1 top gateoverflow.in/1638

A die is rolled three times. The probability that exactly one odd number turns up among the three outcomes is

1
(a) 6

(b) 3
8

1
(c)
8

1
(d) 2

gate1998 probability easy

12.61 Probability: GATE2008-IT_23 top gateoverflow.in/3284

What is the probability that in a randomly chosen group of r people at least three people have the same birthday?

365.364(365r+1)
A) 1 365r

365.364(365r+1) r 365.364.363(364(r2)+1)
B)
365r
+ (2).
364r2
365.364(365r+1) r 365.364.363(364(r2)+1)
C) 1 + (2).
365r 364r2
365.364(365r+1)
D)
365r

gate2008-it probability normal

12.62 Probability: GATE2003_60 top gateoverflow.in/948

A program consists of two modules executed sequentially. Let f1 (t) and f2 (t) respectively denote the probability density
functions of time taken to execute the two modules. The probability density function of the overall time taken to execute the
program is given by

A. f1 (t) + f2 (t)
t
1 (x) 2 (x)dx

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 657 of 852

t
B. 0 f1 (x)f2 (x)dx
t
C. 0 f1 (x)f2 (t x)dx

D. max{f1 (t), f2 (t)}

gate2003 probability normal

12.63 Probability: GATE2003_3 top gateoverflow.in/894

Let P (E) denote the probability of the event E. Given P (A) = 1, P (B) = 1/2, the values of P (A B) and P (B A)
respectively are

(A) 1/4,1/2

(B) 1/2,1/4

(C) 1/2,1

(D) 1,1/2

gate2003 probability easy

12.64 Probability: GATE2000_2.2 top gateoverflow.in/649

E1 and E 2 are events in a probability space satisfying the following constraints:

Pr(E1) = Pr(E 2)
Pr(E1 E2) = 1
E1 and E 2 are independent

The value of Pr(E 1), the probability of the event E 1, is

A. 0
B.
C.
D. 1

gate2000 probability easy

12.65 Probability: GATE2000_1.1 top gateoverflow.in/624

The minimum number of cards to be dealt from an arbitrarily shuffled deck of 52 cards to guarantee that three cards are
from same suit is

(a) 3 (b) 8 (c) 9 (d) 12

gate2000 probability easy

12.66 Probability: GATE2008_27 top gateoverflow.in/425

Aishwarya studies either computer science or mathematics everyday. If she studies computer science on a day, then the
probability that she studies mathematics the next day is 0.6. If she studies mathematics on a day, then the probability that
she studies computer science the next day is 0.4. Given that Aishwarya studies computer science on Monday, what is the
probability that she studies computer science on Wednesday?

(A) 0.24 (B) 0.36 (C) 0.4 (D) 0.6

gate2008 probability normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 658 of 852

12.67 Probability: GATE2001_2.4 top gateoverflow.in/722

Seven (distinct) car accidents occurred in a week. What is the probability that they all occurred on the same day?

(a) 17
7

1
(b)
76

1
(c)
27

(d) 77
2

gate2001 probability normal

12.68 Probability: GATE1995_1.18 top gateoverflow.in/780

The probability that a number selected at random between 100 and 999 (both inclusive) will not contain the digit 7 is:

(a)16/25

(b) (9/10)3

(c)27/75

(d) 18/25

gate1995 probability normal

12.69 Probability: GATE2002_2.16 top gateoverflow.in/846

Four fair coins are tossed simultaneously. The probability that at least one head and one tail turn up is

A. 1
16
1
B.
8
7
C. 8

D. 15
16

gate2002 probability easy

12.70 Probability: GATE2009_21 top gateoverflow.in/798

An unbalanced dice (with 6 faces, numbered from 1 to 6) is thrown. The probability that the face value is odd is 90% of the
probability that the face value is even. The probability of getting any even numbered face is the same. If the probability that
the face is even given that it is greater than 3 is 0.75 , which one of the following options is closest to the probability that the
face value exceeds 3?

(A) 0.453

(B) 0.468

(C) 0.485

(D) 0.492

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 659 of 852

gate2009 probability normal

12.71 Probability: GATE2014-1_48 top gateoverflow.in/1927

X
Four fair six-sided dice are rolled. The probability that the sum of the results being 22 is 1296 . The value of X is _______

gate2014-1 probability numerical-answers normal

12.72 Probability: GATE1999_2.1 top gateoverflow.in/1479

Consider two events E1 and E2 such that probability of E1 , Pr [ E1 ] = 12 , probability of E2 , Pr [E2 ] = 13 , and probability of
1
E1 , and E2 , Pr [E1 and E2 ] = 5
. Which of the following statements is/are true?

A. Pr [ E1 or E2 ] is 23

B. Events E1 and E2 are independent

C. Events E1 and E2 are not independent

D. Pr [ ]= 4
E1
E2 5

gate1999 probability normal

12.73 Probability: GATE1994_2.8 top gateoverflow.in/2475

Let A, B and C be independent events which occur with probabilities 0.8, 0.5 and 0.3 respectively. The probability of
occurrence of at least one of the event is _____

gate1994 probability normal

12.74 Probability: GATE1994_2.6 top gateoverflow.in/2473

The probability of an event B is P1 . The probability that events A and B occur together is P2 while the probability that A
and B occur together is P3 . The probability of the event A in terms of P1 , P2 and P3 is _____________

gate1994 probability normal

12.75 Probability: GATE-2014-2_1 top gateoverflow.in/1953

The security system at an IT oce is composed of 10 computers of which exactly four are working. To check whether the system is functional, the ocials
inspect four of the computers picked at random (without replacement). The system is deemed functional if at least three of the four computers inspected are
working. Let the probability that the system is deemed functional be denoted by p. Then 100p = _____________.

gate2014-2 probability numerical-answers normal

12.76 Probability: GATE1995_2.14 top gateoverflow.in/2626

A bag contains 10 white balls and 15 black balls. Two balls are drawn in succession. The probability that one of them is black
and the other is white is:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 660 of 852

2
A. 3

B. 4
5

C. 1
2
1
D. 3

gate1995 probability normal

12.77 Probability: GATE1996_1.5 top gateoverflow.in/2709

Two dice are thrown simultaneously. The probability that at least one of them will have 6 facing up is

A. 1
36
1
B. 3

25
C. 36

D. 11
36

gate1996 probability easy

12.78 Probability: GATE2008-IT_2 top gateoverflow.in/3224

A sample space has two events A and B such that probabilities P(A B) = 1/2, P(A') = 1/3, P(B') = 1/3. What is P(A U B)?

A) 11/12

B) 10/12

C) 9/12
D) 8/12

gate2008-it probability easy

12.79 Probability: GATE1996_2.7 top gateoverflow.in/2736

The probability that top and bottom cards of a randomly shuffled deck are both aces is
4 4
A. 52 52
4 3
B. 52 52

C. 4 3
52 51

D. 4 4
52 51

gate1996 probability easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 661 of 852

12.80 Probability: GATE2011_34 top gateoverflow.in/2136

A deck of 5 cards (each carrying a distinct number from 1 to 5) is shuffled thoroughly. Two cards are then removed one at a
time from the deck. What is the probability that the two cards are selected with the number on the first card being one
higher than the number on the second card?

(A) 1/5

(B) 4/25

(C) 1/4

(D) 2/5

gate2011 probability normal

12.81 Probability: GATE1997_1.1 top gateoverflow.in/2217

The probability that it will rain today is 0.5. The probability that it will rain tomorrow is 0.6. The probability that it will rain
either today or tomorrow is 0.7. What is the probability that it will rain today and tomorrow?

A. 0.3
B. 0.25
C. 0.35
D. 0.4

gate1997 probability easy

12.82 Probability: GATE2014-2_48 top gateoverflow.in/2014

The probability that a given positive integer lying between 1 and 100 (both inclusive) is NOT divisible by 2, 3 or 5 is ______ .

gate2014-2 probability numerical-answers normal

12.83 Probability: GATE2014-3_48 top gateoverflow.in/2082

Let S be a sample space and two mutually exclusive events A and B be such that A B = S. If P (. ) denotes the
probability of the event, the maximum value of P (A)P (B) is_____.

gate2014-3 probability numerical-answers normal

12.84 Probability: GATE2011_3 top gateoverflow.in/2105

If two fair coins are flipped and at least one of the outcomes is known to be a head, what is the probability that both outcomes are heads?

(A) 1/3

(B) 1/4

(C) 1/2

(D) 2/3

gate2011 probability easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 662 of 852

12.85 Random Variable: TIFR2015-A-12 top gateoverflow.in/29583

Consider two independent and identically distributed random variables X and Y uniformly distributed in [0, 1] . For
[0, 1], the probability that max (X, Y ) < XY is
a. 1/(2)
b. exp (1 )
c. 1
d. (1 )2
e. 1 2

tifr2015 probability random-variable

12.86 Random Variable: TIFR2011-A-7 top gateoverflow.in/20012

Let X and Y be two independent and identically distributed random variables. Then P (X > Y ) is.

a. 1
2
b. 1
c. 0
d. 1
3
e. Information is insufficient.

tifr2011 probability random-variable

12.87 Random Variable: GATE2015-3_37 top gateoverflow.in/8496

= 1, 2, 3 are independent and identically distributed random variables whose probability mass functions are
Suppose Xi for i
P r[Xi = 0] = P r[Xi = 1] = 12 for i = 1, 2, 3. Define another random variable Y = X1 X2 X3 , where denotes XOR.
Then P r[Y = 0 X3 = 0] = ______.

gate2015-3 probability random-variable normal numerical-answers

12.88 Random Variable: GATE2011_18 top gateoverflow.in/2120

If the dierence between the expectation of the square of a random variable (E [X 2 ]) and the square of the expectation of the random
2
variable (E [X]) is denoted by R, then

(A) R = 0

(B) R < 0 </span>

(C) R 0

(D) R > 0

gate2011 probability random-variable expectation normal

12.89 Random Variable: TIFR2014-A-19 top gateoverflow.in/27130

Consider the following random function of x


F (x) = 1 + Ux + V x2 mod 5,
where U and V are independent random variables uniformly distributed over {0, 1, 2, 3, 4}. Which of the following is FALSE?

a. F (1) is uniformly distributed over {0, 1, 2, 3, 4}.


b. F (1), F (2) are independent random variables and both are uniformly distributed over {0, 1, 2, 3, 4}.
c. F (1), F (2), F (3) are independent and identically distributed random variables.
d. All of the above.
e. None of the above.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 663 of 852

tifr2014 probability random-variable

12.90 Random Variable: TIFR2013-A-18 top gateoverflow.in/25498

Consider three independent uniformly distributed (taking values between 0 and 1) random variables. What is the probability
that the middle of the three values (between the lowest and the highest value) lies between a and b where 0 a < b 1.

a. 3(1 b)a(b a)
b. 3(b a) (b2 a2 )/2)
c. 6(1 b)a(b a)
d. (1 b)a(b a)
e. 6((b2 a2 )/2 (b3 a3 )/3).

tifr2013 probability random-variable

12.91 Random Variable: GATE2011_33 top gateoverflow.in/2135

Consider a nite sequence of random values X = [x1 , x2 , xn ]. Let x be the mean and x be the standard deviation of X. Let another
nite sequence Y of equal length be derived from this as yi = a xi + b, where a and b are positive constants. Let y be the mean and y
be the standard deviation of this sequence. Which one of the following statements is INCORRECT?

(A) Index position of mode of X in X is the same as the index position of mode of Y in Y

(B) Index position of median of X in X is the same as the index position of median of Y in Y

(C) y = ax + b

(D) y = ax + b

gate2011 probability random-variable normal

12.92 Random Variable: GATE2006-IT_58 top gateoverflow.in/3602

A software program consists of two modules M 1 and M 2 that can fail independently, but never simultaneously. The program
is considered to have failed if any of these modules fails. Both the modules are 'repairable' and so the program starts
working again as soon as the repair is done. Assume that the mean time to failure (MTTF) of M 1 is T 1 with a mean time to
repair (MTTR) of R1. The MTTF of M 2 is T 2 with an MTTR of R 2. What is the availability of the overall program given that the
failure and repair times are all exponentially distributed random variables?

A) ((T1T2)/(T1R1 + T 2R2))
B) ((R1R2)/(T1R1 + T 2R2))

C) ((T1T2)/(T1T2 + T 1R1 + T2R2))

D) ((T1T2)/(T1T2 + T 1R2 + T2R1))

gate2006-it probability random-variable normal

12.93 Random Variable: GATE2005_12 top gateoverflow.in/1162

Let f(x) be the continuous probability density function of a random variable X, the probability that a < X b, is :
b
(A) f(b-a) (B) f(b) - f(a) (C) a f(x) dx (D) ab xf(x) dx

gate2005 probability random-variable easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 664 of 852

12.94 Random Variable: GATE2012_21 top gateoverflow.in/1577

Consider a random variable X that takes values +1 and 1 with probability 0.5 each. The values of the cumulative
distribution function F(x) at x = 1 and +1 are

(A) 0 and 0.5

(B) 0 and 1

(C) 0.5 and 1

(D) 0.25 and 0.75

gate2012 probability random-variable easy

12.95 Random Variable: GATE1999_1.1 top gateoverflow.in/1455

Suppose that the expectation of a random variable X is 5. Which of the following statements is true?

A. There is a sample point at which X has the value 5.

B. There is a sample point at which X has value greater than 5.

C. There is a sample point at which X has a value greater than equal to 5.

D. None of the above

gate1999 probability random-variable expectation easy

12.96 Statistics: TIFR2015-A-15 top gateoverflow.in/29611

Let A and B be non-empty disjoint sets of real numbers. Suppose that the average of the numbers in the first set is A and
the average of the numbers in the second set is B ; let the corresponding variances be vA and vB respectively. If the
average of the elements in A B is = p. A + (1 p). B , what is the variance of the elements in A B?

a. p. vA + (1 p). vB
b. (1 p). vA + p. vB
c. p. [ vA + (A )2 ] + (1 p). [ vB + (B )2 ]
d. (1 p). [ vA + (A )2 ] + p. [ vB + (B )2 ]
e. p. vA + (1 p). vB + (A B )2

tifr2015 statistics

12.97 Uniform Distribution: GATE2014-1_2 top gateoverflow.in/1717

Suppose you break a stick of unit length at a point chosen uniformly at random. Then the expected length of the shorter
stick is ________ .

gate2014-1 probability uniform-distribution expectation numerical-answers normal

12.98 Uniform Distribution: GATE2004_80 top gateoverflow.in/1074

A point is randomly selected with uniform probability in the X-Y plane within the rectangle with corners at (0,0), (1,0), (1,2)
and (0,2). If p is the length of the position vector of the point, the expected value of p 2 is

(A) 2
3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 665 of 852

(B) 1
4
(C) 3

(D) 5
3

gate2004 probability uniform-distribution expectation normal

12.99 GATE2014-EC01-GA10 top gateoverflow.in/41499

You are given three coins: one has heads on both faces, the second has tails on both faces, and the third has a head on one
face and a tail on the other. You choose a coin at random and toss it, and it comes up heads. The probability that the other
face is tails is

A. 1/4
B. 1/3
C. 1/2
D. 2/3

gate2014-ec01

12.100 TIFR 2015 top gateoverflow.in/17821

Consider a 6 sided die with all sides not necessarily equally likely such that probability of an even number is P({2,4,6}) =
1/2 , probability of a multiple 3 is P({3,6) = 1/3,and probability of 1 is P({1}) = 1/6 Given the above conditions choose the
strongest (most stringent) condition of the following that must always hold about P({5}) the probability of 5?

a) P({5} =1/6

b) P({5}) >=1/6

c) P({5}) <=1/6<br />


d) P({5}) <=1/3<br />
e) None of the above

tifr 2015

12.100 GATE 2011 A fair die is tossed two times. the probability that 2d toss
results in value greater than first top gateoverflow.in/33714

gate2011-ec

12.101 GATE 2008 IISC Baanglr Paper top gateoverflow.in/33744

Three values of x and y are to be fitted in a stright line in the form of y=a+bx by the method of least squares
Given
SIGMA x =6
SIGMA y=21
SIGMA x*x = 14
SIGMA xy = 46

Find the values of a and b

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 666 of 852

13 Set Theory & Algebra top


13.1 Boolean Algebra: GATE2006_28 top gateoverflow.in/991

A logical binary relation , is defined as follows:

A B A B
True True True
True False True
False True False
False False True

Let be the unary negation (NOT) operator, with higher precedence then .
Which one of the following is equivalent to A B ?

A. ( A B)
B. (A B)
C. ( A B)
D. ( A B)

gate2006 set-theory&algebra normal boolean-algebra

13.2 Boolean Expressions: GATE2015-3_2 top gateoverflow.in/8393

Let # be the binary operator defined as

X#Y = X'+Y' where X and Y are Boolean variables.

Consider the following two statements.

(S1) (P#Q)#R = P#(Q#R)

(S2) Q#R = (R#Q)

Which are the following is/are true for the Boolean variables P, Q and R?

A. Only S1 is true
B. Only S2 is true
C. Both S1 and S2 are true
D. Neither S1 nor S2 are true

gate2015-3 set-theory&algebra boolean-expressions normal

13.3 Countable Uncountable Set: GATE2014-3_16 top gateoverflow.in/2050


Let be a finite non-empty alphabet and let 2 be the power set of . Which one of the following is TRUE?

(A) Both 2 and are countable

(B) 2 is countable and is uncountable

(C) 2 is uncountable and is countable

(D) Both 2 and are uncountable

gate2014-3 set-theory&algebra countable-uncountable-set normal

13.4 Counting: GATE2015-2_40 top gateoverflow.in/8212

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 667 of 852

The number of onto functions (surjective functions) from set X = {1, 2, 3, 4} to set Y = {a, b, c} is ______.

gate2015-2 set-theory&algebra functions counting normal

13.5 Counting: GATE2006-IT_24 top gateoverflow.in/3563

What is the cardinality of the set of integers X defined below?

X = {n | 1 n 123, n is not divisible by either 2, 3 or 5}

A) 28
B) 33
C) 37
D) 44

gate2006-it set-theory&algebra normal counting

13.6 Functions: TIFR2010-Maths-B-3 top gateoverflow.in/19368

If f, g : R R are uniformly continuous functions, then their compositions g f is.


a. Uniformly continuous.
b. Continuous but not uniformly continuous.
c. Continuous and bounded.
d. None of the above.

tifrmaths2010 set-theory&algebra functions

13.7 Functions: GATE1997_13 top gateoverflow.in/2273

Let F be the set of one-to-one functions from the set {1, 2, , n} to the set {1, 2, , m} where m n 1.
a. How many functions are members of F ?

b. How many functions f in F satisfy the property f(i) = 1 for some i, 1 i n?


c. How many functions f in F satisfy the property f(i) < f(j) for all 1 i j n?

gate1997 set-theory&algebra functions normal

13.8 Functions: TIFR2010-Maths-A-5 top gateoverflow.in/19351

Let f be an one to one function from the closed interval [0, 1] to the set of real numbers R, then.
a. f must be onto.
b. Range of f must contain a rational number.
c. Range of f must contain an irrational number.
d. Range of f must contain both rational and irrational numbers.

tifrmaths2010 set-theory&algebra functions

13.9 Functions: TIFR2014-B-18 top gateoverflow.in/27351

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 668 of 852

Let k be an integer at least 4 and let [k] = {1, 2, . . . , k}. Let f : [k]4 {0, 1} be defined as follows: f(y1 , y2 , y3 , y4 ) = 1 if
3
an only if the yi s are all distinct. For each choice z = (z1 , z2 , z3 ) [k] , let gz : [k] {0, 1} be defined by
gz (Y ) = f(Y , z1 , z2 , z3 ). Let N be the number of distinct functions gz that are obtained as z varies in {1, 2, . . . , k}3 , that is,
N = {gz : z {1, 2, . . . , k}3 }. What is N ?

a. k3 +1
( k3 )
b. 2
k
c. ( )
3
k
d. (
3
)+ 1
k
e. 4 ( 3 )

tifr2014 set-theory&algebra functions

13.10 Functions: GATE2003_39 top gateoverflow.in/930

Let = {a, b, c, d, e} be an alphabet. We define an encoding scheme as follows:


g(a) = 3, g(b) = 5, g(c) = 7, g(d) = 9, g(e) = 11.
Let pi denote the i-th prime number (p1 = 2).

For a non-empty string s = a1 an , where each ai , define f(s) = ni=1 Pig(ai ) .


f(si )
For a non-empty sequence sj , , sn of stings from + , define h (si sn ) = ni=1 Pi
Which of the following numbers is the encoding, h , of a non-empty sequence of strings?

A. 27 37 57

B. 28 38 58

C. 29 39 59

D. 210 310 510

gate2003 set-theory&algebra functions normal

13.11 Functions: TIFR2014-B-17 top gateoverflow.in/27344

n
Let f : {0, 1} {0, 1} be a boolean function computed by a logical circuit comprising just binary AND and binary OR gates
n
(assume that the circuit does not have any feedback). Let PARITY : {0, 1} {0, 1} be the boolean function that outputs 1
if the total number of input bits set to 1 is odd. Similarly, let MAJORITY be the boolean function that outputs 1 if the number
of input bits that are set to 1 is at least as large as the number of input bits that are set to 0. Then, which of the following is
NOT possible?

a. f(0, 0, . . . , 0) = f(1, 1, . . . , 1) = 0.
b. f(0, 0, . . . , 0) = f(1, 1.. . . , 1) = 1
c. f is the MAJORITY function.
d. f is the PARITY function.
e. f outputs 1 at exactly one assignment of the input bits.

tifr2014 set-theory&algebra functions

13.12 Functions: TIFR2013-B-16 top gateoverflow.in/25859

k,n : {0, 1}n {0, 1} k,n (x) =1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 669 of 852

n
Consider a function Tk,n : {0, 1} {0, 1} which returns 1 if at least k of its n inputs are 1. Formally, Tk,n (x) = 1 if
n1 xi k. Let y {0, 1}n be such that y has exactly k ones. Then, the function Tk,n1 (y1 , y2 , . . . . yi1 , yi+1 , . . . , yn )
(where yi is omitted) is equivalent to

a. Tk1 , n(y)
b. Tk,n (y)
c. yi
d. yi
e. None of the above.

tifr2013 set-theory&algebra functions

13.13 Functions: GATE2014-3_2 top gateoverflow.in/2036

Let X and Y be finite sets and f : X Y be a function. Which one of the following statements is TRUE?

(A) For any subsets A and B of X, |fA B| = |f(A)| + |f(B)|

(B) For any subsets A and B of X, f(A B) = f(A) f(B)

(C) For any subsets A and B of X, |f(A B| = min{|f(A)|, |f(B)|}

(D) For any subsets S and T of Y , f 1 (S T ) = f 1 (S) f 1 (T )

gate2014-3 set-theory&algebra functions normal

13.14 Functions: GATE2007_3 top gateoverflow.in/1202

What is the maximum number of different Boolean functions involving n Boolean variables?
2
(A) n2 (B) 2n (C) 22 (D) 2n
n

gate2007 combinatory functions normal

13.15 Functions: GATE1998_1.8 top gateoverflow.in/1645

The number of functions from an m element set to an n element set is

A. m + n
B. mn
C. nm
D. m n

gate1998 set-theory&algebra combinatory functions easy

13.16 Functions: TIFR2012-B-1 top gateoverflow.in/25046

n n
For x, y {0, 1} , let x y be the element of {0, 1} obtained by the component-wise exclusive-or of x and y. A Boolean
n
function F : {0, 1} {0, 1} is said to be linear if F (x y) = F (x) F (y), for all x and y. The number of linear functions
n
from {0, 1} to {0, 1} is.

a. 22n
b. 2n+1
c. 2n1 +1
d. n!
e. 2n

tifr2012 set-theory&algebra functions

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 670 of 852

13.17 Functions: GATE2015-1_5 top gateoverflow.in/8025

x g(h(x))
If g(x) = 1 x and h(x) = x1
, then
h(g(x))
is:

h(x)
A.
g(x)
1
B. x
g(x)
C.
h(x)
x
D.
(1x)2

gate2015-1 set-theory&algebra functions normal

13.18 Functions: GATE2012_37 top gateoverflow.in/1759

How many onto (or surjective) functions are there from an n-element (n 2) set to a 2-element set?

(A) 2n
(B) 2n 1
(C) 2n 2
(D) 2(2n 2)

gate2012 set-theory&algebra functions normal

13.19 Functions: GATE2003_37 top gateoverflow.in/927

Let f: A B be an injective (one-to-one) function. Define g : 2A 2B as:


g(C) = {f(x) x C}, for all subsets C of A.
Define h : 2B 2A as: h(D) = {x x A, f(x) D}, for all subsets D of B. Which of the following statements is always
true?

(A) g(h(D)) D
(B) g(h(D)) D
(C) g(h(D)) D =
(D) g(h(D)) (B D)

gate2003 set-theory&algebra functions normal

13.20 Functions: GATE2014-1_50 top gateoverflow.in/1930

Let  S denote the set of all functions f : {0, 1 }4 {0, 1} . Denote by N the number of functions from S to the set {0, 1} . The value of log2 log2 N is
_______.

gate2014-1 set-theory&algebra functions combinatory numerical-answers

13.21 Functions: GATE2005_43 top gateoverflow.in/1168

Let f : B C and g : A B be two functions and let h = fog. Given that h is an onto function which one of the following
is TRUE?

(A) f and g should both be onto functions.


(B) f should be onto but g need not to be onto
(C) g should be onto but f need not be onto.
(D) both f and g need not be onto.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 671 of 852

gate2005 set-theory&algebra functions normal

13.22 Functions: GATE2014-3_49 top gateoverflow.in/2083

Consider the set of all functions f : {0, 1, , 2014} {0, 1, , 2014} such that f (f (i)) = i, for all 0 i 2014.
Consider the following statements:

P . For each such function it must be the case that for every i, f(i) = i.
Q. For each such function it must be the case that for some i, f(i) = i.
R. Each function must be onto.
Which one of the following is CORRECT?

(A) P, Q and R are true

(B) Only Q and R are true

(C) Only P and Q are true

(D) Only R is true

gate2014-3 set-theory&algebra functions normal

13.23 Functions: TIFR-2014-Maths-B-10 top gateoverflow.in/31334

How many maps : N {0} N {0} are there, with the property that (ab) = (a) + (b), for all a, b N {0}?
a. None
b. Finitely many
c. Countably many
d. Uncountably many.

tifrmaths2014 set-theory&algebra functions

13.24 Functions: TIFR-2015-Maths-B-12 top gateoverflow.in/31930

Let X R and let f, g : X X be a continuous functions such that f(X) g(X) = and f(X) g(X) = X. Which one
of the following sets cannot be equal to X ?

A. [0, 1]
B. (0, 1)
C. [0, 1)
D. R

tifrmaths2015 set-theory&algebra functions

13.25 Functions: TIFR-2015-Maths-B-9 top gateoverflow.in/31924

Let f : R R be a continuous function and A R be defined by


A = {y R : y = limn f(xn ), for some sequencexn +}
Then the set A is necessarily.

A. A connected set
B. A compact set
C. A singleton set
D. None of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 672 of 852

tifrmaths2015 functions non-gate

13.26 Functions: GATE2015-2_54 top gateoverflow.in/8257

Let X and Y denote the sets containing 2 and 20 distinct objects respectively and F denote the set of all possible functions
defined from X to Y . Let f be randomly chosen from F . The probability of f being one-to-one is ______.

gate2015-2 set-theory&algebra functions normal

13.27 Functions: GATE2001_4 top gateoverflow.in/745

Consider the function h : N N N so that h(a, b) = (2a + 1)2b 1, where N = {0, 1, 2, 3, } is the set of natural
numbers.

(a) Prove that the function h is an injection (one-one).

(b) Prove that it is also a Surjection (onto)

gate2001 functions set-theory&algebra normal

13.28 Functions: GATE1996_2.1 top gateoverflow.in/2730

Let R denote the set of real numbers. Let f : R R R R be a bijective function defined by f(x, y) = (x + y, x y).
The inverse function of f is given by

(a) f 1 (x, y) = ( x+y


1
, xy )
1

(b) f 1 (x, y) = (x y, x + y)

=( , 2 )
x+y xy
(c) f 1 (x, y) 2

(d) f 1 (x, y) = [2 (x y) , 2 (x + y)]

gate1996 set-theory&algebra functions normal

13.29 Functions: GATE2001_2.3 top gateoverflow.in/721

Let f : A B a function, and let E and F be subsets of A. Consider the following statements about images.
S1 : f(E F ) = f(E) f(F )
S2 : f(E F ) = f(E) f(F )
Which of the following is true about S1 and S2?

(A) Only S1 is correct

(B) Only S2 is correct

(C) Both S1 and S2 are correct

(D) None of S1 and S2 is correct

gate2001 set-theory&algebra functions normal

13.30 Functions: GATE2015-1_39 top gateoverflow.in/8294

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 673 of 852

Consider the operations

f (X, Y, Z) = X'YZ + XY' + Y'Z' and g (X, Y, Z) = X'YZ + X'YZ' + XY


Which one of the following is correct?

A. Both {f} and {g} are functionally complete


B. Only {f} is functionally complete
C. Only {g} is functionally complete
D. Neither {f} nor {g} is functionally complete

gate2015-1 set-theory&algebra functions difficult

13.31 Functions: GATE1996_1.3 top gateoverflow.in/2707

Suppose X and Y are sets and |X| and |Y | are their respective cardinalities. It is given that there are exactly 97 functions
from X to Y. From this one can conclude that

A. |X| = 1, |Y | = 97
B. |X| = 97, |Y | = 1
C. |X| = 97, |Y | = 97
D. None of the above

gate1996 set-theory&algebra functions normal

13.32 Functions: GATE 2016-1-28 top gateoverflow.in/39717

A function f : N+ N+ , defined on the set of positive integers N+ ,satisfies the following properties:

f(n) = f(n/2) if n is even

f(n) = f(n + 5) if n is odd

Let R = {i j : f(j) = i} be the set of distinct values that f takes. The maximum possible size of R is ___________.
gate2016-1 set-theory&algebra functions normal numerical-answers

13.33 Functions: GATE2015-2_GA_9 top gateoverflow.in/8040

If p, q, r, s are distinct integers such that:

f(p, q, r, s) = max (p, q, r, s)

g(p, q, r, s) = min (p, q, r, s)

h(p, q, r, s) = remainder of (p q)/(r s) if (p q) > (r s)


or remainder of (r s)/(p q) if (r s) > (p q)

Also a function fgh(p, q, r, s) = f(p, q, r, s) g(p, q, r, s) h(p, q, r, s)


Also the same operations are valid with two variable functions of the form f(p, q)
What is the value of fg (h (2, 5, 7, 3) , 4, 6, 8)?

gate2015-2 set-theory&algebra functions normal

13.34 Functions: GATE2015-2_GA_3 top gateoverflow.in/8030

Consider a function f(x) = 1 |x| on 1 x 1. The value of x at which the function attains a maximum, and the
maximum value of the function are:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 674 of 852

A. 0, -1
B. -1, 0
C. 0, 1
D. -1, 2

gate2015-2 set-theory&algebra functions normal

13.35 Functions: GATE2005-IT_31 top gateoverflow.in/3777

Let f be a function from a set A to a set B, g a function from B to C, and h a function from A to C, such that h(a) = g(f(a))
for all a A. Which of the following statements is always true for all such functions f and g?

A) g is onto => h is onto


B) h is onto => f is onto
C) h is onto => g is onto
D) h is onto => f and g are onto

gate2005-it set-theory&algebra functions normal

13.36 Functions: TIFR-2015-Maths-B-6 top gateoverflow.in/31892

Let f : [0, 1] R be a fixed continuous function such that f is differentiable on (0, 1) and f(0) = f(1) = 0. Then the
equation f(x) = f (x) admits.

A. No solution x (0, 1)
B. More than one solution x (0, 1)
C. Exactly one solution x (0, 1)
D. At least one solution x (0, 1)

tifrmaths2015 set-theory&algebra functions

13.37 Functions: GATE2006-IT_6 top gateoverflow.in/3545

Given a boolean function f (x 1, x2, ..., xn), which of the following equations is NOT true

A) f (x 1, x2, ..., xn) = x1'f(x1, x2, ..., xn) + x1f(x1, x2, ..., xn)
B) f (x 1, x2, ..., xn) = x2f(x1, x2, , x n) + x2'f(x1, x2, ,xn)
C) f (x 1, x2, ..., xn) = xn'f(x1, x2, , 0) + x nf(x1, x2, ,1)
D) f (x 1, x2, ..., xn) = f(0, x 2, , x n) + f(1, x 2, .., xn)

gate2006-it set-theory&algebra functions normal

13.38 Generating Functions: TIFR2010-A-12 top gateoverflow.in/18391

The coefficient of x3 in the expansion of (1 + x)3 (2 + x2 )10 is.

a. 214
b. 31
3 10
c. ( 3 ) + ( 1 )
d. ( 3 ) + 2 ( 10 )
3 1
e. ( 3 ) ( 10 ) 29
3 1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 675 of 852

tifr2010 generating-functions

13.39 Groups: TIFR2010-Maths-B-9 top gateoverflow.in/19502

Let

G = {z C z n = 1 for some positive integer n}


. Then under multiplication of complex numbers,

a. G is a group of finite order.


b. G is a group of infinite order, but every element of G has finite order.
c. G is a cyclic group.
d. None of the above.

tifrmaths2010 set-theory&algebra groups

13.40 Groups: GATE1996_1.4 top gateoverflow.in/2708

Which of the following statements is false?

A. The set of rational numbers is an abelian group under addition

B. The set of integers in an abelian group under addition

C. The set of rational numbers form an abelian group under multiplication

D. The set of real numbers excluding zero is an abelian group under multiplication

gate1996 set-theory&algebra groups normal

13.41 Groups: GATE1997_3.1 top gateoverflow.in/2232

Let (Z, ) be an algebraic structure where Z is the set of integers and the operation is defined by n m = max(n. m).
Which of the following statements is true for (Z, )?

A. (Z, ) is a monoid
B. (Z, ) is an Abelian group
C. (Z, ) is a group
D. None of the above

gate1997 set-theory&algebra groups normal

13.42 Groups: GATE1993_28 top gateoverflow.in/2324

Let ({p, q}, ) be a semigroup where p p = q. Show that:


a. p q = q p and
b. q q = p

gate1993 set-theory&algebra groups normal

13.43 Groups: GATE1994_1.10 top gateoverflow.in/2451

Some group (G, o) is known to be abelian. Then, which one of the following is true for G?
g= 1 for every g G

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 676 of 852

A. g = g1 for every g G
B. g = g2 for every g G
C. (goh )2 = g2 oh2 for every g, h G
D. G is of finite order

gate1994 set-theory&algebra groups normal

13.44 Groups: GATE1999_4 top gateoverflow.in/1503

Let G be a finite group and H be a subgroup of G. For a G, define aH = {ah h H}.


a. Show that |aH| = |H|
b. Show that for every pair of elements a, b G, either aH = bH or aH and bH are disjoint
c. Use the above to argue that the order of H must divide the order of G

gate1999 set-theory&algebra groups normal

13.45 Groups: TIFR2010-Maths-A-1 top gateoverflow.in/19346

A cyclic group of order 60 has

a. 12 Generators
b. 15 Generators
c. 16 Generators
d. 20 Generators

tifrmaths2010 groups

13.46 Groups: GATE1995_2.17 top gateoverflow.in/2629

Let A be the set of all non-singular matrices over real number and let be the matrix multiplication operation. Then

A. A is closed under but A, is not a semigroup.

B. A, is a semigroup but not a monoid.

C. A, is a monoid but not a group.

D. A, is a a group but not an abelian group.

gate1995 set-theory&algebra groups

13.47 Groups: TIFR2010-Maths-A-2 top gateoverflow.in/19347

Which of the following is false?

a. Any abelian group of order 27 is cyclic.


b. Any abelian group of order 14 is cyclic.
c. Any abelian group of order 21 is cyclic.
d. Any abelian group of order 30 is cyclic.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 677 of 852

tifrmaths2010 set-theory&algebra groups

13.48 Groups: TIFR2010-Maths-A-15 top gateoverflow.in/19365

Let G be the set of all 2 x 2 symmetric, invertible matrices with real entries. Then with matrix multiplication, G is.

a. An infinite group.
b. A finite group.
c. Not a group.
d. An abelian group.

tifrmaths2010 groups

13.49 Groups: GATE1995_21 top gateoverflow.in/2659

Let G1 and G2 be subgroups of a group G.

a. Show that G1 G2 is also a subgroup of G.


b. Is G1 G2 always a subgroup of G?.

gate1995 set-theory&algebra groups normal

13.50 Groups: GATE2014-3_50 top gateoverflow.in/2084

There are two elements x, y in a group (G, ) such that every element in the group can be written as a product of some
number of x's and y's in some order. It is known that

xx= yy = xyxy = yxyx= e

where e is the identity element. The maximum number of elements in such a group is ____.

gate2014-3 set-theory&algebra groups numerical-answers normal

13.51 Groups: GATE1998_12 top gateoverflow.in/1726

Let (A, ) be a semigroup, Furthermore, for every a and b in A, if a b, then a b b a.


a. Show that for every a in A, a a = a
b. Show that for every a , b in A, a b a = a
c. Show that for every a, b, c in A, a b c = a c

gate1998 set-theory&algebra groups descriptive

13.52 Groups: GATE2003_7 top gateoverflow.in/898

Consider the set of all strings over the alphabet = {0, 1}. with the concatenation operator for strings
A. does not form a group

B. forms a non-commutative group

C. does not have a right identity element

D. forms a group if the empty string is removed from

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 678 of 852

gate2003 set-theory&algebra groups normal

13.53 Groups: GATE2006_03 top gateoverflow.in/882

The set {1,2,3,5,7,8,9} under multiplication modulo 10 is not a group. Given below are four possible reasons. Which one of
them is false?

(A) It is not closed


(B) 2 does not have an inverse
(C) 3 does not have an inverse
(D) 8 does not have an inverse

gate2006 set-theory&algebra groups normal

13.54 Groups: GATE2005_46 top gateoverflow.in/1171

Consider the set H of all 3 * 3 matrices of the type

a f e
0 b d
0 0 c
where a,b,c,d,e and f are real numbers and abc 0. under the matrix multiplication operation, the set H is:

(A) a group (B) a monoid but not a group (C) a semi group but not a monoid (D) neither a group nor a semi group

gate2005 set-theory&algebra groups normal

13.55 Groups: TIFR-2014-Maths-B-4 top gateoverflow.in/31321

Let H1 , H2 be two distinct subgroups of a finite group G, each of order 2. Let H be the smallest subgroup containing H1
and H2 . Then the order of H is

a. Always 2
b. Always 4
c. Always 8
d. None of the above.

tifrmaths2014 set-theory&algebra groups

13.56 Groups: GATE2004_72 top gateoverflow.in/1066

The following is the incomplete operation table of a 4-element group.

*eabc
ee a bc
aa bc e
b
c

The last row of the table is

A. c a e b
B. c b a e
C. c b e a
D. c e a b

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 679 of 852

gate2004 set-theory&algebra groups normal

13.57 Groups: GATE2002_1.6 top gateoverflow.in/810

Which of the following is true?

A. The set of all rational negative numbers forms a group under multiplication.
B. The set of all non-singular matrices forms a group under multiplication.
C. The set of all matrices forms a group under multiplication.
D. Both B and C are true.

gate2002 set-theory&algebra groups normal

13.58 Groups: TIFR-2015-Maths-B-8 top gateoverflow.in/31921

For a group G, let F (G) denote the collection of all subgroups of G. Which one of the following situations can occur ?

A. G is finite but F (G) is infinite.


B. G is infinite but F (G) is finite.
C. G is countable but F (G) is uncountable.
D. G is uncountable but F (G) is countable.

tifrmaths2015 groups

13.59 Groups: GATE2007_21 top gateoverflow.in/1219

How many different non-isomorphic Abelian groups of order 4 are there?

(A) 2 (B) 3 (C) 4 (D) 5

gate2007 groups normal

13.60 Groups: TIFR-2015-Maths-B-14 top gateoverflow.in/31937

Let G be a group. Suppose |G| = p2 q, where p and q are distinct prime numbers satisfying q 1 mod p. Which of the
following is always true?

A. G has more than one p-Sylow subgroup.


B. G has a normal p-Sylow subgroup.
C. The number of q-Sylow subgroups of G is divisible by p.
D. G has a unique q-Sylow subgroup.

tifrmaths2015 groups

13.61 Groups: GATE1992-14b top gateoverflow.in/43580

Consider the set of integers {1, 2, 3, 4, 6, 8, 12, 24} together with the two binary operations LCM (lowest common multiple)
and GCD (greatest common divisor). Which of the following algebraic structures does this represent?

A. group
B. ring
C. field
D. lattice

gate1992 set-theory&algebra groups normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 680 of 852

13.62 Groups: GATE1992-14a top gateoverflow.in/593

If G is a group of even order, then show that there exists an element a e, e, the identity in G, such that a2 = e.

gate1992 set-theory&algebra groups normal

13.63 Injective Functions: GATE1993_8.6 top gateoverflow.in/2304

Let A and B be sets with cardinalities m and n respectively. The number of one-one mappings from A to B, when m < n,
is

A. mn
B. n Pm
C. m Cn
D. n Cm
E. m Pn

gate1993 set-theory&algebra functions injective-functions easy

13.64 Lattice: GATE1997_3.3 top gateoverflow.in/2234

In the lattice defined by the Hasse diagram given in following figure, how many complements does the element e have?

A. 2
B. 3
C. 0
D. 1

gate1997 set-theory&algebra lattice normal

13.65 Lattice: GATE2015-1_34 top gateoverflow.in/8281

Suppose L = {p, q, r, s, t} is a lattice represented by the following Hasse diagram:

For any x, y L , not necessarily distinct , x y and x y are join and meet of x, y, respectively. Let
L3 = {(x, y, z) : x, y, z L} be the set of all ordered triplets of the elements of L. Let pr be the probability that an element
(x, y, z) L3 chosen equiprobably satisfies x (y z) = (x y) (x z). Then
A. pr = 0
B. pr = 1
1
C. 0 < pr 5
1
< r <1
Copyright GATE Overflow. All rights reserved.
GATE Overflow April 2016 681 of 852

D. 1 < pr < 1
5

gate2015-1 set-theory&algebra normal lattice

13.66 Lattice: GATE2005_9 top gateoverflow.in/1158

The following is the Hasse diagram of the poset [{a,b,c,d,e},]

The poset is :

A. not a lattice
B. a lattice but not a distributive lattice
C. a distributive lattice but not a Boolean algebra
D. a Boolean algebra

gate2005 set-theory&algebra lattice normal

13.67 Lattice: GATE1994_2.9 top gateoverflow.in/2476

The Hasse diagrams of all the lattices with up to four elements are _____ (write all the relevant Hasse diagrams)

gate1994 set-theory&algebra lattice normal

13.68 Lattice: GATE2008-IT_28 top gateoverflow.in/3318

Consider the following Hasse diagrams.

Which all of the above represent a lattice?

A) (i) and (iv) only


B) (ii) and (iii) only
C) (iii) only
D) (i), (ii) and (iv) only

gate2008-it set-theory&algebra lattice normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 682 of 852

13.69 Lattice: GATE2002_4 top gateoverflow.in/857

S = {(1, 2), (2, 1)} is binary relation on set A = {1, 2, 3}. Is it irreflexive? Add the minimum number of ordered pairs to S
to make it an equivalence relation. Give the modified S.

Let S = {a, b} and let (S) be the powerset of S. Consider the binary relation ' (set inclusion)' on (S). Draw the Hasse
diagram corresponding to the lattice ((S), )

gate2002 set-theory&algebra normal lattice

13.70 Lattice: TIFR2012-B-4 top gateoverflow.in/25090

Let , denote the meet and join operations of lattice. A lattice is called distributive if for all x, y, z,
x (y z) = (x y) (x z)
It is called complete if meet and join exist for every subset. It is called modular if for all x, y, z
z x x (y z) = (x y) z
The positive integers under divisibility ordering i.e. p q if p divides q forms a.
a. Complete lattice.
b. Modular, but not distributive lattice.
c. Distributive lattice.
d. Lattice but not a complete lattice.
e. Under the give ordering positive integers do not form a lattice.

tifr2012 set-theory&algebra lattice

13.71 Lines Curves: GATE2007-IT_80 top gateoverflow.in/3532

Let P 1, P 2,..... , P n be n points in the xy-plane such that no three of them are collinear. For every pair of points P i and P j, let
Lij be the line passing through them. Let L ab be the line with the steepest gradient amongst all n(n -1)/2 lines.

Which one of the following properties should necessarily be satisfied ?

A) Pa and P b are adjacent to each other with respect to their x-coordinate


B) Either P a or P b has the largest or the smallest y-coordinate among all the points
C) The difference between x-coordinatef P a and P b is minimum
D) None of the above

gate2007-it lines-curves

13.72 Number Series: TIFR2010-Maths-A-4 top gateoverflow.in/19350

The sum of the series

1 1 1 1
+ + ++
12 23 34 100 101
a. 99
101
98
b.
101
99
c. 100
d. None of the above.

tifrmaths2010 number-series

13.73 Partial Order: TIFR2012-B-5 top gateoverflow.in/25092

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 683 of 852

Let R be a binary relation over a set S. The binary relation R is called an equivalence relation if it is reflexive transitive and
symmetric. The relation is called partial order if it is reflexive, transitive and anti symmetric. (Notation: Let aRb denote that
order pair (a, b) R. ) The relation R is called a well-order if R is a partial order and there does not exist an infinite
descending chain (with respect to R) within S. An infinite sequence x1 , x2 . . . of elements of S is called an infinite
descending chain if for all i we have xi+1 Rxi and xi xi+1 .

Take S = and let the binary relation over S be such that (i1 , j1 ) (i2 , j2 ) if and only if either (i1 < i2 ) or
((i1 = i2 ) (j1 j2 )). Which statement is true of ?
a. is an equivalence relation but not a well order.
b. is a partial order but not a well order.
c. is a partial order and a well order.
d. is an equivalence relation and a well order.
e. is neither a partial order nor an equivalence relation.

tifr2012 set-theory&algebra partial-order

13.74 Partial Order: GATE1993_8.5 top gateoverflow.in/2303

The less-than relation, <, on reals is

A. a partial ordering since it is asymmetric and reflexive

B. a partial ordering since it is antisymmetric and reflexive

C. not a partial ordering because it is not asymmetric and not reflexive

D. not a partial ordering because it is not antisymmetric and reflexive

E. none of the above

gate1993 set-theory&algebra partial-order easy

13.75 Partial Order: GATE1998_11 top gateoverflow.in/1725

Suppose A = {a, b, c, d} and 1 is the following partition of A


1 = {{a, b, c} {d}}
a. List the ordered pairs of the equivalence relations induced by 1 .

b. Draw the graph of the above equivalence relation.

c. Let 2 = {{a} , {b} , {C} , {d}}


3 = {{a, b, c, d}}
and 4 = {{a, b} , {c, d}}
Draw a Poset diagram of the poset, {1 , 2 , 3 , 4 } , refines .

gate1998 set-theory&algebra normal partial-order

13.76 Partial Order: GATE1996_1.2 top gateoverflow.in/2706

Let X = {2, 3, 6, 12, 24}, Let be the partial order defined by X Y if x divides y. Number of edges in the Hasse diagram
of (X, ) is

A. 3
B. 4
C. 9
D. None of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 684 of 852

gate1996 set-theory&algebra partial-order normal

13.77 Partial Order: TIFR2014-B-15 top gateoverflow.in/27322

Consider the set N of finite sequences of natural numbers with x p y denoting that sequence x is a prefix of sequence y.
Then, which of the following is true?

a. N is uncountable.
b. p is a total order.
c. Every non-empty subset of N has a least upper bound.
d. Every non-empty subset of N has a greatest lower bound.
e. Every non-empty finite subset of N has a least upper bound.

tifr2014 set-theory&algebra partial-order

13.78 Partial Order: GATE1991_01,xiv top gateoverflow.in/509

If the longest chain in a partial order is of length n, then the partial order can be written as a _____ of n antichains.
gate1991 set-theory&algebra partial-order normal

13.79 Partial Order: TIFR2014-B-16 top gateoverflow.in/27341

Consider the ordering relation x y N N over natural numbers N such that x y if there exists z N such that
x z = y. A set is called lattice if every finite subset has a least upper bound and greatest lower bound. It is called a
complete lattice if every subset has a least upper bound and greatest lower bound. Then,

a. is an equivalence relation.
b. Every subset of N has an upper bound under | .
c. is a total order.
d. (N, ) is a complete lattice.
e. (N, ) is a lattice but not a complete lattice.

tifr2014 set-theory&algebra partial-order

13.80 Partial Order: GATE2004_73 top gateoverflow.in/1067

The inclusion of which of the following sets into

S = {{1, 2} , {1, 2, 3} , {1, 3, 5} , {1, 2, 4} , {1, 2, 3, 4, 5}}


is necessary and sufficient to make S a complete lattice under the partial order defined by set containment?

A. {1}
B. {1}, {2, 3}
C. {1}, {1, 3}
D. {1}, {1, 3}, {1, 2, 3, 4}, {1, 2, 3, 5}

gate2004 set-theory&algebra partial-order normal

13.81 Partial Order: TIFR2013-B-4 top gateoverflow.in/25664

A set S together with partial order is called a well order if it has no infinite descending chains, i.e. there is no infinite
S i+1 i i

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 685 of 852

sequence x1 , x2 , of elements from S such that xi+1 xi and xi+1 xi for all i.
Consider the set of all words (finite sequence of letters a z), denoted by W , in dictionary order.

a. Between aa " and az " there are only 24 words.


b. Between aa " and az " there are only 224 words.
c. W is not a partial order.
d. W is a partial order but not a well order.
e. W is a well order.

tifr2013 set-theory&algebra partial-order

13.82 Partial Order: GATE2007-IT_23 top gateoverflow.in/3456

A partial order P is defined on the set of natural numbers as follows. Here x/y denotes integer division.

i. (0, 0) P.
ii. (a, b) P if and only if a % 10 b % 10 and (a/10, b/10) P.

Consider the following ordered pairs:

i. (101, 22)
ii. (22, 101)
iii. (145, 265)
iv. (0, 153)

Which of these ordered pairs of natural numbers are contained in P?

A) (i) and (iii)


B) (ii) and (iv)
C) (i) and (iv)
D) (iii) and (iv)

gate2007-it set-theory&algebra partial-order normal

13.83 Partial Order: GATE1997_6.1 top gateoverflow.in/2257

A partial order is defined on the set S = {x, a 1, a 2, ... a n, y} as x a i for all i and a i y for all i, where n 1. The
number of total orders on the set S which contain the partial order is

A. n!
B. n+2
C. n
D. 1

gate1997 set-theory&algebra partial-order normal

13.84 Pigeonhole: GATE2005_44 top gateoverflow.in/1170

What is the minimum number of ordered pairs of non-negative numbers that should be chosen to ensure that there are two
pairs (a,b) and (c,d) in the chosen set such that

ac mod 3 and b d mod 5


(A) 4 (B) 6 (C) 16 (D) 24

gate2005 set-theory&algebra normal pigeonhole counting

13.85 Polynomials: GATE2014-2_5 top gateoverflow.in/1957

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 686 of 852

A non-zero polynomial f(x) of degree 3 has roots at x = 1 , x = 2 and x = 3 . Which one of the following must be TRUE?

(A) f(0)f(4) < 0

(B) f(0)f(4) >0

(C) f(0) + f(4) >0

(D) f(0) + f(4) <0

gate2014-2 set-theory&algebra polynomials numerical-answers normal

13.86 Polynomials: TIFR2010-Maths-B-15 top gateoverflow.in/26477

Which of the following statements is false?

A. The polynomial x2 + x + 1 is irreducible in Z/2Z[x].


B. The polynomial x2 2 is irreducible in Q[x].
C. The polynomial x2 + 1 is reducible in Z/5Z[x] .
D. The polynomial x2 + 1 is reducible in Z/7Z[x] .

tifrmaths2010 polynomials

13.87 Recurrence: GATE 2016-1-2 top gateoverflow.in/39636

Let an be the number of n-bit strings that do NOT contain two consecutive 1s. Which one of the following is the recurrence
relation for an ?

A. an = an1 + 2an2
B. an = an1 + an2
C. an = 2an1 + an2
D. an = 2an1 + 2an2

gate2016-1 set-theory&algebra recurrence easy

13.88 Recurrence: GATE1996_9 top gateoverflow.in/2761

The Fibonacci sequence {f1 , f2 , f3 fn } is defined by the following recurrence:

fn+2 = fn+1 + fn , n 1; f2 = 1 : f1 = 1

Prove by induction that every third element of the sequence is even.

gate1996 set-theory&algebra recurrence proof

13.89 Recurrence: GATE 2016-1-27 top gateoverflow.in/39714

Consider the recurrence relation a1 = 8, an = 6n2 + 2n + an1 . Let a99 = K 104 . The value of K is __________.
gate2016-1 set-theory&algebra recurrence normal numerical-answers

13.90 Relations: GATE1998_1.7 top gateoverflow.in/1644

Let R1 and R2 be two equivalence relations on a set. Consider the following assertions:
R1 R2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 687 of 852

i. R1 R2 is an equivalence relation
ii. R1 R2 is an equivalence relation
Which of the following is correct?

A. Both assertions are true

B. Assertions (i) is true but assertions (ii) is not true

C. Assertions (ii) is true but assertions (i) is not true

D. Neither (i) nor (ii) is true

gate1998 set-theory&algebra relations normal

13.91 Relations: GATE 2016-2-26 top gateoverflow.in/39603

A binary relation R on N N is defined as follows: (a, b)R(c, d) if a c or b d. Consider the following propositions:
P: R is reflexive.

Q: R is transitive.

Which one of the following statements is TRUE?

A. Both P and Q are true.


B. P is true and Q is false.
C. P is false and Q is true.
D. Both P and Q are false.

gate2016-2 set-theory&algebra relations normal

13.92 Relations: GATE2004-IT_4 top gateoverflow.in/3645

Let R 1 be a relation from A = {1, 3, 5, 7} to B = {2, 4, 6, 8} and R 2 be another relation from B to C = {1, 2, 3, 4} as
defined below:

i. An element x in A is related to an element y in B (under R 1) if x + y is divisible by 3.


ii. An element x in B is related to an element y in C (under R 2) if x + y is even but not divisible by 3.

Which is the composite relation R 1R2 from A to C?

A) R1R2 = {(1, 2), (1, 4), (3, 3), (5, 4), (7, 3)}
B) R1R2 = {(1, 2), (1, 3), (3, 2), (5, 2), (7, 3)}
C) R1R2 = {(1, 2), (3, 2), (3, 4), (5, 4), (7, 2)}
D) R1R2 = {(3, 2), (3, 4), (5, 1), (5, 3), (7, 1)}

gate2004-it set-theory&algebra relations normal

13.93 Relations: GATE2015-2_16 top gateoverflow.in/8089

Let R be the relation on the set of positive integers such that aRb and only if a and b are distinct and let have a common
divisor other than 1. Which one of the following statements about R is true?

A. R is symmetric and reflexive but not transitive

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 688 of 852

B. R is reflexive but not symmetric not transitive


C. R is transitive but not reflexive and not symmetric
D. R is symmetric but not reflexive and not transitive

gate2015-2 set-theory&algebra relations normal

13.94 Relations: GATE1996_8 top gateoverflow.in/2760

Let F be the collection of all functions f : {1, 2, 3} {1, 2, 3}. If f and g F , define an equivalence relation by f g if
and only if f(3) = g(3).

a. Find the number of equivalence classes defined by .


b. Find the number of elements in each equivalence class.

gate1996 set-theory&algebra relations functions normal

13.95 Relations: GATE1998_1.33 top gateoverflow.in/1670

Given two union compatible relations R1 (A, B) and R2 (C, D), what is the result of the operation R1 A=CB=D R2 ?
A. R1 R2
B. R1 R2
C. R1 R2

D. R1 R2

gate1998 set-theory&algebra relations normal relational-algebra

13.96 Relations: GATE1999_3 top gateoverflow.in/1522

a. Mr. X claims the following:

If a relation R is both symmetric and transitive, then R is reflexive. For this, Mr. X offers the following proof:

From xRy, using symmetry we get yRx. Now because R is transitive xRy and yRx together imply xRx. Therefore, R is
reflexive.

b. Give an example of a relation R which is symmetric and transitive but not reflexive.

gate1999 set-theory&algebra relations normal

13.97 Relations: GATE1998_1.6 top gateoverflow.in/1643

Suppose A is a finite set with n elements. The number of elements in the largest equivalence relation of A is

(a) n

(b) n2

(c) 1

(d) n + 1

gate1998 set-theory&algebra relations easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 689 of 852

13.98 Relations: GATE1996_2.2 top gateoverflow.in/2731

Let R be a non-empty relation on a collection of sets defined by ARB if and only if A B = . Then, (pick the true
statement)

A. A is reflexive and transitive

B. R is symmetric and not transitive

C. R is an equivalence relation

D. R is not reflexive and not symmetric

gate1996 set-theory&algebra relations normal

13.99 Relations: GATE2000_2.5 top gateoverflow.in/652

A relation R is defined on the set of integers as xRy iff (x + y) is even. Which of the following statements is true?

A. R is not an equivalence relation


B. R is an equivalence relation having 1 equivalence class
C. R is an equivalence relation having 2 equivalence classes
D. R is an equivalence relation having 3 equivalence classes

gate2000 set-theory&algebra relations normal

13.100 Relations: GATE2015-3_41 top gateoverflow.in/8500

Let R be a relation on the set of ordered pairs of positive integers such that ((p, q), (r, s)) R if and only if p s = q r.
Which one of the following is true about R?

A. Both reflexive and symmetric


B. Reflexive but not symmetric
C. Not reflexive but symmetric
D. Neither reflexive nor symmetric

gate2015-3 set-theory&algebra relations normal

13.101 Relations: GATE1997_14 top gateoverflow.in/2274

Let R be a reflexive and transitive relation on a set A. Define a new relation E on A as


E = {(a, b) (a, b) R and (b, a) R}
1. Prove that E is an equivalence relation on A.

2. Define a reason on the equivalence classes of E as E1 E2 if a, b such that a E1 , b E2 and (a, b) R. Prove
that is a partal order.

gate1997 set-theory&algebra relations normal

13.102 Relations: GATE1997_6.3 top gateoverflow.in/2259

The number of equivalence relations of the set {1, 2, 3, 4} is

A. 15

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 690 of 852

B. 16
C. 24
D. 4

gate1997 set-theory&algebra relations normal

13.103 Relations: GATE1995_1.19 top gateoverflow.in/2606

Let R be a symmetric and transitive relation on a set A. Then


A. R is reflexive and hence an equivalence relation

B. R is reflexive and hence a partial order

C. R is reflexive and hence not an equivalence relation

D. None of the above

gate1995 set-theory&algebra relations normal

13.104 Relations: GATE1999_1.2 top gateoverflow.in/1456

The number of binary relations on a set with n elements is:

A. n2

B. 2n
2
C. 2n

D. None of the above

gate1999 set-theory&algebra relations combinatory easy

13.105 Ring: GATE2010_4 top gateoverflow.in/1150

Consider the set S = {1, , 2 }, where and 2 are cube roots of unity. If * denotes the multiplication operation, the
structure (S, *) forms

(A) A Group (B) A Ring (C) An integral domain (D) A field

gate2010 set-theory&algebra normal ring groups

13.106 Ring: GATE1994_16 top gateoverflow.in/2512

Every element a of some ring (R, +, o) satisfies the equation a o a = a. Decide whether or not the ring is commutative.
gate1994 set-theory&algebra ring normal

13.107 Sequence: GATE2007-IT_76 top gateoverflow.in/3528

Consider the sequence defined by the recurrence relation , where .

Suppose there exists a non-empty, open interval such that for all satisfying , the sequence converges to
a limit. The sequence converges to the value?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 691 of 852

A)

B)

C)

D)

gate2007-it set-theory&algebra normal recurrence sequence

13.108 Sets: TIFR2010-Maths-A-9 top gateoverflow.in/19356

The total number of subsets of a set of 6 elements is.

a. 720
b. 66
c. 21
d. None of the above.

tifrmaths2010 set-theory&algebra sets

13.109 Sets: GATE2015-3_23 top gateoverflow.in/8426

Suppose U is the power set of the set S = {1, 2, 3, 4, 5, 6}. For any T U , let |T | denote the number of elements in T and
T denote the complement of T . For any T , R U let T R be the set of all elements in T which are not in R. Which one of
the following is true?

A. X U, (|X| = |X |)
B. X U, Y U, (|X| = 5, |Y | = 5 and X Y = )
C. X U, Y U, (|X| = 2, |Y | = 3 and XY = )
D. X U, Y U, (XY = Y X )

gate2015-3 set-theory&algebra sets normal

13.110 Sets: GATE2015-1_16 top gateoverflow.in/8238

For a set A, the power set of A is denoted by 2A . If A = {5, {6} , {7}}, which of the following options are TRUE?

I. 2A
II. 2A
III. {5, {6}} 2A
IV. {5, {6}} 2A

A. I and III only


B. II and III only
C. I, II and III only
D. I, II and IV only

gate2015-1 set-theory&algebra sets normal

13.111 Sets: TIFR2011-B-23 top gateoverflow.in/20400

Suppose (S1 , S2 , . . . , Sm ) is a finite collection of non-empty subsets of a universe U. Note that the sets in this collection

Si Sj

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 692 of 852

need not to be distinct. Consider the following basic step to be performed on this sequence. While there exist sets Si and Sj
in the sequence, neither of which is a subset of the other, delete them from the sequence, and

(i) If Si Sj , then add the sets Si Sj and Si Sj to the sequence;


(ii) If Si Sj = , then add only the set Si Sj to the sequence.
In each step we delete two sets from the sequence and add at most two sets to the sequence. Also, note that empty sets are
never added to the sequence. Which of the following statements is TRUE?

a. The size of the smallest set in the sequence decreases in every step.
b. The size of the largest set in the sequence increases in every step.
c. The process always terminates.
d. The process terminates if U is finite but might not if U is infinite.
e. There is a finite collection of subsets of a finite universe U and a choice of Si and Sj in each step such that the process
does not terminate.

tifr2011 set-theory&algebra sets

13.112 Sets: TIFR2010-Maths-B-6 top gateoverflow.in/19499

Let A, B be subsets of R. Define A + B to be the set of all sums x + y with x A and y B. Which of the following
statements is false?

a. If A and B are bounded, then A + B is bounded.


b. If A and B are open, then A + B is open.
c. If A and B are closed, then A + B is closed.
d. If A and B are connected, then A + B is connected.

tifrmaths2010 set-theory&algebra sets

13.113 Sets: GATE2015-2_18 top gateoverflow.in/8092

The cardinality of the power set of {0, 1, 2, , 10} is _______

gate2015-2 set-theory&algebra sets easy

13.114 Sets: TIFR2011-A-10 top gateoverflow.in/20039

Let m , n denote two integers from the set {1, 2, , 10}. The number of ordered pairs (m, n) such that 2m + 2n is divisible
by 5 is.

a. 10
b. 14
c. 24
d. 8
e. None of the above.

tifr2011 set-theory&algebra sets

13.115 Sets: TIFR2010-A-18 top gateoverflow.in/18496

Let X be a set of size n. How many pairs of sets (A, B) are there that satisfy the condition A B X ?
a. 2n+1
b. 22n
c. 3n
d. 2 + 1
n

e. 3n+1

tifr2010 sets

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 693 of 852

13.116 Time Complexity: GATE2005_7 top gateoverflow.in/1349

The time complexity of computing the transitive closure of a binary relation on a set of n elements is known to be:

A. O(n)

B. O(n log n)

C. O (n 2 )
3

D. O (n3 )

gate2005 set-theory&algebra normal time-complexity

13.117 GATE1992-15.b top gateoverflow.in/43579

Let S be the set of all integers and let n > 1 be a fixed integer. Define for a,b S,aRb iff a b is a multiple of n . Show that R is an equivalence relation and find its
equivalence classes for n = 5.

gate1992 set-theory&algebra normal

13.118 GATE_2016_SET2_26 top gateoverflow.in/40385

A binary relation R on NN is defined as follows: (a,b)R(c,d) if ac or bd. Consider the following propositions:

P: R is reflexive

Q: R is transitive

Which one of the following statements is TRUE?

(A) Both P and Q are true. (B) P is true and Q is false. (C) P is false and Q is true. (D) Both P and Q are false.

13.119 TIFR2012-A-8 top gateoverflow.in/21007

How many pairs of sets (A, B) are there that satisfy the condition A, B {1, 2, . . . , 5} , A B = {}?
a. 125
b. 127
c. 130
d. 243
e. 257

tifr2012 set-theory&algebra

13.120 GATE2015-3_5 top gateoverflow.in/8399

The number of 4 digit numbers having their digits in non-decreasing order (from left to right) constructed by using the digits
belonging to the set {1, 2, 3} is ________.

gate2015-3 set-theory&algebra normal

13.121 TIFR-2015-Maths-B-7 top gateoverflow.in/31897

C P (x) Q [x]

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 694 of 852

A complex number C is called algebraic if there is a non-zero polynomial P (x) Q [x] with rational coefficients such
that P () = 0. Which of the following statements is true?

A. There are only finitely many algebraic numbers.


B. All complex numbers are algebraic.
C. sin + cos is algebraic.
3 4
D. None of the above.

tifrmaths2015 set-theory&algebra non-gate

13.122 TIFR2010-A-15 top gateoverflow.in/18394

Let A, B be sets. Let A denote the compliment of set A (with respect to some fixed universe), and (A B) denote the set
of elements in A which are not in B. Set (A (A B)) is equal to:

a. B
b. A B
c. A B
d. A B
e. B

tifr2010 set-theory&algebra

13.123 TIFR2013-A-3 top gateoverflow.in/25384

Three candidates, Amar, Birendra and Chanchal stand for the local election. Opinion polls are conducted and show that
fraction a of the voters prefer Amar to Birendra, fraction b prefer Birendra to Chanchal and fraction c prefer Chanchal to
Amar. Which of the following is impossible?

a. (a, b, c) = (0.51, 0.51, 0.51);


b. (a, b, c) = (0.61, 0.71, 0.67);
c. (a, b, c) = (0.68, 0.68, 0.68);
d. (a, b, c) = (0.49, 0.49, 0.49);
e. None of the above.

tifr2013 set-theory&algebra

13.124 GATE 2016-2-28 top gateoverflow.in/39595

Consider a set U of 23 different compounds in a chemistry lab. There is a subset S of U of 9 compounds, each of which
reacts with exactly 3 compounds of U . Consider the following statements:

I. Each compound in U \ S reacts with an odd number of compounds.


II. At least one compound in U \ S reacts with an odd number of compounds.
III. Each compound in U \ S reacts with an even number of compounds.

Which one of the above statements is ALWAYS TRUE?

A. Only I
B. Only II
C. Only III
D. None.

gate2016-2 set-theory&algebra difficult

13.125 GATE2015-1_26 top gateoverflow.in/8248

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 695 of 852

99
x=1
1
x(x+1)
= __________________.

gate2015-1 set-theory&algebra normal

13.126 GATE 2016-1-1 top gateoverflow.in/39663

Let p, q, r, s represents the following propositions.

p : x {8, 9, 10, 11, 12}

q : x is a composite number.
r : x is a perfect square.
s : x is a prime number.
The integer x 2 which satisfies ((p q) (r s)) is ____________.
gate2016-1 set-theory&algebra normal numerical-answers

13.127 GATE2015-1_28 top gateoverflow.in/8226

The binary operator is defined by the following truth table.

p q p q
0 0 0
0 1 1
1 0 1
1 1 0

Which one of the following is true about the binary operator ?

A. Both commutative and associative


B. Commutative but not associative
C. Not commutative but associative
D. Neither commutative nor associative

gate2015-1 set-theory&algebra easy

13.128 GATE1994_3.9 top gateoverflow.in/2495

Every subset of a countable set is countable.

State whether the above statement is true or false with reason.

gate1994 set-theory&algebra normal

13.129 GATE2006_24 top gateoverflow.in/987

Given a set of elements N = {1, 2, ..., n} and two arbitrary subsets AN and BN, how many of the n! permutations from
N to N satisfy min((A)) = min( (B)), where min(S) is the smallest integer in the set of integers S, and (S) is the set of
integers obtained by applying permutation to each element of S?

2 |AB| |AB|2
(A) (n - |A B|) |A| |B| (B) (|A| + |B|2 )n2 (C) n! |AB| (D) n C
|AB|

gate2006 set-theory&algebra normal

13.130 GATE2006_25 top gateoverflow.in/988

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 696 of 852

Let S = {1, 2, 3,........, m}, m >3. Let X 1.........Xn be subsets of S each of size 3. Define a function f from S to the set of
m
natural numbers as, f(i) is the number of sets Xj that contain the element i. That is f(i) = |{j i Xj }| then i=1 f(i) is:

(A) 3m
(B) 3n
(C) 2m+1
(D) 2n+1

gate2006 set-theory&algebra normal

13.131 GATE2006_22 top gateoverflow.in/983

Let E, F and G be finite sets. Let

X = (E F ) (F G) and
Y = (E (E G)) (E F ).

Which one of the following is true?

(A) X Y (B) X Y (C) X = Y (D) X Y and Y X


gate2006 set-theory&algebra normal

13.132 GATE2003_38 top gateoverflow.in/929

Consider the set {a, b, c} with binary operators + and defined as follows.

+ a b c
a b a c
b a b c
c a c b

* a b c
a a b c
b b c a
c c c b

For example, a + c = c, c + a = a, c b = c and b c = a.


Given the following set of equations:

(a x) + (a y) = c
(b x) + (c y) = c

The number of solution(s) (i.e., pair(s) (x, y) that satisfy the equations) is

(A) 0 (B) 1 (C) 2 (D) 3

gate2003 set-theory&algebra normal

13.133 GATE2006_04 top gateoverflow.in/883

A relation R is defined on ordered pairs of integers as follows:

(x, y)R(u, v) if x < u and y > v


Then R is:

(A) Neither a Partial Order nor an Equivalence Relation

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 697 of 852

(B) A Partial Order but not a Total Order


(C) A total Order
(D) An Equivalence Relation

gate2006 set-theory&algebra normal

13.134 GATE2003_31 top gateoverflow.in/921

Let (S, ) be a partial order with two minimal elements a and b, and a maximum element c. Let P: S {True, False} be a
predicate defined on S. Suppose that P(a) = True, P(b) = False and P(x) P(y) for all x, y S satisfying x y, where
stands for logical implication. Which of the following statements CANNOT be true?
(A) P(x) = True for all x S such that x b
(B) P(x) = False for all x S such that x a and x c
(C) P(x) = False for all x S such that b x and x c
(D) P(x) = False for all x S such that a x and b x

gate2003 set-theory&algebra normal

13.135 GATE2004_24 top gateoverflow.in/1021

Consider the binary relation:

S = {(x, y) y = x + 1 and x, y {0, 1, 2}}


The reflexive transitive closure is S is

A. {(x, y) y > x and x, y {0, 1, 2}}


B. {(x, y) y x and x, y {0, 1, 2}}
C. {(x, y) y < x and x, y {0, 1, 2}}
D. {(x, y) y x and x, y {0, 1, 2}}

gate2004 set-theory&algebra easy

13.136 GATE2010_3 top gateoverflow.in/1149

What is the possible number of reflexive relations on a set of 5 elements?

(A) 210 (B) 215 (C) 220 (D) 225

gate2010 set-theory&algebra easy

13.137 GATE2007_2 top gateoverflow.in/1201

Let S be a set of n elements. The number of ordered pairs in the largest and the smallest equivalence relations on S are:
(A) n and n (B) n2 and n (C) n2 and 0 (D) n and 1

gate2007 set-theory&algebra normal

13.138 GATE2007_26 top gateoverflow.in/1224

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 698 of 852

Consider the set S = {a, b, c, d} . Consider the following 4 partitions 1 , 2 , 3 , 4 on


S : 1 = {abcd

} , 2 = {ab , cd } , 3 = {abc

, d } , 4 = {a, b , c , d}. Let be the partial order on the set of partitions

S = {1 , 2 , 3 , 4 } defined as follows: i j if and only if i refines j . The poset diagram for (S , ) is:

gate2007 set-theory&algebra normal

13.139 GATE2005_42 top gateoverflow.in/1167

Let R and S be any two equivalence relations on a non-empty set A. Which one of the following statements is TRUE?

(A) R S, R S are both equivalence relations.


(B) R S is an equivalence relation.
(C) R S is an equivalence relation.
(D) Neither R S nor R S are equivalence relations.

gate2005 set-theory&algebra normal

13.140 GATE2005_13 top gateoverflow.in/1163

The set {1, 2, 4, 7, 8, 11, 13, 14} is a group under multiplication modulo 15. the inverses of 4 and 7 are respectively:

(A) 3 and 13 (B) 2 and 11 (C) 4 and 13 (D) 8 and 14

gate2005 set-theory&algebra normal

13.141 GATE2005_8 top gateoverflow.in/1157

Let A, B and C be non-empty sets and let X = ( A - B ) - C and Y = ( A - C ) - ( B - C ). Which one of the following is TRUE?

(A) X = Y
(B) X Y
(C) Y X
(D) None of these

gate2005 set-theory&algebra easy

13.142 GATE2006_02 top gateoverflow.in/881

Let X, Y , Z be sets of sizes x, y and z respectively. Let W = X Y and E be the set of all subsets of W . The number of
functions from Z to E is:

xy x+y

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 699 of 852

(A) z 2 (B) z 2xy (C) z 2


xy x+y
(D) 2xyz

gate2006 set-theory&algebra normal

13.143 GATE2002_3 top gateoverflow.in/856

Let A be a set of n(>0) elements. Let Nr be the number of binary relations on A and let Nf be the number of functions from
A to A

A. Give the expression for Nr , in terms of n.


B. Give the expression for Nf , terms of n.
C. Which is larger for all possible n, Nr or Nf

gate2002 set-theory&algebra normal

13.144 GATE2000_4 top gateoverflow.in/675

Let S= {0, 1, 2, 3, 4, 5, 6, 7} and denote multiplication modulo 8, that is, x y= (xy) mod 8

a. Prove that ( { 0, 1}, ) is not a group.


b. Write 3 distinct groups (G, ) where G S and G has 2 elements.

gate2000 set-theory&algebra

13.145 GATE2000_6 top gateoverflow.in/677

Let S be a set of n elements {1, 2, . . . . . , n} and G a graph with 2 n vertices, each vertex corresponding to a distinct subset
of S. Two vertices are adjacent iff the symmetric difference of the corresponding sets has exactly 2 elements. Note: The
symmetric difference of two sets R1 and R2 is defined as (R1 R2 ) (R2 R1 )

1. Every vertex in G has the same degree. What is the degree of a vertex in G?
2. How many connected components does G have?

gate2000 set-theory&algebra normal

13.146 GATE2000_2.6 top gateoverflow.in/653

Let P(S) denotes the power set of set S. Which of the following is always true?

A. P(P(S)) = P(S)
B. P(S) P(P(S)) = { }
C. P(S) S = P(S)
D. S P(S)

gate2000 set-theory&algebra easy

13.147 GATE2000_2.4 top gateoverflow.in/651

A polynomial p(x) satisfies the following:

p(1) = p(3) = p(5) = 1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 700 of 852

p(2) = p(4) = -1

The minimum degree of such a polynomial is

a. 1
b. 2
c. 3
d. 4

gate2000 set-theory&algebra normal

13.148 GATE2008_2 top gateoverflow.in/400

If P, Q, R are subsets of the universal set U, then

(P Q R) (P c Q R) Qc Rc
is

(A) Qc Rc (B) P Qc Rc (C) P c Qc Rc (D) U


gate2008 normal set-theory&algebra

13.149 GATE1992-15.a top gateoverflow.in/594

Uses Modus ponens (A, A B| = B) or resolution to show that the following set is inconsistent:
1. Q(x) P (x) R(a)
2. R(a) Q(a)
3. Q(a)
4. P (y)

where x and y are universally quantified variables, a is a constant and P , Q, R are monadic predicates.

gate1992 set-theory&algebra normal

13.150 GATE2001_1.2 top gateoverflow.in/695

Consider the following relations:

R1 (a, b) iff (a + b) is even over the set of integers


R2 (a, b) iff (a + b) is odd over the set of integers
R3 (a, b) iff a. b > 0 over the set of non-zero rational numbers
R4 (a, b) iff |a b| 2 over the set of natural numbers

Which of the following statements is correct?

(A) R1 and R2 are equivalence relations, R3 and R4 are not

(B) R1 and R3 are equivalence relations, R2 and R4 are not

(C) R1 and R4 are equivalence relations, R2 and R3 are not

(D) R1, R2, R3 and R4 all are equivalence relations

gate2001 set-theory&algebra normal

13.151 GATE2001_2.2 top gateoverflow.in/720

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 701 of 852

Consider the following statements:

S1: There exists infinite sets A, B, C such that A (B C) is finite.


S2: There exists two irrational numbers x and y such that (x + y) is rational.

Which of the following is true about S1 and S2?

(A) Only S1 is correct

(B) Only S2 is correct

(C) Both S1 and S2 are correct

(D) None of S1 and S2 is correct

gate2001 set-theory&algebra normal

13.152 GATE2009_22 top gateoverflow.in/799

For the composition table of a cyclic group shown below:


* a b c d
a a b c d
b b a d c
c c b d a
d d c a b

Which one of the following choices is correct?

(A) a,b are generators

(B) b,c are generators

(C) c,d are generators

(D) d,a are generators

gate2009 set-theory&algebra normal

13.153 GATE2002_2.17 top gateoverflow.in/847

The binary relation S = (empty set) on a set A = {1,2,3} is


A. Neither reflexive nor symmetric


B. Symmetric and reflexive
C. Transitive and reflexive
D. Transitive and symmetric

gate2002 set-theory&algebra normal

13.154 GATE2009_4 top gateoverflow.in/797

Consider the binary relation R = {(x, y), (x, z), (z, x), (z, y)} on the set {x, y, z}.
Which one of the following is TRUE?

(A) R is symmetric but NOT antisymmetric

(B) R is NOT symmetric but antisymmetric


R

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 702 of 852

(C) R is both symmetric and antisymmetric

(D) R is neither symmetric nor antisymmetric

gate2009 set-theory&algebra easy

13.155 GATE2009_1 top gateoverflow.in/795

Which one of the following is NOT necessarily a property of a Group?

(A) Commutativity

(B) Associativity

(C) Existence of inverse for every element

(D) Existence of identity

gate2009 set-theory&algebra easy

13.156 GATE2001_3 top gateoverflow.in/744

(a) Prove that powerset (A B) = powerset(A) powerset(B)


(b) Let sum(n) = 0 + 1 + 2 + ..... + n for all natural numbers n. Give an induction proof to show that the following equation
is true for all natural numbers m and n:

sum(m+n) = sum(m) + sum(n) + mn

gate2001 set-theory&algebra normal

13.157 GATE1999_2.3 top gateoverflow.in/1481

Let L be a set with a relation R which is transitive, anti-symmetric and reflexive and for any two elements a, b L, let the
least upper bound lub(a, b) and the greatest lower bound glb(a, b) exist. Which of the following is/are true?

A. L is a poset

B. L is a Boolean algebra

C. L is a lattice

D. None of the above

gate1999 set-theory&algebra normal

13.158 GATE1998_2.3 top gateoverflow.in/1675

The binary relation R = {(1, 1), (2, 1), (2, 2), (2, 3), (2, 4), (3, 1), (3, 2), (3, 3), (3, 4)} on the set A = {1, 2, 3, 4} is
A. reflective, symmetric and transitive

B. neither reflective, nor irreflexive but transitive

C. irreflexive, symmetric and transitive

D. irreflexive and antisymmetric

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 703 of 852

gate1998 set-theory&algebra easy

13.159 GATE1996_2.4 top gateoverflow.in/2733

Which one of the following is false?

A. The set of all bijective functions on a finite set forms a group under function composition.
B. The set {1, 2, p 1} forms a group under multiplication mod p, where p is a prime number.
C. The set of all strings over a finite alphabet forms a group under concatenation.
D. A subset S of G is a subgroup of the group G, if and only if for any pair of elements a, b S, a b1 S.

gate1996 set-theory&algebra normal

13.160 GATE1996_2.6 top gateoverflow.in/2735

cos sin 0
The matrices [ ] and [ ] commute under multiplication
a
sin cos 0 b
A. if a = b or = n, n an integer
B. always

C. never

D. if a cos = b sin

gate1996 set-theory&algebra normal

13.161 GATE1996_1.1 top gateoverflow.in/2705

L e t A and B be sets and let Ac and Bc denote the complements of the sets A and B. The set
(A B) (B A) (A B) is equal to
A. A B

B. Ac Bc
C. A B

D. Ac Bc

gate1996 set-theory&algebra easy

13.162 GATE1995_23 top gateoverflow.in/2661

Prove using mathematical induction for n 5, 2n > n2


gate1995 set-theory&algebra proof

13.163 GATE1995_1.20 top gateoverflow.in/2607

The number of elements in the power set P (S) of the set S = {{}, 1, {2, 3}} is:
A. 2
B. 4
C. 8

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 704 of 852

D. None of the above

gate1995 set-theory&algebra normal

13.164 GATE1995_2.8 top gateoverflow.in/2620

If the cube roots of unity are 1, and 2 , then the roots of the following equation are

(x 1)3 + 8 = 0
A. 1, 1 + 2, 1 + 22

B. 1, 1 2, 1 22

C. 1, 1 2, 1 22

D. 1, 1 + 2, 1 + 22

gate1995 set-theory&algebra normal

13.165 GATE2008-IT_26 top gateoverflow.in/3316

Consider the field C of complex numbers with addition and multiplication. Which of the following form(s) a subfield of C with
addition and multiplication?

(S1) the set of real numbers


(S2) {(a + ib) | a and b are rational numbers}
(S3) {a + ib | (a2 + b 2) 1}
(S4) {ia | a is real}

1) only S1
2) S1 and S3
3) S2 and S3
4) S1 and S2

gate2008-it set-theory&algebra normal

13.166 GATE2007-IT_16 top gateoverflow.in/3449

The minimum positive integer p such that 3 p modulo 17 = 1 is

A) 5
B) 8
C) 12
D) 16

gate2007-it set-theory&algebra normal

13.167 GATE2004-IT_2 top gateoverflow.in/3643

In a class of 200 students, 125 students have taken Programming Language course, 85 students have taken Data Structures
course, 65 students have taken Computer Organization course; 50 students have taken both Programming Language and
Data Structures, 35 students have taken both Data Structures and Computer Organization; 30 students have taken both
Data Structures and Computer Organization, 15 students have taken all the three courses.

How many students have not taken any of the three courses?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 705 of 852

A) 15
B) 20
C) 25
D) 30

gate2004-it set-theory&algebra easy

13.168 GATE2005-IT_33 top gateoverflow.in/3779

Let A be a set with n elements. Let C be a collection of distinct subsets of A such that for any two subsets S 1 and S 2 in C,
either S1 S2 or S 2 S1. What is the maximum cardinality of C?

1) n
2) n + 1
3) 2n-1 + 1
4) n!

gate2005-it set-theory&algebra normal

13.169 GATE2006-IT_23 top gateoverflow.in/3562

Let P, Q and R be sets let denote the symmetric difference operator defined as PQ = (P U Q) - (P Q). Using Venn
diagrams, determine which of the following is/are TRUE?

I. P (Q R) = (P Q) (P R)
II. P (Q R) = (P Q) (P R)

A) I only
B) II only
C) Neither I nor II
D) Both I and II

gate2006-it set-theory&algebra normal

13.170 GATE2006-IT_2 top gateoverflow.in/3539

For the set N of natural numbers and a binary operation f : N x N N, an element z N is called an identity for f, if f (a, z)
= a = f(z, a), for all a N. Which of the following binary operations have an identity?

I. f (x, y) = x + y - 3
II. f (x, y) = max(x, y)
III. f (x, y) = x y

A) I and II only
B) II and III only
C) I and III only
D) None of these

gate2006-it set-theory&algebra easy

13.171 GATE2007-IT_77 top gateoverflow.in/3529

Consider the sequence xn , n 0 defined by the recurrence relation xn+1 = c (xn )2 2, where c > 0.
For which of the following values of c, does there exist a non-empty open interval (a, b) such that the sequence xn
a< 0 <b

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 706 of 852

converges for all x0 satisfying a < x0 < b?


(i) 0.25 (iii) 0.35 (iii) 0.45 (iv) 0.5

A) (i) only
B) (i) and (ii) only
C) (i), (ii) and (iii) only
D) (i), (ii), (iii) and (iv)

gate2007-it set-theory&algebra normal

13.172 GATE1994_15 top gateoverflow.in/2511

Use the patterns given to prove that


n1
a. (2i + 1) = n2
i=0
(You are not permitted to employ induction)

b. Use the result obtained in (a) to prove that


n
n(n + 1)
i =
i=1
2

gate1994 set-theory&algebra proof

13.173 GATE2013_1 top gateoverflow.in/59

A binary operation on a set of integers is defined as x y = x2 + y 2 . Which one of the following statements is **TRUE**
about ?

(A) Commutative but not associative

(B) Both commutative and associative

(C) Associative but not commutative

(D) Neither commutative nor associative

gate2013 set-theory&algebra easy

13.174 GATE1997_4.4 top gateoverflow.in/2245

A polynomial p(x) is such that p(0) = 5, p(1) = 4, p(2) = 9 and p(3) = 20. The minimum degree it should have is

A. 1
B. 2
C. 3
D. 4

gate1997 set-theory&algebra normal

13.175 GATE1993_8.3 top gateoverflow.in/2301

Let S be an infinite set and S1 , Sn be sets such that S1 S2 Sn = S. Then


Si

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 707 of 852

A. at least one of the set Si is a finite set

B. not more than one of the set Si can be finite

C. at least one of the sets Si is an infinite

D. not more than one of the sets Si can be infinite

E. None of the above

gate1993 set-theory&algebra normal

13.176 GATE2014-2_50 top gateoverflow.in/2016

Consider the following relation on subsets of the set S of integers between 1 and 2014. For two distinct subsets U and V of
S we say U < V if the minimum element in the symmetric difference of the two sets is in U .
Consider the following two statements:

S1: There is a subset of S that is larger than every other subset.


S2: There is a subset of S that is smaller than every other subset.
Which one of the following is CORRECT?

(A) Both S1 and S2 are true

(B) S1 is true and S2 is flase

(C) S2 is true and S1 is false

(D) Neither S1 nor S2 is true

gate2014-2 set-theory&algebra normal

13.177 GATE1998_10 top gateoverflow.in/1724

n(n3)
a. Prove by induction that the expression for the number of diagonals in a polygon of n sides is 2

b. Let R be a binary relation on A = {a, b, c, d, e, f, g, h} represented by the following two component digraph. Find the
smallest integers m and n such that m < n and Rm = Rn .

gate1998 set-theory&algebra descriptive

13.178 GATE1998_2.4 top gateoverflow.in/1676

In a room containing 28 people, there are 18 people who speak English, 15, people who speak Hindi and 22 people who
speak Kannada. 9 persons speak both English and Hindi, 11 persons speak both Hindi and Kannada whereas 13 persons
speak both Kannada and English. How many speak all three languages?

A. 9
B. 8
C. 7
D. 6

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 708 of 852

gate1998 set-theory&algebra easy

13.179 GATE1993_8.4 top gateoverflow.in/2302

Let A be a finite set of size n. The number of elements in the power set of A A is:

A. 22
n

2
B. 2n
C. (2n )2
D. (22 )n
E. None of the above

gate1993 set-theory&algebra easy

13.180 GATE1993_17 top gateoverflow.in/2314

Out of a group of 21 persons, 9 eat vegetables, 10 eat fish and 7 eat eggs. 5 persons eat all three. How many persons eat at
least two out of the three dishes?

gate1993 set-theory&algebra easy

13.181 GATE1994_2.4 top gateoverflow.in/2471

The number of subsets {1, 2, , n} with odd cardinality is ___________

gate1994 set-theory&algebra easy

13.182 GATE1994_3.8 top gateoverflow.in/2494

Give a relational algebra expression using only the minimum number of operators from (, ) which is equivalent to R S.

gate1994 set-theory&algebra normal

13.183 GATE1994_2.3 top gateoverflow.in/2470

Amongst the properties {reflexivity, symmetry, anti-symmetry, transitivity} the relation R = {(x, y) N 2 |x y}
satisfies _________

gate1994 set-theory&algebra normal

13.184 GATE1994_2.2 top gateoverflow.in/2469

On the set N of non-negative integers, the binary operation ______ is associative and non-commutative.

gate1994 set-theory&algebra normal

13.185 GATE1994_1.2 top gateoverflow.in/2438

Let A and B be real symmetric matrices of size n n. Then which one of the following is true?

A. AA =I
B. A = A1
C. AB = BA
D. (AB) = BA

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 709 of 852

gate1994 set-theory&algebra linear-algebra normal

13.186 GATE2005-IT_34 top gateoverflow.in/3780

Let n = p 2q, where p and q are distinct prime numbers. How many numbers m satisfy 1 m n and gcd (m, n) = 1? Note
that gcd (m, n) is the greatest common divisor of m and n.

A) p(q - 1)
B) pq
C) (p2- 1) (q - 1)
D) p(p - 1) (q - 1)

gate2005-it set-theory&algebra normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 710 of 852

14 Combinatory top
14.1 Binary Tree: GATE2005_35 top gateoverflow.in/1371

How many distinct binary search trees can be created out of 4 distinct keys?

A. 5
B. 14
C. 24
D. 42

gate2005 combinatory binary-tree normal

14.2 Binary Tree: GATE2011_29 top gateoverflow.in/2131

We are given a set of n distinct elements and an unlabeled binary tree with n nodes. In how many ways can we populate the tree with the given set so that it
becomes a binary search tree?

(A) 0

(B) 1

(C) n!

1 2n
(D) n+1 . Cn

gate2011 combinatory binary-tree normal

14.3 Combinations: TIFR2012-A-7 top gateoverflow.in/21004

It is required to divide the 2n members of a club into n disjoint teams of 2 members each. The teams are not labelled. The
number of ways in which this can be done is:
(2n)!
a.
2n
(2n)!
b.
n!
(2n)!
c. n
2 .n!
d. n!/2
e. None of the above.

tifr2012 combinations

14.4 Combinatorics: GATE2004-IT_34 top gateoverflow.in/3677

Let H 1, H 2, H 3, ... be harmonic numbers. Then, for n Z +, j=1 Hj can be expressed as


n

A) nHn+1 - (n + 1)
B) (n + 1)Hn - n
C) nHn - n
D) (n + 1) Hn+1 - (n + 1)

gate2004-it recurrence combinatorics normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 711 of 852

14.5 Combinatorics: TIFR 2015 B - 12 top gateoverflow.in/29072

tifr 2015 difficult combinatorics

14.6 Combinatorics: TIFR 2015 Part A -3 top gateoverflow.in/29057

Please solve following question. Correct answer is marked !


tifr 2015 combinatorics recurrence difficult

14.7 Counting: TIFR 2015 A-13 top gateoverflow.in/29069

counting tifr 2015 difficult

14.8 Counting: GATE2000_3 top gateoverflow.in/674

Consider the following sequence:

s1 = s2 = 1 and si = 1 + min (si1 , si2 ) for i > 2.

Prove by induction on n that sn = n2 .

gate2000 combinatory counting descriptive

14.9 Counting: GATE2015-2_9 top gateoverflow.in/8058

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 712 of 852

The number of divisors of 2100 is ____.

gate2015-2 combinatory counting easy

14.10 Generating Functions: GATE 2016-1-26 top gateoverflow.in/39693

3
The coefficient of x12 in (x3 + x4 + x5 + x6 + ) is ___________.

gate2016-1 set-theory&algebra generating-functions normal numerical-answers

14.11 Number Theory: GATE1991_01,xiii top gateoverflow.in/26323

The number of integer-triples (i, j, k) with 1 i, j, k 300 such that i + j + k is divisible by 3 is________
number-theory

14.12 Permutation: TIFR2011-A-2 top gateoverflow.in/19829

In how many ways can the letters of the word ABACUS be rearranged such that the vowels always appear together?

(6 + 3)!
a.
2!

6!
b.
2!

3!3!
c.
2!

4!3!
d.
2!

e. None of the above.

tifr2011 combinatory permutation

14.13 Pigeonhole: TIFR2014-A-5 top gateoverflow.in/25990

The rules for the University of Bombay five-a-side cricket competition specify that the members of each team must have
birthdays in the same month. What is the minimum number of mathematics students needed to be enrolled in the
department to guarantee that they can raise a team of students?

a. 23
b. 91
c. 60
d. 49
e. None of the above.

tifr2014 combinatorics pigeonhole

14.14 Recurrence: TIFR Part B-1 top gateoverflow.in/29070

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 713 of 852

tifr 2015 algorithms recurrence normal

14.15 Recurrence: TIFR2014-A-3 top gateoverflow.in/25988

The Fibonacci sequence is defined as follows: F0 = 0, F1 = 1, and for all integers n 2, Fn = Fn1 + Fn2 . Then which of
the following statements is FALSE?

a. Fn+2 = 1 + ni=0 Fi for any integer n 0


b. Fn+2 n for any integer n 0, where = (5 + 1) /2 is the positive root of x2 x 1 = 0.
c. F3n is even, for every integer n 0.
d. F4n is a multiple of 3, for every integer n 0.
e. F5n is a multiple of 4, for every integer n 0.

tifr2014 recurrence easy

14.16 TIFR2015-A-8 top gateoverflow.in/29571

There is a set of 2n people: n male and n female. A good party is one with equal number of males and females (including
the one where none are invited). The total number of good parties is.

A. 2n
B. n2
2
C. ( )
n
n/2
2n
D. ( n )
E. None of the above.

tifr2015 combinatory

14.17 GATE2007-85 top gateoverflow.in/43509

Suppose that a robot is placed on the Cartesian plane. At each step it is allowed to move either one unit up or one unit right,
i.e., if it is at (i, j) then it can move to either (i + 1, j) or (i, j + 1).

Suppose that the robot is not allowed to traverse the line segment from (4,4) to (5,4). With this constraint, how many
distinct paths are there for the robot to reach (10,10) starting from (0,0)?

A. 29
B. 219
C. 8 C4 11 C5
D. 20 C10 8 C4 11 C5

gate2007 combinatory normal

14.18 GATE2005-IT_46 top gateoverflow.in/3807

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 714 of 852

A line L in a circuit is said to have a stuck-at-0 fault if the line permanently has a logic value 0. Similarly a line L in a circuit is
said to have a stuck-at-1 fault if the line permanently has a logic value 1. A circuit is said to have a multiple stuck-at fault if
one or more lines have stuck at faults. The total number of distinct multiple stuck-at faults possible in a circuit with N lines is

A) 3N
B) 3N - 1
C) 2N - 1
D) 2

gate2005-it combinatory normal

14.19 TIFR -2015 -MATHS-4 top gateoverflow.in/30268

Can anybody explain the answer.

combinatory tifr 2015

14.20 TIFR2013-A-9 top gateoverflow.in/25431

There are n kingdoms and 2n champions. Each kingdom gets 2 champions. The number of ways in which this can be done
is:
(2n)!
a.
2n
(2n)!
b.
n!
(2n)!
c. n
2 .n!
d. n!/2
e. None of the above.

tifr2013 combinatory

14.21 TIFR2012-A-10 top gateoverflow.in/25014

In how many different ways can r elements be picked from a set of n elements if

(i) Repetition is not allowed and the order of picking matters?

(ii) Repetition is allowed and the order of picking does not matter?

n! (n+r1)!
a. and , respectively.
(nr)! r!(n1)!

n! n!

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 715 of 852

n! n!
b. and , respectively.
(nr)! r!(n1)!
n! (nr+1)!
c. and , respectively.
r!(nr)! r!(n1)!
n! n!
d. and , respectively.
r!(nr)! (nr)!
n! r!
e. and , respectively.
r! n!

tifr2012 combinatory

14.22 TIFR2015-A-7 top gateoverflow.in/29568

A 1 1 chessboard has one (1) square, a 2 2 chessboard has (5) squares. Continuing along this fashion, what is the
number of squares on the (regular) 8 8 chessboard?

A. 64
B. 65
C. 204
D. 144
E. 256

tifr2015 combinatory

14.23 GATE2008-IT_25 top gateoverflow.in/3286

In how many ways can b blue balls and r red balls be distributed in n distinct boxes?

(n+b1)! (n+r1)!
A)
(n1)! b! (n1)! r!
(n+(b+r)1)!
B)
(n1)! (n1)! (b+r)!
n!
C) b! r!
(n+(b+r)1)!
D)
n! (b+r1)

gate2008-it combinatory normal

14.24 GATE2003_5 top gateoverflow.in/896

n couples are invited to a party with the condition that every husband should be accompanied by his wife. However, a wife
need not be accompanied by her husband. The number of different gatherings possible at the party is
(2n)!
(A) 2n Cn 2n (B) 3n (C) (D) 2n Cn
2n

gate2003 combinatory normal

14.25 GATE2003_34 top gateoverflow.in/924

m identical balls are to be placed in n distinct bags. You are given that m kn, where k is a natural number 1. In how
many ways can the balls be placed in the bags if each bag must contain at least k balls?

mk
(A) ( )
n1
m kn + n 1
(B) ( )
n1

( )
Copyright GATE Overflow. All rights reserved.
GATE Overflow April 2016 716 of 852

m1
(C) ( )
nk
m kn + n + k 2
(D) ( )
nk

gate2003 combinatory normal

14.26 GATE2004_75 top gateoverflow.in/1069

Mala has the colouring book in which each English letter is drawn two times. She wants to paint each of these 52 prints with
one of k colours, such that the colour pairs used to colour any two letters are different. Both prints of a letter can also be
coloured with the same colour. What is the minimum value of k that satisfies this requirement?

A. 9
B. 8
C. 7
D. 6

gate2004 combinatory normal

14.27 GATE2003_4 top gateoverflow.in/895

Let A be a sequence of 8 distinct integers sorted in ascending order. How many distinct pairs of sequences, B and C are
there such that

(i) each is sorted in ascending order,

(ii) B has 5 and C has 3 elements, and

(iii) the result of merging B and C gives A?

(A) 2 (B) 30 (C) 56 (D) 256

gate2003 combinatory normal

14.28 GATE2002_13 top gateoverflow.in/866

a. In how many ways can a given positive integer n 2 be expressed as the sum of 2 positive integers (which are not
necessarily distinct). For example, for n = 3 the number of ways is 2, i.e., 1+2, 2+1. Give only the answer without any
explanation.
b. In how many ways can a given positive integer n 3 be expressed as the sum of 3 positive integers (which are not
necessarily distinct). For example, for n = 4, the number of ways is 3, i.e., 1+2+1, 2+1+1. Give only the answer
without explanation.
c. In how many ways can a given positive integer n k be expressed as the sum of k positive integers (which are not
necessarily distinct). Give only the answer without explanation.

gate2002 combinatory normal

14.29 GATE1991-02,iv top gateoverflow.in/514

Match the pairs in the following questions by writing the corresponding letters only.

n!

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 717 of 852

(A). The number distinct binary trees with n nodes. n!


(P).
2
(B). The number of binary strings of length of 2n with an equal 3n
(Q). ( n)
number of 0 s and 1 s.
(C). The number of even permutation of n objects. (R). (2n
n)
(D). The number of binary strings of length 6n which are 1 2n
(S). 1+n ( n )
palindromes with 2n 0 s.

gate1991 combinatory normal

14.30 GATE1991-16,a top gateoverflow.in/543

Find the number of binary strings w of length 2n with an equal number of 1 s and 0 s and the property that every prefix of
w has at least as many 0 s as 1 s.
gate1991 combinatory normal

14.31 GATE2001_2.1 top gateoverflow.in/719

How many 4-digit even numbers have all 4 digits distinct

(A) 2240

(B) 2296

(C) 2620

(D) 4536

gate2001 combinatory normal

14.32 GATE2007-84 top gateoverflow.in/1275

Suppose that a robot is placed on the Cartesian plane. At each step it is allowed to move either one unit up or one unit right,
i.e., if it is at (i, j) then it can move to either (i + 1, j) or (i, j + 1).

How many distinct paths are there for the robot to reach the point (10,10) starting from the initial position (0,0)?

A. 20 C10
B. 220
C. 210
D. None of the above.

gate2007 combinatory normal

14.33 GATE1999_1.3 top gateoverflow.in/1457

The number of binary strings of n zeros and k ones in which no two ones are adjacent is

A. n1 Ck

B. n Ck

C. n Ck+1

D. None of the above

gate1999 combinatory normal

14.34 GATE1994_1.15 top gateoverflow.in/2458

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 718 of 852

The number of substrings (of all lengths inclusive) that can be formed from a character string of length n is
A. n
B. n2
n(n1)
C. 2
n(n+1)
D.
2

gate1994 combinatory normal

14.35 GATE2008-IT_24 top gateoverflow.in/3285

The exponent of 11 in the prime factorization of 300! is

1) 27
2) 28
3) 29
4) 30

gate2008-it combinatory normal

14.36 GATE2008_24 top gateoverflow.in/422

Let P = 1i2k i and Q = 1i2k i, where k is a positive integer. Then


i odd i even

(A) P =Qk
(B) P =Q+k
(C) P =Q
(D) P = Q + 2k
gate2008 combinatory easy

14.37 GATE2014-2_49 top gateoverflow.in/2015

The number of distinct positive integral factors of 2014 is _____________

gate2014-2 combinatory easy

14.38 GATE2014-1_49 top gateoverflow.in/1929

A pennant is a sequence of numbers, each number being 1 or 2. An n-pennant is a sequence of numbers with sum equal to n. For example, (1, 1, 2) is a 4-
pennant. The set of all possible 1-pennants is (1) , the set of all possible 2-pennants is (2), (1, 1) and the set of all 3-pennants is (2, 1), (1, 1, 1), (1, 2). Note
that the pennant (1, 2) is not the same as the pennant (2, 1). The number of 10-pennants is________

gate2014-1 combinatory numerical-answers normal

14.39 GATE1999_2.2 top gateoverflow.in/1480

Two girls have picked 10 roses, 15 sunflowers and 15 daffodils. What is the number of ways they can divide the flowers
among themselves?

A. 1638
B. 2100
C. 2640
D. None of the above

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 719 of 852

gate1999 combinatory normal

14.40 GATE1998_1.23 top gateoverflow.in/1660

How many sub strings of different lengths (non-zero) can be found formed from a character string of length n?
A. n
B. n2
C. 2n
n(n+1)
D.
2

gate1998 combinatory normal

14.41 GATE2004-IT_35 top gateoverflow.in/3678

In how many ways can we distribute 5 distinct balls, B 1, B 2, ..., B 5 in 5 distinct cells, C 1, C2, ...., C 5 such that Ball B i is not
in cell C i, i = 1, 2, ..., 5 and each cell contains exactly one ball?

A) 44

B) 96

C) 120
D) 3125

gate2004-it combinatory normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 720 of 852

15 Graph Theory top


15.1 Chromatic Number: GATE2008-IT_3 top gateoverflow.in/3263

What is the chromatic number of the following graph?

A) 2
B) 3
C) 4
D) 5

gate2008-it graph-theory graph-coloring chromatic-number normal

15.2 Chromatic Number: GATE2009_2 top gateoverflow.in/796

What is the chromatic number of an n vertex simple connected graph which does not contain any odd length cycle? Assume
n > 2.
(A) 2

(B) 3

(C) n-1

(D) n

gate2009 graph-theory graph-coloring chromatic-number normal

15.3 Combinatorics: TIFR 2015 B 4 top gateoverflow.in/29343

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 721 of 852

graph-theory tifr 2015 difficult combinatorics

15.4 Connected Components: GATE2014-3_51 top gateoverflow.in/2085

If G is the forest with n vertices and k connected components, how many edges does G have?

(A) n/k

(B) n/k

(C) n k

(D) n k + 1

gate2014-3 graph-theory connected-components normal

15.5 Connected Components: GATE2003_8 top gateoverflow.in/899

Let G be an arbitrary graph with n nodes and k components. If a vertex is removed from G, the number of components in
the resultant graph must necessarily lie down between

A. k and n
B. k 1 and k + 1
C. k 1 and n 1
D. k + 1 and n k

gate2003 graph-theory connected-components normal

15.6 Connected Components: GATE1991_01,xv top gateoverflow.in/510

The maximum number of possible edges in an undirected graph with n vertices and k components is ______.

gate1991 graph-theory connected-components normal

15.7 Cutvertices&edges: GATE1999_5 top gateoverflow.in/1504

Let G be a connected, undirected graph. A cut in G is a set of edges whose removal results in G being broken into two or
more components, which are not connected with each other. The size of a cut is called its cardinality. A min-cut of G is a cut
in G of minimum cardinality. Consider the following graph.

a. Which of the following sets of edges is a cut

i. {(A, B), (E, F ), (B, D), (A, E), (A, D)}


ii. {(B, D), (C, F ), (A, B)}
b. What is cardinality of min-cut in this graph?
c. Prove that if a connected undirected graph G with n vertices has a min-cut of cardinality k, then G has at least (nk/2)
edges

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 722 of 852

gate1999 graph-theory cutvertices&edges normal

15.8 Degree Sequence: GATE2010_28 top gateoverflow.in/1154

The degree sequence of a simple graph is the sequence of the degrees of the nodes in the graph in decreasing order. Which
of the following sequences can not be the degree sequence of any graph?

I. 7, 6, 5, 4, 4, 3, 2, 1 II. 6, 6, 6, 6, 3, 3, 2, 2 III. 7, 6, 6, 4, 4, 3, 2, 2 IV. 8, 7, 7, 6, 4, 2, 1, 1

(A) I and II (B) III and IV (C) IV only (D) II and IV

gate2010 graph-theory degree-sequence havel-hakimi-theorem normal

15.9 Degree Sequence: GATE2014-1_52 top gateoverflow.in/1932

An ordered ntuple (d1 , d2 , . . . . , dn ) with d1 d2 . . . dn is called graphic if there exists a simple undirected graph with n vertices having degrees
d1 , d2 , . . . , dn respectively. Which one of the following 6-tuples is NOT graphic?

(A) (1, 1, 1, 1, 1, 1)

(B) (2, 2, 2, 2, 2, 2)

(C) (3, 3, 3, 1, 0, 0)

(D) (3, 2, 1, 1, 1, 0)

gate2014-1 graph-theory degree-sequence havel-hakimi-theorem normal

15.10 Graph Coloring: GATE2004_77 top gateoverflow.in/1071

The minimum number of colours required to colour the following graph, such that no two adjacent vertices are assigned the
same color, is

A. 2
B. 3
C. 4
D. 5

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 723 of 852

gate2004 graph-theory graph-coloring easy

15.11 Graph Coloring: GATE 2016-2-03 top gateoverflow.in/39553

The minimum number of colours that is sufficient to vertex-colour any planar graph is ________.

gate2016-2 graph-theory graph-coloring normal numerical-answers

15.12 Graph Coloring: GATE2002_1.4 top gateoverflow.in/808

The minimum number of colours required to colour the vertices of a cycle with n nodes in such a way that no two adjacent
nodes have the same colour is

A. 2
B. 3
C. 4
n
D. n 2 2 + 2

gate2002 graph-theory graph-coloring normal

15.13 Graph Coloring: GATE2006-IT_25 top gateoverflow.in/3564

Consider the undirected graph G defined as follows. The vertices of G are bit strings of length n. We have an edge between
vertex u and vertex v if and only if u and v differ in exactly one bit position (in other words, v can be obtained from u by
flipping a single bit). The ratio of the chromatic number of G to the diameter of G is

A) 1/(2n-1)
B) 1/n
C) 2/n
D) 3/n

gate2006-it graph-theory graph-coloring normal

15.14 Graph Connectivity: GATE2014-2_3 top gateoverflow.in/1955

The maximum number of edges in a bipartite graph on 12 vertices is____

gate2014-2 graph-theory graph-connectivity numerical-answers normal

15.15 Graph Connectivity: GATE2004-IT_5 top gateoverflow.in/3646

What is the maximum number of edges in an acyclic undirected graph with n vertices?

A) n - 1
B) n
C) n + 1
D) 2n - 1

gate2004-it graph-theory graph-connectivity normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 724 of 852

15.16 Graph Connectivity: GATE2015-2_50 top gateoverflow.in/8252

In a connected graph, a bridge is an edge whose removal disconnects the graph. Which one of the following statements is
true?

A. A tree has no bridges


B. A bridge cannot be part of a simple cycle
C. Every edge of a clique with size 3 is a bridge (A clique is any complete subgraph of a graph)
D. A graph with bridges cannot have cycle

gate2015-2 graph-theory graph-connectivity easy

15.17 Graph Connectivity: GATE2005-IT_56 top gateoverflow.in/3817

Let G be a directed graph whose vertex set is the set of numbers from 1 to 100. There is an edge from a vertex i to a vertex
j iff either j = i + 1 or j = 3i. The minimum number of edges in a path in G from vertex 1 to vertex 100 is

A) 4
B) 7
C) 23
D) 99

gate2005-it graph-theory graph-connectivity normal

15.18 Graph Connectivity: GATE2006-IT_11 top gateoverflow.in/3550

If all the edge weights of an undirected graph are positive, then any subset of edges that connects all the vertices and has
minimum total weight is a

A) Hamiltonian cycle
B) grid
C) hypercube
D) tree

gate2006-it graph-theory graph-connectivity normal

15.19 Graph Connectivity: GATE2004-IT_37 top gateoverflow.in/3680

What is the number of vertices in an undirected connected graph with 27 edges, 6 vertices of degree 2, 3 vertices of degree
4 and remaining of degree 3?

A) 10
B) 11
C) 18
D) 19

gate2004-it graph-theory graph-connectivity normal

15.20 Graph Connectivity: GATE1995_1.25 top gateoverflow.in/2612

The minimum number of edges in a connected cyclic graph on n vertices is:

n1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 725 of 852

(a) n 1
(b) n
(c) n + 1
(d) None of the above

gate1995 graph-theory graph-connectivity easy

15.21 Graph Connectivity: GATE2008-IT_27 top gateoverflow.in/3317

G is a simple undirected graph. Some vertices of G are of odd degree. Add a node v to G and make it adjacent to each odd
degree vertex of G. The resultant graph is sure to be

A) regular
B) complete
C) Hamiltonian
D) Euler

gate2008-it graph-theory graph-connectivity normal

15.22 Graph Connectivity: GATE1993_8.1 top gateoverflow.in/2299

Consider a simple connected graph G with n vertices and n edges (n > 2). Then, which of the following statements are
true?

A. G has no cycles
B. The graph obtained by removing any edge from G is not connected
C. G has at least one cycle
D. The graph obtained by removing any two edges from G is not connected
E. None of the above

gate1993 graph-theory graph-connectivity easy

15.23 Graph Connectivity: GATE1999_1.15 top gateoverflow.in/1468

The number of articulation points of the following graph is

A. 0
B. 1
C. 2
D. 3

gate1999 graph-theory graph-connectivity normal

15.24 Graph Isomorphism: GATE2012_26 top gateoverflow.in/1611

Which of the following graphs is isomorphic to

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 726 of 852

gate2012 graph-theory graph-isomorphism normal

15.25 Graph Matching: GATE2003_36 top gateoverflow.in/926

How many perfect matching are there in a complete graph of 6 vertices?

(A) 15 (B) 24 (C) 30 (D) 60

gate2003 graph-theory graph-matching normal

15.26 Groups: GATE2014-3_3 top gateoverflow.in/2037

Let G be a group with 15 elements. Let L be a subgroup of G. It is known that L G and that the size of L is at least 4.
The size of L is __________.

gate2014-3 graph-theory groups numerical-answers normal

15.27 Permutation: GATE2012_38 top gateoverflow.in/473

Let G be a complete undirected graph on 6 vertices. If vertices of G are labeled, then the number of distinct cycles of length
4 in G is equal to

(A) 15 (B) 30 (C) 90 (D) 360

gate2012 graph-theory normal marks-to-all permutation

15.28 Spanning Tree: GATE2007-IT_25 top gateoverflow.in/3458

What is the largest integer m such that every simple connected graph with n vertices and n edges contains at least m
different spanning trees ?

A) 1
B) 2
C) 3
D) n

gate2007-it graph-theory spanning-tree normal

15.29 TIFR2010-B-36 top gateoverflow.in/19248

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 727 of 852

In a directed graph, every vertex has exactly seven edges coming in. What can one always say about the number of edges
going out of its vertices?

a. Exactly seven edges leave every vertex.


b. Exactly seven edges leave some vertex.
c. Some vertex has at least seven edges leaving it.
d. The number of edges coming out of vertex is odd.
e. None of the above.

tifr2010 graph-theory

15.30 TIFR2011-B-33 top gateoverflow.in/20624

Which of the following is NOT a sufficient and necessary condition for an undirected graph G to be a tree?
a. G is connected and has n 1 edges.
b. G is a acyclic and connected.
c. G is a acyclic and has n 1 edges.
d. G is a acyclic, connected and has n 1 edges.
e. G has n 1 edges.

tifr2011 graph-theory

15.31 TIFR2012-B-2 top gateoverflow.in/25047

In a graph, the degree of a vertex is the number of edges incident (connected) on it. Which of the following is true for every
graph G?

a. There are even number of vertices of even degree.


b. There are odd number of vertices of even degree.
c. There are even number of vertices of odd degree.
d. There are odd number of vertices of odd degree.
e. All the vertices are of even degree.

tifr2012 graph-theory

15.32 GATE2006-73 top gateoverflow.in/43567

The 2n vertices of a graph G corresponds to all subsets of a set of size n, for n 6. Two vertices of G are adjacent if and
only if the corresponding sets intersect in exactly two elements.

The number of connected components in G is:

A. n
B. n + 2
C. 2n/2
2n
D. n

gate2006 graph-theory normal

15.33 GATE1991-16,b top gateoverflow.in/26647

Show that all vertices in an undirected finite graph cannot have distinct degrees, if the graph has at least two vertices.

gate1991 graph-theory

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 728 of 852

15.34 TIFR2015-B-5 top gateoverflow.in/29858

Suppose

0 1 0 0 0 1
1 0

0 1 0 0
0 1
1 0 1 0
0 0


0 1 0 1
0 0 0 1 0 1
1 0 1 0 1 0
is the adjacency matrix of an undirected graph with six vertices: that is, the rows and columns are indexed by vertices of the
graph, and an entry is 1 if the corresponding vertices are connected by an edge and is 0 otherwise; the same order of
vertices is used for the rows and columns. Which of the graphs below has the above adjacency matrix?

A. Only (i)
B. Only (ii)
C. Only (iii)
D. Only (iv)
E. (i) and (ii)

tifr2015

15.35 TIFR2013-B-1 top gateoverflow.in/25508

Let G = (V , E) be a simple undirected graph on n vertices. A colouring of G is an assignment of colours to each vertex
such that endpoints of every edge are given different colours. Let (G) denote the chromatic number of G, i.e. the
minimum numbers of colours needed for a valid colouring of G. A set B V is an independent set if no pair of vertices in B
is connected by an edge. Let a(G) be the number of vertices in a largest possible independent set in G. In the absence of
any further information about G we can conclude.

a. (G) a(G)
b. (G) a(G)
c. a(G) n/(G)
d. a(G) n/(G)
e. None of the above.

tifr2013 graph-theory

15.36 TIFR2015-B-11 top gateoverflow.in/30043

Let Kn be the complete graph on n vertices labelled {1, 2, , n} with m = n(n 1)/2 edges. What is the number of
spanning trees of Kn ?

A. m
n1
B. mn1
C. nn2
D. nn1
E. None of the above.

tifr2015 graph-theory

15.37 gate2006 top gateoverflow.in/35749

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 729 of 852

15.38 GATE2006-72 top gateoverflow.in/43566

The 2n vertices of a graph G corresponds to all subsets of a set of size n, for n 6. Two vertices of G are adjacent if and
only if the corresponding sets intersect in exactly two elements.

The maximum degree of a vertex in G is:


n/2 n/2
A. (
2
)2
B. 2n2

n3
3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 730 of 852

C. 2n3 3
D. 2n1

gate2006 graph-theory normal

15.39 GATE2014-2_51 top gateoverflow.in/2018

A cycle on n vertices is isomorphic to its complement. The value of n is _____.

gate2014-2 graph-theory numerical-answers normal

15.40 GATE2004_79 top gateoverflow.in/1073

(n2 3n)
How many graphs on n labeled vertices exist which have at least edges ?
2

( n 2n )
2
(a) C n23n
2

( n23n
)
(b) k=0
2 (n2 n) C
k

( n 2n )
2
(c) Cn

( n 2n )
2
n
(d) k=0 Ck
gate2004 graph-theory combinatory normal

15.41 GATE2010_1 top gateoverflow.in/1147

Let G=(V, E) be a graph. Define (G) = id d, where id is the number of vertices of degree d in G. If S and T are two
d
different trees with (S) = (T ), then
(A) |S| = 2|T| (B) |S| = |T| - 1 (C) |S| = |T| (D) |S| = |T| + 1

gate2010 graph-theory normal

15.42 GATE2005_11 top gateoverflow.in/1161

Let G be a simple graph with 20 vertices and 100 edges. The size of the minimum vertex cover of G is 8. then, the size of
the maximum independent set of G is:

(A) 12 (B) 8 (C) less than 8 (D) more than 12

gate2005 graph-theory normal

15.43 GATE2003_40 top gateoverflow.in/931

A graph G = (V , E) satisfies |E| 3|V | 6. The min-degree of G is defined as minvV {degree(v)}. Therefore, min-
degree of G cannot be

(A) 3 (B) 4 (C) 5 (D) 6

gate2003 graph-theory normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 731 of 852

15.44 GATE2002_1.25 top gateoverflow.in/830

The maximum number of edges in a n-node undirected graph without self loops is

A. n2
n(n1)
B. 2
C. n 1
(n+1)(n)
D. 2

gate2002 graph-theory easy

15.45 GATE2001_2.15 top gateoverflow.in/733

How many undirected graphs (not necessarily connected) can be constructed out of a given set V = {v1 , v2 , vn } of n
vertices?
n(n1)
A. 2
B. 2 n
C. n!
n(n1)
D. 2 2

gate2001 graph-theory normal

15.46 GATE2009_3 top gateoverflow.in/804

Which one of the following is TRUE for any simple connected undirected graph
with more than 2 vertices?

(A) No two vertices have the same degree.

(B) At least two vertices have the same degree.

(C) At least three vertices have the same degree.

(D) All vertices have the same degree.

gate2009 graph-theory normal

15.47 GATE2007_23 top gateoverflow.in/1221

Which of the following graphs has an Eulerian circuit?

(A) Any k-regular graph where k is an even number.


(B) A complete graph on 90 vertices.
(C) The complement of a cycle on 25 vertices.
(D) None of the above

gate2007 graph-theory normal

15.48 GATE1994_1.6 top gateoverflow.in/2443

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 732 of 852

The number of distinct simple graphs with up to three nodes is

A. 15
B. 10
C. 7
D. 9

gate1994 graph-theory combinatory normal

15.49 GATE1994_2.5 top gateoverflow.in/2472

The number of edges in a regular graph of degree d and n vertices is ____________

gate1994 graph-theory easy

15.50 GATE2014-1_51 top gateoverflow.in/1931

Consider an undirected graph G where self-loops are not allowed. The vertex set of G is {(i, j) 1 i 12, 1 j 12} . There is an edge between (a, b)
and (c, d) if |a c| 1 and |b d| 1 . The number of edges in this graph is______.

gate2014-1 graph-theory numerical-answers normal

15.51 GATE2006-71 top gateoverflow.in/1850

The 2n vertices of a graph G corresponds to all subsets of a set of size n, for n 6. Two vertices of G are adjacent if and
only if the corresponding sets intersect in exactly two elements.
The number of vertices of degree zero in G is:

A. 1
B. n
C. n + 1
D. 2n

gate2006 graph-theory normal

15.52 GATE2013_25 top gateoverflow.in/1536

Which of the following statements is/are TRUE for undirected graphs?

P: Number of odd degree vertices is even.

Q: Sum of degrees of all vertices is even.

(A) P only (B) Q only (C) Both P and Q (D) Neither P nor Q

gate2013 graph-theory easy

15.53 GATE2013_26 top gateoverflow.in/1537

The line graph L(G) of a simple graph G is defined as follows:

There is exactly one vertex v(e) in L(G) for each edge e in G.


For any two edges e and e in G, L(G) has an edge between v(e) and v(e ), if and only if e and e are incident with the
same vertex in G.

Which of the following statements is/are TRUE?


(P) The line graph of a cycle is a cycle.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 733 of 852

(Q) The line graph of a clique is a clique.


(R) The line graph of a planar graph is planar.
(S) The line graph of a tree is a tree.

(A) P only

(B) P and R only

(C) R only

(D) P, Q and S only

gate2013 graph-theory normal

15.54 GATE1995_24 top gateoverflow.in/2663

Prove that in finite graph, the number of vertices of odd degree is always even.

gate1995 graph-theory

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 734 of 852

16 Linear Algebra top


16.1 Cayley Hamilton Theorem: GATE1993_02.7 top gateoverflow.in/611

1 0 0 1
0
If A =
1
the matrix A4 , calculated by the use of Cayley-Hamilton theorem or otherwise, is ____
1 0
0 0 i

i
0 0 0 i
gate1993 linear-algebra normal cayley-hamilton-theorem

16.2 Cayley Hamilton Theorem: TIFR2010-A-16 top gateoverflow.in/18492

Let the characteristic equation of matrix M be 2 1 = 0. Then.


a. M 1 does not exist.
b. M 1 exists but cannot be determined from the data.
c. M 1 = M + I
d. M 1 = M I
e. M 1 exists and can be determined from the data but the choices (c) and (d) are incorrect.

tifr2010 linear-algebra matrices cayley-hamilton-theorem

16.3 Eigen Value: TIFR2010-Maths-A-10 top gateoverflow.in/19357

Let Mn (R) be the set of n x n matrices with real entries. Which of the following statements is true?

a. Any matrix A M4 (R) has a real eigenvalue.


b. Any matrix A M5 (R) has a real eigenvalue.
c. Any matrix A M2 (R) has a real eigenvalue.
d. None of the above.

tifrmaths2010 eigen-value

16.4 Eigen Value: GATE2005_49 top gateoverflow.in/1174

What are the eigenvalues of the following 2 2 matrix?

2 1
( )
4 5
(A) -1 and 1 (B) 1 and 6 (C) 2 and 5 (D) 4 and -1

gate2005 linear-algebra eigen-value easy

16.5 Eigen Value: GATE2010_29 top gateoverflow.in/1155

Consider the following matrix

2 3
A=[ ]
x y
If the eigenvalues of A are 4 and 8, then

(A) x = 4, y = 10 (B) x = 5, y = 8 (C) x = 3,y = 9 (D) x = -4, y = 10

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 735 of 852

gate2010 linear-algebra eigen-value easy

16.6 Eigen Value: GATE2014-3_4 top gateoverflow.in/2038

Which one of the following statements is TRUE about every n n matrix with only real eigenvalues?

(A) If the trace of the matrix is positive and the determinant of the matrix is negative, at least one of its eigenvalues is negative.

(B) If the trace of the matrix is positive, all its eigenvalues are positive.

(C) If the determinant of the matrix is positive, all its eigenvalues are positive.

(D) If the product of the trace and determinant of the matrix is positive, all its eigenvalues are positive.

gate2014-3 linear-algebra eigen-value normal

16.7 Eigen Value: GATE 2016-1-05 top gateoverflow.in/39634



Two eigenvalues of a 3 3 real matrix P are (2 + 1 ) and 3. The determinant of P is _______

gate2016-1 linear-algebra eigen-value numerical-answers normal

16.8 Eigen Value: GATE2015-3_15 top gateoverflow.in/8411

1 1 2
In the given matrix 0 1 0 , one of the eigenvalues is 1. The eigenvectors corresponding to the eigenvalue 1 are
1 2 1

0, a R}
A. {a (4, 2, 1) a
B. {a (4, 2, 1) a 0, a R}
C. {a (2, 0, 1) a 0, a R}
D. {a ( 2, 0, 1) a 0, a R}

gate2015-3 linear-algebra eigen-value normal

16.9 Eigen Value: GATE2014-2_47 top gateoverflow.in/2013

The product of the non-zero eigenvalues of the matrix is ____

gate2014-2 linear-algebra eigen-value normal

16.10 Eigen Value: GATE2011_40 top gateoverflow.in/2142

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 736 of 852

Consider the matrix as given below.

1 2 3
0 4 7
0 0 3
Which one of the following options provides the CORRECT values of the eigenvalues of the matrix?

(A) 1, 4, 3

(B) 3, 7, 3

(C) 7, 3, 2

(D) 1, 2, 3

gate2011 linear-algebra eigen-value easy

16.11 Eigen Value: GATE2014-1_5 top gateoverflow.in/1760

The value of the dot product of the eigenvectors corresponding to any pair of dierent eigenvalues of a 4 by 4 symmetric positive denite matrix is
___________

gate2014-1 linear-algebra eigen-value numerical-answers normal

16.12 Eigen Value: GATE_2014 ME top gateoverflow.in/33416

Consider a 3 x 3 real symmetric matrix S such that two of its eigen values are a 0 , b 0 with respective Eigen vectors

[ x1 x2 x3 ] , [ y1 y2 y3 ] .

If a b then x1y1 + x2y2 + x3y3 is

a) a

b) b

c) ab

d) 0

engineering-mathematics linear-algebra eigen-value

16.13 Eigen Value: GATE2015-2_5 top gateoverflow.in/8051

4 5
The larger of the two eigenvalues of the matrix [ ] is _______.
2 1
gate2015-2 linear-algebra eigen-value easy

16.14 Eigen Value: GATE2006-IT_26 top gateoverflow.in/3565

What are the eigenvalues of the matrix P given below

a 1 0
P = 1 a 1
0 1 a

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 737 of 852

A) a, a -2, a + 2
B) a, a, a
C) 0, a, 2a
D) -a, 2a, 2a

gate2006-it linear-algebra eigen-value normal

16.15 Eigen Value: Gate_2007 ME top gateoverflow.in/33428

The number of linearly independent Eigen vectors of is

a) 0

b) 1

C) 2

d) infinite

engineering-mathematics linear-algebra eigen-value

16.16 Eigen Value: GATE2015-1_36 top gateoverflow.in/8285

Consider the following 2 2 matrix A where two elements are unknown and are marked by a and b . The eigenvalues of this
matrix are -1 and 7. What are the values of a and b ?

A = ( 1b 4a )

A. a = 6, b = 4
B. a = 4, b = 6
C. a = 3, b = 5
D. a = 5, b = 3

gate2015-1 linear-algebra eigen-value normal

16.17 Eigen Value: GATE 2016-2-06 top gateoverflow.in/39549

T
Suppose that the eigenvalues of matrix A are 1, 2, 4. The determinant of (A1 ) is _________.

gate2016-2 linear-algebra eigen-value normal numerical-answers

16.18 Eigen Value: GATE2002_5a top gateoverflow.in/858

a. Obtain the eigen values of the matrix

1 2 34 49

A=
94

0 2 43
0 0 2 104
0 0 0 1

gate2002 linear-algebra eigen-value normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 738 of 852

16.19 Eigen Value: GATE2007_25 top gateoverflow.in/254

[ ], where
A I
Let A be a 4 4 matrix with eigen values -5,-2,1,4. Which of the following is an eigen value of the matrix
I A
I is the 4 4 identity matrix?
A) -5 B) -7 C) 2 D) 1

gate2007 eigen-value linear-algebra difficult

16.20 Eigen Value: GATE2008_28 top gateoverflow.in/426

How many of the following matrices have an eigenvalue 1?


1 0 0 1 1 1 1 0
[ ][ ][ ] and [ ]
0 0 0 0 1 1 1 1
(A) one (B) two (C) three (D) four

gate2008 eigen-value linear-algebra

16.21 Eigen Value: GATE1993_01.1 top gateoverflow.in/596

In questions 1.1 to 1.7 below, one or more of the alternatives are correct. Write the code letter(s) a, b, c, d corresponding
to the correct alternative(s) in the answer book. Marks will be given only if all the correct alternatives have been selected
and no incorrect alternative is picked up.

1.1). The eigen vector (s) of the matrix

0 0
0 0 0 , 0
0 0 0
is (are)

(a). (0, 0, )

(b). (, 0, 0)

(c). (0, 0, 1)

(d). (0, , 0)

gate1993 eigen-value linear-algebra easy

16.22 Eigen Value: GATE2007-IT_2 top gateoverflow.in/3433

3 1
Let A be the matrix [ ]. What is the maximum value of x T Ax where the maximum is taken over all x that are the unit
1 2
eigenvectors of A?

A) 3
B) (5 + 5)/2
C) 3
D) (5 - 5)/2

gate2007-it linear-algebra eigen-value normal

16.23 Matrices: TIFR2012-B-12 top gateoverflow.in/25141

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 739 of 852

Let A be a matrix such that Ak = 0. What is the inverse of I A?


a. 0
b. I
c. A
d. 1 + A + A2 +. . . + Ak1
e. Inverse is not guaranteed to exist.

tifr2012 linear-algebra matrices

16.24 Matrices: GATE1995_1.24 top gateoverflow.in/2611

The rank of the following (n + 1) (n + 1) matrix, where a is a real number is

1 a a2 an
1 an

a a2








1 a a2 an
A. 1
B. 2
C. n
D. Depends on the value of a

gate1995 linear-algebra matrices normal

16.25 Matrices: GATE1996_10 top gateoverflow.in/2762

1 0
=[ ] and B = [ 11 ] be two matrices such that AB = I . Let C = A [ ] and CD = I .
a12 a11 b b12
Let A
a22 a21 b21 b22 1 1
Express the elements of D in terms of the elements of B.

gate1996 linear-algebra matrices normal

16.26 Matrices: TIFR2015-A-14 top gateoverflow.in/29588

Consider the following 3 3 matrices.

0 1 1
M1 = 1 0 1
1 1 0

1 0 1
M2 = 0 0 0
1 0 1
How may 0 1 column vectors of the form

x1
X= x2
x
3

are there such that M1 X = M2 X (modulo 2)? (modulo 2 means all operations are done modulo 2, i.e, 3 = 1 (modulo 2),
4 = 0 (modulo 2)).

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 740 of 852

a. None
b. Two
c. Three
d. Four
e. Eight

tifr2015 matrices

16.27 Matrices: TIFR2010-A-5 top gateoverflow.in/18216

A is symmetric positive definite matrix ( i.e., xT Ax > 0 for all non zero x). Which of the following statements is false?
a. At least one element is positive.
b. All eigen values are positive real.
c. Sum of the diagonal elements is positive.
d. det (A) is positive.
e. None of the above.

tifr2010 linear-algebra matrices

16.28 Matrices: GATE1994_3.12 top gateoverflow.in/2498

1 0 1
Find the inverse of the matrix 1 1 1
0 1 0
gate1994 linear-algebra matrices easy

16.29 Matrices: GATE1994_1.9 top gateoverflow.in/2446

0 0 3
The rank of matrix 9 3 5 is:
3 1 1
A. 0
B. 1
C. 2
D. 3

gate1994 linear-algebra matrices easy

16.30 Matrices: GATE2004-IT_36 top gateoverflow.in/3679

1
=[ ] and X 2 X + I = O (I is the identity matrix and O is the zero matrix), then the
a
If matrix X
a2 + a 1 1a
inverse of X is

1 a 1
A) [ ]
a2 a
1a 1
B) [ 2 ]
a a+1 a
a 1
C) [ 2 ]
a + a 1 1 a

2 a+1
[ ]
Copyright GATE Overflow. All rights reserved.
GATE Overflow April 2016 741 of 852

D) a2 a + 1
[ ]
a
1 1a
gate2004-it linear-algebra matrices normal

16.31 Matrices: TIFR2013-B-3 top gateoverflow.in/25659

How many 4 4 matrices with entries from 0, 1 have odd determinant?

Hint: Use modulo 2 arithmetic.

a. 20160
b. 32767
c. 49152
d. 57343
e. 65520

tifr2013 linear-algebra matrices

16.32 Matrices: GATE2015-1_18 top gateoverflow.in/8241

2 2
In the LU decomposition of the matrix [ ], if the diagonal elements of U are both 1, then the lower diagonal entry l22
4 9
of L is_________________.

gate2015-1 linear-algebra matrices

16.33 Matrices: GATE2015-2_27 top gateoverflow.in/8131

3 4 45
Perform the following operations on the matrix 7 9 105
13 2 195
i. Add the third row to the second row
ii. Subtract the third column from the first column.

The determinant of the resultant matrix is _____.

gate2015-2 linear-algebra matrices easy

16.34 Matrices: TIFR2010-Maths-B-11 top gateoverflow.in/19664

Which of the following is true?

1 0
a. The matrix ( ) is not diagonalisable.
1 2
1 5
b. The matrix ( ) is diagonalisable.
0 2
1 1
c. The matrix ( ) is diagonalisable
0 1
d. None of the above.

tifrmaths2010 linear-algebra matrices

16.35 Matrices: GATE1998_2.1 top gateoverflow.in/1673

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 742 of 852

The rank of the matrix given below is:

1 4 8 7
0 0

0 3
4 2 3 1

3 12 24 2
A. 3
B. 1
C. 2
D. 4

gate1998 linear-algebra matrices normal

16.36 Matrices: TIFR-2015-Maths-B-5 top gateoverflow.in/31724

Let n 1 and let A be an n n matrix with real entries such that Ak = 0, for some k 1. Let I be the identity n n
matrix. Then.

A. I + A need not be invertible.


B. Det (I + A) can be any non-zero real number.
C. Det (I + A) = 1
D. An is a non-zero matrix.

tifrmaths2015 linear-algebra matrices

16.37 Matrices: GATE2004-IT_32 top gateoverflow.in/3675

Let A be an n n matrix of the following form.

What is the value of the determinant of A?

A. ( ) ( )+ ( ) ( )
5+3 n1 53 +7 53 n1 53 7
2 23 2 23

B. ( ) ( 725 +3 )+( ) ( 725 3 )


7+5 n1 75 n1
2 5 2 5

C. ( ) ( )+ ( ) ( )
3+7 n1 37 +5 37 n1 37 5
2 27 2 27

D. ( ) ( 325 +7 )+( ) ( 325 7 )


3+5 n1 35 n1
2 5 2 5

gate2004-it linear-algebra matrices normal

16.38 Matrices: GATE1998_2.2 top gateoverflow.in/1674

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 743 of 852

1 a bc
Consider the following determinant = 1 b ca
1 C ab
Which of the following is a factor of ?

A. a+b
B. a-b
C. a+b+c
D. abc

gate1998 linear-algebra matrices normal

16.39 Matrices: TIFR2010-Maths-B-10 top gateoverflow.in/19661

Let x and y Rn be non-zero column vectors, from the matrix A = xy T , where y T is the transpose of y. Then the rank of
A is:
a. 2
b. 0
c. At least n/2
d. None of the above.

tifrmaths2010 matrices

16.40 System Of Equations: GATE2015-3_33 top gateoverflow.in/8490

If the following system has non-trivial solution,

px + qy + rz = 0
qx + ry + pz = 0
rx + py + qz = 0,
then which one of the following options is TRUE?

A. p q + r = 0 or p = q = r
B. p + q r = 0 or p = q = r
C. p + q + r = 0 or p = q = r
D. p q + r = 0 or p = q = r

gate2015-3 linear-algebra system-of-equations normal

16.41 System Of Equations: GATE2004-IT_6 top gateoverflow.in/3647

What values of x, y and z satisfy the following system of linear equations?

1 2 3x 6
1 3 4y = 8
2 2 3 z 12

A) x = 6, y = 3, z = 2
B) x = 12, y = 3, z = - 4
C) x = 6, y = 6, z = - 4
D) x = 12, y = - 3, z = 0

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 744 of 852

gate2004-it linear-algebra system-of-equations easy

16.42 System Of Equations: TIFR2014-A-1 top gateoverflow.in/25979

Consider the reactions

X + 2Y 3Z
2X + Z Y .

Let nX , nY , nZ denote the numbers of molecules of chemicals X, Y , Z in the reaction chamber. Then which of the following
is conserved by both reactions?

a. nX + nY + nZ .
b. nX + 7nY + 5nZ .
c. 2nX + 9nY 3nZ .
d. 3nX 3nY + 13nZ .
e. None of the above.

tifr2014 linear-algebra system-of-equations

16.43 System Of Equations: GATE2014-1_4 top gateoverflow.in/1757

Consider the following system of equations:

3x + 2y = 1

4x + 7z = 1
x+y+z = 3

x 2y + 7z = 0

The number of solutions for this system is ______________

gate2014-1 linear-algebra system-of-equations numerical-answers normal

16.44 System Of Equations: GATE2004_71 top gateoverflow.in/1065

How many solutions does the following system of linear equations have?

x + 5y = 1
xy = 2
x + 3y = 3
A. infinitely many
B. two distinct solutions
C. unique
D. none

gate2004 linear-algebra system-of-equations normal

16.45 System Of Equations: GATE2003_41 top gateoverflow.in/932

Consider the following system of linear equations

2 1 4 x
4 3 12 y = 5
1 2 8 z 7

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 745 of 852

Notice that the second and the third columns of the coefficient matrix are linearly dependent. For how many values of ,
does this system of equations have infinitely many solutions?
(A) 0 (B) 1
(C) 2 (D) 3

gate2003 linear-algebra system-of-equations normal

16.46 System Of Equations: GATE 2016-2-04 top gateoverflow.in/39545

Consider the system, each consisting of m linear equations in n variables.

I. If m < n, then all such systems have a solution.


II. If m > n, then none of these systems has a solution.
III. If m = n, then there exists a system which has a solution.
Which one of the following is CORRECT?

a. I, II and III are true.


b. Only II and III are true.
c. Only III is true.
d. None of them is true.

gate2016-2 linear-algebra system-of-equations normal

16.47 System Of Equations: GATE1996_1.7 top gateoverflow.in/2711

Let Ax = b be a system of linear equations where A is an m n matrix and b is a m 1 column vector and X is an n 1
column vector of unknowns. Which of the following is false?

A. The system has a solution if and only if, both A and the augmented matrix [Ab] have the same rank.
B. If m < n and b is the zero vector, then the system has infinitely many solutions.
C. If m = n and b is a non-zero vector, then the system has a unique solution.
D. The system will have only a trivial solution when m = n, b is the zero vector and rank(A) = n.

gate1996 linear-algebra system-of-equations normal

16.48 System Of Equations: GATE2005_48 top gateoverflow.in/1173

Consider the following system of linear equations :

2x1 x2 + 3x3 = 1
3 1 +2 2 +5 3 =2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 746 of 852

3x1 + 2x2 + 5x3 = 2


x1 + 4x2 + x3 = 3
The system of equations has

(A) no solution (B) a unique solution (C) more than one but a finite number of solutions (D) an infinite number of
solutions

gate2005 linear-algebra system-of-equations normal

16.49 System Of Equations: TIFR2010-Maths-B-14 top gateoverflow.in/19820

The equations.

x1 + 2x2 + 3x3 = 1
x1 + 4x2 + 9x3 = 1
x1 + 8x2 + 27x3 = 1
have

a. Only one solution.


b. Two solutions.
c. Infinitely many solutions.
d. No solutions

tifrmaths2010 linear-algebra system-of-equations

16.50 System Of Equations: GATE1998_9 top gateoverflow.in/1723

Derive the expressions for the number of operations required to solve a system of linear equations in n unknowns using the
Gaussian Elimination Method. Assume that one operation refers to a multiplication followed by an addition.

gate1998 linear-algebra system-of-equations descriptive

16.51 System Of Equations: GATE1998_1.2 top gateoverflow.in/1639

Consider the following set of equations

x + 2y = 5
4x + 8y = 12
3x + 6y + 3z = 15
This set

A. has unique solution

B. has no solution

C. has finite number of solutions

D. has infinite number of solutions

gate1998 linear-algebra system-of-equations easy

16.52 Vector Space: TIFR2010-Maths-B-2 top gateoverflow.in/19367

If V is a vector space over the field Z/5Z and dimZ/5Z (V ) = 3 then V has.

a. 125 elements
b. 15 elements
c. 243 elements

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 747 of 852

d. None of the above.

tifrmaths2010 vector-space

16.53 Vector Space: GATE2014-3_5 top gateoverflow.in/2039

If V1 and V2 are 4 -dimensional subspaces of a 6 -dimensional vector space V , then the smallest possible dimension of V1 V2 is _____.

gate2014-3 linear-algebra vector-space normal

16.54 Vector Space: TIFR-2014-Maths-B-8 top gateoverflow.in/31331

Let X be a non-empty topological space such that every function f : X R is continuous. Then
a. X has the discrete topology
b. X has the indiscrete topology
c. X is compact
d. X is not connected.

tifrmaths2014 vector-space

16.55 GATE 2014 _ 28 [IN] top gateoverflow.in/34572

A scalar valued function is defined as

f(x) = xT Ax + bT x + c
where A = symmetric +ve definite matrix with diamension n*n

x = are vectors of dimension n* 1


The min value of f(x) will occur when x equals

A. (ATA )-1B
B. - (ATA )-1B
C. -(A-1B) / 2
D. (A-1B) / 2

linear-algebra

16.56 GATE 2012 What is Normalised Eigen Vector ? top gateoverflow.in/34573

5 3
For the Matrix [ ]
1 3

One of the Normalised Eigen Vector is given as__________

Answer

2
1

1

2

What is Normalised Eigen Vector ?


How to Find the Solution ?

linear-algebra gate-2012

16.57 TIFR-2015-Maths-B-15 top gateoverflow.in/31942

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 748 of 852

Let d(x, y) be the usual Euclidean metric on R2 . Which of the following metric spaces is complete?

a. Q2 R2 with the metric d(x, y).


2 d(x,y)
b. [0, 1] [0, ) R with the metric d (x, y) = .
1+d(x,y)
c. (0, ) [0, ) R2 with the metric d(x, y).
d. [0, 1] [0, 1) R2 with the metric d (x, y) = min {1, d(x, y)}.

tifrmaths2015 non-gate

16.58 TIFR-2015-Maths-B-11 top gateoverflow.in/31928

Let (X, d) be a path connected metric space with at least two elements, and let S = {d(x, y) : x, y X}. Which of the
following statements is not necessarily true ?

A. S is infinite.
B. S contains a non-zero rational number.
C. S is connected.
D. S is a closed subset of R

tifrmaths2015 linear-algebra non-gate

16.59 TIFR-2015-Maths-B-4 top gateoverflow.in/31719

Let U1 U2 . . . be a decreasing sequence of open sets in Euclidean 3-space R3 . What can we say about the set Ui ?
A. It is infinite.
B. It is open.
C. It is non-empty.
D. None of the above.

tifrmaths2015 linear-algebra non-gate

16.60 TIFR2014-A-20 top gateoverflow.in/27132

Consider the equation x2 + y 2 3z 2 3t2 = 0. The total number of integral solutions of this equation in the range of the
first 10000 numbers, i.e., 1 x, y, z, t 10000, is

A. 200
B. 55
C. 100
D. 1
E. None of the above

tifr2014 linear-algebra

16.61 TIFR-2015-Maths-B-13 top gateoverflow.in/31934

Let X = {(x, y) R2 : 2x2 + 3y 2 = 1}. Endow R2 with the discrete topology, and X with the subspace topology. Then.

A. X is a compact subset of R2 in this topology.


2
B. X is a connected subset of R in this topology.
2
C. X is an open subset of R in this topology.
D. None of the above.

tifrmaths2015 linear-algebra

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 749 of 852

16.62 GATE2008-IT_29 top gateoverflow.in/3319

If M is a square matrix with a zero determinant, which of the following assertion (s) is (are) correct?

(S1) Each row of M can be represented as a linear combination of the other rows
(S2) Each column of M can be represented as a linear combination of the other columns
(S3) MX = 0 has a nontrivial solution
(S4) M has an inverse

1) S3 and S2
2) S1 and S4
3) S1 and S3
4) S1, S2 and S3

gate2008-it linear-algebra normal

16.63 GATE2004_26 top gateoverflow.in/1023

The number of different n n symmetric matrices with each element being either 0 or 1 is: (Note: power (2, X) is same as
2X )

A. power (2, n)

B. power (2, n2 )

C. power (2, (n2 + n) /2)

D. power (2, (n2 n) /2)

gate2004 linear-algebra normal

16.64 GATE2004_27 top gateoverflow.in/1024

Let A, B, C, D be n x n matrices, each with non-zero determinant. If ABCD = I, then B -1 is

A. D-1C-1A-1
B. CDA
C. ADC
D. Does not necessarily exist

gate2004 linear-algebra normal

16.65 GATE2004_76 top gateoverflow.in/1070

In an M N matrix all non-zero entries are covered in a rows and b columns. Then the maximum number of non-zero entries,
such that no two are on the same row or column, is

A. a+b
B. max(a, b)
C. min(M a, N b)
D. min(a, b)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 750 of 852

gate2004 linear-algebra normal

16.66 GATE2006_23 top gateoverflow.in/984

F is an n n real matrix. b is an n 1 real vector. Suppose there are two n 1 vectors, u and v such that, u v and
F u = b, F v = b. Which one of the following statements is false?
(A) Determinant of F is zero.

(B) There are an infinite number of solutions to F x = b

(C) There is an x 0 such that F x = 0

(D) F must have two identical rows

gate2006 linear-algebra normal

16.67 GATE2002_1.1 top gateoverflow.in/805

1 1
The rank of the matrix [ ] is
0 0
A. 4
B. 2
C. 1
D. 0

gate2002 linear-algebra easy

16.68 GATE2008_3 top gateoverflow.in/401

The following system of equations

x1 + x2 + 2x3 = 1
x1 + 2x2 + 3x3 = 2
x1 + 4x2 + x3 = 4
has a unique solution. The only possible value(s) for is/are

(A) 0 (B) either 0 or 1 (C) one of 0, 1, or -1 (D) any real number

gate2008 easy linear-algebra

16.69 GATE2000_1.3 top gateoverflow.in/626

The determinant of the matrix

2 0 0 0
8 2

1 7
2 0 2 0

9 0 6 1
A. 4
B. 0
C. 15
D. 20

gate2000 linear-algebra easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 751 of 852

16.70 GATE2001_1.1 top gateoverflow.in/694

Consider the following statements:

S1: The sum of two singular n n matrices may be non-singular


S2: The sum of two n n non-singular matrices may be singular

Which one of the following statements is correct?

(A) S1 and S2 both are true

(B) S1 is true, S2 is false

(C) S1 is false, S2 is true

(D) S1 and S2 both are false

gate2001 linear-algebra normal

16.71 GATE2007_27 top gateoverflow.in/1225

Consider the set of (column) vectors defined by

X = {x R3 x1 + x2 + x3 = 0, where xT = [x1 , x2 , x3 ]T }

Which of the following is TRUE ?

(A) {[1, 1, 0] , [1, 0, 1]T } is a basis for the subspace X.


T

(B) {[1, 1, 0] , [1, 0, 1]T } is a linearly independent set, but it does not span X and therefore is not a basis of X.
T

(C) X is not a subspace of R3 .


(D) None of the above

gate2007 linear-algebra normal

16.72 GATE2013_3 top gateoverflow.in/1412

Which one of the following does NOT equal

1 x x2

1 y y2

1 z z2
?

(A)

1 x(x + 1) x+1

1 y(y + 1) y+1

1 z(z + 1) z+1
(B)

1 x+1 x2 + 1

1 y+1 y2 + 1

1 z+1 z2 + 1
(C)

2 2


Copyright GATE Overflow. All rights reserved.

GATE Overflow April 2016 752 of 852

0 xy x2 y 2

0 yz y 2 z2

1 z z2
(D)

2 x+y x2 + y 2

2 y+z y 2 + z2

1 z z2

gate2013 linear-algebra normal

16.73 GATE2006-IT_76 top gateoverflow.in/3620

x + y/2 = 9
3x + y = 10

The value of the Frobenius norm for the above system of equations is

1) 0.5
2) 0.75
3) 1.5
4) 2.0

gate2006-it linear-algebra normal

16.74 GATE2006-IT_77 top gateoverflow.in/3621

x + y/2 = 9
3x + y = 10

What can be said about the Gauss-Siedel iterative method for solving the above set of linear equations?

A) it will converge
B) It will diverse
C) It will neither converge nor diverse

D) It is not applicable

gate2006-it linear-algebra normal

16.75 GATE2005-IT_3 top gateoverflow.in/3747

The determinant of the matrix given below is

0 1 0 2
1 1 3

1
0 0 0 1

1 2 0 1

A) -1
B) 0
C) 1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 753 of 852

D) 2
gate2005-it linear-algebra normal

16.76 GATE2012_11 top gateoverflow.in/43

Let A be the 2 2 matrix with elements a_11 = a12 = a_21 = +1 and a_22 = 1 . Then the eigenvalues of the matrix A19
are

(A) 1024 and 1024


(B) 10242 and 10242
(C) 42 and 42
(D) 5122 and 5122

gate2012 linear-algebra

16.77 GATE1995_2.13 top gateoverflow.in/2625

A unit vector perpendicular to both the vectors a = 2i 2j + k and b = 1 + j 2k is:

A. 1 (i + j + k)
3

1
B. 3 (i + j k)

1
C. 3 (i j k)

D. 1 (i + j k)
3

gate1995 linear-algebra normal

16.78 GATE2014-2_4 top gateoverflow.in/1956

If the matrix A is such that

2
A = 4 [ 1 9 5 ]
7

then the determinant of A is equal to ______.

gate2014-2 linear-algebra numerical-answers easy

16.79 GATE1997_1.3 top gateoverflow.in/2219

6 8 1 1
0
The determinant of the matrix
6

2 4
0 0 4 8

0 0 0 1
A. 11
B. -48
C. 0
D. -24

gate1997 linear-algebra normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 754 of 852

16.80 TIFR2010-A-11 top gateoverflow.in/18503

The length of a vector x = (x1 , . . . . . xn ) is defined as



x = ni=1 x2i .

Given two vectors x = (x1 , . . . . xn ) and y = (y1 , . . . . yn ), which of the following measures of discrepancy between x and y
is insensitive to the length of the vectors?

a. x y
b. x y / x y
c. x y
d.
X Y
X
Y
e. None of the above.

tifr2010 linear-algebra

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 755 of 852

17 Calculus top
17.1 Continuity: GATE2013_22 top gateoverflow.in/1533

Which one of the following functions is continuous at x = 3?

2,
if x = 3
= x 1

if x > 3
x+3
(A) f(x)

3
if x < 3

={
4, if x = 3
(B) f(x)
8x if x 3

={
x + 3, if x 3
(C) f(x)
x4 if x > 3
1
(D) f(x) ={ x3 27
if x 3

gate2013 calculus continuity normal

17.2 Continuity: GATE2014-1_47 top gateoverflow.in/1925

A function f(x) is continuous in the interval [0, 2]. It is known that f(0) = f(2) = 1 and f(1) = 1 . Which one of the following statements must be true?

(A) There exists a y in the interval (0, 1) such that f(y) = f(y + 1)

(B) For every y


in the interval (0, 1),f(y) = f(2 y)

(C) The maximum value of the function in the interval (0, 2) is 1

(D) There exists a y


in the interval (0, 1) such that f(y) = f(2 y)

gate2014-1 calculus continuity normal

17.3 Continuity: GATE2015-2_26 top gateoverflow.in/8124

Let f(x) = x(1/3) and A denote the area of region bounded by f(x) and the X-axis, when x varies from -1 to 1. Which of
the following statements is/are TRUE?

I. f is continuous in [-1, 1]
II. f is not bounded in [-1, 1]
III. A is nonzero and finite

A. II only
B. III only
C. II and III only
D. I, II and III

gate2015-2 continuity functions normal

17.4 Convergence: TIFR2010-Maths-B-5 top gateoverflow.in/19370

I f fn (x) are continuous functions from [0, 1] to [0, 1], and fn (x) f(x) as n , then which of the following
statements is true?

a. fn (x) converges to f(x) uniformly on [0, 1].


b. fn (x) converges to f(x) uniformly on (0, 1).
f(x)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 756 of 852

c. f(x) is continuous on [0, 1].


d. None of the above.

tifrmaths2010 calculus convergence

17.5 Convergence: TIFR2010-Maths-B-1 top gateoverflow.in/19366

Let Un = sin( n ) and consider the series un . Which of the following statements is false?

a. un is convergent.
b. un 0 as n
c. un is divergent.
d. un is absolutely convergent.

tifrmaths2010 calculus convergence

17.6 Convergence: TIFR2010-Maths-B-13 top gateoverflow.in/19819

Define {xn } as x1 = 0.1, x2 = 0.101, x3 = 0.101001, Then the sequence {xn }.


a. Converges to a rational number.
b. Converges to a irrational number.
c. Does not coverage.
d. Oscillates.

tifrmaths2010 calculus convergence

17.7 Counting: GATE1995_7 top gateoverflow.in/2642

a. Determine the number of divisors of 600.

b. Compute without using power series expansion limx0 sinx x

gate1995 calculus normal counting

17.8 Differentiability: TIFR2010-Maths-A-8 top gateoverflow.in/19355

Let f(x) = |x|3/2 , x R. Then


A. f is uniformly continuous.
B. f is continuous, but not differentiable at x = 0.
C. f is differentiable and f is continuous.
D. f is differentiable, but f is discontinuous at x = 0.

tifrmaths2010 calculus differentiability continuity

17.9 Differentiability: GATE1996_1.6 top gateoverflow.in/2710

The formula used to compute an approximation for the second derivative of a function f at a point X0 is
f(x0 +h)+f(x0 h)
A. 2

f(x0 +h)f(x0 h)
B.
2h

f( 0 +h)+2f( 0 )+f( 0 h)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 757 of 852

f(x0 +h)+2f(x0 )+f(x0 h)


C.
h2

f(x0 +h)2f(x0 )+f(x0 h)


D.
h2

gate1996 calculus differentiability normal

17.10 Differentiability: GATE1996_3 top gateoverflow.in/2755

Let f be a function defined by

x2 for x 1
f(x) = ax2 + bx + c

for 1 < x 2
x+d for x > 2

Find the values for the constants a , b , c and d so that f is continuous and differentiable everywhere on the real line.

gate1996 calculus continuity differentiability normal

17.11 Differentiability: GATE1998_1.4 top gateoverflow.in/1641

Consider the function y = |x| in the interval [1, 1]. In this interval, the function is
A. continuous and differentiable

B. continuous but not differentiable

C. differentiable but not continuous

D. neither continuous nor differentiable

gate1998 calculus continuity differentiability easy

17.12 Differentiability: GATE2007_1 top gateoverflow.in/1200

Consider the following two statements about the function f(x) = |x|:
P. f(x) is continuous for all real values of x.
Q. f(x) is differentiable for all real values of x .

Which of the following is TRUE?

(A) P is true and Q is false. (B) P is false and Q is true.


(C) Both P and Q are true. (D) Both P and Q are false.

gate2007 calculus continuity differentiability easy

17.13 Integration: GATE2014-3_47 top gateoverflow.in/2081

The value of the integral given below is

x2 cos x dx
0

A. 2
B.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 758 of 852

C.
D. 2

gate2014-3 calculus limits integration normal

17.14 Integration: GATE1993_02.6 top gateoverflow.in/610

Q2). In questions from 2.1 to 2.10 below, each black (_______) is to be filled suitably.
1
1 x
2.6). The value of the double integral 0 0 x dxdy is_________.
1+y 2

gate1993 calculus integration normal

17.15 Integration: GATE2011_31 top gateoverflow.in/2133

/2

cos x+i sin x
Given i = 1, what will be the evaluation of the definite integral cos xi sin x
dx?
0

(A) 0

(B) 2

(C) i

(D) i

gate2011 calculus integration normal

17.16 Integration: GATE2015-3_45 top gateoverflow.in/8554

If for non-zero x, af(x) + bf( x1 ) = 1


x 25 where a a b then 12 f(x)dx is


1 47b ]
A. [ a(ln 2 25) +
a2 b2 2
1
B. 2 2 [ a(2 ln 2 25) 47b
2
]
a b
C. 2 1 2 [ a(2 ln 2 25) + 47b ]
a b 2
D. 2 1 2 [ a(ln 2 25) 47b ]
a b 2

gate2015-3 calculus integration normal

17.17 Integration: Gate_EE_2006 top gateoverflow.in/40963

engineering-mathematics integration

17.18 Integration: GATE2015-1_44 top gateoverflow.in/8314

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 759 of 852

Compute the value of:

2
cos(1/x)


dx
1

x2

gate2015-1 calculus integration normal

17.19 Integration: GATE1993_01.6 top gateoverflow.in/601

1. In questions 1.1 to 1.7 below, one or more of the alternatives are correct. Write the code letter(s) a, b, c, d
corresponding to the correct alternative(s) in the answer book. Marks will be given only if all the correct alternatives
have been selected and no incorrect alternative is picked up.

1.6). Which of the following improper integrals is (are) convergent?


1 sin x
A. 0 dx
1cos x
cos x
B. 0 1+x dx
x
C. 0 dx
1+x2
1 1cos x
D. 0 dx
x5
2

gate1993 calculus integration normal

17.20 Integration: GATE2014-3_6 top gateoverflow.in/2040

2
If |x sin x|dx = k, then the value of k is equal to ______.
0

gate2014-3 calculus integration limits numerical-answers easy

17.21 Integration: GATE1998_8 top gateoverflow.in/1722

(a) Find the points of local maxima and minima, if any, of the following function defined in 0 x 6.
x3 6x2 + 9x + 15

(b) Integrate

x cos xdx

gate1998 calculus maxima-minima integration normal

17.22 Integration: GATE2009_25 top gateoverflow.in/802

/4
0 (1 tan x)/(1 + tan x) dx
A. 0
B. 1
C. ln 2
D. 1/2 ln 2

gate2009 calculus integration normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 760 of 852

17.23 Integration: GATE2005-IT_35 top gateoverflow.in/3782

2
What is the value of 0 (x )2 (sin x)dx

A) -1
B) 0
C) 1
D)

gate2005-it calculus integration normal

17.24 Integration: TIFR2011-A-11 top gateoverflow.in/20219

1
ln x dx =
0

a. 1
b. 1
c.
d.
e. None of the above.

tifr2011 calculus integration

17.25 Integration: GATE2000_2.3 top gateoverflow.in/650

100
Let S = i=3 i log2 i, and

100
T = 2 x log2 xdx.
Which of the following statements is true?

A. S > T
B. S = T
C. S < T and 2S > T
D. 2S T

gate2000 calculus integration normal

17.26 Limits: GATE 2016-1-3 top gateoverflow.in/39630

sin(x 4)
lim
x4 x4
=____.

gate2016-1 calculus limits easy numerical-answers

17.27 Limits: TIFR2014-A-18 top gateoverflow.in/27128

We are given a collection of real numbers where a real number ai 0 occurs ni times. Let the collection be enumerated as
{x1 , x2 , . . . xn } so that x1 = x2 =. . . = xn1 = a1 and so on, and n = i ni is finite. What is
1/k
limk (ni=1 1
) ?
|xi |k

i ( i | i |)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 761 of 852

A. maxi (ni | ai |)
B. mini | ai |
C. mini (ni | ai |)
D. maxi | ai |
E. None of the above.

tifr2014 limits

17.28 Limits: TIFR2014-A-16 top gateoverflow.in/27107

Let x0 = 1 and
3+2xn
xn+1 = 3+xn
, n 0.

x = limn xn is
A. (5 1) /2
B. (5 + 1) /2

C. (13 1) /2

D. ( 13 1) /2
E. None of the above.

tifr2014 limits

17.29 Limits: TIFR2010-Maths-A-13 top gateoverflow.in/19363

What is the value of

1
lim sin ( )
x0 x
a. 1
b. 0
c. 12
d. Does Not Exist.

tifrmaths2010 limits

17.30 Limits: TIFR2011-A-17 top gateoverflow.in/20254

What is the value of the following limit?

2x 1
lim
x0 x
a. 0
b. log2 (e)
c. loge (2)
d. 1
e. None of the above.

tifr2011 limits

17.31 Limits: TIFR2011-A-14 top gateoverflow.in/20224

What is the value of the following limit?

2 x
Copyright GATE Overflow. All rights reserved.
GATE Overflow April 2016 762 of 852

d sin2 x
lim
x0 dx x
a. 0
b. 2
c. 1
d. 1
2
e. None of the above

tifr2011 calculus limits

17.32 Limits: TIFR2010-A-7 top gateoverflow.in/18234

The limit of 10n /n! as n is.


A. 0
B. 1
C. e
D. 10
E.

tifr2010 calculus limits

17.33 Limits: GATE2015-3_9 top gateoverflow.in/8403

x
The value of limx (1 + x2 )e is

A. 0
B. 12
C. 1
D.

gate2015-3 calculus limits normal

17.34 Limits: GATE2015-1_4 top gateoverflow.in/8021

1
limx x x is
A.
B. 0
C. 1
D. Not defined

gate2015-1 calculus limits normal

17.35 Limits: GATE2008_1 top gateoverflow.in/399

xsin x
limx x+cos x equals

(A) 1 (B) 1 (C) (D)

gate2008 calculus limits easy

17.36 Limits: GATE2010_5 top gateoverflow.in/1151

2n
n

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 763 of 852

2n
What is the value of limn (1 n1 ) ?

(A) 0 (B) e2 (C) e1/2 (D) 1

gate2010 calculus limits normal

17.37 Limits: GATE1993_02.1 top gateoverflow.in/605

x(ex 1)+2(cos x1)


Q2). In questions 2.1 to 2.10 below, each blank (___) is to be suitably filled in. limx0 is_____________
x(1cos x)

gate1993 limits calculus normal

17.38 Maxima Minima: GATE2012_9 top gateoverflow.in/41

Consider the function f(x) = sin(x) in the interval x = [/4, 7/4]. The number and location(s) of the local minima of this
function are

(A) One, at /2
(B) One, at 3/2
(C) Two, at /2 and 3/2
(D) Two, at /4 and 3/2

gate2012 calculus maxima-minima normal

17.39 Maxima Minima: TIFR2011-A-4 top gateoverflow.in/20002

Consider the problem of maximizing x2 2x + 5 such that 0 < x < 2. The value of x at which the maximum is achieved is:
a. 0.5
b. 1
c. 1.5
d. 1.75
e. None of the above.

tifr2011 calculus maxima-minima

17.40 Maxima Minima: GATE2008_25 top gateoverflow.in/423

A point on a curve is said to be an extremum if it is a local minimum or a local maximum. The number of distinct extrema for
the curve 3x4 16x3 + 24x2 + 37 is

(A) 0 (B) 1 (C) 2 (D) 3

gate2008 calculus maxima-minima easy

17.41 Maxima Minima: TIFR2014-A-9 top gateoverflow.in/25996

Solve min x2 + y2
subject to

x + y 10,
2x + 3y 20,
x 4,
y 4.
a. 32
b. 50
c. 52
100

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 764 of 852

d. 100
e. None of the above

tifr2014 calculus maxima-minima

17.42 Maxima Minima: TIFR2013-A-16 top gateoverflow.in/25496

The minimum of the function f(x) = x loge (x) over the interval [1/2, ) is
a. 0
b. e
c. loge (2)/2
d. 1/e
e. None of the above

tifr2013 calculus maxima-minima

17.43 Maxima Minima: TIFR2012-A-13 top gateoverflow.in/25036

The maximum value of the function.

f (x, y, z) = (x 1/3) 2 + (y 1/3)2 + (z 1/3) 2


Subject to the constraints

x + y + z = 1, x 0, y 0, z 0
is

a. 1/3
b. 2/3
c. 1
d. 4/3
e. 4/9

tifr2012 calculus maxima-minima

17.44 Maxima Minima: TIFR2012-A-15 top gateoverflow.in/25040

Consider the differential equation dx/dt = (1 x) (2 x) (3 x). Which of its equilibria is unstable?
a. x = 0
b. x = 1
c. x = 2
d. x = 3
e. None of the above.

tifr2012 calculus maxima-minima

17.45 Maxima Minima: TIFR2015-A-10 top gateoverflow.in/29579

Let f(x), x [0, 1] , be any positive real valued continuous function. Then

1
limn (n + 1) 0 xn f(x)dx

equals.

a. ma xx[0,1] f(x)
b. minx[0,1] f(x)
c. f(0)

f(1)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 765 of 852

d. f(1)
e.

tifr2015 maxima-minima

17.46 Maxima Minima: TIFR2010-Maths-A-6 top gateoverflow.in/19352

The maximum value of f(x) = xn (1 x)n for a natural numbers n 1 and 0 x 1 is


a. 1n
2
b. 1n
3
c. 1n
5
1
d.
4n

tifrmaths2010 calculus maxima-minima

17.47 Maxima Minima: GATE1997_4.1 top gateoverflow.in/2242

What is the maximum value of the function f(x) = 2x2 2x + 6 in the interval [0, 2]?
A. 6
B. 10
C. 12
D. 5.5

gate1997 calculus maxima-minima normal

17.48 Maxima Minima: TIFR2010-A-3 top gateoverflow.in/18209

The function f(x) = 2.5 loge (2 + exp(x2 4x + 5)) attains a minimum at x =?

a. 0
b. 1
c. 2
d. 3
e. 4

tifr2010 calculus maxima-minima

17.49 Maxima Minima: TIFR2015-A-11 top gateoverflow.in/29581

Suppose that f(x) is a continuous function such that 0.4 f(x) 0.6 for 0 x 1. Which of the following is always true?
A. f(0.5) = 0.5 .
B. There exists x between 0 and 1 such that f(x) = 0.8x.
C. There exists x between 0 and 0.5 such that f(x) = x.
D. f(0.5) > 0.5 .
E. None of the above statements are always true.

tifr2015 maxima-minima

17.50 Maxima Minima: GATE2008-IT_31 top gateoverflow.in/3341

If f(x) is defined as follows, what is the minimum value of f(x) for x (0, 2] ?

f(x) = {
Copyright GATE Overflow. All rights reserved.
GATE Overflow April 2016 766 of 852

f(x) = {
25
8x
when x 32
x + x1 otherwise

A) 2
B) 2(1/12)
C) 2(1/6)
D) 2(1/2)

gate2008-it calculus maxima-minima normal

17.51 Gate mathematics top gateoverflow.in/41570

The function y=|2 - 3x|

a) is continuous x R and differentiable x R

b) is continuous x R and differentiable x R except at x= 3/2

c) is continuous x R and differentiable x R except at x= 2/3

d) is continuous x R except x=3 and differentiable x R

calculus gate engineering-mathematics

17.52 TIFR 2015 Part A-11 top gateoverflow.in/28905

Suppose f(x) is a continuous function such that 0.4 f(x) 0.6for0 x 1.. Which of the following is always true?

a) f(0.5)=0.5

b) There exists x between 0 and 1 such that f(x)=0.8x

c) There exists x between 0 and 0.5 such that f(x)=x

d) f(0.5)>0.5

e) None of the above statements are always true

answer given is b)

How do we evaluate such ques?

tifr 2015

17.53 TIFR 2015 Part A-11 top gateoverflow.in/28904

Suppose f(x) is a continuous function such that 0.4 f(x) 0.6for0 x 1.. Which of the following is always true?

a) f(0.5)=0.5

b) There exists x between 0 and 1 such that f(x)=0.8x

c) There exists x between 0 and 0.5 such that f(x)=x

d) f(0.5)>0.5

e) None of the above statements are always true

answer given is b)

How do we evaluate such ques?

tifr 2015

17.54 GATE 2016-2-02 top gateoverflow.in/39571

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 767 of 852

Let f(x) be a polynomial and g(x) = f (x) be its derivative. If the degree of (f(x) + f(x)) is 10, then the degree of
(g(x) g(x)) is __________.
gate2016-2 calculus normal numerical-answers

17.55 GATE1993_01.5 top gateoverflow.in/262

Fourier series of the periodic function (period 2) defined by

f(x) = {
0, p < x < 0
is
x, 0 < x < p
1 1
+ [
p
(cos n 1) cos nx cos n sin nx]
4 n 2 n
But putting x = , we get the sum of the series
1 1 1
1+ + + + is
32 52 72

2
A.
4
2
B.
6
2
C. 8
2
D. 12

gate1993 calculus normal

17.56 TIFR2010-Maths-A-14 top gateoverflow.in/19364

The solution of the ordinary differential equation.

dy
= y, y(0) = 0
dx
a. Is unbounded
b. Is positive
c. Is negative.
d. Is zero.

tifrmaths2010 calculus

17.57 GATE1995_25 top gateoverflow.in/2664

a. Find the minimum value of 3 4x + 2x2 .


b. Determine the number of positive integers ( 720) which are not divisible by any of 2, 3 or 5.

gate1995 calculus normal

17.58 GATE2014-1_46 top gateoverflow.in/1924

The function f(x) = x sin x satisfies the following equation:

f (x) + f(x) + t cos x = 0

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 768 of 852

f (x) + f(x) + t cos x = 0

. The value of t is______.

gate2014-1 calculus easy numerical-answers

17.59 GATE1995_1.21 top gateoverflow.in/2608

In the interval [0, ] the equation x = cos x has


A. No solution

B. Exactly one solution

C. Exactly two solutions

D. An infinite number of solutions

gate1995 calculus normal

17.60 GATE1993_02.8 top gateoverflow.in/612

Q2). In questions 2.1 to 2.10 . Fill in the blank(_) suitably

2.8). Given v = x cos2 y^


i + x2 ez j^ + z sin2 yk
^ and S the suface of a unit cube with one corner at the origin and edges parallel
to the coordinate axes, the value of integral

1 s V . n
^ dS

is __________.

gate1993 calculus normal

17.61 TIFR2010-Maths-B-7 top gateoverflow.in/19500

Number of solutions of the ordinary differential equation.


d2 y
dx2
y = 0, y(0) = 0, y() = 1

a. is 0
b. is 1
c. is 2
d. None of the above.

tifrmaths2010 calculus

17.62 TIFR2012-A-12 top gateoverflow.in/25035

For the polynomial p(x) = 8x10 7x3 + x 1 consider the following statements (which may be true or false)
(i) It has a root between [0, 1].

(ii) It has a root between [0, -1].

(iii) It has no roots outside (-1, 1).

Which of the above statements are true?

a. Only (i).
b. Only (i) and (ii).
c. Only (i) and (iii).

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 769 of 852

d. Only (ii) and (iii).


e. All of (i), (ii) and (iii).

tifr2012 calculus

17.63 GATE1993_02.3 top gateoverflow.in/607

If the linear velocity V is given by

V = x2 y ^i + xyz j^ yz 2 k
^

The angular velocity at the point (1, 1, 1) is ________

gate1993 calculus normal

17.64 TIFR2010-Maths-B-8 top gateoverflow.in/26486

The function f(x) defined by

f(x) = {
0 if x is rational
x if x is irrational
A. is not continuous at any point.
B. is continuous at every point.
C. is continuous at every rational number.
D. is continuous at x = 0.

tifrmaths2010 calculus

17.65 TIFR2012-A-14 top gateoverflow.in/25037


The limit limn (n2 + n n) equals.
a.
b. 1
c. 1/2
d. 0
e. None of the above.

tifr2012 calculus

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 770 of 852

18 Programming top
18.1 Activation Records: GATE2012_36 top gateoverflow.in/1758

Consider the program given below, in a block-structured pseudo-language with lexical scoping and nesting of procedures
permitted.
Program main;
Var ...

Procedure A1;
Var ...
Call A2;
End A1
Procedure A2;
Var ...
Procedure A21;
Var ...
Call A1;
End A21

Call A21;
End A2
Call A1;
End main.

Consider the calling chain: Main -> A1 -> A2 -> A21 -> A1

The correct set of activation records along with their access links is given by

gate2012 programming activation-records normal

18.2 Arrays: GATE2014-3_42 top gateoverflow.in/2076

Consider the C function given below. Assume that the array listA contains n(> 0) elements, sorted in ascending order.

int ProcessArray(int *listA, int x, int n)


{
int i, j, k;
i = 0; j = n-1;
do {
k = (i+j)/2;
if (x <= listA[k]) j = k-1;
if (listA[k] <= x) i = k+1;
}
while (i <= j);
if (listA[k] == x) return(k);
else return -1;
}

Which one of the following statements about the function ProcessArray is CORRECT?

A. It will run into an infinite loop when x is not in listA.


B. It is an implementation of binary search.
C. It will always find the maximum element in listA.
D. It will return 1 even when x is present in listA.

gate2014-3 data-structure arrays easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 771 of 852

18.3 Arrays: GATE 2016-2-37 top gateoverflow.in/39602

Consider the following program:


int f (int * p, int n)
{
if (n <= 1) return 0;
else return max (f (p+1, n-1), p[0] - p[1]);
}
int main ()
{
int a[] = {3, 5, 2, 6, 4};
print f(" %d", f(a, 5));
}

Note: max (x, y) returns the maximum of x and y.

The value printed by this program is ________.

gate2016-2 programming-in-c arrays normal numerical-answers

18.4 Concurrency: TIFR2012-B-9 top gateoverflow.in/25109

Consider the concurrent program


x := 1;
cobegin
x := x + x + 1 || x := x + 2
coend;

Reading and writing of a variable is atomic, but evaluation of an expression is not atomic. The set of possible values of
variable x at the end of execution of the program is

a. {3}
b. {7}
c. {3, 5, 7}
d. {3, 7}
e. {3, 5}

tifr2012 programming concurrency

18.5 Loop Invariants: TIFR2010-B-37 top gateoverflow.in/19251

Consider the program where a, b are integers with b > 0.


x:=a; y:=b; z:=0;
while y > 0 do
if odd (x) then
z:= z + x;
y: y - 1;
else y:= y % 2;
x:= 2 * x;
fi

Invariant of the loop is a condition which is true before and after every iteration of the loop. In the above program the loop
invariant is given by

0 y and z + x y = a b
Which of the following is true of the program?

a. The program will not terminate for some values of a, b.


b. The program will terminate with z = 2b
c. The program will terminate with z = a * b.
d. The program will not terminate for some values of a, b but when it does terminate, the condition z = a * b will hold.
e. The program will terminate with z = ab

tifr2010 programming loop-invariants

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 772 of 852

18.6 Loop Invariants: GATE1991-1,vi top gateoverflow.in/504

Consider the following PASCAL program segment:


if i mod 2 = 0 then
while i >= 0 do
begin
i := i div 2;
if i mod 2 < > 0 then i := i - 1;
else i := i 2;
end;

An appropriate loop-invariant for the while-loop is ________

gate1991 programming loop-invariants normal

18.7 Loop Invariants: GATE2004_32 top gateoverflow.in/1029

Consider the following program fragment for reversing the digits in a given integer to obtain a new integer.

Let n = d1 d2 dm .

int n, rev;
rev = 0;
while(n > 0) {
rev = rev * 10 + n%10;
n = n/10;
}

The loop invariant condition at the end of the ith iteration is:

A. n = d1 d2 dmi and rev = dm dm1 dmi+1


B. n = dmi+1 dm1 dm or rev = dmi d2 d1
C. n rev
D. n = d1 d2 dm or rev = dm d2 d1

gate2004 programming loop-invariants normal

18.8 Parameter Passing: GATE1993_26 top gateoverflow.in/2322

A stack is used to pass parameters to procedures in a procedure call.

a. If a procedure P has two parameters as described in procedure definition:


procedure P (var x :integer; y: integer);

and if P is called by ; P (a, b)

State precisely in a sentence what is pushed on stack for parameters a and b


b. In the generated code for the body of procedure P , how will the addressing of formal parameters x and y differ?

gate1993 programming parameter-passing normal

18.9 Parameter Passing: GATE2004_2 top gateoverflow.in/999

Consider the following function


void swap(int a, int b) { int temp; temp = a; a = b; b = temp; }

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 773 of 852

In order to exchange the values of two variables x and y.

A. call swap(x, y)

B. call swap(&x, &y)

C. swap (x, y) cannot be used as it does not return any value

D. swap (x, y) cannot be used as the parameters are passed by value

gate2004 programming programming-in-c parameter-passing easy

18.10 Parameter Passing: TIFR2011-B-32 top gateoverflow.in/20619

Various parameter passing mechanisms have been in used in different programming languages. Which of the following
statements is true?

a. Call by value result is used in language Ada.


b. Call by value result is the same as call by name.
c. Call by value is the most robust.
d. Call by reference is the same as call by name.
e. Call by name is the most efficient.

tifr2011 programming parameter-passing

18.11 Pointers: GATE2001_2.18 top gateoverflow.in/736

Consider the following three C functions:

[P1]

int *g(void)
{
int x = 10;
return (&x);
}

[P2]
int *g(void)
{
int *px;
*px = 10;
return px;
}

[P3]
int *g(void)
{
int *px;
px = (int*) malloc (sizeof(int));
*px = 10;
return px;
}

Which of the above three functions are likely to cause problems with pointers?

A. Only P3
B. Only P1 and P3
C. Only P1 and P2
D. P1, P2 and P3

gate2001 programming-in-c pointers programming normal

18.12 Post Condition: GATE2015-1_33 top gateoverflow.in/8276

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 774 of 852

Consider the following pseudo code, where x and y are positive integers.
begin
q := 0
r := x
while r y do
begin
r := r - y
q := q + 1
end
end

The post condition that needs to be satisfied after the program terminates is

A. { r = qx + y r < y}
B. { x = qy + r r < y}
C. { y = qx + r 0 < r < y}
D. { q + 1 < r - y y > 0}

gate2015-1 programming post-condition normal

18.13 Programming In C: GATE2008-IT_49 top gateoverflow.in/3359

What is the output printed by the following C code?


# include <stdio.h>
int main ()
{
char a [6] = "world";
int i, j;
for (i = 0, j = 5; i < j; a [i++] = a [j--]);
printf ("%s\n", a);
}

A) dlrow
B) Null string
C) dlrld
D) worow

gate2008-it programming programming-in-c normal

18.14 Programming In C: GATE2010_11 top gateoverflow.in/2184

What does the following program print?

#include<stdio.h>
void f(int *p, int *q) {
p=q;
*p=2;
}
int i=0, j=1;
int main() {
f(&i, &j);
printf("%d %d\n", i,j);
return 0;
}

(A) 2 2

(B) 2 1

(C) 0 1

(D) 0 2

gate2010 programming programming-in-c easy

18.15 Programming In C: GATE2006-IT_49 top gateoverflow.in/3592

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 775 of 852

Which one of the choices given below would be printed when the following program is executed ?

#include <stdio.h>
struct test {
int i;
char *c;
}st[] = {5, "become", 4, "better", 6, "jungle", 8, "ancestor", 7, "brother"};
main ()
{
struct test *p = st;
p += 1;
++p -> c;
printf("%s,", p++ -> c);
printf("%c,", *++p -> c);
printf("%d,", p[0].i);
printf("%s \n", p -> c);
}

A) jungle, n, 8, nclastor
B) etter, u, 6, ungle
C) cetter, k, 6, jungle
D) etter, u, 8, ncestor

gate2006-it programming programming-in-c normal

18.16 Programming In C: GATE2007-IT_31 top gateoverflow.in/3464

Consider the C program given below :


#include <stdio.h>
int main () {
int sum = 0, maxsum = 0, i, n = 6;
int a [] = {2, -2, -1, 3, 4, 2};
for (i = 0; i < n; i++) {
if (i == 0 || a [i] < 0 || a [i] < a [i - 1]) {
if (sum > maxsum) maxsum = sum;
sum = (a [i] > 0) ? a [i] : 0;
}
else sum += a [i];
}
if (sum > maxsum) maxsum = sum ;
printf ("%d\n", maxsum);
}

What is the value printed out when this program is executed?

A) 9
B) 8
C) 7
D) 6

gate2007-it programming programming-in-c normal

18.17 Programming In C: GATE2012-48 top gateoverflow.in/2176

Consider the following C code segment.

int a, b, c = 0;
void prtFun(void);
main()
{
static int a = 1; /* Line 1 */
prtFun();
a += 1;
prtFun();
printf( \n %d %d , a, b);
}
void prtFun(void)
{
static int a = 2; /* Line 2 */
int b = 1;
a += ++b;
printf( \n %d %d , a, b);
}

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 776 of 852

What output will be generated by the given code segment?


(A)
3 1
4 1
4 2

(B)
4 2
6 1
6 1

(C)
4 2
6 2
2 0

(D)
3 1
5 2
5 2

gate2012 programming programming-in-c normal

18.18 Programming In C: GATE2008-IT_51 top gateoverflow.in/3361

Consider the C program given below. What does it print?



#include <stdio.h>
int main ()
{
int i, j;
int a [8] = {1, 2, 3, 4, 5, 6, 7, 8};
for(i = 0; i < 3; i++) {
a[i] = a[i] + 1;
i++;
}
i--;
for (j = 7; j > 4; j--) {
int i = j/2;
a[i] = a[i] - 1;
}
printf ("%d, %d", i, a[i]);
}

A) 2, 3
B) 2, 4
C) 3, 2
D) 3, 3

gate2008-it programming programming-in-c normal

18.19 Programming In C: GATE2008-IT_52 top gateoverflow.in/3362

C program is given below:


# include <stdio.h>
int main ()
{
int i, j;
char a [2] [3] = {{'a', 'b', 'c'}, {'d', 'e', 'f'}};
char b [3] [2];
char *p = *b;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 777 of 852

for (i = 0; i < 2; i++) {


for (j = 0; j < 3; j++) {
*(p + 2*j + i) = a [i] [j];
}
}
}

What should be the contents of the array b at the end of the program?

a b
A) c d
e f
a d
B) b e
c f
a c
C) e b
d f
a e
D) d c
b f

gate2008-it programming programming-in-c normal

18.20 Programming In C: GATE2008-IT_50 top gateoverflow.in/3360

Consider the C program below. What does it print?

# include <stdio.h>
# define swapl (a, b) tmp = a; a = b; b = tmp
void swap2 ( int a, int b)
{
int tmp;
tmp = a; a = b; b = tmp;
}
void swap3 (int*a, int*b)
{
int tmp;
tmp = *a; *a = *b; *b = tmp;
}
int main ()
{
int num1 = 5, num2 = 4, tmp;
if (num1 < num2) {swap1 (num1, num2);}
if (num1 < num2) {swap2 (num1 + 1, num2);}
if (num1 > = num2) {swap3 (&num1, &num2);}
printf ("%d, %d", num1, num2);
}

A) 5, 5
B) 5, 4
C) 4, 5
D) 4, 4

gate2008-it programming programming-in-c normal

18.21 Programming In C: GATE2015-1_11 top gateoverflow.in/8185

The output of the following C program is_____________.


void f1 ( int a, int b) {
int c;
c = a; a = b;
b = c;
}
void f2 ( int * a, int * b) {
int c;
c = * a; *a = *b; *b = c;
}
int main () {
int a = 4, b = 5, c = 6;
f1 ( a, b);
f2 (&b, &c);
printf ("%d, c - a - b);
}

gate2015-1 programming programming-in-c easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 778 of 852

18.22 Programming In C: Gate1989 Programming top gateoverflow.in/37264

In which of the following case(s) is it possible to obtain different results for call-by-reference and call-by-name parameter
passing?

a) Passing an expression as a parameter

b) Passing an array as a parameter

c) Passing a pointer as a parameter

d) Passing as array element as a parameter

programming-in-c gate1989

18.23 Programming In C: GATE2015-3_54 top gateoverflow.in/8563

Consider the following C program


#include<stdio.h>
int f1(void);
int f2(void);
int f3(void);
int x=10;
int main()
{
int x=1;
x += f1() + f2 () + f3() + f2();
printf("%d", x);
return 0;
}
int f1() { int x = 25; x++; return x;}
int f2() { static int x = 50; x++; return x;}
int f3() { x *= 10; return x;}

The output of the program is ______.

gate2015-3 programming programming-in-c normal

18.24 Programming In C: GATE2015-3_48 top gateoverflow.in/8557

Consider the following C program:


#include<stdio.h>
int main()
{
int i, j, k = 0;
j=2 * 3 / 4 + 2.0 / 5 + 8 / 5;
k-=--j;
for (i=0; i<5; i++)
{
switch(i+k)
{
case 1:
case 2: printf("\n%d", i+k);
case 3: printf("\n%d", i+k);
default: printf("\n%d", i+k);
}
}
return 0;
}

The number of times printf statement is executed is _______.

gate2015-3 programming programming-in-c normal numerical-answers

18.25 Programming In C: gate1990 Programming top gateoverflow.in/37267

Math the pairs in the following

List - 1

A. Pointer data type

B. Activation method

C. Repeat until

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 779 of 852

D. Coercion

List-2

P. Type Conversion

Q. Dynamic Data Structure

R. Recursion

S. Nondeterministic loop

programming-in-c gate1989

18.26 Programming In C: GATE 2016-2-12 top gateoverflow.in/39565

The value printed by the following program is _______.


void f (int * p, int m) {
m = m + 5;
*p = *p + m;
return;
}
void main () {
int i=5, j=10;
f (&i, j);
print f ("%d", i+j);
}

gate2016-2 programming-in-c normal numerical-answers

18.27 Programming In C: GATE2012-49 top gateoverflow.in/43314

Consider the following C code segment.


int a, b, c = 0;
void prtFun(void);
main()
{
static int a = 1; /* Line 1 */
prtFun();
a += 1;
prtFun();
printf( \n %d %d , a, b);
}

void prtFun(void)
{
static int a = 2; /* Line 2 */
int b = 1;
a += ++b;
printf( \n %d %d , a, b);
}

What output will be generated by the given code segment if:

Line 1 is replaced by auto int a = 1;

Line 2 is replaced by register int a = 2;

(A)

3 1

4 1

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 780 of 852

4 2

(B)

4 2

6 1

6 1

(C)

4 2

6 2

2 0

(D)

4 2

4 2

2 0

normal gate2012 programming-in-c programming

18.28 Programming In C: GATE 2016-1-15 top gateoverflow.in/39642

Consider the following C program.


# include <stdio.h>
void mystery (int *ptra, int *ptrb) {
int *temp;
temp = ptrb;
ptrb =ptra;
ptra = temp;
}
int main () {
int a = 2016, b=0, c= 4, d = 42;
mystery (&a, &b);
if (a < c)
mystery (&c, &a);
mystery (&a, &d);
print f("%d\n", a);
}

The output of the program is _________.

gate2016-1 programming-in-c easy numerical-answers

18.29 Programming In C: GATE 2016-1-12 top gateoverflow.in/39638

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 781 of 852

Consider the following "C" program.

void f(int, short);


void main()
{
int i = 100;
short s = 12;
short *p = &s;
____________; // call to f()
}

Which one of the following expressions , when placed in the blank above, will NOT result in a type checking error?

A. f(s, *s)
B. i = f(i,s)
C. f(i, *s)
D. f(i, *p)

gate2016-1 programming-in-c easy

18.30 Programming In C: GATE2015-3_26 top gateoverflow.in/8478

Consider the following C program


#include<stdio.h>
int main() {
static int a[] = {10, 20, 30, 40, 50};
static int *p[] = {a, a+3, a+4, a+1, a+2};
int **ptr = p;
ptr++;
printf("%d%d", ptr-p, **ptr);
}

The output of the program is _______.

gate2015-3 programming programming-in-c normal numerical-answers

18.31 Programming In C: GATE2015-3_7 top gateoverflow.in/8401

Consider the following C program segment.


# include <stdio.h>
int main()
{
char s1[7] = "1234", *p;
p = s1 + 2;
*p = '0';
printf("%s", s1);
}

What will be printed by the program?

A. 12
B. 120400
C. 1204
D. 1034

gate2015-3 programming programming-in-c normal

18.32 Programming In C: GATE2004-IT_60 top gateoverflow.in/3703

Choose the correct option to fill the ?1 and ?2 so that the program prints an input string in reverse order. Assume that the
input string is terminated by a new line character.

#include <stdio.h>
void wrt_it (void);
int main (void)
{
printf("Enter Text");
printf ("\n");
wrt_ it();

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 782 of 852

printf ("\n");
return 0;
}
void wrt_it (void)
{
int c;
if (?1)
wrt_it();
?2
}

?1 is getchar() ! = '\n'
A)
?2 is getchar(c);
?1 is (c = getchar()); ! = '\n'
B)
?2 is getchar(c);
?1 is c! = '\n'
C)
?2 is putchar(c);
?1 is (c = getchar()) ! = '\n'
D)
?2 is putchar(c);

gate2004-it programming programming-in-c normal

18.33 Programming In C: GATE2004-IT_59 top gateoverflow.in/3702

What is the output of the following program?



#include<stdio.h>
int funcf (int x);
int funcg (int y);
main ()
{
int x = 5, y = 10, count;
for (count = 1; count <= 2; ++count) {
y += funcf(x) + funcg(x);
printf ("%d", y);
}
}
funcf (int x) {
int y;
y = funcg(x);
return (y);
}
funcg (int x) {
static int y = 10;
y += 1;
return (y + x);
}

A) 43 80
B) 42 74
C) 33 37
D) 32 32

gate2004-it programming programming-in-c normal

18.34 Programming In C: GATE2006-IT_51 top gateoverflow.in/3594

Which one of the choices given below would be printed when the following program is executed?
#include <stdio.h>
int a1[] = {6, 7, 8, 18, 34, 67};
int a2[] = {23, 56, 28, 29};
int a3[] = {-12, 27, -31};
int *x[] = {a1, a2, a3};
void print(int *a[])
{
printf("%d,", a[0][2]);
printf("%d,", *a[2]);
printf("%d,", *++a[0]);
printf("%d,", *(++a)[0]);
printf("%d\n", a[-1][+1]);
}
main()
{
print(x);
}

A) 8, -12, 7, 23, 8
B) 8, 8, 7, 23, 7

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 783 of 852

C) -12, -12, 27, -31, 23


D) -12, -12, 27, -31, 56

gate2006-it programming programming-in-c normal

18.35 Programming In C: GATE2004-IT_61 top gateoverflow.in/3704

Consider the following C program:


#include <stdio.h>
typedef struct {
char *a;
char *b;
} t;
void f1 (t s);
void f2 (t *p);
main()
{
static t s = {"A", "B"};
printf ("%s %s\n", s.a, s.b);
f1(s);
printf ("%s %s\n", s.a, s.b);
f2(&s);
}
void f1 (t s)
{
s.a = "U";
s.b = "V";
printf ("%s %s\n", s.a, s.b);
return;
}
void f2(t *p)
{
p -> a = "V";
p -> b = "W";
printf("%s %s\n", p -> a, p -> b);
return;
}

What is the output generated by the program ?

A B
U V
A)
V W
V W
A B
U V
B)
A B
V W
A B
U V
C)
U V
V W
A B
U V
D)
V W
U V

gate2004-it programming programming-in-c normal

18.36 Programming In C: GATE2015-2_15 top gateoverflow.in/8086

Consider the following function written in the C programming langauge


void foo(char *a) { if (*a && *a != ' ') foo(a+1); putchar(*a); } }

The output of the above function on input "ABCD EFGH" is

A. ABCD EFGH
B. ABCD
C. HGFE DCBA
D. DCBA

gate2015-2 programming programming-in-c normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 784 of 852

18.37 Programming In C: GATE2015-1_35 top gateoverflow.in/8283

What is the output of the following C code? Assume that the address of x is 2000 (in decimal) and an integer requires four
bytes of memory.
int main () {
unsigned int x [4] [3] =
{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}};
printf ("%u, %u, %u, x + 3, * (x + 3), * (x + 2) + 3);
}

A. 2036, 2036, 2036


B. 2012, 4, 2204
C. 2036, 10, 10
D. 2012, 4, 6

gate2015-1 programming programming-in-c normal

18.38 Programming In C: GATE2014-2_42 top gateoverflow.in/2008

Consider the C function given below.

int f(int j)
{
static int i = 50;
int k;
if (i == j)
{
printf("something");
k = f(i);
return 0;
}
else return 0;
}

Which one of the following is TRUE?

(A) The function returns 0 for all values of j.

(B) The function prints the string something for all values of j.

(C) The function returns 0 when j = 50.

(D) The function will exhaust the runtime stack or run into an infinite loop when j = 50.

gate2014-2 programming programming-in-c

18.39 Programming In C: GATE2006-IT_50 top gateoverflow.in/3593

Which one of the choices given below would be printed when the following program is executed?
#include <stdio.h>
void swap (int *x, int *y)
{
static int *temp;
temp = x;
x = y;
y = temp;
}
void printab ()
{
static int i, a = -3, b = -6;
i = 0;
while (i <= 4)
{
if ((i++)%2 == 1) continue;
a = a + i;
b = b + i;
}
swap (&a, &b);
printf("a = %d, b = %d\n", a, b);
}
main()
{
printab();
printab();
}

a = 0, b = 3
A)
a = 0, b = 3

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 785 of 852

B) a = 3, b = 0
a = 12, b = 9
a = 3, b = 6
C)
a = 3, b = 6
a = 6, b = 3
D)
a = 15, b = 12

gate2006-it programming programming-in-c normal

18.40 Programming In C: GATE2011_22 top gateoverflow.in/2124

What does the following fragment of C program print?

char c[] = "GATE2011";


char *p = c;
printf("%s", p + p[3] - p[1]);

(A) GATE2011

(B) E2011

(C) 2011

(D) 011

gate2011 programming programming-in-c normal

18.41 Programming In C: GATE2005_1 top gateoverflow.in/1343

What does the following C-statement declare?


int (*f) (int * );

A. A function that takes an integer pointer as argument and returns an integer

B. A function that takes an integer as argument and returns an integer pointer

C. A pointer to a function that takes an integer pointer as argument and returns an integer

D. A function that takes an integer pointer as argument and returns a function pointer

gate2005 programming programming-in-c easy

18.42 Programming In C: GATE2002_1.17 top gateoverflow.in/822

In the C language

A. At most one activation record exists between the current activation record and the activation record for the main
B. The number of activation records between the current activation record and the activation records fro the main depends
on the actual function calling sequence.
C. The visibility of global variables depends on the actual function calling sequence
D. Recursion requires the activation record for the recursive function to be saved in a different stack before the recursive
function can be called.

gate2002 programming programming-in-c easy

18.43 Programming In C: GATE2005_32 top gateoverflow.in/1368

Consider the following C program:


double foo (double); /* Line 1 */
int main() {
double da, db;
//input da
db = foo(da);

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 786 of 852

}
double foo (double a) {
return a;
}

The above code compiled without any error or warning. If Line 1 is deleted, the above code will show:

A. no compile warning or error

B. some compiler-warnings not leading to unintended results

C. some compiler-warnings due to type-mismatch eventually leading to unintended results

D. compiler errors

gate2005 programming programming-in-c compiler-design easy

18.44 Programming In C: GATE2003_89 top gateoverflow.in/972

Consider the C program shown below:

#include<stdio.h>
#define print(x) printf("%d", x)
int x;
void Q(int z)
{
z+=x;
print(z);
}
void P(int *y)
{
int x = *y + 2;
Q(x);
*y = x - 1;
print(x);
}
main(void) {
x = 5;
P(&x);
print(x);
}

The output of this program is

(A) 12 7 6

(B) 22 12 11

(C) 14 6 6

(D) 7 6 6

gate2003 programming programming-in-c normal

18.45 Programming In C: GATE2002_2.8 top gateoverflow.in/838

Consider the following declaration of a two-dimensional array in C:

char a[100][100];

Assuming that the main memory is byte-addressable and that the array is stored starting from memory address 0, the
address of a [40][50] is

A. 4040
B. 4050
C. 5040
D. 5050

gate2002 programming-in-c programming easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 787 of 852

18.46 Programming In C: GATE2002_2.18 top gateoverflow.in/848

The C language is:

A. A context free language


B. A context sensitive language
C. A regular language
D. Parsable fully only by a Turing machine

gate2002 programming programming-in-c normal

18.47 Programming In C: GATE2014-2_11 top gateoverflow.in/1965

Suppose n and p are unsigned int variables in a C program. We wish to set p to n C3 . If n is large, which one of the following statements is most likely to set p
correctly?

(A) p = n * (n-1) * (n-2) / 6;

(B) p = n * (n-1) / 2 * (n-2) / 3;

(C) p = n * (n-1) / 3 * (n-2) / 2;

(D) p = n * (n-1) * (n-2) / 6.0;

gate2014-2 programming programming-in-c normal

18.48 Programming In C: GATE2003_2 top gateoverflow.in/893

Assume the following C variable declaration


int *A[10], B[10][10];

Of the following expressions

I. A[2]
II. A[2][3]
III. B[1]
IV. B[2][3]

which will not give compile-time errors if used as left hand sides of assignment statements in a C program?

A. I, II, and IV only


B. II, III, and IV only
C. II and IV only
D. IV only

gate2003 programming programming-in-c easy

18.49 Programming In C: GATE2004_33 top gateoverflow.in/1030

Consider the following C program segment:


char p[20];
char* s = "string";
int length = strlen(s);
for(i = 0; i < length; i++)
p[i] = s[length-i];
printf("%s", p);

The output of the program is

A. gnirts
B. string
C. gnirt
D. no output is printed

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 788 of 852

gate2004 programming programming-in-c easy

18.50 Programming In C: GATE2000_1.12 top gateoverflow.in/635

The most appropriate matching for the following pairs

X: m = malloc(5); m = NULL; 1: using dangling pointers


Y: free(n); n -> value = 5; 2: using uninitialized pointers
Z: char *p, *p ='a'; 3: lost memory

is:

a. X - 1 Y - 3 Z - 2
b. X - 2 Y - 1 Z - 3
c. X - 3 Y - 2 Z - 1
d. X - 3 Y - 1 Z - 2

gate2000 programming programming-in-c normal

18.51 Programming In C: GATE2000_1.17 top gateoverflow.in/640

Consider the following C declaration


struct (
short x[5];
union {
float y;
long z;
} u;
)t;

Assume that the objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory
requirement for variable t, ignoring alignment consideration, is

A. 22 bytes
B. 14 bytes
C. 18 bytes
D. 10 bytes

gate2000 programming programming-in-c easy

18.52 Programming In C: GATE2008_18 top gateoverflow.in/416

Which combination of the integer variables x, y and z makes the variable a get the value 4 in the following expression?

a = (x > y)?((x > z)?x : z) : ((y > z)?y : z)


A. x = 3, y = 4, z = 2
B. x = 6, y = 5, z = 3
C. x = 6, y = 3, z = 5
D. x = 5, y = 4, z = 5

gate2008 programming programming-in-c easy

18.53 Programming In C: GATE2014-1_10 top gateoverflow.in/1770

Consider the following program in C language:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 789 of 852

#include <stdio.h>
main()
{
int i;
int*pi = &i;
scanf("%d",pi);
printf("%d\n", i+5);
}

Which one of the following statements is TRUE?

(A) Compilation fails.

(B) Execution results in a run-time error.

(C) On execution, the value printed is 5 more than the address of variable i.

(D) On execution, the value printed is 5 more than the integer value entered.

gate2014-1 programming programming-in-c easy

18.54 Programming In C: GATE2008_60 top gateoverflow.in/483

What is printed by the following C program?


int f(int x, int *py, int **ppz)
{
int y, z;
**ppz += 1; z = *ppz;
*py += 2; y = *py;
x += 3;
return x+y+z;
}
void main()
{
int c, *b, **a;
c = 4; b = &c; a = &b;
printf("%d", f(c, b, a));

A. 18
B. 19
C. 21
D. 22

gate2008 programming programming-in-c normal

18.55 Programming In C: GATE2006_57 top gateoverflow.in/1835

Consider this C code to swap two integers and these five statements: the code
void swap (int *px, int *py) { *px = *px - *py; *py = *px + *py; *px = *py - *px; }

S1: will generate a compilation error

S2: may generate a segmentation fault at runtime depending on the arguments passed

S3: correctly implements the swap procedure for all input pointers referring to integers stored in memory locations
accessible to the process

S4: implements the swap procedure correctly for some but not all valid input pointers

S5: may add or subtract integers and pointers

(A) S1
(B) S2 and S3
(C) S2 and S4
(D) S2 and S5

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 790 of 852

gate2006 programming programming-in-c normal

18.56 Programming In C: GATE2000_1.11 top gateoverflow.in/634

The following C declarations

struct node {
int i:
float j;
};
struct node *s[10];

define s to be

a. An array, each element of which is a pointer to a structure of type node


b. A structure of 2 fields, each field being a pointer to an array of 10 elements
c. A structure of 3 fields: an integer, a float, and an array of 10 elements
d. An array, each element of which is a structure of type node

gate2000 programming programming-in-c easy

18.57 Programming Paradigms: GATE2008-IT_13 top gateoverflow.in/3273

Match the programming paradigms and languages given in the following table.

Paradigms Languages
(I) Imperative (a) Prolog
(II) Object Oriented (b) Lisp
(III) Functional (c) C, Fortran 77, Pascal
(IV) Logic (d) C++, Smalltalk, Java

A. I-c, II-d, III-b, IV-a


B. I-a, II-d, III-c, IV-b
C. I-d, II-c, III-b, IV-a
D. I-c, II-d, III-a, IV-b

gate2008-it programming programming-paradigms easy

18.58 Recursion: GATE 2016-1-35 top gateoverflow.in/39730

What will be the output of the following C program?

void count (int n) {


static int d=1;
printf ("%d",n);
printf ("%d",d);
d++;
if (n>1) count (n-1);
printf ("%d",d);

}
void main(){
count (3);
}

A. 3 1 2 2 1 3 4 4 4
B. 3 1 2 1 1 1 2 2 2
C. 3 1 2 2 1 3 4
D. 3 1 2 1 1 1 2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 791 of 852

gate2016-1 programming-in-c recursion normal

18.59 Recursion: GATE2001_13 top gateoverflow.in/754

Consider the following C program:


void abc(char*s)
{
if(s[0]=='\0')return;
abc(s+1);
abc(s+1);
printf("%c",s[0]);
}

main()
{
abc("123");
}

(a) What will be the output of the program?

(b) If abc(s) is called with a null-terminated string s of length n characters (not counting the null ('\0') character), how many
characters will be printed by abc(s)?

gate2001 programming recursion normal

18.60 Recursion: GATE2004_31 top gateoverflow.in/1028

Consider the following C function:


int f(int n)
{
static int i = 1;
if(n >= 5) return n;
n = n+i;
i++;
return f(n);
}

The value returned by f(1) is

A. 5
B. 6
C. 7
D. 8

gate2004 programming programming-in-c recursion easy

18.61 Runtime Environments: GATE1991_09b top gateoverflow.in/43603

For the following code, indicate the output if

a. static scope rules


b. dynamic scope rules

are used

var a,b : integer;


procedure P;
a := 5;
b := 10;
end {P};
procedure Q;
var a, b : integer;
P;
end {Q};

begin
a := 1;
b := 2;
Q;
Write ('a = ', a, 'b = ', b);
end

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 792 of 852

gate1991 runtime-environments programming parameter-passing normal

18.62 Runtime Environments: GATE1992-10b top gateoverflow.in/43584

Show the activation records and the display structure just after the procedures called at lines marked x and y have started
their execution. Be sure to indicate which of the two procedures named A you are referring to.

Program Test;
Procedure A;
Procedure B;
Procedure A;
begin

end A;
begin
y: A;
end B;
begin
B;
end A;
begin
x: A;
end Test

gate1992 parameter-passing programming runtime-environments normal

18.63 Runtime Environments: GATE1991_09a top gateoverflow.in/536

Consider the following pseudo-code (all data items are of type integer):
procedure P(a, b, c);
a := 2;
c := a + b;
end {P}

begin
x := 1;
y := 5;
z := 100;
P(x, x*y, z);
Write ('x = ', x, 'z = ', z);
end

Determine its output, if the parameters are passed to the Procedure P by

i. value
ii. reference
iii. name

gate1991 programming parameter-passing runtime-environments normal

18.64 Stack: GATE2007-IT_32 top gateoverflow.in/3465

Consider the following C program:



#include <stdio.h>
#define EOF -1
void push (int); /* push the argument on the stack */
int pop (void); /* pop the top of the stack */
void flagError ();
int main ()
{ int c, m, n, r;
while ((c = getchar ()) != EOF)
{ if (isdigit (c) )
push (c);
else if ((c == '+') || (c == '*'))
{ m = pop ();
n = pop ();
r = (c == '+') ? n + m : n*m;
push (r);
}
else if (c != ' ')
flagError ();
}
printf("% c", pop ());

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 793 of 852

What is the output of the program for the following input ?


5 2 * 3 3 2 + * +

A) 15
B) 25
C) 30
D) 150

gate2007-it stack programming-in-c normal

18.65 Variable Binding: GATE2003-74 top gateoverflow.in/43575

The following program fragment is written in a programming language that allows global variables and does not allow nested
declarations of functions.
global int i=100, j=5;
void P(x) {
int i=10;
print(x+10);
i=200;
j=20;
print (x);
}
main() {P(i+j);}

If the programming language uses dynamic scoping and call by name parameter passing mechanism, the values printed by
the above program are

A. 115, 220
B. 25, 220
C. 25, 15
D. 115, 105

gate2003 programming variable-binding parameter-passing runtime-environments normal

18.66 Variable Binding: GATE2003-73 top gateoverflow.in/960

The following program fragment is written in a programming language that allows global variables and does not allow nested
declarations of functions.
global int i=100, j=5;
void P(x) {
int i=10;
print(x+10);
i=200;
j=20;
print (x);
}
main() {P(i+j);}

If the programming language uses static scoping and call by need parameter passing mechanism, the values printed by the
above program are

A. 115, 220
B. 25, 220
C. 25, 15
D. 115, 105

gate2003 programming variable-binding parameter-passing normal runtime-environments

18.67 GATE2008_61 top gateoverflow.in/484

Choose the correct option to fill ?1 and ?2 so that the program below prints an input string in reverse order. Assume that the
input string is terminated by a new line character.
void reverse(void) {
int c;
if(?1) reverse();

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 794 of 852

?2
}
main() {
printf("Enter text"); ptintf("\n");
reverse(); printf("\n");
}

A. ?1 is (getchar() != \n)

?2 is getchar(c);

B. ?1 is ((c = getchar() ) !=\n)

?2 is getchar(c);

C. ?1 is (c != \n)

?2 is putchar(c);

D. ?1 is ((c = getchar() ) != \n)

?2 is putchar(c);

gate2008 programming normal

18.68 GATE1994_1.5 top gateoverflow.in/2442

An unrestricted use of the "goto" statement is harmful because

A. it makes it more difficult to verify programs


B. it increases the running time of the programs
C. it increases the memory required for the programs
D. it results in the compiler generating longer machine code

gate1994 programming easy

18.69 GATE1999_2.5 top gateoverflow.in/1483

Given the programming constructs


(i) assignment
(ii) for loops where the loop parameter cannot be changed within the loop
(iii) if-then-else
(iv) forward go to
(v) arbitrary go to
(vi) non-recursive procedure call
(vii) recursive procedure/function call
(viii) repeat loop,
which constructs will you not include in a programming language such that it should be possible to program the terminates
(i.e., halting) function in the same programming language

A. (ii), (iii), (iv)


B. (v), (vii), (viii)
C. (vi), (vii), (viii)
D. (iii), (vii), (viii)

gate1999 programming normal

18.70 GATE2000_1.16 top gateoverflow.in/639

Aliasing in the context of programming languages refers to

A. multiple variables having the same memory location

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 795 of 852

B. multiple variables having the same value


C. multiple variables having the same identifier
D. multiple uses of the same variable

gate2000 programming easy

18.71 TIFR2011-B-40 top gateoverflow.in/20937

Consider the class of object oriented languages. Which of the following is true?

a. Pascal is an object oriented language.


b. Object oriented languages require heap management.
c. Object oriented languages cannot be implemented in language C.
d. Object oriented languages are more powerful than declarative programming languages.
e. Parallelism cannot be realized in object oriented languages.

tifr2011 programming

18.72 GATE1998_2.13 top gateoverflow.in/1685

What is the result of the following program?

program side-effect (input, output);


var x, result: integer;
function f (var x:integer:integer;
begin
x:x+1;f:=x;
end
begin
x:=5;
result:=f(x)*f(x);
writeln(result);
end

A. 5
B. 25
C. 36
D. 42

gate1998 programming normal

18.73 GATE1998_2.15 top gateoverflow.in/1687

Faster access to non-local variables is achieved using an array of pointers to activation records called a

A. stack
B. heap
C. display
D. activation tree

gate1998 programming normal

18.74 GATE2012_3 top gateoverflow.in/35

What will be the output of the following C program segment?


char inChar = 'A';
switch ( inChar ) {
case 'A' : printf ("Choice A\ n");
case 'B' :
case 'C' : printf ("Choice B");
case 'D' :

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 796 of 852

case 'E' :
default : printf ("No Choice");
}

(A) No Choice
(B) Choice A
(C) Choice A
Choice B No Choice
(D) Program gives no output as it is erroneous

gate2012 programming easy

18.75 GATE2010_14 top gateoverflow.in/2187

Which languages necessarily need heap allocation in the runtime environment?

(A) Those that support recursion.

(B) Those that use dynamic scoping.

(C) Those that allow dynamic data structure.

(D) Those that use global variables.

gate2010 programming easy

18.76 GATE2013_42 top gateoverflow.in/60

What is the return value of f(p,p), if the value of p is initialized to 5 before the call? Note that the first parameter is passed
by reference, whereas the second parameter is passed by value.

int f (int &x, int c) {
c = c - 1;
if (c==0) return 1;
x = x + 1;
return f(x,c) * x;
}

gate2013 programming normal marks-to-all

18.77 TIFR2011-B-24 top gateoverflow.in/20402

Consider the program


x:=0; y:=0; (r1:=x; r2:=x; y:= if r1 = r2 then 1 r3:= y; x:= r3)

Note that denotes the parallel operator. In which of the following cases can the program possibly result in a final state with
r1 = 0; r2 = r3 = 1.
a. Such a transformation is not possible in Java.
b. Such a program transformation is possible in Java.
c. Possible in Pascal when the compiler appropriately translates the operator to interleaved pascal statements.
d. Possible in all sequential programming languages when the compiler appropriately translates the operator to
interleaved statements in the sequential language.
e. None of the above.

tifr2011 programming

18.78 GATE1997_1.10 top gateoverflow.in/2226

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 797 of 852

Heap allocation is required for languages.

A. that support recursion

B. that support dynamic data structure

C. that use dynamic scope rules

D. None of the above

gate1997 programming easy

18.79 GATE2008_54 top gateoverflow.in/477

Which of the following are true?

I. A programming language which does not permit global variables of any kind and has no nesting of
procedures/functions, but permits recursion can be implemented with static storage allocation

II. Multi-level access link (or display) arrangement is needed to arrange activation records only if the programming
language being implemented has nesting of procedures/functions

III. Recursion in programming languages cannot be implemented with dynamic storage allocation

IV. Nesting procedures/functions and recursion require a dynamic heap allocation scheme and cannot be implemented with
a stack-based allocation scheme for activation records

V. Programming languages which permit a function to return a function as its result cannot be implemented with a stack-
based storage allocation scheme for activation records

A. II and V only
B. I, III and IV only
C. I, II and V only
D. II, III and V only

gate2008 programming difficult

18.80 TIFR2010-B-31 top gateoverflow.in/26484

Consider the following computation rules. Parallel-outermost rule: Replace all the outermost occurrences of F (i.e., all
occurrences of F which do not occur as arguments of other F's) simultaneously. Parallel - innermost rule: Replace all the
innermost occurrences of F (i.e.,all occurrences of F with all arguments free of F's) simultaneously. Now consider the
evaluations of the recursive program over the integers.
F(x, y) <== if x = 0 then 0 else
[ F(x + 1, F(x, y)) * F(x - 1, F(x, y))]

where the multiplication functions * is extended as follows:

0 * w & w * 0 are 0
a * w & w * a are w (for any non-zero integer a)
w * w is w

We say that F(x, y) = w when the evaluation of F(x, y) does not terminate. Computing F(1, 0) using the parallel - innermost
and parallel - outermost rule yields

A. w and 0 respectively
B. 0 and 0 respectively
C. w and w respectively
D. w and 1 respectively
E. none of the above

tifr2010

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 798 of 852

18.81 GATE FEB7 EVN top gateoverflow.in/7998

1) A
2) B
3) C
D
4)

18.82 GATE2002_2.19 top gateoverflow.in/849

To evaluate an expression without any embedded function calls

A. One stack is enough


B. Two stacks are needed
C. As many stacks as the height of the expression tree are needed
D. A Turing machine is needed in the general case

gate2002 programming easy

18.83 GATE2015_7feb top gateoverflow.in/7981

#include int fun(int n) { int x=1,k; if(n==1) return 1; for(k=1;k What is the output of the above program

programming

18.84 GATE2003_24 top gateoverflow.in/914

Which of the following statements is FALSE?

A. In statically typed languages, each variable in a program has a fixed type


B. In un-typed languages, values do not have any types
C. In dynamically typed languages, variables have no types
D. In all statically typed languages, each variable in a program is associated with values of only a single type during the
execution of the program

gate2003 programming normal

18.85 GATE2004-IT_15 top gateoverflow.in/3656

Let x be an integer which can take a value of 0 or 1. The statement


if (x = = 0) x = 1;
else x = 0;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 799 of 852

is equivalent to which one of the following ?

A) x = 1 + x;
B) x = 1 - x;
C) x = x - 1;
D) x = 1% x;

gate2004-it programming easy

18.86 GATE2004_1 top gateoverflow.in/998

The goal of structured programming is to

A. have well indented programs


B. be able to infer the flow of control from the compiled code
C. be able to infer the flow of control from the program text
D. avoid the use of GOTO statements

gate2004 programming easy

18.87 GATE2004_34 top gateoverflow.in/1031

It is desired to design an object-oriented employee record system for a company. Each employee has a name, unique id, and
salary. Employees belong to different categories and their salary is determined by their category. The functions get name,
getId and compute salary are required. Given the class hierarchy below, possible locations for these functions are:

I. getId is implemented in the superclass

II. getId is implemented in the subclass

III. getName is an abstract function in the superclass

IV. getName is implemented in superclass

V. getName is implemented in subclass

VI. getSalary is an abstract function in the superclass

VII. getSalary is implemented in the superclass

VIII. getSalary is implemented in the subclass

Choose the best design

A. (I), (IV), (VI), (VIII)


B. (I), (IV), (VII)
C. (I), (III), (V), (VI), (VIII)
D. (II), (V), (VIII)

gate2004 programming normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 800 of 852

18.88 GATE2004_90 top gateoverflow.in/1084

Choose the best matching between the programming styles in Group 1 and their characteristics in Group 2.

Group 1 Group 2
1. Common-based, procedural
P. Functional
2. Imperative, abstract data types
Q. Logic
3. Side-effect free, declarative, expression
R. Object-
evaluations
oriented
4. Declarative, clausal representation,
S. Imperative
theorem proving

A. P-2 Q-3 R-4 S-1


B. P-4 Q-3 R-2 S-1
C. P-3 Q-4 R-1 S-2
D. P-3 Q-4 R-2 S-1

gate2004 programming normal

18.89 GATE2000_2.20 top gateoverflow.in/667

The value of j at the end of the execution of the following C program

int incr (int i)


{
static int count = 0;
count = count + i;
return (count);
}
main () {
int i, j;
for (i = 0; i <= 4; i++)
j = incr (i);
}

is

A. 10
B. 4
C. 6
D. 7

gate2000 programming easy

18.90 GATE2006-IT_53 top gateoverflow.in/3596

Match the following concepts and their best possible descriptions.

Concept Description
allows to define a class to
i. overloading a. have properties of another
class
defining a set of similar
ii. friend b.
functions
iii. constructor c. used in dereferencing
used to give a non-
member function access to
iv. protected d. the private parts of an
object

a function which is
v. this e. automatically called when
an object is created

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 801 of 852

vi. Concept
inheritance allows a derived class to
f. Description
have access to the private
parts of the base class
a pointer to the object
g. associated with the current
function
used to obtain object
h.
persistence

A) i-b, ii-d, iii-e, iv-f, v-g, vi-a


B) i-c, ii-a, iii-e, iv-d, v-h, vi-f
C) i-c, ii-f, iii-h, iv-a, v-g, vi-d
D) i-b, ii-e, iii-c, iv-f, v-g, vi-s

gate2006-it programming easy

18.91 GATE2005_4 top gateoverflow.in/1346

Which one of the following are essential features of an object-oriented programming language?

I. Abstraction and encapsulation

II. Strictly-typedness

III. Type-safe property coupled with sub-type rule

IV. Polymorphism in the presence of inheritance

A. (I) and (II) only


B. (I) and (IV) only
C. (I), (II) and (IV) only
D. (I), (III) and (IV) only

gate2005 programming normal

18.92 GATE2002_1.16 top gateoverflow.in/821

Sign extension is a step in

A. floating point multiplication


B. signed 16 bit integer addition
C. arithmetic left shift
D. converting a signed integer from one size to another

gate2002 digital-logic easy

18.93 GATE2005_3 top gateoverflow.in/1345

A common property of logic programming languages and functional languages is:

A. both are procedural languages

B. both are based on -calculus

C. both are declarative

D. both use Horn-clauses

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 802 of 852

gate2005 programming normal

18.94 GATE1995_3 top gateoverflow.in/2639

Consider the following high level programming segment. Give the contents of the memory locations for variables W, X, Y and
Z after the execution of the program segment. The values of the variables A and B are 5CH and 92H, respectively. Also
indicate error conditions if any.
var
A, B, W, X, Y :unsigned byte;
Z :unsigned integer, (each integer is represented by two bytes)
begin
X :=A+B
Y :=abs(A-B);
W :=A-B
Z :=A*B
end;

gate1995 programming normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 803 of 852

19 DS top
19.1 Arrays: GATE2005_5 top gateoverflow.in/1347

A program P reads in 500 integers in the range [0, 100] representing the scores of 500 students. It then prints the
frequency of each score above 50. What would be the best way for P to store the frequencies?

A. An array of 50 numbers

B. An array of 100 numbers

C. An array of 500 numbers

D. A dynamically allocated array of 550 numbers

gate2005 data-structure arrays easy

19.2 Arrays: GATE1994_1.11 top gateoverflow.in/2452

In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal
are zero) of size n n, non-zero elements, (i.e elements of lower triangle) of each row are stored one after another,
starting from the first row, the index of the (i, j)th element of the lower triangular matrix in this new representation is:

A. i + j
B. i + j 1
i(i1)
C. j + 2
j(j1)
D. i +
2

gate1994 data-structure arrays normal

19.3 Arrays: GATE2000_1.2 top gateoverflow.in/625

An n n array v is defined as follows:

v [i, j] = i j for all i, j, i n, 1 j n


The sum of the elements of the array v is

A. 0
B. n 1
C. n2 3n + 2
(n+1)
D. n2 2

gate2000 data-structure arrays easy

19.4 Arrays: GATE2015-2_31 top gateoverflow.in/8148

A Young tableau is a 2D array of integers increasing from left to right and from top to bottom. Any unfilled entries are
marked with , and hence there cannot be any entry to the right of, or below a . The following Young tableau consists of
unique entries.

1 2 5 14
3 4 6 23

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 804 of 852

10 12 18 25
31
When an element is removed from a Young tableau, other elements should be moved into its place so that the resulting table
is still a Young tableau (unfilled entries may be filled with a ). The minimum number of entries (other than 1) to be
shifted, to remove 1 from the given Young tableau is _____.

gate2015-2 databases arrays normal

19.5 Arrays: GATE1998_2.14 top gateoverflow.in/1686

Let A be a two dimensional array declared as follows:


A: array [1 . 10] [1 .. 15] of integer;

Assuming that each integer takes one memory location, the array is stored in row-major order and the first element of the
array is stored at location 100, what is the address of the element A[i][j] ?

A. 15i + j + 84

B. 15j + i + 84

C. 10i + j + 89

D. 10j + i + 89

gate1998 data-structure arrays easy

19.6 Arrays: GATE2000_15 top gateoverflow.in/686

Suppose you are given arrays p [1......N] and q [1......N] both uninitialized, that is, each location may contain an arbitrary value), and a
variable count, initialized to 0. Consider the following procedures set and is_set:

set(i) {
count = count + 1;
q[count] = i;
p[i] = count;
}
is_set(i) {
if (p[i] 0 or p[i] > count)
return false;
if (q[p[i]] i)
return false;
return true;
}

a. Suppose we make the following sequence of calls:


set(7); set(3); set(9);
After these sequence of calls, what is the value of count, and what do q[1], q[2] ,q[3], p[7], p[3] and p[9] contain?
b. Complete the following statement "The first count elements of __________contain values i such that set (_________________) has
been called".
c. Show that if set(i) has not been called for some i, then regardless of what p[i] contains, is_set(i) will return false.

gate2000 data-structure arrays easy

19.7 Avl Tree: GATE1998_21 top gateoverflow.in/1735

a. Derive a recurrence relation for the size of the smallest AVL tree with height h.
b. What is the size of the smallest AVL tree with height 8?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 805 of 852

gate1998 data-structure trees avl-tree descriptive numerical-answers

19.8 B Tree: GATE2003_65 top gateoverflow.in/952

Consider the following 2-3-4 tree (i.e., B-tree with a minimum degree of two) in which each data item is a letter. The usual
alphabetical ordering of letters is used in constructing the tree.

What is the result of inserting G in the above tree?

A.

B.

C.
D. None of the above

gate2003 algorithms b-tree normal

19.9 Bfs: GATE 2016-2-11 top gateoverflow.in/39563

Breadth First Search (BFS) is started on a binary tree beginning from the root vertex. There is a vertex t at a distance four
from the root. If t is the n th vertex in this BFS traversal, then the maximum possible value of n is _________.

gate2016-2 data-structure bfs binary-tree normal numerical-answers

19.10 Binary Heap: GATE2004_37 top gateoverflow.in/1034

The elements 32, 15, 20, 30, 12, 25, 16, are inserted one by one in the given order into a maxHeap. The resultant maxHeap
is

A.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 806 of 852

B.

C.

D.

gate2004 data-structure heap binary-heap normal

19.11 Binary Heap: GATE2011_23 top gateoverflow.in/2125

A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the following is a max-
heap?

(A)

(B)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 807 of 852

(C)

(D)

gate2011 data-structure heap binary-heap easy

19.12 Binary Heap: GATE2009-60 top gateoverflow.in/43466

Consider a binary max-heap implemented using an array.


What is the content of the array after two delete operations on {25, 14, 16, 13, 10, 8, 12}

A. {14, 13, 12, 10, 8}


B. {14, 12, 13, 8, 10}
C. {14, 13, 8, 12, 10}
D. {14, 13, 12, 8, 10}

gate2009 data-structure heap binary-heap normal

19.13 Binary Heap: GATE 2016-1-37 top gateoverflow.in/39706

An operator delete(i) for a binary heap data structure is to be designed to delete the item in the i-th node. Assume that the
heap is implemented in an array and i refers to the i-th index of the array. If the heap tree has depth d (number of edges on
the path from the root to the farthest leaf ), then what is the time complexity to re-fix the heap efficiently after the removal
of the element?

A. O(1)
B. O(d) but not O(1)
C. O(2d ) but not O(d)
D. O(d 2d ) but not O(2d )

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 808 of 852

gate2016-1 data-structure binary-heap normal

19.14 Binary Heap: GATE2015-2_17 top gateoverflow.in/8091

Consider a complete binary tree where the left and right subtrees of the root are max-heaps. The lower bound for the
number of operations to convert the tree to a heap is

A. (log n)
B. (n)
C. (n log n)
D. (n2 )

gate2015-2 data-structure binary-tree heap binary-heap normal

19.15 Binary Heap: GATE2009-59 top gateoverflow.in/1341

Consider a binary max-heap implemented using an array.


59. Which one of the following array represents a binary max-heap?

A. {25, 12, 16, 13, 10, 8, 14}


B. {25, 14, 13, 16, 10, 8, 12}
C. {25, 14, 16, 13, 10, 8, 12}
D. {25, 14, 12, 13, 10, 8, 16}

gate2009 data-structure heap binary-heap normal

19.16 Binary Heap: GATE2001_1.15 top gateoverflow.in/708

Consider any array representation of an n element binary heap where the elements are stored from index 1 to index n of the
array. For the element stored at index i of the array (i n), the index of the parent is

(A) i 1

(B) 2i

(C) i
2

(i+1)
(D)
2

gate2001 data-structure heap binary-heap easy

19.17 Binary Search: GATE2006-IT_45 top gateoverflow.in/3588

Suppose that we have numbers between 1 and 100 in a binary search tree and want to search for the number 55. Which of
the following sequences CANNOT be the sequence of nodes examined?

A) {10, 75, 64, 43, 60, 57, 55}


B) {90, 12, 68, 34, 62, 45, 55}
C) {9, 85, 47, 68, 43, 57, 55}
D) {79, 14, 72, 56, 16, 53, 55}

gate2006-it data-structure binary-search normal

19.18 Binary Search: GATE2007-IT_29 top gateoverflow.in/3462

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 809 of 852

When searching for the key value 60 in a binary search tree, nodes containing the key values 10, 20, 40, 50, 70 80, 90 are
traversed, not necessarily in the order given. How many different orders are possible in which these key values can occur on
the search path from the root to the node containing the value 60?

A) 35
B) 64
C) 128
D) 5040

gate2007-it data-structure binary-search normal

19.19 Binary Search: GATE 2016-2-40 top gateoverflow.in/39586

The number of ways in which the numbers 1, 2, 3, 4, 5, 6, 7 can be inserted in an empty binary search tree, such that the
resulting tree has height 6, is _________.

Note: The height of a tree with a single node is 0.

gate2016-2 data-structure binary-tree binary-search normal numerical-answers

19.20 Binary Search Tree: TIFR2010-B-26 top gateoverflow.in/18749

Suppose there is a balanced binary search tree with n nodes, where at each node, in addition to the key, we store the
number of elements in the sub tree rooted at that node.

Now, given two elements a and b , such that a < b , we want to find the number of elements x in the tree that lie between a
and b , that is, a x b . This can be done with (choose the best solution).

A. O(log n) comparisons and O(log n) additions.


B. O(log n) comparisons but no further additions.
C. O (n) comparisons but O(log n) additions.
D. O(log n) comparisons but a constant number of additions.
E. O(n) comparisons and O(n) additions, using depth-first- search.

tifr2010 binary-search-tree bst

19.21 Binary Tree: GATE2015-1_10 top gateoverflow.in/8129

Which of the following is/are correct in order traversal sequence(s) of binary search tree(s)?

I. 3, 5, 7, 8, 15, 19, 25
II. 5, 8, 9, 12, 10, 15, 25
III. 2, 7, 10, 8, 14, 16, 20
IV. 4, 6, 7, 9, 18, 20, 25

A. I and IV only
B. II and III only
C. II and IV only
D. II only

gate2015-1 data-structure binary-tree easy

19.22 Binary Tree: GATE2005-IT_55 top gateoverflow.in/3816

A binary search tree contains the numbers 1, 2, 3, 4, 5, 6, 7, 8. When the tree is traversed in pre-order and the values in
each node printed out, the sequence of values obtained is 5, 3, 1, 2, 4, 6, 8, 7. If the tree is traversed in post-order, the
sequence obtained would be

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 810 of 852

A) 8, 7, 6, 5, 4, 3, 2, 1
B) 1, 2, 3, 4, 8, 7, 6, 5
C) 2, 1, 4, 3, 6, 7, 8, 5
D) 2, 1, 4, 3, 7, 8, 6, 5

gate2005-it data-structure binary-tree normal

19.23 Binary Tree: GATE2005-IT_50 top gateoverflow.in/3811

In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2. If the
height of the tree is h > 0, then the minimum number of nodes in the tree is

A) 2h - 1
B) 2h - 1 + 1
C) 2h - 1
D) 2h

gate2005-it data-structure binary-tree normal

19.24 Binary Tree: GATE2015-3_25 top gateoverflow.in/8428

Consider a binary tree T that has 200 leaf nodes. Then the number of nodes in T that have exactly two children are ______.

gate2015-3 data-structure binary-tree normal numerical-answers

19.25 Binary Tree: TIFR2012-B-16 top gateoverflow.in/25214

Consider a complete binary tree of height n, where each edge is one Ohm resistor. Suppose all the leaves of the tree are
tied together. Approximately how much is the effective resistance from the root to this bunch of leaves for very large n?

a. Exponential in n.
b. Cubic in n.
c. Linear in n.
d. Logarithmic in n.
e. Of the order square root of n.

tifr2012 binary-tree

19.26 Binary Tree: GATE1993_16 top gateoverflow.in/2313

Prove by the principal of mathematical induction that for any binary tree, in which every non-leaf node has 2-descendants,
the number of leaves in the tree is one more than the number of non-leaf nodes.

gate1993 data-structure binary-tree normal

19.27 Binary Tree: GATE1997_16 top gateoverflow.in/2276

A size-balanced binary tree is a binary tree in which for every node the difference between the number of nodes in the left
and right subtree is at most 1. The distance of a node from the root is the length of the path from the root to the node. The
height of a binary tree is the maximum distance of a leaf node from the root.

a. Prove, by using induction on h, that a size-balance binary tree of height h contains at least 2h nodes.

b. In a size-balanced binary tree of height h 1, how many nodes are at distance h 1 from the root? Write only the
answer without any explanations.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 811 of 852

gate1997 data-structure binary-tree normal

19.28 Binary Tree: GATE2015-1_25 top gateoverflow.in/8223

The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a
binary tree of height 5 are

A. 63 and 6, respectively
B. 64 and 5, respectively
C. 32 and 6, respectively
D. 31 and 5, respectively

gate2015-1 data-structure binary-tree easy

19.29 Binary Tree: GATE2014-1_12 top gateoverflow.in/1776

Consider a rooted n node binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having exactly
4 nodes is O( na logb n) . Then the value of a + 10b is __________.

gate2014-1 data-structure binary-tree numerical-answers normal

19.30 Binary Tree: GATE2004-IT_54 top gateoverflow.in/3697

Which one of the following binary trees has its inorder and preorder traversals as BCAD and ABCD, respectively?

A)

B)

C)

D)

gate2004-it binary-tree easy

19.31 Binary Tree: GATE2010_10 top gateoverflow.in/2183

In a binary tree with n nodes, every node has an odd number of descendants. Every node is considered to be its own descendant. What is
the number of nodes in the tree that have exactly one child?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 812 of 852

(A) 0

(B) 1
(n1)
(C) 2

(D) n 1

gate2010 data-structure binary-tree normal

19.32 Binary Tree: GATE2005-IT_12 top gateoverflow.in/3757

The numbers 1, 2, .... n are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root
contains p nodes. The first number to be inserted in the tree must be

A. p
B. p + 1
C. n - p
D. n - p + 1

gate2005-it data-structure binary-tree normal

19.33 Binary Tree: GATE1995_6 top gateoverflow.in/2667

What is the number of binary trees with 3 nodes which when traversed in post-order give the sequence A, B, C? Draw all
these binary trees.

gate1995 data-structure binary-tree normal

19.34 Binary Tree: GATE2008-IT_77 top gateoverflow.in/3391

A binary tree with n > 1 nodes has n 1, n 2 and n 3 nodes of degree one, two and three respectively. The degree of a node is
defined as the number of its neighbours.

Starting with the above tree, while there remains a node v of degree two in the tree, add an edge between the two
neighbours of v and then remove v from the tree. How many edges will remain at the end of the process?

A) 2 * n1 - 3
B) n2 + 2 * n 1 - 2
C) n3 - n2
D) n2 + n 1 - 2

gate2008-it data-structure binary-tree normal

19.35 Binary Tree: GATE2008-IT_76 top gateoverflow.in/3390

A binary tree with n > 1 nodes has n 1, n 2 and n 3 nodes of degree one, two and three respectively. The degree of a node is
defined as the number of its neighbours.

n3 can be expressed as

A) n1 + n 2 - 1
B) n1 - 2
C) [((n1 + n 2)/2)]
D) n2 - 1

gate2008-it data-structure binary-tree normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 813 of 852

19.36 Binary Tree: GATE2008-IT_73 top gateoverflow.in/3387

How many distinct BSTs can be constructed with 3 distinct keys?

A) 4
B) 5
C) 6
D) 9

gate2008-it data-structure binary-tree combinatory normal

19.37 Binary Tree: GATE2006-IT_73 top gateoverflow.in/3617

An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array is 0. If
the root node is at level 0, the level of element X[i], i 0, is

A) log2 i
B) log2 (i + 1)
C) log2 (i + 1)
D) log2 i

gate2006-it data-structure binary-tree normal

19.38 Binary Tree: GATE2015-2_10 top gateoverflow.in/8059

A binary tree T has 20 leaves. The number of nodes in T having two children is ______.

gate2015-2 data-structure binary-tree normal

19.39 Binary Tree: GATE2006-IT_71 top gateoverflow.in/3615

An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array is
0. The index of the parent of element X[i], i 0, is?

A.
i
2

i1
B.
2

C.
i
2

D. 1
i
2

gate2006-it data-structure binary-tree normal

19.40 Binary Tree: GATE2006-IT_9 top gateoverflow.in/3548

In a binary tree, the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10. The
number of leaf nodes in the binary tree is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 814 of 852

A) 10
B) 11
C) 12
D) 15

gate2006-it data-structure binary-tree normal

19.41 Binary Tree: GATE2008-IT_72 top gateoverflow.in/3386

A Binary Search Tree (BST) stores values in the range 37 to 573. Consider the following sequence of keys.

I. 81, 537, 102, 439, 285, 376, 305


II. 52, 97, 121, 195, 242, 381, 472
III. 142, 248, 520, 386, 345, 270, 307
IV. 550, 149, 507, 395, 463, 402, 270

Which of the following statements is TRUE?

A) I, II and IV are inorder sequences of three different BSTs


B) I is a preorder sequence of some BST with 439 as the root
C) II is an inorder sequence of some BST where 121 is the root and 52 is a leaf
D) IV is a postorder sequence of some BST with 149 as the root

gate2008-it data-structure binary-tree easy

19.42 Binary Tree: GATE2008-IT_71 top gateoverflow.in/3385

A Binary Search Tree (BST) stores values in the range 37 to 573. Consider the following sequence of keys.

I. 81, 537, 102, 439, 285, 376, 305


II. 52, 97, 121, 195, 242, 381, 472
III. 142, 248, 520, 386, 345, 270, 307
IV. 550, 149, 507, 395, 463, 402, 270

Suppose the BST has been unsuccessfully searched for key 273. Which all of the above sequences list nodes in the order in
which we could have encountered them in the search?

A) II and III only


B) I and III only
C) III and IV only
D) III only

gate2008-it data-structure binary-tree normal

19.43 Binary Tree: GATE1996_1.14 top gateoverflow.in/2718

In the balanced binary tree in the below figure, how many nodes will become unbalanced when a node is inserted as a child
of the node g?

A. 1
B. 3
C. 7
D. 8

gate1996 data-structure binary-tree normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 815 of 852

19.44 Binary Tree: GATE2015-3_13 top gateoverflow.in/8409

While inserting the elements 71, 65, 84, 69, 67, 83 in an empty binary search tree (BST) in the sequence shown, the
element in the lowest level is

A. 65
B. 67
C. 69
D. 83

gate2015-3 data-structure binary-tree easy

19.45 Binary Tree: GATE1995_1.17 top gateoverflow.in/2604

A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is

A. log2 n
B. n 1
C. n
D. 2n

gate1995 data-structure binary-tree normal

19.46 Binary Tree: GATE1996_1.15 top gateoverflow.in/2719

Which of the following sequences denotes the post order traversal sequence of the below tree?

A. f egcdba
B. g cbdaf e
C. g cdbf ea
D. f edgcba

gate1996 data-structure binary-tree easy

19.47 Binary Tree: TIFR2013-B-13 top gateoverflow.in/25775

Given a binary tree of the following form and having n nodes, the height of the tree is

(log n)

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 816 of 852

a. (log n)
b. (n)
c. (n)
d. (n/ log n)
e. None of the above.

tifr2013 binary-tree

19.48 Binary Tree: GATE1996_4 top gateoverflow.in/2756

A binary search tree is used to locate the number 43. Which of the following probe sequences are possible and which are
not? Explain.

(a) 61 52 14 17 40 43
(b) 2 3 50 40 60 43
(c) 10 65 31 48 37 43
(d) 81 61 52 14 41 43
(e) 17 77 27 66 18 43

gate1996 data-structure binary-tree normal

19.49 Binary Tree: GATE1996_2.14 top gateoverflow.in/2743

A binary search tree is generated by inserting in order the following integers:

50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24


The number of nodes in the left subtree and right subtree of the root respectively is

A. (4, 7)
B. (7, 4)
C. (8, 3)
D. (3, 8)

gate1996 data-structure binary-tree normal

19.50 Binary Tree: GATE1994_8 top gateoverflow.in/2504

A rooted tree with 12 nodes has its nodes numbered 1 to 12 in pre-order. When the tree is traversed in post-order, the
nodes are visited in the order 3, 5, 4, 2, 7, 8, 6, 10, 11, 12, 9, 1.

Reconstruct the original tree from this information, that is, find the parent of each node, and show the tree
diagrammatically.

gate1994 data-structure binary-tree normal

19.51 Binary Tree: GATE1998_20 top gateoverflow.in/1734

Draw the binary tree with node labels a, b, c, d, e, f and g for which the inorder and postorder traversals result in the
following sequences:

Inorder: a f b c d g e

Postorder: a f c g e d b

gate1998 data-structure binary-tree descriptive

19.52 Binary Tree: GATE2004_35 top gateoverflow.in/1032

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 817 of 852

Consider the label sequences obtained by the following pairs of traversals on a labeled binary tree. Which of these pairs
identify a tree uniquely?

I. preorder and postorder

II. inorder and postorder

III. preorder and inorder

IV. level order and postorder

A. (I) only
B. (II), (III)
C. (III) only
D. (IV) only

gate2004 data-structure binary-tree normal

19.53 Binary Tree: GATE2004_4 top gateoverflow.in/1001

The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the
height of the binary search tree (the height is the maximum distance of a leaf node from the root)?

A. 2
B. 3
C. 4
D. 6

gate2004 data-structure binary-tree easy

19.54 Binary Tree: GATE2000_1.14 top gateoverflow.in/637

Consider the following nested representation of binary trees: (X Y Z) indicates Y and Z are the left and right subtrees,
respectively, of node X. Note that Y and Z may be NULL, or further nested. Which of the following represents a valid binary
tree?

1. (1 2 (4 5 6 7))
2. (1 (2 3 4) 5 6) 7)
3. (1 (2 3 4) (5 6 7))
4. (1 (2 3 NULL) (4 5))

gate2000 data-structure binary-tree easy

19.55 Binary Tree: GATE1991_14,c top gateoverflow.in/43027

Consider the binary tree in the figure below:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 818 of 852

Outline a procedure in Pseudo-code to delete an arbitrary node from such a binary tree with n nodes that preserves the
structures. What is the worst-case-time-complexity of your procedure?

gate1991 normal data-structure binary-tree time-complexity

19.56 Binary Tree: GATE2002_2.12 top gateoverflow.in/842

A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at
most twice the number of nodes in the right sub tree. The maximum possible height (number of nodes on the path from the
root to the furthest leaf) of such a tree on n nodes is best described by which of the following?

A. log2 n
B. log 4 n
3
C. log3 n
D. log 3 n
2

gate2002 data-structure binary-tree normal

19.57 Binary Tree: GATE1991_14,b top gateoverflow.in/43026

Consider the binary tree in the figure below:

Give different steps for deleting the node with key 5 so that the structure is preserved.

gate1991 data-structure binary-tree normal

19.58 Binary Tree: GATE2006_13 top gateoverflow.in/974

A scheme for storing binary trees in an array X is as follows. Indexing of X starts at 1 instead of 0. the root is stored at X[1].
For a node stored at X[i], the left child, if any, is stored in X[2i] and the right child, if any, in X[2i+1]. To be able to store
any binary tree on n vertices the minimum size of X should be

(A) log2 n
(B) n
(C) 2n + 1
(D) 2n 1

gate2006 data-structure binary-tree normal

19.59 Binary Tree: GATE2003_6 top gateoverflow.in/897

Let T (n) be the number of different binary search trees on n distinct elements.

Then T (n) = nk=1 T (k 1)T (x), where x is


A. n k + 1
B. n k
C. n k 1

nk2

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 819 of 852

D. n k 2

gate2003 binary-tree normal

19.60 Binary Tree: GATE2002_6 top gateoverflow.in/859

Draw all binary trees having exactly three nodes labeled A, B and C on which preorder traversal gives the sequence C, B, A.

gate2002 data-structure binary-tree easy

19.61 Binary Tree: GATE2003_19 top gateoverflow.in/909

Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree. The
binary search tree uses the usual ordering on natural numbers. What is the in-order traversal sequence of the resultant tree?

A. 7 5 1 0 3 2 4 6 8 9

B. 0 2 4 3 1 6 5 9 8 7

C. 0 1 2 3 4 5 6 7 8 9

D. 9 8 6 4 2 3 0 1 5 7

gate2003 binary-tree easy

19.62 Binary Tree: GATE2015-1_23 top gateoverflow.in/8221

What are the worst-case complexities of insertion and deletion of a key in a binary search tree?

A. (log n) for both insertion and deletion


B. (n) for both insertion and deletion
C. (n) for insertion and (log n) for deletion
D. (log n) for insertion and (n) for deletion

gate2015-1 data-structure binary-tree easy

19.63 Binary Tree: GATE2001_14 top gateoverflow.in/755

a. Insert the following keys one by one into a binary search tree in the order specified.
15, 32, 20, 9, 3, 25, 12, 1
Show the final binary search tree after the insertions.
b. Draw the binary search tree after deleting 15 from it.
c. Complete the statements S1, S2 and S3 in the following function so that the function computes the depth of a binary
tree rooted at t.
typedef struct tnode{
int key;
struct tnode *left, *right;
} *Tree;
int depth (Tree t)
{
int x, y;
it (t == NULL) return 0;
x = depth (t -> left);
S1: ___________;
S2: if (x > y) return __________;

S3: else return _______;

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 820 of 852

gate2001 data-structure binary-tree normal

19.64 Binary Tree: GATE2007_12 top gateoverflow.in/1210

The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a
binary tree of height h is:

A. 2h 1
B. 2h1 1
C. 2h+1 1
D. 2h+1

gate2007 data-structure binary-tree easy

19.65 Binary Tree: GATE2004_43 top gateoverflow.in/1040

Consider the following C program segment


struct CellNode{
struct CellNode *leftChild
int element;
struct CellNode *rightChild;
};
int Dosomething (struct CellNode *ptr)
{
int value = 0;
if(ptr != NULL)
{
if (ptr -> leftChild != NULL)
value = 1 + DoSomething (ptr -> leftChild);
if (ptr -> rightChild != NULL)
value = max(value, 1 + Dosomething (ptr -> rightChild));
}
return(value);
}

The value returned by the function DoSomething when a pointer to the root of a non-empty tree is passed as argument is

A. The number of leaf nodes in the tree


B. The number of nodes in the tree
C. The number of internal nodes in the tree
D. The height of the tree

gate2004 data-structure binary-tree normal

19.66 Binary Tree: GATE1991-1,ix top gateoverflow.in/502

If the binary tree in figure is traversed in inorder, then the order in which the nodes will be visited is ______

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 821 of 852

gate1991 algorithms binary-tree easy

19.67 Binary Tree: GATE2005_33 top gateoverflow.in/1369

Postorder traversal of a given binary search tree, T produces the following sequence of keys

10, 9, 23, 22, 27, 25, 15, 50, 95, 60, 40, 29

Which one of the following sequences of keys can be the result of an in-order traversal of the tree T?

A. 9, 10, 15, 22, 23, 25, 27, 29, 40, 50, 60, 95

B. 9, 10, 15, 22, 40, 50, 60, 95, 23, 25, 27, 29

C. 29, 15, 9, 10, 25, 22, 23, 27, 40, 60, 50, 95

D. 95, 50, 60, 40, 27, 23, 22, 25, 10, 9, 15, 29

gate2005 data-structure binary-tree easy

19.68 Binary Tree: TIFR2014-B-1 top gateoverflow.in/27133

Let T be a rooted binary tree whose vertices are labelled with symbols a, b, c, d, e, f, g, h, i, j, k. Suppose the in-order (visit
left subtree, visit root, visit right subtree) and post-order (visit left subtree, visit right subtree, visit root) traversals of T
produce the following sequences.

in-order:a, b, c, d, e, f, g, h, i, j, k

post-order:a, c, b, e, f, h, j, k, i, g, d

How many leaves does the tree have?

a. THREE.
b. FOUR.
c. FIVE.
d. SIX.
e. Cannot be determined uniquely from the given information.

tifr2014 binary-tree

19.69 Binary Tree: GATE1991_01,viii top gateoverflow.in/506

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 822 of 852

The weighted external path length of the binary tree in figure is ______

gate1991 binary-tree data-structure normal

19.70 Binary Tree: TIFR2015-B-4 top gateoverflow.in/29849

First, consider the tree on the left.

On the right, the nine nodes of the tree have been assigned numbers from the set {1, 2, . . . .9} so that for every node, the
numbers in its left subtree and right subtree lie in disjoint intervals (that is, all numbers in one subtree are less than all
numbers in the other subtree). How many such assignments are possible? Hint: Fix a value for the root and ask what values
can then appear in its left and right subtrees.

A. 29 = 512
B. 24 .32 .5.9 = 6480
C. 23 .3.5.9 = 1080
D. 24 = 16
E. 23 .33 = 216

tifr2015 binary-tree combinatory

19.71 Binary Tree: GATE1991_14,a top gateoverflow.in/541

Consider the binary tree in the figure below:

(a). What structure is represented by the binary tree?

gate1991 data-structure binary-tree time-complexity normal

19.72 Binary Tree: GATE2013_7 top gateoverflow.in/1416

Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a
binary search tree of n nodes?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 823 of 852

(A) O(1)

(B) O(log n)

(C) O(n)

(D) O(n log n)

gate2013 data-structure binary-tree time-complexity easy

19.73 Counting: GATE2000_5 top gateoverflow.in/676

A multiset is an unordered collection of elements where elements may repeat any number of times. The size of a multiset is the number of
elements in it, counting repetitions.

a. What is the number of multisets of size 4 that can be constructed from n distinct elements so that at least one element occurs exactly
twice?
b. How many multisets can be constructed from n distinct elements?

gate2000 combinatory counting normal

19.74 Graph Algorithms: GATE2008_19 top gateoverflow.in/417

The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the
nodes of the following graph is

A. MNOPQR
B. NQMPOR
C. QMNPRO
D. QMNPOR

gate2008 normal data-structure graph-algorithms

19.75 Hashing: GATE1996_1.13 top gateoverflow.in/2717

An advantage of chained hash table (external hashing) over the open addressing scheme is

A. Worst case complexity of search operations is less

B. Space used is less

C. Deletion is easier

D. None of the above

gate1996 data-structure hashing normal

19.76 Hashing: GATE2005-IT_16 top gateoverflow.in/3761

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 824 of 852

A hash table contains 10 buckets and uses linear probing to resolve collisions. The key values are integers and the hash
function used is key % 10. If the values 43, 165, 62, 123, 142 are inserted in the table, in what location would the key value
142 be inserted?

A) 2
B) 3
C) 4
D) 6

gate2005-it data-structure hashing easy

19.77 Hashing: GATE2008-IT_48 top gateoverflow.in/3358

Consider a hash table of size 11 that uses open addressing with linear probing. Let h(k) = k mod 11 be the hash function
used. A sequence of records with keys

43 36 92 87 11 4 71 13 14

is inserted into an initially empty hash table, the bins of which are indexed from zero to ten. What is the index of the bin into
which the last record is inserted?

A) 3
B) 4
C) 6
D) 7

gate2008-it data-structure hashing normal

19.78 Hashing: GATE1996_15 top gateoverflow.in/2767

Insert the characters of the string K R P C S N Y T J M into a hash table of size 10.

Use the hash function

h(x) = (ord(x) ord(a ) + 1) mod 10


and linear probing to resolve collisions.

a. Which insertions cause collisions?

b. Display the final hash table.

gate1996 data-structure hashing normal

19.79 Hashing: GATE2007-IT_28 top gateoverflow.in/3461

Consider a hash function that distributes keys uniformly. The hash table size is 20. After hashing of how many keys will the
probability that any new key hashed collides with an existing one exceed 0.5.

A) 5
B) 6
C) 7
D) 10

gate2007-it data-structure hashing probability normal

19.80 Hashing: GATE2004_7 top gateoverflow.in/1004

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 825 of 852

Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the
following statements are true?

I. 9679, 1989, 4199 hash to the same value

II. 1471, 6171 hash to the same value

III. All elements hash to the same value

IV. Each element hashes to a different value

A. I only
B. II only
C. I and II only
D. III or IV

gate2004 data-structure hashing easy

19.81 Hashing: GATE2014-3_40 top gateoverflow.in/2074

Consider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the rst 3 slots are
unfilled after the first 3 insertions?

(A) (97 97 97)/1003

(B) (99 98 97)/1003

(C) (97 96 95)/1003

(D) (97 96 95/(3! 1003 )

gate2014-3 data-structure hashing probability normal

19.82 Hashing: GATE1997_12 top gateoverflow.in/2272

Consider a hash table with n buckets, where external (overflow) chaining is used to resolve collisions. The hash function is
1
such that the probability that a key value is hashed to a particular bucket is n . The hash table is initially empty and K
distinct values are inserted in the table.

A. What is the probability that bucket number 1 is empty after the K th insertion?

B. What is the probability that no collision has occurred in any of the K insertions?
C. What is the probability that the first collision occurs at the K th insertion?

gate1997 data-structure hashing probability normal

19.83 Hashing: GATE 1989 top gateoverflow.in/10905

A hash table with ten buckets with one slot per bucket is shown in the following figure with the symbols s1 to s7 entered into it using some
hashing function with linear probing.The worst case number of comparison required when the symbol being searched is not in the table is

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 826 of 852

hashing

19.84 Hashing: GATE2010-53 top gateoverflow.in/43327

A hash table of length 10 uses open addressing with hash function h(k) = k mod 10, and linear probing. After inserting 6
values into an empty hash table, the table is shown as below

0
1
2 42
3 23
4 34
5 52
6 46
7 33
8
9

How many different insertion sequences of the key values using the same hash function and linear probing will result in the
hash table shown above?

A. 10
B. 20
C. 30
D. 40

data-structure hashing difficult gate2010

19.85 Hashing: GATE2010-52 top gateoverflow.in/2360

A hash table of length 10 uses open addressing with hash functionh(k) = k mod 10, and linear probing. After inserting 6 values into an
empty hash table, the table is shown as below

0
1
2 42
3 23
4 34
5 52
6 46
7 33
8
9

Which one of the following choices gives a possible order in which the key values could have been inserted in the table?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 827 of 852

A. 46, 42, 34, 52, 23, 33


B. 34, 42, 23, 52, 33, 46
C. 46, 34, 42, 23, 52, 33
D. 42, 46, 33, 23, 34, 52

gate2010 data-structure hashing difficult

19.86 Hashing: GATE2009_36 top gateoverflow.in/1322

The keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of length 10 using open addressing
with hash function h(k) = k mod 10 and linear probing. What is the resultant hash table?

A B C D
0 0 0 0
1 1 1 1
22 2 12 2 12 2 2, 12
3 23 3 13 3 13 3 13, 3, 23
4 4 42 4
5 15 55 53 5 5, 15
6 6 6 23 6
7 7 75 7
8 18 8 18 8 18 8 18
9 9 9 15 9

gate2009 data-structure hashing normal

19.87 Hashing: GATE2014-1_40 top gateoverflow.in/1918

Consider a hash table with 9 slots. The hash function is h(k) = k mod 9. The collisions are resolved by chaining. The
following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10. The maximum, minimum, and average chain
lengths in the hash table, respectively, are

(A) 3, 0, and 1

(B) 3, 3, and 3

(C) 4, 0, and 1

(D) 3, 0, and 2

gate2014-1 data-structure hashing normal

19.88 Hashing: GATE2006-IT_20 top gateoverflow.in/3559

Which of the following statement(s) is TRUE?

I. A hash function takes a message of arbitrary length and generates a fixed length code.
II. A hash function takes a message of fixed length and generates a code of variable length.
III. A hash function may give the same hash value for distinct messages.

A) I only
B) II and III only

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 828 of 852

C) I and III only


D) II only

gate2006-it data-structure hashing normal

19.89 Heap: GATE2006-IT_72 top gateoverflow.in/3616

An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array is 0. If
only the root node does not satisfy the heap property, the algorithm to convert the complete binary tree into a heap has the
best asymptotic time complexity of

A) O (n)
B) O (log n)
C) O (n log n)
D) O (n log log n)

gate2006-it data-structure binary-tree heap easy

19.90 Heap: GATE2006-IT_44 top gateoverflow.in/3587

Which of the following sequences of array elements forms a heap?

A) {23, 17, 14, 6, 13, 10, 1, 12, 7, 5}


B) {23, 17, 14, 6, 13, 10, 1, 5, 7, 12}
C) {23, 17, 14, 7, 13, 10, 1, 5, 6, 12}
D) {23, 17, 14, 7, 13, 10, 1, 12, 5, 7}

gate2006-it data-structure heap easy

19.91 Heap: GATE2004-IT_53 top gateoverflow.in/3696

An array of integers of size n can be converted into a heap by adjusting the heaps rooted at each internal node of the
complete binary tree starting at the node (n - 1) /2, and doing this adjustment up to the root node (root node is at
index 0) in the order (n - 1)/2, (n - 3)/ 2, ....., 0. The time required to construct a heap in this manner is

A) O(log n)
B) O(n)
C) O (n log log n)
D) O(n log n)

gate2004-it data-structure heap normal

19.92 Heap: GATE 2016-2-34 top gateoverflow.in/39585

A complete binary min-heap is made by including each integer in [1, 1023] exactly once. The depth of a node in the heap is
the length of the path from the root of the heap to that node. Thus, the root is at depth 0. The maximum depth at which
integer 9 can appear is _________.

gate2016-2 data-structure heap normal numerical-answers

19.93 Heap: GATE2015-1_32 top gateoverflow.in/8273

Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4.

Array index 1 2 3 4 5 6 7 8 9

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 829 of 852

Value 40 30 20 10 15 16 17 8 4

Now consider that a value 35 is inserted into this heap. After insertion, the new heap is

A. 40, 30, 20, 10, 15, 16, 17, 8, 4, 35


B. 40, 35, 20, 10, 30, 16, 17, 8, 4, 15
C. 40, 30, 20, 10, 35, 16, 17, 8, 4, 15
D. 40, 35, 20, 10, 15, 16, 17, 8, 4, 30

gate2015-1 data-structure heap easy

19.94 Heap: GATE2005_34 top gateoverflow.in/1370

A priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is: 10, 8, 5, 3, 2. Two new elements 1 and 7 are
inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is:

(A) 10, 8, 7, 5, 3, 2, 1

(B) 10, 8, 7, 2, 3, 1, 5

(C) 10, 8, 7, 1, 2, 3, 5

(D) 10, 8, 7, 3, 2, 1, 5

gate2005 data-structure heap normal

19.95 Heap: GATE2014-2_12 top gateoverflow.in/1967

A priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is: 10, 8, 5, 3, 2. Two new elements 1 and 7 are
inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is:

(A) 10, 8, 7, 3, 2, 1, 5

(B) 10, 8, 7, 2, 3, 1, 5

(C) 10, 8, 7, 1, 2, 3, 5

(D) 10, 8, 7, 5, 3, 2, 1

gate2014-2 data-structure heap normal

19.96 Heap: GATE2006_76,77 top gateoverflow.in/1852

Statement for Linked Answer Questions 76 & 77:

A 3-ary max heap is like a binary max heap, but instead of 2 children, nodes have 3 children. A 3-ary heap can be
represented by an array as follows: The root is stored in the first location, a[0], nodes in the next level, from left to right, is
stored from a[1] to a[3]. The nodes from the second level of the tree from left to right are stored from a[4] location onward.
An item x can be inserted into a 3-ary heap containing n items by placing x in the location a[n] and pushing it up the tree to
satisfy the heap property.

76. Which one of the following is a valid sequence of elements in an array representing 3-ary max heap?

(A) 1, 3, 5, 6, 8, 9

(B) 9, 6, 3, 1, 8, 5

(C) 9, 3, 6, 8, 5, 1

(D) 9, 5, 6, 8, 3, 1

77. Suppose the elements 7, 2, 10 and 4 are inserted, in that order, into the valid 3-ary max heap found in the above
question, Q.76. Which one of the following is the sequence of items in the array representing the resultant heap?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 830 of 852

(A) 10, 7, 9, 8, 3, 1, 5, 2, 6, 4
(B) 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
(C) 10, 9, 4, 5, 7, 6, 8, 2, 1, 3
(D) 10, 8, 6, 9, 7, 2, 3, 4, 1, 5

gate2006 data-structure heap normal

19.97 Heap: TIFR2014-B-19 top gateoverflow.in/27352

Consider the following tree with 13 nodes.

Suppose the nodes of the tree are randomly assigned distinct labels from {1, 2, . . . . , 13}, each permutation being equally
likely. What is the probability that the labels form a min-heap (i.e., every node receives the minimum label in its subtree)?
2
a. ( ) ( 3!1 )
1
6!
2
( 3!1 ) ( 2!1 )
3
b.
3
c. ( 131 ) ( 16 ) ( 13 )
2
d. 13
1
e.
213

tifr2014 heap

19.98 Heap: GATE2015-3_19 top gateoverflow.in/8418

Consider the following array of elements.

89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100


The minimum number of interchanges needed to convert it into a max-heap is

A. 4
B. 5
C. 2
D. 3

gate2015-3 data-structure heap normal

19.99 Heap: GATE1999_12 top gateoverflow.in/1511

a. In binary tree, a full node is defined to be a node with 2 children. Use induction on the height of the binary tree to
prove that the number of full nodes plus one is equal to the number of leaves.

b. Draw the min-heap that results from insertion of the following elements in order into an initially empty min-heap: 7, 6,
5, 4, 3, 2, 1. Show the result after the deletion of the root of this heap.

gate1999 data-structure binary-tree heap normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 831 of 852

19.100 Heap: GATE1996_2.11 top gateoverflow.in/2740

The minimum number of interchanges needed to convert the array into a max-heap is

89, 19, 40, 17, 12, 10, 2, 5, 7, 11, 6, 9, 70

(a) 0

(b) 1

(c) 2

(d) 3

gate1996 data-structure heap easy

19.101 Heap: GATE2015-3_17 top gateoverflow.in/8414

Given that hash table T with 25 slots that stores 2000 elements, the load factor a for T is _________.

gate2015-3 data-structure heap normal

19.102 Infix Postfix: GATE2004_38 top gateoverflow.in/1035

Assume that the operators +, , are left associative and ^ is right associative. The order of precedence (from highest to
lowest) is ^ , , +, . The postfix expression corresponding to the infix expression a + b c d ^ e^ f is

A. abc +def ^ ^

B. abc +de^ f ^

C. ab + c d e^ f ^

D. + a b c^ ^ def

gate2004 infix-postfix

19.103 Linked Lists: GATE1998_19a top gateoverflow.in/1733

a. Let p be a pointer as shown in the figure in a single linked list.


What do the following assignment statements achieve?

q: = p -> next
p -> next:= q -> next
q -> next:=(q -> next) -> next
(p -> next) -> next:= q

gate1998 data-structure linked-lists normal

19.104 Linked Lists: GATE2008_62 top gateoverflow.in/485

The following C function takes a single-linked list of integers as a parameter and rearranges the elements of the list. The
function is called with the list containing the integers 1, 2, 3, 4, 5, 6, 7 in the given order. What will be the contents of the

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 832 of 852

list after function completes execution?


struct node {
int value;
struct node *next;
};
void rearrange(struct node *list) {
struct node *p, *q;
int temp;
if (!list || !list -> next) return;
p = list; q = list -> next;
while(q) {
temp = p -> value; p->value = q -> value;
q->value = temp; p = q ->next;
q = p? p ->next : 0;
}
}

A. 1, 2 ,3, 4, 5, 6, 7
B. 2, 1, 4 ,3, 6, 5, 7
C. 1, 3, 2, 5, 4, 7, 6
D. 2, 3, 4, 5, 6, 7, 1

gate2008 data-structure linked-lists normal

19.105 Linked Lists: GATE2005-IT_54 top gateoverflow.in/3815

The following C function takes a singly-linked list of integers as a parameter and rearranges the elements of the list. The list
is represented as pointer to a structure. The function is called with the list containing the integers 1, 2, 3, 4, 5, 6, 7 in the
given order. What will be the contents of the list after the function completes execution?

struct node {int value; struct node *next;);
void rearrange (struct node *list) {
struct node *p, *q;
int temp;
if (!list || !list -> next) return;
p = list; q = list -> next;
while (q) {
temp = p -> value;
p -> value = q -> value;
q -> value = temp;
p = q -> next;
q = p ? p -> next : 0;
}
}

A) 1, 2, 3, 4, 5, 6, 7
B) 2, 1, 4, 3, 6, 5, 7
C) 1, 3, 2, 5, 4, 7, 6
D) 2, 3, 4, 5, 6, 7, 1

gate2005-it data-structure linked-lists identify-function normal

19.106 Linked Lists: GATE2004_40 top gateoverflow.in/1037

Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among
union, intersection, membership, cardinality will be the slowest?

A. union only

B. intersection, membership

C. membership, cardinality

D. union, intersection

gate2004 data-structure linked-lists normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 833 of 852

19.107 Linked Lists: GATE2003_90 top gateoverflow.in/973

Consider the function f defined below.


struct item {
int data;
struct item * next;
};
int f(struct item *p) {
return ((p == NULL) || (p->next == NULL)||
((p->data <= p ->next -> data) &&
f(p->next)));
}

For a given linked list p, the function f returns 1 if and only if

A. the list is empty or has exactly one element

B. the elements in the list are sorted in non-decreasing order of data value

C. the elements in the list are sorted in non-increasing order of data value

D. not all elements in the list have the same data value

gate2003 data-structure linked-lists normal

19.108 Linked Lists: GATE2004_36 top gateoverflow.in/1033

A circularly linked list is used to represent a Queue. A single variable p is used to access the Queue. To which node should p
point such that both the operations enQueue and deQueue can be performed in constant time?

A. rear node
B. front node
C. not possible with a single pointer
D. node next to front

gate2004 data-structure linked-lists normal

19.109 Linked Lists: GATE1997_1.4 top gateoverflow.in/2220

The concatenation of two lists is to be performed on O(1) time. Which of the following implementations of a list should be
used?

A. Singly linked list

B. Doubly linked list

C. Circular doubly linked list

D. Array implementation of list

gate1997 data-structure linked-lists easy

19.110 Linked Lists: GATE 2016-2-15 top gateoverflow.in/39557

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 834 of 852

N items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For
a decrease-key operation, a pointer is provided to the record on which the operation is to be performed.

An algorithm performs the following operations on the list in this order: (N) delete, O(log N) insert, O(log N) find, and
(N) decrease-key. What is the time complexity of all these operations put together?
2
A. O(log N)
B. O(N)
C. O(N 2 )
D. (N 2 log N)

gate2016-2 data-structure linked-lists time-complexity normal

19.111 Queues: GATE2006_49 top gateoverflow.in/1826

An implementation of a queue Q, using two stacks S1 and S2, is given below:


void insert (Q, x) {
push (S1, x);
}
void delete (Q) {
if (stack-empty(S2)) then
if (stack-empty(S1)) then {
print(Q is empty);
return;
}
else while (!(stack-empty(S1))){
x=pop(S1);
push(S2,x);
}
x=pop(S2);
}

let n insert and m( n) delete operations be performed in an arbitrary order on an empty queue Q. Let x and y be the
number of push and pop operations performed respectively in the process. Which one of the following is true for all m and
n?
(A) n + m x < 2n and 2m y n + m
(B) n + m x < 2n and 2m y 2n
(C) 2m x < 2n and 2m y n + m
(D) 2m x < 2n and 2m y 2n

gate2006 data-structure queues stack normal

19.112 Queues: GATE 2016-1-41 top gateoverflow.in/39684

Let Q denote a queue containing sixteen numbers and S be an empty stack. Head(Q) returns the element at the head of the
queue Q without removing it from Q. Similarly Top (S) returns the element at the top of S without removing it from S.
Consider the algorithm given below.
while Q is not Empty do
if S is Empty OR Top(S) Head (Q) then
x:= Dequeue (Q);
Push (S, x);
else
x:= Pop(S);
Enqueue (Q, x);
end
end

The maximum possible number of iterations of the while loop in the algorithm is _______.

gate2016-1 data-structure queues difficult numerical-answers

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 835 of 852

19.113 Queues: GATE 2016-1-10 top gateoverflow.in/39667

A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of
the following statements is CORRECT (n refers to the number of items in the queue) ?

A. Both operations can be performed in O(1) time.


B. At most one operation can be performed in O(1) time but the worst case time for the operation will be (n).
C. The worst case time complexity for both operations will be (n).
D. Worst case time complexity for both operations will be (log n)

gate2016-1 data-structure queues normal

19.114 Queues: GATE2012_35 top gateoverflow.in/1756

Suppose a circular queue of capacity (n 1) elements is implemented with an array of n elements. Assume that the
insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially,
REAR = FRONT = 0. The conditions to detect queue full and queue empty are

(A)

full: (REAR+1) mod n == FRONT

empty: REAR == FRONT$

(B)

full: (REAR+1) mod n == FRONT

empty: (FRONT+1) mod n == REAR

(C)

full: REAR == FRONT

empty: (REAR+1) mod n == FRONT

(D)

full: (FRONT+1) mod n == REAR

empty: REAR == FRONT

gate2012 data-structure queues normal

19.115 Queues: GATE2007-IT_30 top gateoverflow.in/3463

Suppose you are given an implementation of a queue of integers. The operations that can be performed on the queue are:

i. isEmpty (Q) returns true if the queue is empty, false otherwise.


ii. delete (Q) deletes the element at the front of the queue and returns its value.
iii. insert (Q, i) inserts the integer i at the rear of the queue.

Consider the following function:


void f (queue Q) {
int i ;
if (!isEmpty(Q)) {
i = delete(Q);
f(Q);
insert(Q, i);
}
}

What operation is performed by the above function f ?

A) Leaves the queue Q unchanged


B) Reverses the order of the elements in the queue Q

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 836 of 852

C) Deletes the element at the front of the queue Q and inserts it at the rear keeping the other elements in the same order
D) Empties the queue Q

gate2007-it data-structure queues normal

19.116 Queues: GATE1994_26 top gateoverflow.in/2522

A queue Q containing n items and an empty stack S are given. It is required to transfer all the items from the queue to the
stack, so that the item at the front of queue is on the TOP of the stack, and the order of all other items are preserved. Show
how this can be done in O(n) time using only a constant amount of additional storage. Note that the only operations which
can be performed on the queue and stack are Delete, Insert, Push and Pop. Do not assume any implementation of the queue
or stack.

gate1994 data-structure queues stack normal

19.117 Spanning Tree: TIFR2013-B-17 top gateoverflow.in/25860

In a connected weighted graph with n vertices, all the edges have distinct positive integer weights. Then, the maximum
number of minimum weight spanning trees in the graph is

a. 1
b. n
c. equal to number of edges in the graph.
d. equal to maximum weight of an edge of the graph.
e. nn2

tifr2013 spanning-tree

19.118 Stack: GATE2015-3_12 top gateoverflow.in/8408

The result evaluating the postfix expression 10 5 + 60 6 / * 8 - is

A. 284
B. 213
C. 142
D. 71

gate2015-3 data-structure stack normal

19.119 Stack: GATE1994_1.14 top gateoverflow.in/2457

Which of the following permutations can be obtained in the output (in the same order) using a stack assuming that the input
is the sequence 1, 2, 3, 4, 5 in that order?

(a) 3, 4, 5, 1, 2

(b) 3, 4, 5, 2, 1

(c) 1, 5, 2, 3, 4

(d) 5, 4, 3, 1, 2

gate1994 data-structure stack normal

19.120 Stack: GATE2000_13 top gateoverflow.in/684

Suppose a stack implementation supports, in addition to PUSH and POP, an operation REVERSE, which reverses the order of
the elements on the stack.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 837 of 852

a. To implement a queue using the above stack implementation, show how to implement ENQUEUE using a single
operation and DEQUEUE using a sequence of 3 operations.
b. The following post fix expression, containing single digit operands and arithmetic operators + and *, is evaluated using
a stack.
5 2 * 3 4 + 5 2 * * +
Show the contents of the stack
i. After evaluating 5 2 * 3 4 +
ii. After evaluating 5 2 * 3 4 + 5 2
iii. At the end of evaluation.

gate2000 data-structure stack normal

19.121 Stack: GATE1997_4.7 top gateoverflow.in/2248

A priority queue Q is used to implement a stack that stores characters. PUSH (C) is implemented as INSERT (Q, C, K) where
K is an appropriate integer key chosen by the implementation. POP is implemented as DELETEMIN(Q). For a sequence of
operations, the keys chosen are in

A. non-increasing order

B. non-decreasing order

C. strictly increasing order

D. strictly decreasing order

gate1997 data-structure stack normal

19.122 Stack: GATE2014-2_41 top gateoverflow.in/2007

Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in
addition to the PUSH and POP instructions. Which one of the following statements is TRUE (with respect to this modified
stack)?

(A) A queue cannot be implemented using this stack.

(B) A queue can be implemented where ENQUEUE takes a single instruction and DEQUEUE takes a sequence of two
instructions.

(C) A queue can be implemented where ENQUEUE takes a sequence of three instructions and DEQUEUE takes a single
instruction.

(D) A queue can be implemented where both ENQUEUE and DEQUEUE take a single instruction each.

gate2014-2 data-structure stack easy

19.123 Stack: GATE2007_38 top gateoverflow.in/1236

The following postfix expression with single digit operands is evaluated using a stack:

8 2 3 ^ / 2 3 * + 5 1 * -

Note that ^ is the exponentiation operator. The top two elements of the stack after the first * is evaluated are

A. 6, 1
B. 5, 7
C. 3, 2
D. 1, 5

gate2007 data-structure stack normal

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 838 of 852

19.124 Stack: GATE2015-2_38 top gateoverflow.in/8164

Consider the C program below


#include <stdio.h>
int *A, stkTop;
int stkFunc (int opcode, int val)
{
static int size=0, stkTop=0;
switch (opcode) {
case -1: size = val; break;
case 0: if (stkTop < size ) A[stkTop++]=val; break;
default: if (stkTop) return A[--stkTop];
}
return -1;
}
int main()
{
int B[20]; A=B; stkTop = -1;
stkFunc (-1, 10);
stkFunc (0, 5);
stkFunc (0, 10);
printf ("%d\n", stkFunc(1, 0)+ stkFunc(1, 0));
}

The value printed by the above program is ________.

gate2015-2 data-structure stack easy

19.125 Stack: GATE2004_3 top gateoverflow.in/1000

A single array A[1 .. MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array.
Variables top1 and top 2 (top < top 2) point to the location of the topmost element in each of the stacks. If the space is to
be used efficiently, the condition for stack full is

A. (top1 = MAXSIZE / 2) and (top2 = MAXSIZE / 2 + 1)

B. top1 + top2 = MAXSIZE

C. (top1 = MAXSIZE / 2) or (top2 = MAXSIZE)

D. top1 = top2 - 1

gate2004 data-structure stack easy

19.126 Stack: GATE1991_03,vii top gateoverflow.in/522

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

The following sequence of operations is performed on a stack:

PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP, PUSH (20), POP

The sequence of values popped out is

(a). 20,10,20,10,20

(b). 20,20,10,10,20

(c). 10,20,20,10,20

(d). 20,20,10,20,10

gate1991 data-structure stack easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 839 of 852

19.127 Stack: GATE2003_64 top gateoverflow.in/951

Let S be a stack of size n 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and
then perform n pop operations. Assume that Push and Pop operations take X seconds each, and Y seconds elapse between
the end of one such stack operation and the start of the next operation. For m 1, define the stack-life of m as the time
elapsed from the end of Push(m) to the start of the pop operation that removes m from S. The average stack-life of an
element of this stack is

A. n(X+Y)

B. 3Y+2X

C. n(X+Y)-X

D. Y+2X

gate2003 data-structure stack normal

19.128 Stack: GATE2005-IT_13 top gateoverflow.in/3758

A function f defined on stacks of integers satisfies the following properties. f() = 0 and f (push (S, i)) = max (f(S), 0) + i
for all stacks S and integers i.

If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)?

A) 6
B) 4
C) 3
D) 2

gate2005-it data-structure stack normal

19.129 Stack: GATE1995_2.21 top gateoverflow.in/2633

The postfix expression for the infix expression A + B (C + D)/F + D E is:


A. AB + CD + F /D + E

B. ABCD + F /DE ++

C. A B + CD/F DE + +
D. A + BCD/F DE + +

gate1995 data-structure stack easy

19.130 Tree Traversal: GATE 2016-2-36 top gateoverflow.in/39597

Consider the following New-order strategy for traversing a binary tree:

Visit the root;


Visit the right subtree using New-order;
Visit the left subtree using New-order;

The New-order traversal of the expression tree corresponding to the reverse polish expression
3 4 * 5 - 2 ^ 6 7 * 1 + -

is given by:

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 840 of 852

A. + - 1 6 7 * 2 ^ 5 - 3 4 *
B. - + 1 * 6 7 ^ 2 - 5 * 3 4
C. - + 1 * 7 6 ^ 2 - 5 * 4 3
D. 1 7 6 * + 2 5 4 3 * - ^ -

gate2016-2 data-structure tree-traversal normal

19.131 Trees: GATE2009_37 top gateoverflow.in/1323

What is the maximum height of any AVL-tree with 7 nodes? Assume that the height of a tree with a single node is 0.

A. 2
B. 3
C. 4
D. 5

gate2009 data-structure trees normal

19.132 Trees: GATE2007_43 top gateoverflow.in/1241

A complete n-ary tree is a tree in which each node has n children or no children. Let I be the number of internal nodes and L
be the number of leaves in a complete n-ary tree. If L = 41 and I = 10, what is the value of n?

A. 3
B. 4
C. 5
D. 6

gate2007 data-structure trees normal

19.133 Trees: GATE1998_2.11 top gateoverflow.in/1683

A complete n-ary tree is one in which every node has 0 or n sons. If x is the number of internal nodes of a complete n-ary
tree, the number of leaves in it is given by

A. x(n 1) + 1
B. xn 1
C. xn + 1
D. x(n + 1)

gate1998 data-structure trees normal

19.134 Trees: GATE1992_02,vii top gateoverflow.in/562

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

A 2 3 tree is such that

a. All internal nodes have either 2 or 3 children


b. All paths from root to the leaves have the same length.

23 9

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 841 of 852

The number of internal nodes of a 2 3 tree having 9 leaves could be

(a). 4

(b). 5

(c). 6

(d). 7

gate1992 trees data-structure normal

19.135 Trees: GATE2005_36 top gateoverflow.in/1372

In a complete k-ary tree, every internal node has exactly k children. The number of leaves in such a tree with n interval
node is:

A. nk
B. (n 1)k + 1
C. n(k 1) + 1
D. n(k 1)

gate2005 data-structure trees normal

19.136 Trees: GATE2002_2.9 top gateoverflow.in/839

The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is:


n
A. 2
(n1)
B. 3
(n1)
C. 2
(2n+1)
D. 3

gate2002 data-structure trees normal

19.137 Trees: GATE1998_1.24 top gateoverflow.in/1661

Which of the following statements is false?

(a) A tree with a n nodes has (n 1) edges


(b) A labeled rooted binary tree can be uniquely constructed given its postorder and preorder traversal results.
(c) A complete binary tree with n internal nodes has (n + 1) leaves.
(d) The maximum number of nodes in a binary tree of height h is 2h+1 1
gate1998 data-structure trees normal

19.138 Trees: GATE1994_5 top gateoverflow.in/2501

A 3 ary tree is a tree in which every internal node has exactly three children. Use induction to prove that the number of
leaves in a 3 ary tree with n internal nodes is 2(n 1).

gate1994 data-structure trees proof

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 842 of 852

19.139 GATE2001_2.16 top gateoverflow.in/734

What is the minimum number of stacks of size n required to implement a queue of size n?

A. One
B. Two
C. Three
D. Four

gate2001 data-structure easy

19.140 GATE1992_09 top gateoverflow.in/588

Suggest a data structure for representing a subset S of integers from 1 to n. Following operations on the set S are to be
performed in constant time (independent of cardinality of S).

Check whether X is in the set S or


(i). MEMBER (X):
not
I f S is not empty, return one
(ii). FIND-ONE(S): element of the set S (any arbitrary
element will do)
(iii). ADD (X): Add integer X to set S
(iv). DELETE (X): Delete integer X from S.

Give pictorial examples of your data structure. Give routines for these operations in an English like language. You may
assume that the data structure has been suitable initialized. Clearly state your assumptions regarding initialization.

gate1992 programming normal descriptive

19.141 GATE2005_2 top gateoverflow.in/1344

An Abstract Data Type (ADT) is:

A. same as an abstract class


B. a data type that cannot be instantiated
C. a data type for which only the operations defined on it can be used, but none else
D. all of the above

gate2005 data-structure normal

19.142 GATE1996_1.12 top gateoverflow.in/2716

Consider the following statements:

i. First-in-first out types of computations are efficiently supported by STACKS.

ii. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST
operations.

iii. Implementing QUEUES on a circular array is more efficient than implementing QUEUES on a linear array with two
indices.

iv. Last-in-first-out type of computations are efficiently supported by QUEUES.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 843 of 852

A. (ii) and (iii) are true


B. (i) and (ii) are true
C. (iii) and (iv) are true
D. (ii) and (iv) are true

gate1996 data-structure easy

19.143 GATE2015-1_40 top gateoverflow.in/8299

An algorithm performs (log N) 1/2 find operations , N insert operations, (log N) 1/2 delete operations, and (log N) 1/2 decrease-
key operations on a set of data items with keys drawn from a linearly ordered set . For a delete operation, a pointer is
provided to the record that must be deleted . For the decrease-key operation, a pointer is provided to the record that has its
key decreased. Which one of the following data structures is the most suited for the algorithm to use, if the goal is to
achieve the best total asymptotic complexity considering all the operations?

A. Unsorted array
B. Min - heap
C. Sorted array
D. Sorted doubly linked list

gate2015-1 data-structure normal

19.144 GATE2013_44 top gateoverflow.in/61

Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.

MultiDequeue(Q){
m = k
while (Q is not empty) and (m > 0) {
Dequeue(Q)
m = m 1
}
}

What is the worst case time complexity of a sequence of n queue operations on an initially empty
queue?

(A) (n)

(B) (n + k)

(C) (nk)

(D) (n2 )

gate2013 data-structure algorithms normal

19.145 gate qn top gateoverflow.in/9489

A full binary tree with 'n' non-leaf node contains

19.146 GATE2004_5 top gateoverflow.in/1002

The best data structure to check whether an arithmetic expression has balanced parentheses is a

A. queue

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 844 of 852

B. stack
C. tree
D. list

gate2004 data-structure easy

19.147 GATE2003_63 top gateoverflow.in/950

A data structure is required for storing a set of integers such that each of the following operations can be done in O(log n)
time, where n is the number of elements in the set.

I. Deletion of the smallest element

II. Insertion of an element if it is not already present in the set

Which of the following data structures can be used for this purpose?

A. A heap can be used but not a balanced binary search tree

B. A balanced binary search tree can be used but not a heap

C. Both balanced binary search tree and heap can be used

D. Neither balanced search tree nor heap can be used

gate2003 data-structure easy

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 845 of 852

20 IISc/IITs top
20.1 Gate 2016 top gateoverflow.in/40946

I am expecting 59 marks in gate 2016 (not normalized) set 2.which psu can call for interview nd what are my chances for iit
and nits

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 846 of 852

21 NITs top
21.1 Gate admission top gateoverflow.in/41840

Which nit is best in terms of placements after mtech(preferably in north side)?

21.2 Gate 2016 top gateoverflow.in/41579

Dep- CSE

Category- OBC

Rank- 2000

What colleges can I get?

Are IITs possible with no scholarship?

21.3 Gate 2016 Score 629, 49.85 out off 100 top gateoverflow.in/41551

Hi all,

Can i get admission in top NIT with these score?

Score : 629

Marks : 49.85

AIR : 1339

OBC Non creamy layer.

gate-2016-admission

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 847 of 852

22 IIITs top
22.1 Gate 2016 top gateoverflow.in/41586

@Arjun sir

Score : 588

Marks : 46.25
AIR : 1888
Category :general
is there any possibility of interview call from any IIts??

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 848 of 852

23 Other Colleges top


23.0 Gate 34 marks in CS,General Cateogory. Which good colleges I can get?
top gateoverflow.in/40836

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 849 of 852

24 Study Resources top


24.1 GATE 2016 Preparation top gateoverflow.in/19029

Hi All, I have applied for GATE 2016 exam in the stream of CS. I haven't started preparation yet. Would it be possible to
prepare for the exam in less than 110 days including solving previous papers? If yes how should it be scheduled. Can anyone
help? To add a point, i have been away from books since 2 years as i am working as test engineer.

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 850 of 852

25 GATE Application top


25.1 GATE 2016 CSE top gateoverflow.in/40717

SET - 1, Normalized Marks - 31.39, Category - SC, What can I expect ?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 851 of 852

26 Written Exam top


26.1 Gate 2016 top gateoverflow.in/41596

Hello..

I have secured AIR 645 category-general in gate 2016.which iits, nits, PSUs are possible for me?

Copyright GATE Overflow. All rights reserved.


GATE Overflow April 2016 852 of 852

Brought to you by GATE Overflow


http://gateoverflow.in/

Copyright GATE Overflow. All rights reserved.

You might also like