0% found this document useful (0 votes)
94 views149 pages

Filter 5

The document contains a table of contents that lists 21 chapters covering various topics related to computer science and engineering. The chapters include algorithms, databases, discrete mathematics, engineering mathematics, general aptitude, operating systems, programming and data structures, and theory of computation. Each chapter is further divided into sections that provide additional details on specific subtopics. Answer keys are provided at the end of most chapters. The document also lists contributors who have added or completed questions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views149 pages

Filter 5

The document contains a table of contents that lists 21 chapters covering various topics related to computer science and engineering. The chapters include algorithms, databases, discrete mathematics, engineering mathematics, general aptitude, operating systems, programming and data structures, and theory of computation. Each chapter is further divided into sections that provide additional details on specific subtopics. Answer keys are provided at the end of most chapters. The document also lists contributors who have added or completed questions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 149

Table of Contents

Table of Contents 1
Contributors 4
1 Algorithms (57) 5
1.1 Algorithm Design (1) 5
1.2 Asymptotic Notations (9) 5
1.3 Binary Search (1) 7
1.4 Graph Algorithms (3) 7
1.5 Identify Function (4) 8
1.6 Maximum Minimum (3) 10
1.7 Minimum Spanning Tree (2) 11
1.8 P Np Npc Nph (9) 11
1.9 Quick Sort (1) 15
1.10 Recurrence Relation (3) 15
1.11 Searching (2) 16
1.12 Shortest Path (1) 17
1.13 Sorting (9) 17
1.14 Spanning Tree (5) 20
1.15 Time Complexity (4) 22
Answer Keys 23
2 Compiler Design (3) 25
2.1 Parsing (3) 25
Answer Keys 26
3 Computer Networks (1) 27
3.1 Network Security (1) 27
Answer Keys 27
4 Databases (2) 28
4.1 Relational Algebra (2) 28
Answer Keys 28
5 Digital Logic (11) 29
5.1 Boolean Algebra (4) 29
5.2 Canonical Normal Form (1) 31
5.3 Digital Circuits (1) 31
5.4 Gray Code (1) 31
5.5 Number Representation (2) 31
5.6 Number System (1) 32
Answer Keys 32
6 Discrete Mathematics: Combinatory (16) 33
6.1 Balls In Bins (4) 34
6.2 Generating Functions (1) 35
6.3 Modular Arithmetic (1) 35
6.4 Pigeonhole Principle (2) 35
6.5 Recurrence Relation (2) 35
Answer Keys 36
7 Discrete Mathematics: Graph Theory (17) 37
7.1 Counting (1) 37
7.2 Degree Of Graph (3) 37
7.3 Graph Coloring (5) 38
7.4 Graph Connectivity (4) 39
7.5 Line Graph (1) 41
7.6 Minimum Spanning Tree (1) 41
7.7 Spanning Tree (1) 42
7.8 Tree (1) 42
Answer Keys 42
8 Discrete Mathematics: Mathematical Logic (15) 43
8.1 First Order Logic (7) 43
8.2 Logical Reasoning (6) 45
8.3 Propositional Logic (2) 47
Answer Keys 47
9 Discrete Mathematics: Set Theory & Algebra (22) 48
9.1 Convex Sets Functions (1) 48
9.2 Functions (6) 48
9.3 Lattice (1) 49
9.4 Number Theory (1) 50
9.5 Partial Order (4) 50
9.6 Polynomials (1) 51
9.7 Set Theory (8) 51
Answer Keys 53
10 Engineering Mathematics: Calculus (21) 55
10.1 Convergence (1) 55
10.2 Differentiation (1) 55
10.3 Integration (3) 55
10.4 Limits (7) 56
10.5 Maxima Minima (8) 58
Answer Keys 60
11 Engineering Mathematics: Linear Algebra (14) 61
11.1 Eigen Value (1) 61
11.2 Matrix (8) 61
11.3 Rank Of Matrix (1) 64
11.4 Vector Space (3) 64
Answer Keys 65
12 Engineering Mathematics: Probability (40) 66
12.1 Binomial Distribution (3) 71
12.2 Conditional Probability (3) 72
12.3 Expectation (5) 73
12.4 Independent Events (1) 74
12.5 Random Variable (2) 74
12.6 Uniform Distribution (3) 74
Answer Keys 75
13 General Aptitude: Analytical Aptitude (10) 76
13.1 Logical Reasoning (10) 76
Answer Keys 79
14 General Aptitude: Quantitative Aptitude (55) 80
14.1 Cartesian Coordinates (3) 80
14.2 Circle (1) 81
14.3 Clock Time (3) 81
14.4 Complex Number (3) 82
14.5 Convex Sets Functions (1) 82
14.6 Cost Market Price (1) 83
14.7 Factors (3) 83
14.8 Fraction (2) 84
14.9 Geometry (9) 84
14.10 Logarithms (1) 86
14.11 Modular Arithmetic (3) 87
14.12 Number Representation (1) 87
14.13 Number Series (5) 88
14.14 Number System (2) 89
14.15 Number Theory (1) 89
14.16 Numerical Computation (5) 89
14.17 Polynomials (1) 91
14.18 Quantitative Aptitude (2) 91
14.19 Ratio Proportion (2) 92
14.20 Sequence Series (1) 92
14.21 Speed Time Distance (2) 92
14.22 Statistics (1) 93
14.23 Three Dimensional Geometry (1) 93
Answer Keys 94
15 General Aptitude: Verbal Aptitude (2) 95
15.1 Quantitative Aptitude (2) 95
Answer Keys 95
16 Non GATE: Object Oriented Programming (1) 96
16.1 Object Oriented Programming (1) 96
Answer Keys 96
17 Operating System (11) 97
17.1 Page Replacement (1) 97
17.2 Process Synchronization (8) 97
17.3 Round Robin Scheduling (1) 100
17.4 Semaphore (1) 100
Answer Keys 101
18 Others: Others (91) 102
18.1 3 Sat (1) 126
18.2 Binomial Theorem (1) 126
18.3 Closure Property (1) 127
18.4 Complex Number (1) 127
18.5 Divergence (1) 127
18.6 Dynamic Programming (1) 128
18.7 Euler Graph (1) 128
18.8 Generalaptitude (1) 128
18.9 P Np Npc Nph (1) 129
18.10 Uniform Hashing (1) 129
18.11 Work Time (1) 129
Answer Keys 130
19 Programming and DS: DS (10) 131
19.1 Array (1) 131
19.2 Binary Search Tree (1) 131
19.3 Binary Tree (5) 131
19.4 Heap (1) 133
19.5 Stack (1) 134
19.6 Tree (1) 134
Answer Keys 135
20 Programming and DS: Programming (11) 136
20.1 Loop Invariants (4) 136
20.2 Parameter Passing (2) 138
20.3 Programming In C (2) 138
20.4 Recursion (2) 139
Answer Keys 140
21 Theory of Computation (28) 141
21.1 Closure Property (2) 141
21.2 Decidability (3) 141
21.3 Identify Class Language (10) 142
21.4 Recursive And Recursively Enumerable Languages (2) 145
21.5 Regular Expression (5) 146
21.6 Regular Language (6) 147
Answer Keys 149
Contributors
User , Answers User Added User Done
Pragy Agarwal 790, 27 makhdoom ghaya 223 Arjun Suresh 68
Umang Raman 440, 24 Arjun Suresh 60 kenzou 44
Arjun Suresh 425, 34 GO Editor 57 soujanyareddy13 39
srestha 372, 20 Lakshman Patel 38 Milicevic3306 34
Anurag Pandey 325, 15 soujanyareddy13 27 Naveen Kumar 33
Himanshu Agarwal 301, 10 admin 8 Pavan Singh 18
Praveen Saini 191, 7 Rohit Gupta 4 Lakshman Patel 9
Riya Roy(Arayana) 188, 6 JATIN MITTAL 8
Pooja Palod 145, 9 Rupendra Choudhary 6
tarun_svbk 122, 8 Manoja Rajalakshmi 6
Kapil Phulwani 110, 4 Aravindakshan
Akash Kanase 98, 7 ankitgupta.1729 6
Shaun Patel 77, 3 Ajay kumar soni 6
Sachin Mittal 74, 2 Sudeshna Chaudhuri 5
Ayush Upadhyaya 70, 2 Shikha Mallick 5
Utkarsh Joshi 63, 3 Akash Dinkar 5
Anu007 63, 5 gatecse 4
Avdhesh Singh Rana 59, 2 Krithiga2101 4
Motamarri Anusha 57, 4 Subarna Das 3
Prajwal Bhat 53, 3 Sukanya Das 3
Leen Sharma 52, 2 Sourajit25 3
venky.victory35 51, 3 Puja Mishra 3
Hemant Parihar 47, 2 Motamarri Anusha 2
Saurav Shrivastava 46, 3 Debashish Deka 2
Debashish Deka 44, 4 Nikhil Dhama 2
Sourav Basu 43, 1 Sayan Bose 2
sudipta roy 42, 2 Gyanendra Singh 2
ankitgupta.1729 42, 17 Kapil Phulwani 2
Mk Utkarsh 40, 3 afroze 2
Ahwan Mishra 39, 2 krish__ 2
Shobhit Joshi 38, 3 Arun Madhav 2
ZAHID WAKEEL 37, 3 Pragy Agarwal 2
Shivansh Gupta 36, 3 Sachin Mittal 2
Manoja Rajalakshmi severustux 1
Aravindakshan Himanshu Agarwal 1
36, 8 srestha 1
Ashwani Kumar 35, 5 Satbir Singh 1
Dhananjay Kumar 34, 3 Mk Utkarsh 1
Sharma Chandrashis Mazumdar 1
Rupendra Choudhary 33, 4 Manu Thakur 1
Lakshman Patel 33, 5 Hemant Parihar 1
Prateek Dwivedi 32, 2 Lotan Chatterjee 1
papesh 29, 1 Cringe is my middle 1
Digvijay 28, 3 name...
yes 27, 1 PandurangaVitthal 1
Sujit Kumar Muduli 27, 1 noobnoob 1
Rameez Raza 27, 2 Ashish verma 1
minal 26, 1 Amartyap 1
sonu 25, 2 Prateek Dwivedi 1
pramod 25, 2 Soumya Jain 1
Gokulnath 25, 2 Tushar Kadam 1
kunal chalotra 24, 3 SHIVESH KUMAR 1
Manu Thakur 23, 1 ROY
sarveswara rao vangala 23, 1 Shiva Sagar Rao 1
Shreya Roy 22, 1 khamer 1
krish__ 22, 3 Umang Raman 1
Amar Vashishth 21, 1 Pooja Palod 1
Manish Joshi 21, 2 Shivansh Gupta 1
HABIB MOHAMMAD 21, 2 Resmi A.C. 1
KHAN Shobhit Joshi 1
Mehak Sharma 20, 1 Shaik Masthan 1
Ravi Singh 19, 1 KUSHAGRA गु ा 1
Mari Ganesh Kumar 19, 1 Pooja Khatri 1
Aghori 18, 4
Happy Mittal 17, 1
Vidhi Sethi 17, 1
Prabhanjan_1 17, 1
Jagdish Singh 17, 1
Ashish verma 17, 1
Prashant Singh 16, 1
Vikranth Inti 16, 2
Shubhgupta 16, 2
1 Algorithms (57)

1.1 Algorithm Design (1) top☝

1.1.1 Algorithm Design: TIFR CSE 2011 | Part B | Question: 29 top☝

You are given ten rings numbered from to , and three pegs labeled , , and . Initially all
the rings are on peg , arranged from top to bottom in ascending order of their numbers. The
goal is to move all the rings to peg 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. B. C. D. E. None of the above.


tifr2011 algorithms algorithm-design

Answer key☟

1.2 Asymptotic Notations (9) top☝

1.2.1 Asymptotic Notations: TIFR CSE 2011 | Part B | Question: 27 top☝

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

A.

B.

C.

D.

E.

tifr2011 asymptotic-notations

Answer key☟

1.2.2 Asymptotic Notations: TIFR CSE 2012 | Part B | Question: 6 top☝

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

A. B.
C. D.
E.
tifr2012 algorithms asymptotic-notations

Answer key☟

1.2.3 Asymptotic Notations: TIFR CSE 2014 | Part B | Question: 8 top☝

Which of these functions grows fastest with ?

A. . B. .
C. . D. .
E. None of the above.
tifr2014 algorithms asymptotic-notations

Answer key☟

1.2.4 Asymptotic Notations: TIFR CSE 2016 | Part B | Question: 7 top☝

Let . Which of the following is TRUE?

A.
B. but not
C.
D. but not
E.

tifr2016 asymptotic-notations

Answer key☟

1.2.5 Asymptotic Notations: TIFR CSE 2017 | Part A | Question: 4 top☝

Which of the following functions asymptotically grows the fastest as goes to infinity?

A. B.
C. D.
E.
tifr2017 algorithms asymptotic-notations

Answer key☟

1.2.6 Asymptotic Notations: TIFR CSE 2018 | Part A | Question: 3 top☝

Which of the following statements is TRUE for all sufficiently large integers n ?

A.
B.
C.
D.
E.

tifr2018 algorithms asymptotic-notations

Answer key☟

1.2.7 Asymptotic Notations: TIFR CSE 2018 | Part B | Question: 5 top☝

Which of the following functions, given by there recurrence, grows the fastest asymptotically?

A.
B.
C.
D.
E. They all are asymptotically the same
tifr2018 asymptotic-notations recurrence-relation

Answer key☟

1.2.8 Asymptotic Notations: TIFR CSE 2019 | Part B | Question: 5 top☝

Stirling’s approximation for states for some constants

What are the tightest asymptotic bounds that can be placed on

A. B.
C. D.
E.
tifr2019 algorithms asymptotic-notations

Answer key☟

1.2.9 Asymptotic Notations: TIFR CSE 2020 | Part B | Question: 10 top☝

Among the following asymptotic expressions, which of these functions grows the slowest (as a
function of ) asymptotically?

A. B.
C. D.
E.
tifr2020 algorithms asymptotic-notations time-complexity

Answer key☟

1.3 Binary Search (1) top☝

1.3.1 Binary Search: TIFR CSE 2019 | Part A | Question: 5 top☝

Asha and Lata play a game in which Lata first thinks of a natural number between and .
Asha must find out that number by asking Lata questions, but Lata can only reply by saying
“Yes” or “no”. Assume that Lata always tells the truth. What is the least number of questions that Asha
needs to ask within which she can always find out the number Lata has thought of?

A. B. C. D. E.
tifr2019 algorithm-design binary-search

Answer key☟

1.4 Graph Algorithms (3) top☝

1.4.1 Graph Algorithms: TIFR CSE 2013 | Part B | Question: 15 top☝

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

A. B. but not
C. but not D. but not
E. but not
tifr2013 graph-algorithms
Answer key☟

1.4.2 Graph Algorithms: TIFR CSE 2013 | Part B | Question: 5 top☝

Given a weighted directed graph with 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. B. but not
C. but not D. but not
E. but not
tifr2013 algorithms graph-algorithms

Answer key☟

1.4.3 Graph Algorithms: TIFR CSE 2014 | Part B | Question: 3 top☝

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 , the
number of back edges is and the number of cross edges is . Then

A. , , and . B. , , and .
C. , , and . D. , , and .
E. , , and .
tifr2014 algorithms graph-algorithms

Answer key☟

1.5 Identify Function (4) top☝

1.5.1 Identify Function: TIFR CSE 2010 | Part B | Question: 24 top☝

Consider the following program operating on four variables , and two constants and
.
x, y, u, v:= X, Y, Y, X;
While (x ≠ y)
do
if (x > y) then x, v := x - y, v + u;
else if (y > x) then y, u:= y - x, u + v;
od;
print ((x + y) / 2); print ((u + v) / 2);

Given , pick the true statement out of the following:

A. The program prints and the first prime larger than both and .
B. The program prints followed by .
C. The program prints followed by .
D. The program prints followed by .
E. The program does none of the above.

tifr2010 algorithms identify-function


Answer key☟

1.5.2 Identify Function: TIFR CSE 2014 | Part B | Question: 2 top☝

Consider the following code.


def brian(n):
count = 0

while ( n ! = 0 )
n = n & ( n-1 )
count = count + 1

return count

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

A. The highest power of dividing , but zero if is zero.


B. The number obtained by complementing the binary representation of .
C. The number of ones in the binary representation of .
D. The code might go into an infinite loop for some .
E. The result depends on the number of bits used to store unsigned integers.

tifr2014 algorithms identify-function

Answer key☟

1.5.3 Identify Function: TIFR CSE 2014 | Part B | Question: 20 top☝

Consider the following game. There is a list of distinct numbers. At any round, a player
arbitrarily chooses two numbers from the list and generates a new number by subtracting
the smaller number from the larger one. The numbers and are put back in the list. If the number is
non-zero and is not yet in the list, 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: and
. What is the score of the best player for this game?

A. B. C. D. E.
tifr2014 algorithms identify-function

Answer key☟

1.5.4 Identify Function: TIFR CSE 2017 | Part A | Question: 12 top☝

Consider the following program modifying an square matrix :


for i=1 to n:
for j=1 to n:
temp=A[i][j]+10
A[i][j]=A[j][i]
A[j][i]=temp-10
end for
end for

Which of the following statements about the contents of matrix at the end of this program must be
TRUE?
A. the new is the transpose of the old
B. all elements above the diagonal have their values increased by and all the values below have
their values decreased by
C. all elements above the diagonal have their values decreased by and all the values below have
their values increased by
D. the new matrix is symmetric, that is, for all
E. remains unchanged

tifr2017 algorithms identify-function

Answer key☟

1.6 Maximum Minimum (3) top☝

1.6.1 Maximum Minimum: TIFR CSE 2014 | Part B | Question: 10 top☝

Given a set of 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 comparisons.


B. comparisons do not suffice, however these two elements can be determined using
comparisons.
C. comparisons do not suffice, however these two elements can be determined using
comparisons.
D. comparisons do not suffice, however these two elements can be determined using
comparisons.
E. None of the above.

tifr2014 algorithms maximum-minimum

Answer key☟

1.6.2 Maximum Minimum: TIFR CSE 2014 | Part B | Question: 6 top☝

Consider the problem of computing the minimum of a set of distinct numbers. We choose
a permutation uniformly at random (i.e., each of the n! permutations of is chosen
with probability 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.

What is the expected number of times MIN is updated?

A. B. C. D. E.
tifr2014 algorithms maximum-minimum

Answer key☟

1.6.3 Maximum Minimum: TIFR CSE 2014 | Part B | Question: 9 top☝

Given a set of 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 comparisons.


B. comparisons do not suffice, however these three elements can be determined using
comparisons.
C. comparisons do not suffice, however these three elements can be determined using
comparisons.
D. comparisons do not suffice, however these three elements can be determined using
comparisons.
E. None of the above.

tifr2014 algorithms maximum-minimum

Answer key☟

1.7 Minimum Spanning Tree (2) top☝

1.7.1 Minimum Spanning Tree: TIFR CSE 2018 | Part B | Question: 13 top☝

Let and let be a simple, connected, undirected graph with the same number of
vertices and edges. Each edge of has a distinct real weight associated with it. Let be the
minimum weight spanning tree of Which of the following statements is NOT ALWAYS TRUE ?

A. The minimum weight edge of is in


B. The maximum weight edge of is not in
C. has a unique cycle and the minimum weight edge of is also in
D. has a unique cycle and the maximum weight edge of is not in
E. can be found in time from the adjacency list representation of

tifr2018 graph-algorithms minimum-spanning-tree

Answer key☟

1.7.2 Minimum Spanning Tree: TIFR CSE 2019 | Part B | Question: 2 top☝

How many distinct minimum weight spanning trees does the following undirected, weighted
graph have ?

A. B. C. D. E. None of the above


tifr2019 algorithms minimum-spanning-tree

Answer key☟

1.8 P Np Npc Nph (9) top☝

1.8.1 P Np Npc Nph: TIFR CSE 2010 | Part B | Question: 39 top☝

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

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

tifr2010 algorithms p-np-npc-nph

Answer key☟

1.8.2 P Np Npc Nph: TIFR CSE 2011 | Part B | Question: 37 top☝

Given an integer , consider the problem of determining if there exist integers


such that . Call this the forward problem. The reverse problem is: given and , compute
(mod b). Note that the input length for the forward problem is , while the input length for
the reverse problem is . 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 -hard.
C. The reverse problem can be solved in polynomial time, however the forward problem is -hard.
D. Both the forward and reverse problem are -hard.
E. None of the above.

tifr2011 algorithms p-np-npc-nph

Answer key☟

1.8.3 P Np Npc Nph: TIFR CSE 2012 | Part B | Question: 20 top☝

This question concerns the classes and If you are familiar with them, you may skip
the definitions and go directly to the question.
Let be a set. We say that is in if there is some algorithm which given input decides if is in
or not in time bounded by a polynomial in the length of For example, the set of all connected graphs
is in 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 is a superset of class It contains those sets that have membership witnesses that
can be verified in polynomial time. For example, the set of composite numbers is in 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 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 is a set in consisting of elements of the form then the set

is in N P .
Let be a graph. is said to have perfect matching if there is a subset of the edges of
so that

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


ii. Every vertex of has an edge in

Let be the set of all graphs that have a perfect matching. Let be the set of graphs
that do not have a perfect matching. Let be the number of components of that have an odd
number of vertices.
if and only if for all subsets of the number of components in
(the graph formed by deleting the vertices in with an odd number of vertices is at most
That is,

Which of the following is true?

A. B.
C. D.
E. none of the above
tifr2012 algorithms p-np-npc-nph

Answer key☟

1.8.4 P Np Npc Nph: TIFR CSE 2013 | Part B | Question: 7 top☝

Which of the following is not implied by ?

A. SAT 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

Answer key☟

1.8.5 P Np Npc Nph: TIFR CSE 2015 | Part B | Question: 13 top☝

Two undirected graphs and are said to be isomorphic if there


exist a bijection such that for all if and only
. Consider the following language.
L={(G, H)| and are undirected graphs such that a subgraph of is isomorphic to }
Then which of the following are true?
(i) .
(ii) is - hard.
(iii) is undecidable.

A. Only B. Only C. Only D. and E. and


tifr2015 p-np-npc-nph non-gate

Answer key☟

1.8.6 P Np Npc Nph: TIFR CSE 2017 | Part B | Question: 15 top☝

A multivariate polynomial in variables with integer coefficients has a binary root if it is possible
to assign each variable either 0 or 1, so that the polynomial evaluates to 0. For example, the
multivariate polynomial has the binary root . Then determining
whether a multivariate polynomial, given as the sum of monimials, has a binary root:

A. is trivial: every polynomial has a B. can be done in polynomial time


binary root
C. is NP-hard, but not in NP D. is in NP, but not in P and not NP-
hard
E. is both in NP and NP-hard
tifr2017 algorithms p-np-npc-nph

Answer key☟

1.8.7 P Np Npc Nph: TIFR CSE 2017 | Part B | Question: 2 top☝

Consider the following statements:

i. Checking if a given graph has a cycle is in


ii. Checking if a given graph has a cycle is in
iii. Checking if a given graph has a cycle is in
iv. Checking if a given graph has a cycle is in

Which of the above statements is/are TRUE? Choose from the following options.

A. Only i and ii B. Only ii and iv C. Only ii, iii, and iv D. Only i, ii and iv E. All of them
tifr2017 algorithms p-np-npc-nph

Answer key☟

1.8.8 P Np Npc Nph: TIFR CSE 2018 | Part B | Question: 15 top☝

respresents an undirected graph and a cycle refers to a simple cycle (no repeated edges or
vertices).
Define the following two languages.

and

Which of the following is NOT known to be TRUE (to the best of our current knowledge) ?

A.
B.
C. (i.e, there is a polynomial time many-to -one reduction
from to ).
D. is NP-complete.
E. (i.e, there is a polynomial time many-to-one reduction
from to ).

tifr2018 algorithms p-np-npc-nph non-gate

Answer key☟

1.8.9 P Np Npc Nph: TIFR CSE 2019 | Part B | Question: 7 top☝

A formula is said to be a -CF-formula if it is a conjunction (i.e., an AND) of clauses, and each


clause has at most literals. Analogously, a formula is said to be a -DF-formula if it is a
disjunction (i.e., an OR) of clauses of at most literals each.
Define the languages -CF-SAT and -DF-SAT as follows:

Which of the following best represents our current knowledge of these languages ?
A. Both and are in NP but only is NP-complete
B. Both and are in NP-complete
C. Both and are in P
D. Both and are in NP but only is NP-complete
E. Neither nor are in P

tifr2019 algorithms p-np-npc-nph

Answer key☟

1.9 Quick Sort (1) top☝

1.9.1 Quick Sort: TIFR CSE 2018 | Part B | Question: 7 top☝

Consider the recursive quicksort algorithm with "random pivoting". That is, in each recursive call,
a pivot is chosen uniformly at random from the sub-array being sorted.When this randomized
algorithm is applied to an array of size all whose elements are distinct, what is the probability that the
smallest and the largest elements in the array are compared during a run of the algorithm ?

A. B.

C. D.

E.

tifr2018 algorithms sorting quick-sort

Answer key☟

1.10 Recurrence Relation (3) top☝

1.10.1 Recurrence Relation: TIFR CSE 2014 | Part B | Question: 11 top☝

Consider the following recurrence relation:

Which of the following statements is FALSE?

A. is when . B. is when .
C. is when . D. is when .
E. is when .
tifr2014 algorithms recurrence-relation

Answer key☟

1.10.2 Recurrence Relation: TIFR CSE 2015 | Part B | Question: 1 top☝

Consider the following recurrence relation:

Which of the following statements is TRUE?

A. is .
B. is but not .
C. is but not .
D. is but not .
E. is but not .

tifr2015 algorithms recurrence-relation time-complexity

Answer key☟

1.10.3 Recurrence Relation: TIFR CSE 2017 | Part A | Question: 15 top☝

Let be the function with two arguments (both nonnegative integral powers of 2) defined
by the following recurrence:

;
;
;
.

What is ?

A. B.

C. D.

E. if , otherwise
tifr2017 algorithms recurrence-relation

Answer key☟

1.11 Searching (2) top☝

1.11.1 Searching: TIFR CSE 2010 | Part B | Question: 29 top☝

Suppose you are given an array with numbers.


The numbers in odd positions are sorted in ascending order, that is,
.
The numbers in even positions are sorted in descending order, that is, .
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.

tifr2010 searching

Answer key☟

1.11.2 Searching: TIFR CSE 2012 | Part B | Question: 11 top☝

Consider the following three version of the binary search program. Assume that the elements of
type 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 whenever such an
element exists, or it terminates with if there exists no array element with value . Which of the
following statements is correct?

A. Only Program is correct B. Only Program is correct


C. Only Program and are correct. D. Both Program and are correct
E. All the three programs are wrong
tifr2012 algorithms searching

Answer key☟

1.12 Shortest Path (1) top☝

1.12.1 Shortest Path: TIFR CSE 2018 | Part B | Question: 9 top☝

Let be a DIRECTED graph, where each edge has a positive weight and
all vertices can be reached from vertex For each vertex let be the length of the
shortest path from to Let be a new weighted graph with the same vertices and
edges, but with the edge weight of every edge changed to
Let be a path from to a vertex and let
and
Which of the following options is NOT NECESSARILY TRUE ?

A. If is a shortest path in then is a shortest path in


B. If is a shortest path in then P is a shortest path in
C. If is a shortest path in then
D. If is NOT a shortest path in then
E. All of the above options are necessarily TRUE.

tifr2018 graph-algorithms shortest-path

Answer key☟

1.13 Sorting (9) top☝

1.13.1 Sorting: TIFR CSE 2010 | Part B | Question: 23 top☝

Suppose you are given 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 . B. but not better.


C. D. Same as heap sort.
E. but not better.
tifr2010 algorithms time-complexity sorting

Answer key☟

1.13.2 Sorting: TIFR CSE 2010 | Part B | Question: 27 top☝

Consider the Insertion Sort procedure given below, which sorts an array of size in
ascending order:
begin
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 comparisons. Which of the following is true?

A. There is no input on which insertion Sort makes comparisons.


B. Insertion Sort makes comparisons when the input is already sorted in ascending order.
C. Insertion Sort makes comparisons only when the input is sorted in descending order.
D. There are more than one input orderings where insertion sort makes comparisons.
E. Insertion Sort makes comparisons whenever all the elements of are not distinct.

tifr2010 algorithms sorting

Answer key☟

1.13.3 Sorting: TIFR CSE 2011 | Part B | Question: 21 top☝

Let be a set of numbers. Consider the problem of storing the elements of


in an array such that the following min-heap property is maintained for all
. (Note that is the largest integer that is at most ). Which of the
following statements is TRUE?

A. This problem can be solved in time.


B. This problem can be solved in time but not in time.
C. This problem can be solved in time but not in time.
D. This problem can be solved in time but not in time.
E. None of the above.

tifr2011 algorithms sorting

Answer key☟

1.13.4 Sorting: TIFR CSE 2011 | Part B | Question: 31 top☝

Given a set of 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 comparisons.


B. Both these elements can be determined using comparisons.
C. Both these elements can be determined using comparisons.
D. comparisons are necessary to determine these two elements.
E. comparisons are necessary to determine these two elements.

tifr2011 algorithms sorting

Answer key☟

1.13.5 Sorting: TIFR CSE 2011 | Part B | Question: 39 top☝

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

A. At least comparisons are necessary in the worst case.


B. At least comparisons are necessary in the worst case.
C. comparisons suffice.
D. comparisons suffice.
E. comparisons suffice.

tifr2011 algorithms sorting

Answer key☟

1.13.6 Sorting: TIFR CSE 2012 | Part B | Question: 13 top☝

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

A. can be sorted with constant comparison but not with fewer comparisons.
B. cannot be sorted with less than constant comparisons.
C. can be sorted with constant comparisons.
D. can be sorted with constant comparisons but not with fewer comparisons.
E. can be sorted with constant comparisons but not fewer.

tifr2012 algorithms sorting

Answer key☟

1.13.7 Sorting: TIFR CSE 2012 | Part B | Question: 14 top☝

Consider the quick sort algorithm on a set of 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


B. The running time of the algorithm is .
C. The running time of the algorithm is .
D. The running time of the algorithm is .
E. None of the above.

tifr2012 algorithms sorting

Answer key☟
1.13.8 Sorting: TIFR CSE 2013 | Part B | Question: 20 top☝

Suppose 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 should have the minimum value and the the processor 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. steps B. steps
C. steps D. steps
E. The algorithm is not guaranteed to
sort
tifr2013 algorithms sorting

Answer key☟

1.13.9 Sorting: TIFR CSE 2017 | Part B | Question: 7 top☝

An array of distinct elements is said to be un-sorted if for every index such that
, either , or .
What is the time-complexity of the fastest algorithm that takes as input a sorted array with distinct
elements, and un-sorts ?

A. but not B. but not


C. but not D. but not
E.
tifr2017 algorithms sorting

Answer key☟

1.14 Spanning Tree (5) top☝

1.14.1 Spanning Tree: TIFR CSE 2011 | Part B | Question: 35 top☝

Let be a connected simple graph (no self-loops or parallel edges) on vertices, with
distinct edge weights. Let be an ordering of the edges in decreasing order of
weight. Which of the following statements is FALSE?

A. The edge has to be present in every maximum weight spanning tree.


B. Both and have to be present in every maximum weight spanning tree.
C. The edge has to be present in every minimum weight spanning tree.
D. The edge is never present in any maximum weight spanning tree.
E. has a unique maximum weight spanning tree.

tifr2011 algorithms graph-algorithms spanning-tree

Answer key☟

1.14.2 Spanning Tree: TIFR CSE 2013 | Part B | Question: 17 top☝

In a connected weighted graph with vertices, all the edges have distinct positive integer
weights. Then, the maximum number of minimum weight spanning trees in the graph is
A. B.
C. equal to number of edges in the D. equal to maximum weight of an
graph. edge of the graph.
E.
tifr2013 spanning-tree

Answer key☟

1.14.3 Spanning Tree: TIFR CSE 2014 | Part B | Question: 4 top☝

Consider the following undirected graph with some edge costs missing.

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

A. cost . B. cost .
C. cost . D. cost .
E. cost .
tifr2014 algorithms graph-algorithms spanning-tree

Answer key☟

1.14.4 Spanning Tree: TIFR CSE 2014 | Part B | Question: 5 top☝

Let be an undirected connected simple (i.e., no parallel edges or self-loops)


graph with the weight function on its edge set. Let ,
where . Suppose is a minimum spanning tree of . Which of the following
statements is FALSE?

A. The tree has to contain the edge .


B. The tree has to contain the edge .
C. The minimum weight edge incident on each vertex has to be present in .
D. is the unique minimum spanning tree in .
E. If we replace each edge weight by its square , then must still be a minimum
spanning tree of this new instance.

tifr2014 algorithms spanning-tree

Answer key☟
1.14.5 Spanning Tree: TIFR CSE 2015 | Part B | Question: 2 top☝

Consider the following undirected connected graph 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 .

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 spanning-tree algorithms graph-algorithms

Answer key☟

1.15 Time Complexity (4) top☝

1.15.1 Time Complexity: TIFR CSE 2013 | Part B | Question: 12 top☝

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

A. B. but not
C. but not D. but not
E. but not
tifr2013 algorithms time-complexity

Answer key☟

1.15.2 Time Complexity: TIFR CSE 2013 | Part B | Question: 18 top☝

Let be a set of numbers. For , the rank of is the number of elements in that are
less than or equal to . The procedure takes a set of numbers and a rank
and returns the element in of rank . The procedure takes a set
of numbers and a list of ranks , and returns the list
of elements of , such that the rank of is . Suppose there is an
implementation for that uses at most constant · binary comparisons between
elements of . The minimum number of comparisons needed to implement is

A. constant · B. constant ·
C. constant · D. constant ·
E. constant ·
tifr2013 algorithms time-complexity

Answer key☟

1.15.3 Time Complexity: TIFR CSE 2014 | Part B | Question: 7 top☝

Which of the following statements is TRUE for all sufficiently large ?

A.

B.

C.

D.

E.

tifr2014 algorithms time-complexity

Answer key☟

1.15.4 Time Complexity: TIFR CSE 2015 | Part B | Question: 3 top☝

Consider the following code fragment in the programming language when run on a non-
negative integer .
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 but the optimal running time is exponential in .
B. This algorithm runs in exponential time in and the optimal running time is exponential in .
C. This algorithm runs in exponential time in but the optimal running time is polynomial in .
D. This algorithm runs in polynomial time in and the optimal running time is polynomial in .
E. The algorithm does not terminate.

tifr2015 time-complexity

Answer key☟

Answer Keys
1.1.1 B 1.2.1 D 1.2.2 C 1.2.3 D 1.2.4 A
1.2.5 B 1.2.6 A 1.2.7 C 1.2.8 D 1.2.9 E
1.3.1 A 1.4.1 C 1.4.2 D 1.4.3 D 1.5.1 B
1.5.2 C 1.5.3 D 1.5.4 E 1.6.1 C 1.6.2 B
1.6.3 C 1.7.1 B 1.7.2 D 1.8.1 E 1.8.2 A
1.8.3 C 1.8.4 B 1.8.5 D 1.8.6 E 1.8.7 E
1.8.8 C 1.8.9 A 1.9.1 B 1.10.1 B 1.10.2 B
1.10.3 D 1.11.1 D 1.11.2 E 1.12.1 E 1.13.1 B
1.13.2 D 1.13.3 B 1.13.4 C 1.13.5 D 1.13.6 D
1.13.7 B 1.13.8 C 1.13.9 B 1.14.1 D 1.14.2 A
1.14.3 A 1.14.4 E 1.14.5 E 1.15.1 B 1.15.2 E
1.15.3 A 1.15.4 C
2 Compiler Design (3)

2.1 Parsing (3) top☝

2.1.1 Parsing: TIFR CSE 2012 | Part B | Question: 17 top☝

Which of the following correctly describes parsing?

A. The input string is alternately scanned left to right and right to left with reversals.
B. Input string is scanned once left to right with rightmost derivation and symbol look-ahead.
C. grammers are expressively as powerful as context-free grammers.
D. Parser makes left-to-right passes over input string.
E. Input string is scanned from left to right once with symbol to the right as look-ahead to give left-
most derivation.

tifr2012 compiler-design parsing

Answer key☟

2.1.2 Parsing: TIFR CSE 2012 | Part B | Question: 8 top☝

Consider the parse tree

Assume that has higher precedence than , and operators associate right to left (i.e
. Consider

i.
ii.
iii.
iv.

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

Answer key☟
2.1.3 Parsing: TIFR CSE 2015 | Part B | Question: 15 top☝

Consider the following grammar (the start symbol is ) for generating expressions.

With respect to this grammar, which of the following trees is the valid evaluation tree for the expression
?

A.
B.

D.
C.

E.
tifr2015 parsing

Answer key☟

Answer Keys
2.1.1 B 2.1.2 E 2.1.3 B
3 Computer Networks (1)

3.1 Network Security (1) top☝

3.1.1 Network Security: TIFR CSE 2011 | Part B | Question: 36 top☝

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

Answer key☟

Answer Keys
3.1.1 D
4 Databases (2)

4.1 Relational Algebra (2) top☝

4.1.1 Relational Algebra: TIFR CSE 2010 | Part B | Question: 33 top☝

In a relational database there are three relations:

Then the Relational Algebra expression ( is the projection operator).

returns the names of

A. Customers who buy from at least B. Customers who buy from at least
one shop. 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

Answer key☟

4.1.2 Relational Algebra: TIFR CSE 2013 | Part B | Question: 19 top☝

In a relational database there are three relations:

,
,
.

Which of the following relational algebra expressions returns the names of shops that have no
customers at all? [Here is the projection operator.]

A. B.
C. D.
E. None of the above
tifr2013 databases relational-algebra

Answer key☟

Answer Keys
4.1.1 C 4.1.2 C
5 Digital Logic (11)

5.0.1 TIFR CSE 2020 | Part B | Question: 1 top☝

Consider the followingvalued Boolean


function on Boolean variables:
, where addition is over integers, mapping
to and to Consider Boolean circuits (with no feedback) that use only logical and
gates, and where each gate has two input bits, each of which is either an input bit of or the
output bit of some other gate of the circuit. The circuit has a distinguished gate whose value is the
output of the circuit. The minimum size of such a circuit computing (asymptotically in ) is :

A. B. , for some fixed constant


C. , but D.
E. None of the others
tifr2020

5.1 Boolean Algebra (4) top☝

5.1.1 Boolean Algebra: TIFR CSE 2010 | Part B | Question: 21 top☝

For , let denote the negation of , that is

.
If , then denotes the component wise negation of ; that is:

Consider a circuit , computing a function using AND , OR ,and NOT


gates. Let be the circuit obtained from by replacing each A N D gate by an O R gate and
replacing each OR gate by an AND. Suppose computes the function . Which of the following is true
for all inputs ?

A. B.
C. D.
E. None of the above.
tifr2010 digital-logic boolean-algebra

Answer key☟

5.1.2 Boolean Algebra: TIFR CSE 2014 | Part B | Question: 17 top☝

Let be a boolean function computed by a logical circuit comprising just


binary AND and binary OR gates (assume that the circuit does not have any feedback). Let
PARITY : be the boolean function that outputs if the total number of input bits set
to is odd. Similarly, let MAJORITY be the boolean function that outputs if the number of input bits
that are set to is at least as large as the number of input bits that are set to . Then, which of the
following is NOT possible?

A. .
B.
C. is the MAJORITY function.
D. is the PARITY function.
E. outputs at exactly one assignment of the input bits.

tifr2014 boolean-algebra

Answer key☟

5.1.3 Boolean Algebra: TIFR CSE 2016 | Part B | Question: 1 top☝

A Boolean formula is said to be a if it evaluates to TRUE for all assignments to its


variables. Which one of the following is NOT a tautology?

A.
B.
C.
D.
E.

tifr2016 boolean-algebra

Answer key☟

5.1.4 Boolean Algebra: TIFR CSE 2020 | Part B | Question: 15 top☝

Suppose are ten Boolean variables each of which can take


the value TRUE or FLASE. Recall the Boolean XOR . Define
the Boolean logic formulas

A truth assignment to the ten Boolean variables is said to be a satisfying


assignment if takes the value TRUE for example,

is a satisfying assignment,

is another satisfying assignment, while

is not a satisfying assignment.


How many satisfying assignments does have?

A. B. C. D. E.

tifr2020 digital-logic boolean-algebra

Answer key☟
5.2 Canonical Normal Form (1) top☝

5.2.1 Canonical Normal Form: TIFR CSE 2015 | Part B | Question: 9 top☝

A Boolean expression is an expression made out of propositional letters (such as ) and


operators , and ; e.g. . 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.
. 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.
. Which of the following is not correct?

A. Every Boolean expression is equivalent to an expression in 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

Answer key☟

5.3 Digital Circuits (1) top☝

5.3.1 Digital Circuits: TIFR CSE 2015 | Part A | Question: 4 top☝

The Boolean function obtained by adding an inverter to each and every input of an gate
is:

A. B. C. D. E. None of the above


tifr2015 digital-logic digital-circuits

Answer key☟

5.4 Gray Code (1) top☝

5.4.1 Gray Code: TIFR CSE 2017 | Part B | Question: 8 top☝

For any natural number , an ordering of all binary strings of length is a Gray code if it starts
with , and any successive strings in the ordering differ in exactly one bit (the first and last
string must also differ by one bit). Thus, for , the ordering (000, 100, 101, 111, 110, 010, 011,
001) is a Gray code. Which of the following must be TRUE for all Gray codes over strings of length ?

A. the number of possible Gray codes is even


B. the number of possible Gray codes is odd
C. In any Gray code, if two strings are separated by other strings in the ordering, then they must
differ in exactly bits
D. In any Gray code, if two strings are separated by other strings in the ordering, then they must
differ in exactly bits
E. none of the above

tifr2017 digital-logic binary-codes gray-code

Answer key☟

5.5 Number Representation (2) top☝


5.5.1 Number Representation: TIFR CSE 2011 | Part A | Question: 16 top☝

A variable that takes thirteen possible values can be communicated using?

A. Thirteen bits. B. Three bits.


C. bits. D. Four bits.
E. None of the above.
tifr2011 number-representation

Answer key☟

5.5.2 Number Representation: TIFR CSE 2019 | Part B | Question: 1 top☝

Which of the following decimal numbers can be exactly represented in binary notation with a
finite number of bits ?

A. B. C. D. E. All the above


tifr2019 digital-logic number-representation

Answer key☟

5.6 Number System (1) top☝

5.6.1 Number System: TIFR CSE 2020 | Part B | Question: 3 top☝

Consider the (decimal) number , whose binary representation is . How many


positive integers are there in the following set?

A. B. C. D. E.
tifr2020 digital-logic number-system number-representation

Answer key☟

Answer Keys
5.0.1 E 5.1.1 D 5.1.2 D 5.1.3 B 5.1.4 B
5.2.1 E 5.3.1 D 5.4.1 A 5.5.1 D 5.5.2 D
5.6.1 C
6 Discrete Mathematics: Combinatory (16)

6.0.1 TIFR CSE 2011 | Part A | Question: 2 top☝

In how many ways can the letters of the word be rearranged such that the vowels
always appear together?

A. B. C. D. E. None of the above

tifr2011 combinatory

Answer key☟

6.0.2 TIFR CSE 2012 | Part A | Question: 10 top☝

In how many different ways can elements be picked from a set of 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?

A. and , respectively. B. and , respectively.

C. and , respectively. D. and , respectively.


E. and , respectively.
tifr2012 combinatory discrete-mathematics normal

Answer key☟

6.0.3 TIFR CSE 2015 | Part A | Question: 7 top☝

A chessboard has one square, a chessboard has five squares. Continuing along
this fashion, what is the number of squares on the regular chessboard?

A. B. C. D. E.
tifr2015 combinatory

Answer key☟

6.0.4 TIFR CSE 2017 | Part A | Question: 6 top☝

How many distinct words can be formed by permuting the letters of the word
?

A. B. C. D. E.
tifr2017 combinatory discrete-mathematics easy

Answer key☟

6.0.5 TIFR CSE 2016 | Part A | Question: 15 top☝

In a tournament with teams, each team plays one match with every other team. For each
match, the team earns two points if it wins, one point if it ties, and no points if it loses. At the end
of all matches, the teams are ordered in the descending order of their total points (the order among the
teams with the same total are determined by a whimsical tournament referee). The first three teams in
this ordering are then chosen to play in the next round. What is the minimum total number of points a
team must earn in order to be guaranteed a place in the next round?
A. B. C. D. E.
tifr2016 combinatory discrete-mathematics normal

Answer key☟

6.0.6 TIFR CSE 2019 | Part B | Question: 13 top☝

A row of houses has to be painted using the colours red, blue, and green so that each house
is a single colour, and any house that is immediately to the right of a red or a blue house must
be green. How many ways are there to paint the houses?

A. B. C. D. E.
tifr2019 engineering-mathematics discrete-mathematics combinatory

Answer key☟

6.1 Balls In Bins (4) top☝

6.1.1 Balls In Bins: TIFR CSE 2012 | Part A | Question: 7 top☝

It is required to divide the members of a club into disjoint teams of members each. The
teams are not labelled. The number of ways in which this can be done is:

A. B. C. D. E. None of the above


tifr2012 combinatory balls-in-bins

Answer key☟

6.1.2 Balls In Bins: TIFR CSE 2013 | Part A | Question: 9 top☝

There are kingdoms and champions. Each kingdom gets champions. The number of
ways in which this can be done is:

A. B. C. D. E. None of the above


tifr2013 combinatory discrete-mathematics normal balls-in-bins

Answer key☟

6.1.3 Balls In Bins: TIFR CSE 2015 | Part A | Question: 8 top☝

There is a set of people: male and 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. B. C. D. E. None of the above


tifr2015 combinatory discrete-mathematics normal balls-in-bins

Answer key☟

6.1.4 Balls In Bins: TIFR CSE 2017 | Part A | Question: 5 top☝

How many distinct ways are there to split identical coins among three people so that each
person gets at least coins?

A. B.
C. D.
E.
tifr2017 combinatory discrete-mathematics normal balls-in-bins
Answer key☟

6.2 Generating Functions (1) top☝

6.2.1 Generating Functions: TIFR CSE 2010 | Part A | Question: 12 top☝

The coefficient of in the expansion of is.

A. B.
C. D.
E.
tifr2010 generating-functions

Answer key☟

6.3 Modular Arithmetic (1) top☝

6.3.1 Modular Arithmetic: TIFR CSE 2018 | Part B | Question: 1 top☝

What is the remainder when is divided by

A. B. C. D. E.
tifr2018 modular-arithmetic combinatory

Answer key☟

6.4 Pigeonhole Principle (2) top☝

6.4.1 Pigeonhole Principle: TIFR CSE 2014 | Part A | Question: 5 top☝

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. B. C. D. E. None of the above


tifr2014 combinatory discrete-mathematics normal pigeonhole-principle

Answer key☟

6.4.2 Pigeonhole Principle: TIFR CSE 2018 | Part A | Question: 6 top☝

What is the minimum number of students needed in a class to guarantee that there are at least
students whose birthdays fall in the same month ?

A. B. C. D. E.
tifr2018 pigeonhole-principle combinatory

Answer key☟

6.5 Recurrence Relation (2) top☝

6.5.1 Recurrence Relation: TIFR CSE 2014 | Part A | Question: 3 top☝

The Fibonacci sequence is defined as follows: and for all integers


. Then which of the following statements is FALSE?

A. for any integer


B. for any integer , where is the positive root of .
C. is even, for every integer .
D. is a multiple of , for every integer .
E. is a multiple of , for every integer .

tifr2014 recurrence-relation easy

Answer key☟

6.5.2 Recurrence Relation: TIFR CSE 2017 | Part A | Question: 7 top☝

Consider the sequence defined as follows: and


for . Which of the following statements is FALSE?

A. for every , is even B. for every , is odd


C. for every , is multiple of D. for every , is multiple of

E. none of the above


tifr2017 recurrence-relation

Answer key☟

Answer Keys
6.0.1 D 6.0.2 A 6.0.3 C 6.0.4 A 6.0.5 D
6.0.6 C 6.1.1 C 6.1.2 A 6.1.3 D 6.1.4 E
6.2.1 A 6.3.1 D 6.4.1 D 6.4.2 C 6.5.1 E
6.5.2 C
7 Discrete Mathematics: Graph Theory (17)

7.1 Counting (1) top☝

7.1.1 Counting: TIFR CSE 2017 | Part B | Question: 12 top☝

An undirected graph is complete if there is an edge between every pair of vertices. Given a
complete undirected graph on vertices, in how many ways can you choose a direction for the
edges so that there are no directed cycles?

A. B.
C. D.
E.
tifr2017 graph-theory counting

Answer key☟

7.2 Degree Of Graph (3) top☝

7.2.1 Degree Of Graph: TIFR CSE 2010 | Part B | Question: 36 top☝

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 degree-of-graph

Answer key☟

7.2.2 Degree Of Graph: TIFR CSE 2012 | Part B | Question: 2 top☝

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 ?

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 degree-of-graph

Answer key☟

7.2.3 Degree Of Graph: TIFR CSE 2018 | Part B | Question: 8 top☝

In an undirected graph with vertices, vertex has degree , while each vertex
has degree and the degree of vertex is unknown, Which of the following statement must be
TRUE on the graph ?

A. There is a path from vertex to vertex .


B. There is a path from vertex to each vertex .
C. Vertex has degree .
D. The diameter of the graph is at most
E. All of the above choices must be TRUE

tifr2018 graph-theory degree-of-graph

Answer key☟

7.3 Graph Coloring (5) top☝

7.3.1 Graph Coloring: TIFR CSE 2013 | Part B | Question: 1 top☝

Let be a simple undirected graph on vertices. A colouring of is an assignment


of colours to each vertex such that endpoints of every edge are given different colours. Let
denote the chromatic number of , i.e. the minimum numbers of colours needed for a valid colouring of
. A set is an independent set if no pair of vertices in is connected by an edge. Let be
the number of vertices in a largest possible independent set in . In the absence of any further
information about we can conclude.

A. B.
C. D.
E. None of the above
tifr2013 graph-theory graph-coloring

Answer key☟

7.3.2 Graph Coloring: TIFR CSE 2017 | Part B | Question: 1 top☝

A vertex colouring with three colours of a graph is a mapping


so that adjacent vertices receive distinct colours. Consider the following undirected graph.

How many vertex colouring with three colours does this graph have?

A. B. C. D. E.
tifr2017 graph-theory graph-coloring

Answer key☟

7.3.3 Graph Coloring: TIFR CSE 2017 | Part B | Question: 10 top☝

A vertex colouring of a graph with coulours is a mapping


such that for every . Consider the following statements:

i. If every vertex in has degree at most then admits a vertex coulouring using colours.
ii. Every cycle admits a vertex colouring using colours
iii. Every tree admits a vertex colouring using colours

Which of the above statements is/are TRUE? Choose from the following options:
A. only i B. only i and ii C. only i and iii D. only ii and iii E. i, ii, and iii
tifr2017 graph-theory graph-coloring

Answer key☟

7.3.4 Graph Coloring: TIFR CSE 2018 | Part A | Question: 9 top☝

How many ways are there to assign colours from range to vertices of the
following graph so that adjacent vertices receive distinct colours?

A. B.
C. D.
E.
tifr2018 graph-theory graph-coloring

Answer key☟

7.3.5 Graph Coloring: TIFR CSE 2020 | Part B | Question: 11 top☝

Which of the following graphs are bipartite?

A. Only B. Only
C. Only and D. None of
E. All of
tifr2020 engineering-mathematics graph-theory graph-coloring

Answer key☟

7.4 Graph Connectivity (4) top☝

7.4.1 Graph Connectivity: TIFR CSE 2015 | Part B | Question: 5 top☝

Suppose
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 if the corresponding vertices are connected by an
edge and is otherwise; the same order of vertices is used for the rows and columns. Which of the
graphs below has the above adjacency matrix?

ii.
i.

iii. iv.
A. Only
B. Only
C. Only
D. Only
E. and

tifr2015 graph-connectivity graph-theory

Answer key☟

7.4.2 Graph Connectivity: TIFR CSE 2019 | Part B | Question: 12 top☝

Let be a directed graph with vertices, including a special vertex . Each


edge has a strictly positive edge weight . An arborescence in rooted at is a
subgraph of in which every vertex has a directed path to the special vertex . The
weight of an arborescence is the sum of the weights of the edges in .
Let be a minimum arborescence rooted at , and the weight of . Which of the following is
always true?

A.

B.

C. has exactly edges


D. is acyclic
E. is less than the weight of the minimum weight directed Hamiltonian cycle in , when has a
directed Hamiltonian cycle

tifr2019 graph-connectivity graph-theory difficult

Answer key☟

7.4.3 Graph Connectivity: TIFR CSE 2019 | Part B | Question: 15 top☝

Consider directed graphs on labelled vertices , where each vertex has exactly
one edge coming in and exactly one edge going out. We allow self-loops. How many graphs
have exactly two cycles ?
A. B.

D.
C.

E. None of the above


tifr2019 graph-connectivity graph-theory

Answer key☟

7.4.4 Graph Connectivity: TIFR CSE 2019 | Part B | Question: 3 top☝

A graph is – regular if every vertex has degree . For a – regular graph on vertices, which
of the following must be TRUE?

A. divides B. Both and are even


C. Both and are odd D. At least one of and is odd
E. At least one of and is even
tifr2019 graph-connectivity graph-theory

Answer key☟

7.5 Line Graph (1) top☝

7.5.1 Line Graph: TIFR CSE 2017 | Part B | Question: 13 top☝

For an undirected graph , the line graph is obtained by replacing


each edge in by a vertex, and adding an edge between two vertices in if the corresponding
edges in are incident on the same vertex. Which of the following is TRUE of line graphs?

A. the line graph for a complete graph is complete


B. the line graph for a connected graph is connected
C. the line graph for a bipartite graph is bipartite
D. the maximum degree of any vertex in the line graph is at most the maximum degree in the original
graph
E. each vertex in the line graph has degree one or two

tifr2017 graph-theory line-graph

Answer key☟

7.6 Minimum Spanning Tree (1) top☝

7.6.1 Minimum Spanning Tree: TIFR CSE 2018 | Part B | Question: 3 top☝

How many distinct minimum weight spanning trees does the following undirected, weighted
graph have ?

A. B. C. D. E.
tifr2018 graph-theory minimum-spanning-tree

Answer key☟

7.7 Spanning Tree (1) top☝

7.7.1 Spanning Tree: TIFR CSE 2015 | Part B | Question: 11 top☝

Let be the complete graph on vertices labeled with edges.


What is the number of spanning trees of ?

A. B. C. D. E. None of the above


tifr2015 graph-theory spanning-tree

Answer key☟

7.8 Tree (1) top☝

7.8.1 Tree: TIFR CSE 2011 | Part B | Question: 33 top☝

Which of the following is NOT a sufficient and necessary condition for an undirected graph to
be a tree?

A. is connected and has B. is acyclic and connected.


edges.
C. is acyclic and has edges. D. is acyclic, connected and has
edges.
E. has edges.
tifr2011 graph-theory tree

Answer key☟

Answer Keys
7.1.1 C 7.2.1 C 7.2.2 C 7.2.3 A 7.3.1 C
7.3.2 E 7.3.3 C 7.3.4 C 7.3.5 B 7.4.1 E
7.4.2 B 7.4.3 B 7.4.4 E 7.5.1 B 7.6.1 C
7.7.1 C 7.8.1 E
8 Discrete Mathematics: Mathematical Logic (15)

8.1 First Order Logic (7) top☝

8.1.1 First Order Logic: TIFR CSE 2010 | Part A | Question: 8 top☝

Which of the following is NOT necessarily true? { Notation: The symbol '' ''notes negation;
means that for given and , the property is true }.

A.
B.
C.
D.
E.

tifr2010 mathematical-logic first-order-logic

Answer key☟

8.1.2 First Order Logic: TIFR CSE 2012 | Part A | Question: 2 top☝

If 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

is guilty
is a witness
is lying
is afraid )

A. is guilty. B. is not guilty.


C. From these facts one cannot D. There is a witness who is lying.
conclude that is guilty.
E. No witness is lying.
tifr2012 mathematical-logic first-order-logic

Answer key☟

8.1.3 First Order Logic: TIFR CSE 2012 | Part B | Question: 3 top☝

For a person , let , , and denote that is a woman, admires , is a


lawyer and 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.
B.
C.
D.
E.

tifr2012 mathematical-logic first-order-logic

Answer key☟
8.1.4 First Order Logic: TIFR CSE 2016 | Part B | Question: 4 top☝

In the following, stands for a set of apples, and stands for " is sweeter than . Let

Which of the following statements implies that there are infinitely many apples (i.e.,, is an inifinite
set)?

A.
B.
C.
D.
E.

tifr2016 mathematical-logic first-order-logic

Answer key☟

8.1.5 First Order Logic: TIFR CSE 2017 | Part B | Question: 11 top☝

Given that

means " is a bat",


means " is a fly", and
means " eats ",

what is the best English translation of

A. all flies eat bats B. every fly is eaten by some bat


C. bats eat only flies D. every bat eats flies
E. only bats eat flies
tifr2017 first-order-logic

Answer key☟

8.1.6 First Order Logic: TIFR CSE 2017 | Part B | Question: 6 top☝

Consider the First Order Logic (FOL) with equality and suitable function and relation symbols.
Which of the following is FALSE?

A. Partial orders cannot be axiomatized in FOL


B. FOL has a complete proof system
C. Natural numbers cannot be axiomatized in FOL
D. Real numbers cannot be axiomatized in FOL
E. Relational numbers cannot be axiomatized in FOL

tifr2017 first-order-logic normal

Answer key☟

8.1.7 First Order Logic: TIFR CSE 2019 | Part B | Question: 4 top☝

Let be a propositional formula on a set of variables and be a propositional formula on a


set of variables , such that . A of and is a propositional
formula on variables such that and . Given propositional formula
on the set of variables and propositional formula on
the set of variables , which of the following is a Craig interpolant for and ?

A. B. itself C. D. E.
tifr2019 engineering-mathematics discrete-mathematics mathematical-logic first-order-logic

Answer key☟

8.2 Logical Reasoning (6) top☝

8.2.1 Logical Reasoning: TIFR CSE 2010 | Part A | Question: 4 top☝

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?

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

Answer key☟

8.2.2 Logical Reasoning: TIFR CSE 2011 | Part A | Question: 1 top☝

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

tifr2011 mathematical-logic normal logical-reasoning

Answer key☟

8.2.3 Logical Reasoning: TIFR CSE 2011 | Part A | Question: 12 top☝

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 logical-reasoning

Answer key☟

8.2.4 Logical Reasoning: TIFR CSE 2012 | Part A | Question: 3 top☝

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 , , and (see figure), the following three questions are
put:

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. is Pink, is White, is Blue. B. is Blue, is Pink, is White.


C. is Pink, is Blue, is Pink. D. is White, is Pink, is Blue.
E. Cannot be determined from the
above data.
tifr2012 mathematical-logic logical-reasoning

Answer key☟

8.2.5 Logical Reasoning: TIFR CSE 2013 | Part A | Question: 3 top☝

Three candidates, Amar, Birendra and Chanchal stand for the local election. Opinion polls are
conducted and show that fraction of the voters prefer Amar to Birendra, fraction prefer
Birendra to Chanchal and fraction prefer Chanchal to Amar. Which of the following is impossible?

A. B.
C. D.
E. None of the above.
tifr2013 set-theory&algebra logical-reasoning

Answer key☟

8.2.6 Logical Reasoning: TIFR CSE 2014 | Part A | Question: 8 top☝

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 follows. B. Only claim follows.


C. Either claim or claim follows D. Neither claim nor claim follows.
but not both.
E. Both claim and claim follow.
tifr2014 mathematical-logic logical-reasoning

Answer key☟

8.3 Propositional Logic (2) top☝

8.3.1 Propositional Logic: TIFR CSE 2015 | Part A | Question: 5 top☝

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 propositional-logic

Answer key☟

8.3.2 Propositional Logic: TIFR CSE 2018 | Part B | Question: 4 top☝

The notation " " denotes "implies" and " " denotes "and" in the following formulae.

Let denote the formula:


Let denote the formula:

Which of the following is TRUE?

A. is satisfiable and is not B. is satisfiable and is tautology.


satisfiable.
C. is not tautology and is not D. is not tautology and is
satisfiable. satisfiable.
E. is a tautology and is
satisfiable,
tifr2018 mathematical-logic propositional-logic

Answer key☟

Answer Keys
8.1.1 E 8.1.2 C 8.1.3 E 8.1.4 E 8.1.5 E
8.1.6 A 8.1.7 C 8.2.1 B 8.2.2 X 8.2.3 B
8.2.4 C 8.2.5 C 8.2.6 E 8.3.1 D 8.3.2 D
9 Discrete Mathematics: Set Theory & Algebra (22)

9.1 Convex Sets Functions (1) top☝

9.1.1 Convex Sets Functions: TIFR CSE 2019 | Part A | Question: 6 top☝

A function is said to be if for all and such that


.
Let be a convex function , and define the following functions:
.
Which of the functions and must be convex?

A. Only B. Only C. Only D. Only and E. Only and


tifr2019 engineering-mathematics discrete-mathematics set-theory&algebra functions convex-sets-functions non-gate

Answer key☟

9.2 Functions (6) top☝

9.2.1 Functions: TIFR CSE 2012 | Part B | Question: 1 top☝

Fo r , let be the element of obtained by the component-wise


exclusive-or of and . A Boolean function is said to be linear if
, for all and . The number of linear functions from to is.

A. B. C. D. E.
tifr2012 set-theory&algebra functions

Answer key☟

9.2.2 Functions: TIFR CSE 2013 | Part B | Question: 16 top☝

Consider a function which returns if at least of its inputs are


. Formally, if . Let be such that has exactly ones.
Then, the function (where is omitted) is equivalent to

A. B. C. D. E. None of the above


tifr2013 set-theory&algebra functions

Answer key☟

9.2.3 Functions: TIFR CSE 2014 | Part B | Question: 18 top☝

Let be an integer at least and let . Let be defined


as follows: if an only if the are all distinct. For each choice
, let be defined by . Let be the
number of distinct functions that are obtained as varies in , that is,
. What is ?

A. B. C. D. E.
tifr2014 set-theory&algebra functions

Answer key☟
9.2.4 Functions: TIFR CSE 2017 | Part A | Question: 11 top☝

Let denote function composition such that . Let such


that for all and we have . Which of the
following must be true?

A. is onto (surjective) B. is one-to-one (injective)


C. is both one-to-one and onto D. the range of is finite
(bijective)
E. the domain of is finite
tifr2017 set-theory&algebra functions

Answer key☟

9.2.5 Functions: TIFR CSE 2018 | Part B | Question: 10 top☝

For two bit strings define to be the bitwise XOR of the two strings
(that is, if denote the bits of respectively, then ). A
function is called linear if for every
The number of such linear functions for is:

A. B. C. D. E.
tifr2018 functions

Answer key☟

9.2.6 Functions: TIFR CSE 2019 | Part A | Question: 12 top☝

Let be a function with both input and output in the set , and let the function
be defined as . The function is non-decreasing, so that for
. Consider the following statements:

i. There exists so that


ii. There exists so that
iii. There exists so that

Which of the above statements must be TRUE for ALL such functions and ?

A. Only B. Only and


C. Only D. None of them
E. All of them
tifr2019 engineering-mathematics discrete-mathematics set-theory&algebra functions

Answer key☟

9.3 Lattice (1) top☝

9.3.1 Lattice: TIFR CSE 2012 | Part B | Question: 4 top☝

Let , denote the meet and join operations of lattice. A lattice is called distributive if for all

It is called complete if meet and join exist for every subset. It is called modular if for all

The positive integers under divisibility ordering i.e. if divides 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

Answer key☟

9.4 Number Theory (1) top☝

9.4.1 Number Theory: TIFR CSE 2014 | Part A | Question: 14 top☝

Let and be any two positive integers. Then, which of the following is FALSE?

A. divides .
B. For any prime , .
C. If one of , is prime, then there are integers such that .
D. If , then divides .
E. If is prime, then is prime.

tifr2014 number-theory set-theory&algebra

Answer key☟

9.5 Partial Order (4) top☝

9.5.1 Partial Order: TIFR CSE 2012 | Part B | Question: 5 top☝

Let be a binary relation over a set . The binary relation 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 denote that order pair ) The relation is
called a well-order if is a partial order and there does not exist an infinite descending chain (with
respect to ) within . An infinite sequence of elements of is called an infinite descending
chain if for all we have and .
Take and let the binary relation over be such that if and only if
either or . 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

Answer key☟

9.5.2 Partial Order: TIFR CSE 2013 | Part B | Question: 4 top☝

A set together with partial order is called a well order if it has no infinite descending chains,
i.e. there is no infinite sequence of elements from such that and
for all .
Consider the set of all words (finite sequence of letters ), denoted by , in dictionary order.

A. Between and there B. Between and there


are only words. are only words.
C. is not a partial order. D. is a partial order but not a well
order.
E. is a well order.
tifr2013 set-theory&algebra partial-order

Answer key☟

9.5.3 Partial Order: TIFR CSE 2014 | Part B | Question: 15 top☝

Consider the set of finite sequences of natural numbers with denoting that sequence
is a prefix of sequence . Then, which of the following is true?

A. is uncountable.
B. is a total order.
C. Every non-empty subset of has a least upper bound.
D. Every non-empty subset of has a greatest lower bound.
E. Every non-empty finite subset of has a least upper bound.

tifr2014 set-theory&algebra partial-order

Answer key☟

9.5.4 Partial Order: TIFR CSE 2014 | Part B | Question: 16 top☝

Consider the ordering relation over natural numbers such that if there
exists such that . 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 has an upper


bound under .
C. is a total order. D. is a complete lattice.
E. is a lattice but not a
complete lattice.
tifr2014 set-theory&algebra partial-order

Answer key☟

9.6 Polynomials (1) top☝

9.6.1 Polynomials: TIFR CSE 2012 | Part A | Question: 12 top☝

For the polynomial consider the following statements (which may


be true or false)

i. It has a root between


ii. It has a root between
iii. It has no roots outside

Which of the above statements are true?

A. Only (i). B. Only (i) and (ii).


C. Only (i) and (iii). D. Only (ii) and (iii).
E. All of (i), (ii) and (iii).
tifr2012 set-theory&algebra polynomials

Answer key☟

9.7 Set Theory (8) top☝


9.7.1 Set Theory: TIFR CSE 2010 | Part A | Question: 15 top☝

Let be sets. Let denote the compliment of set (with respect to some fixed universe),
and denote the set of elements in which are not in . Set is equal
to:

A. B. C. D. E.
tifr2010 set-theory&algebra set-theory

Answer key☟

9.7.2 Set Theory: TIFR CSE 2010 | Part A | Question: 18 top☝

Let be a set of size . How many pairs of sets (A, B) are there that satisfy the condition
?

A. B. C. D. E.
tifr2010 set-theory

Answer key☟

9.7.3 Set Theory: TIFR CSE 2011 | Part A | Question: 10 top☝

Let , denote two integers from the set . The number of ordered pairs
such that is divisible by is.

A. B. C. D. E. None of the above


tifr2011 set-theory&algebra set-theory

Answer key☟

9.7.4 Set Theory: TIFR CSE 2011 | Part B | Question: 23 top☝

Suppose is a finite collection of non-empty subsets of a universe Note that


the sets in this collection need not be distinct. Consider the following basic step to be performed
on this sequence. While there exist sets and in the sequence, neither of which is a subset of the
other, delete them from the sequence, and

i. If , then add the sets and to the sequence;


ii. If , then add only the set 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 is finite but might not if is infinite
E. There is a finite collection of subsets of a finite universe and a choice of and in each step
such that the process does not terminate

tifr2011 set-theory&algebra set-theory

Answer key☟
9.7.5 Set Theory: TIFR CSE 2012 | Part A | Question: 8 top☝

How many pairs of sets are there that satisfy the condition

A. B. C. D. E.
tifr2012 set-theory&algebra set-theory

Answer key☟

9.7.6 Set Theory: TIFR CSE 2016 | Part A | Question: 8 top☝

Let and be finite sets such that . Then, what is the value of the expression:

Where ?

A. Always B. Always
C. if and otherwise D. if and otherwise
E. Depends on the size of the
universe
tifr2016 set-theory&algebra set-theory

Answer key☟

9.7.7 Set Theory: TIFR CSE 2017 | Part A | Question: 10 top☝

For a set define to be the set of all subsets of . For example, if then
. Let be a function and is not empty. Which of the
following must be TRUE?

A. cannot be one-to-one (injective) B. cannot be onto (surjective)


C. is both one-to-one and onto D. there is no such possible
(bijective)
E. if such a function exists, then
is infinite
tifr2017 set-theory&algebra set-theory functions easy

Answer key☟

9.7.8 Set Theory: TIFR CSE 2019 | Part A | Question: 1 top☝

Let be a set with elements. How many subsets of have odd cardinality?

A.
B.
C.
D.
E. Can not be determined without knowing whether is odd or even

tifr2019 engineering-mathematics discrete-mathematics set-theory&algebra set-theory

Answer key☟

Answer Keys
9.1.1 D 9.2.2 D 9.2.3 D 9.2.4 B 9.2.5 B

9.2.6 B 9.3.1 C 9.4.1 C 9.5.1 C 9.5.2 E


9.5.3 D 9.5.4 E 9.6.1 E 9.7.1 D 9.7.2 C
9.7.3 C 9.7.4 C 9.7.5 D 9.7.6 D 9.7.7 B
9.7.8 D
10 Engineering Mathematics: Calculus (21)

10.0.1 TIFR CSE 2020 | Part A | Question: 13 top☝

What is the area of the largest rectangle that can be inscribed in a circle of radius ?

A. B. C. D. E. None of the above


tifr2020

Answer key☟

10.1 Convergence (1) top☝

10.1.1 Convergence: TIFR CSE 2014 | Part A | Question: 15 top☝

Consider the following statements:

1. , series with each , converges.


2. converges.

3. converges if

Which of the following is TRUE?

A. Statements and but not B. Statements and but not


. .
C. Statements and but not D. All the three statements.
.
E. None of the three statements.
tifr2014 convergence non-gate

Answer key☟

10.2 Differentiation (1) top☝

10.2.1 Differentiation: TIFR CSE 2018 | Part A | Question: 5 top☝

Which of the following is the derivative of when ?

A.
B.
C.
D.
E.

tifr2018 calculus differentiation

Answer key☟

10.3 Integration (3) top☝

10.3.1 Integration: TIFR CSE 2011 | Part A | Question: 11 top☝


A. B. C. D. E. None of the above
tifr2011 calculus integration

Answer key☟

10.3.2 Integration: TIFR CSE 2015 | Part A | Question: 10 top☝

Let , be any positive real valued continuous function. Then

equals.

A. B.
C. D.
E.
tifr2015 maxima-minima calculus non-gate integration

10.3.3 Integration: TIFR CSE 2019 | Part A | Question: 13 top☝

Consider the integral

What is the value of this integral correct up to two decimal places?

A. B. C. D. E.
tifr2019 engineering-mathematics calculus integration

Answer key☟

10.4 Limits (7) top☝

10.4.1 Limits: TIFR CSE 2010 | Part A | Question: 7 top☝

The limit of as is.

A. B. C. D. E.
tifr2010 calculus limits

Answer key☟

10.4.2 Limits: TIFR CSE 2011 | Part A | Question: 14 top☝

The limit

is
A. B. C. D. E. None of the above
tifr2011 calculus limits

Answer key☟

10.4.3 Limits: TIFR CSE 2011 | Part A | Question: 17 top☝

What is

A. B. C. D. E. None of the above


tifr2011 limits

Answer key☟

10.4.4 Limits: TIFR CSE 2012 | Part A | Question: 14 top☝

The limit equals.

A. B. C. D. E. None of the above


tifr2012 calculus limits

Answer key☟

10.4.5 Limits: TIFR CSE 2014 | Part A | Question: 16 top☝

Let and
.
is

A. B.
C. D.
E. None of the above
tifr2014 limits

Answer key☟

10.4.6 Limits: TIFR CSE 2014 | Part A | Question: 18 top☝

We are given a collection of real numbers where a real number occurs times. Let
the collection be enumerated as so that and so
on, and is finite. What is

A. B.
C. D.
E. None of the above
tifr2014 limits

Answer key☟
10.4.7 Limits: TIFR CSE 2019 | Part A | Question: 15 top☝

Consider the matrix

What is ?

A.

B.

C.

D.

E.

tifr2019 engineering-mathematics calculus limits

Answer key☟

10.5 Maxima Minima (8) top☝

10.5.1 Maxima Minima: TIFR CSE 2010 | Part A | Question: 3 top☝

The function attains a minimum at ?

A. B. C. D. E.
tifr2010 calculus maxima-minima

Answer key☟

10.5.2 Maxima Minima: TIFR CSE 2011 | Part A | Question: 4 top☝

Consider the problem of maximizing such that . The value of at which


the maximum is achieved is:

A. B. C. D. E. None of the above


tifr2011 calculus maxima-minima

Answer key☟
10.5.3 Maxima Minima: TIFR CSE 2012 | Part A | Question: 13 top☝

The maximum value of the function

subject to the constraints

is

A. B. C. D. E.
tifr2012 calculus maxima-minima

Answer key☟

10.5.4 Maxima Minima: TIFR CSE 2012 | Part A | Question: 15 top☝

Consider the differential equation . Which of its equilibria is


unstable?

A. B. C. D. E. None of the above


tifr2012 calculus maxima-minima

Answer key☟

10.5.5 Maxima Minima: TIFR CSE 2013 | Part A | Question: 16 top☝

The minimum of the function over the interval is

A. B. C. D. E. None of the above


tifr2013 calculus maxima-minima

Answer key☟

10.5.6 Maxima Minima: TIFR CSE 2014 | Part A | Question: 9 top☝

Solve min subject to

A. B. C. D. E. None of the above


tifr2014 calculus maxima-minima

Answer key☟

10.5.7 Maxima Minima: TIFR CSE 2015 | Part A | Question: 11 top☝

Suppose that is a continuous function such that for . Which


of the following is always true?

A. .
B. There exists between and such that .
C. There exists between and such that .
D. .
E. None of the above statements are always true.

tifr2015 maxima-minima calculus

Answer key☟

10.5.8 Maxima Minima: TIFR CSE 2020 | Part A | Question: 8 top☝

Consider a function which is twice differentiable in Suppose it has


exactly one global maximum and exactly one global minimum inside . What can you say
about the behaviour of the first derivative and and second derivative on (give the most
precise answer)?

A. is zero at exactly two points, need not be zero anywhere


B. is zero at exactly two points, is zero at exactly one point
C. is zero at at least two points, is zero at exactly one point
D. is zero at at least two points, is zero at at least ​ one point
E. is zero at at least two points, is zero at at least two points

tifr2020 engineering-mathematics calculus maxima-minima

Answer key☟

Answer Keys
10.0.1 D 10.1.1 D 10.2.1 C 10.3.1 B 10.3.2 D
10.3.3 A 10.4.1 A 10.4.2 C 10.4.3 C 10.4.4 C
10.4.5 C 10.4.6 B 10.4.7 D 10.5.1 C 10.5.2 E
10.5.3 B 10.5.4 C 10.5.5 C 10.5.6 B 10.5.7 B
10.5.8 D
11 Engineering Mathematics: Linear Algebra (14)

11.0.1 TIFR CSE 2020 | Part A | Question: 12 top☝

The hour needle of a clock is malfunctioning and travels in the anti-clockwise direction, i.e.,
opposite to the usual direction, at the same speed it would have if it was working correctly. The
minute needle is working correctly. Suppose the two needles show the correct time at noon, thus
both needles are together at the mark. After how much time do the two needles meet again?

A. hour B. hour C. hour D. hour E. One hour

tifr2020

Answer key☟

11.1 Eigen Value (1) top☝

11.1.1 Eigen Value: TIFR CSE 2019 | Part A | Question: 3 top☝

is square matrix for which the entries in every row sum to . Consider the following
statements:

i. The column vector is an eigen vector of


ii.
iii.

Which of the above statements must be TRUE?

A. Only B. Only C. Only and D. Only and E.


tifr2019 engineering-mathematics linear-algebra eigen-value

Answer key☟

11.2 Matrix (8) top☝

11.2.1 Matrix: TIFR CSE 2010 | Part A | Question: 16 top☝

Let the characteristic equation of matrix be . Then.

A. does not exist.


B. exists but cannot be determined from the data.
C.
D.
E. exists and can be determined from the data but the choices (c) and (d) are incorrect.

tifr2010 linear-algebra matrix

Answer key☟

11.2.2 Matrix: TIFR CSE 2010 | Part A | Question: 5 top☝

is symmetric positive definite matrix ( i.e., for all non zero ). 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 D. det (A) is positive.
positive.
E. None of the above.
tifr2010 linear-algebra matrix

Answer key☟

11.2.3 Matrix: TIFR CSE 2012 | Part B | Question: 12 top☝

Let be a matrix such that . What is the inverse of ?

A. B.
C. D.
E. Inverse is not guaranteed to exist.
tifr2012 linear-algebra matrix

Answer key☟

11.2.4 Matrix: TIFR CSE 2013 | Part B | Question: 3 top☝

How many matrices with entries from have odd determinant?


Hint: Use modulo arithmetic.

A. B. C. D. E.
tifr2013 linear-algebra matrix

Answer key☟

11.2.5 Matrix: TIFR CSE 2015 | Part A | Question: 14 top☝

Consider the following matrices.

How may column vectors of the form

are there such that (modulo )? (modulo means all operations are done modulo , i.e,
(modulo ), (modulo )).

A. None B. Two C. Three D. Four E. Eight


tifr2015 matrix

Answer key☟

11.2.6 Matrix: TIFR CSE 2018 | Part A | Question: 12 top☝

An matrix with real entries is said to be positive definite if for every non-zero -
dimensional vector with real entries, we have Let and be symmetric,
positive definite matrices of size with real entries.
Consider the following matrices, where denotes the identity matrix:
1.
2.
3.

Which of the above matrices must be positive definite?

A. Only B. Only
C. Only and D. None of the above matrices are
positive definite
E. All of the above matrices are
positive definite
tifr2018 matrix linear-algebra

Answer key☟

11.2.7 Matrix: TIFR CSE 2018 | Part A | Question: 14 top☝

Let be an invertible matrix with real entries whose row sums are all equal to . Consider
the following statements:

1. Every row in the matrix sums to .


2. Every row in the matrix sums to .
3. Every row in the matrix sums to .

Which of the following is TRUE?

A. none of the statements is correct


B. statement is correct but not necessarily statements or
C. statement is correct but not necessarily statements or
D. statement and are correct but not necessarily statement
E. all the three statements and are correct

tifr2018 matrix linear-algebra

Answer key☟

11.2.8 Matrix: TIFR CSE 2020 | Part A | Question: 5 top☝

Let be am invertible matrix with real entries whose column sums are all equal to .
Consider the following statements:

1. Every column in the matrix sums to


2. Every column in the matrix sums to
3. Every column in the matrix sums to

Which of the following is TRUE?

A. none of the statements is correct


B. statement is correct but not statements or
C. statement is correct but not statements or
D. statement is correct but not statements or
E. all the statements and are correct

tifr2020 engineering-mathematics linear-algebra matrix

Answer key☟
11.3 Rank Of Matrix (1) top☝

11.3.1 Rank Of Matrix: TIFR CSE 2020 | Part A | Question: 2 top☝

Let be a real matrix such that for non-zero vector we have


Then

A. Such an cannot exist B. Such exist and their rank is


always
C. S u c h exist, but their D. No eigenvalue of any such can
eigenvalues are always real be real
E. None of the above
tifr2020 engineering-mathematics linear-algebra rank-of-matrix eigen-value

Answer key☟

11.4 Vector Space (3) top☝

11.4.1 Vector Space: TIFR CSE 2010 | Part A | Question: 11 top☝

The length of a vector is defined as

Given two vectors and , which of the following measures of


discrepancy between and is insensitive to the length of the vectors?

A. B.
C. D.
E. None of the above
tifr2010 linear-algebra vector-space

Answer key☟

11.4.2 Vector Space: TIFR CSE 2017 | Part A | Question: 2 top☝

For vectors in , define the inner product , and the length of to be


. Let be two vectors in so that . Consider the following
statements:

i.
ii.
iii.
iv.
v.

Which of the above statements must be TRUE of ? Choose from the following options.

A. ii only B. i and ii C. iii only D. iv only E. iv and v


tifr2017 linear-algebra vector-space

Answer key☟
11.4.3 Vector Space: TIFR CSE 2020 | Part A | Question: 3 top☝

Let and fix Let

where the polynomial function is defined as and denotes the

derivative of with respect to evaluated at Then,

A. is finite or infinite depending on the value of


B. is a -dimensional vector subspace of
C. is a -dimensional vector subspace of
D. is a -dimensional vector subspace of
E. None of the other options

tifr2020 engineering-mathematics linear-algebra vector-space

Answer Keys
11.0.1 C 11.1.1 C 11.2.1 D 11.2.2 E 11.2.3 D
11.2.4 A 11.2.5 B 11.2.6 E 11.2.7 E 11.2.8 D
11.3.1 B 11.4.1 D 11.4.2 A 11.4.3 D
12 Engineering Mathematics: Probability (40)

12.0.1 TIFR CSE 2020 | Part A | Question: 11 top☝

Suppose we toss labelled balls into numbered bins. Let be the event that the
first bin is empty while be the event that the second bin is empty. and denote
their respective probabilities. Which of the following is true?

A.
B.
C. D.
E. None of the above
tifr2020

Answer key☟

12.0.2 TIFR CSE 2020 | Part A | Question: 10 top☝

In a certain year, there were exactly four Fridays and exactly four Mondays in January. On what
day of the week did the of the January fall that year (recall that January has days)?

A. Sunday B. Monday C. Wednesday D. Friday E. None of the others


tifr2020 engineering-mathematics probability

Answer key☟

12.0.3 TIFR CSE 2013 | Part A | Question: 13 top☝

Doctors and perform surgery on patients in stages and of a disease. Doctor has
performed a surgeries (on stage and stage patients) and out of her
patients have survived ( stage and stage survivors). Doctor has also performed
surgeries (on stage and stage patients). Her success rate is ( stage
survivors and stage survivors). patient has been advised that she is equally likely to be
suffering from stage or stage of this disease. Which doctor would you recommend to this
patient and why?

A. Doctor since she has a higher success rate


B. Doctor since she specializes in stage III patients and the success of surgery in stage patients
is anyway too low
C. Doctor since she has performed more stage surgeries
D. Doctor 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

Answer key☟

12.0.4 TIFR CSE 2013 | Part A | Question: 4 top☝

A biased coin is tossed repeatedly. Assume that the outcomes of different tosses are

independent and probability of heads is in each toss. What is the probability of obtaining an
even number of heads in tosses, zero being treated as an even number?
A. B. C. D. E.

tifr2013 probability

Answer key☟

12.0.5 TIFR CSE 2012 | Part A | Question: 20 top☝

There are balls in a bag, of which are black and are white. I randomly draw
balls from the bag. What is the probability that the st ball will be black?

A. B. More than but less than .


C. Less than but more than . D.
E.
tifr2012 probability

Answer key☟

12.0.6 TIFR CSE 2012 | Part A | Question: 19 top☝

An electric circuit between two terminals and 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 and are connected?

A. B. C. D. E.

tifr2012 probability

Answer key☟

12.0.7 TIFR CSE 2012 | Part A | Question: 17 top☝

A spider is at the bottom of a cliff, and is inches from the top. Every step it takes brings it one
inch closer to the top with probability , and one inch away from the top with probability ,
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 ?

A. It will never reach the top. B. Linear in .


C. Polynomial in . D. Exponential in .
E. Double exponential in .
tifr2012 probability

Answer key☟

12.0.8 TIFR CSE 2012 | Part A | Question: 9 top☝

The probability of throwing six perfect dices and getting six different faces is

A. B. C. D. E. None of the above

tifr2012 probability
Answer key☟

12.0.9 TIFR CSE 2013 | Part A | Question: 14 top☝

An unbiased die is thrown times. The probability that the product of numbers would be even is

A. B. C. D. E. None of the above

tifr2013 probability

Answer key☟

12.0.10 TIFR CSE 2011 | Part A | Question: 9 top☝

You have to play three games with opponents and in a specified sequence. You win the
series if you win two consecutive games. is a stronger player than . Which sequence
maximizes your chance of winning the series?

A. B. C. D. E. All are the same.


tifr2011 probability

Answer key☟

12.0.11 TIFR CSE 2010 | Part A | Question: 13 top☝

A cube whose faces are colored is split into 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. B. C. D. E. None of the above


tifr2010 probability

Answer key☟

12.0.12 TIFR CSE 2011 | Part A | Question: 19 top☝

Three dice are rolled independently. What is the probability that the highest and the lowest value
differ by ?

A. B. C. D. E.

tifr2011 probability

Answer key☟

12.0.13 TIFR CSE 2018 | Part A | Question: 10 top☝

Let be a biased coin such that the probability of a head turning up is Let denote the
probability that an odd number of heads occurs after tosses for Then
which of the following is TRUE ?

A.
B.
C.
D. .
E.
tifr2018 probability

Answer key☟

12.0.14 TIFR CSE 2013 | Part A | Question: 17 top☝

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 . What is the probability that the three sticks
that are left CANNOT form a triangle?

A. B. C. D. E.
tifr2013 probability

Answer key☟

12.0.15 TIFR CSE 2013 | Part B | Question: 10 top☝

Let be positive integers with a power of . Let . Suppose


are subsets of such that and
for all . Such a collection of sets 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 as an array of bits so that given any integer
, we can discover whether by reading only one bit of . Consider the following
strategy to solve this problem. Array is initialized to all zeroes. Given the set to be stored, we put a
one in all the locations of indexed by the union . Now, given the integer , we read a random
location in from and declare that if the bit in that location is one. This strategy gives the
correct answer with probability

A. if and at most if .
B. At least if and at most if .
C. At least if and at least if .
D. if and at least if .
E. At least if and if .

tifr2013 probability

Answer key☟

12.0.16 TIFR CSE 2010 | Part A | Question: 10 top☝

A drawer contains Blue, Red and 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. B.

C. D.

E.

tifr2010 probability

Answer key☟

12.0.17 TIFR CSE 2018 | Part A | Question: 15 top☝

Suppose a box contains 20 balls: each ball has a distinct number in written on it.
We pick 10 balls (without replacement) uniformly at random and throw them out of the box. Then
we check if the ball with number on it is present in the box. If it is present, then we throw it out of
the box; else we pick a ball from the box uniformly at random and throw it out of the box.
What is the probability that the ball with number on it is present in the box?

A. B. C. D. E. None of the above


tifr2018 probability

Answer key☟

12.0.18 TIFR CSE 2017 | Part A | Question: 9 top☝

Consider the function on three bits, where


if and only if . Let be the probability that the
output is 1 when each input is set to 1 independently with probability . What is ?

A. B.
C. D.
E.
tifr2017 probability

Answer key☟

12.0.19 TIFR CSE 2015 | Part A | Question: 1 top☝

Consider a -sided die with all sides not necessarily equally likely such that probability of an
even number is , probability of a multiple of is and

probability of is . Given the above conditions, choose the strongest (most stringent)
condition of the following that must always hold about , the probability of .

A. B.

C. D.
E. None of the above
tifr2015 probability

Answer key☟

12.0.20 TIFR CSE 2019 | Part A | Question: 4 top☝

What is the probability that a point picked uniformly at random from the disk
satisfies ?

A. B.
C. D.
E.
tifr2019 engineering-mathematics discrete-mathematics probability

Answer key☟

12.0.21 TIFR CSE 2019 | Part A | Question: 14 top☝

A drawer contains pens, of which are red, are blue, and are green. The nine pens are
drawn from the drawer one at at time (without replacement) such that each pen is drawn with
equal probability from the remaining pens in the drawer. What is the probability that two red pens are
drawn in succession ?
A. B. C. D. E.
tifr2019 engineering-mathematics probability

Answer key☟

12.0.22 TIFR CSE 2018 | Part A | Question: 13 top☝

A hacker knows that the password to the TIFR server is 10-letter string consisting of lower-case
letters from the English alphabet. He guesses a set of distinct 10-letter strings (with lower-case
letters) uniformly at random. What is the probability that one of the guesses of the hacker is correct
password?

A.

B.

C.
D.
E. None of the above

tifr2018 probability

Answer key☟

12.0.23 TIFR CSE 2016 | Part A | Question: 12 top☝

There are two rocks and , located close to each other, in a lily pond. There is a frog that
jumps randomly between the two rocks at time . The location of the frog is
determined as follows. Initially, at time , the frog is at . From then on, the frog's location is
determined as follows. If the frog is at at time , then at time , with probability it jumps to
and with probability , it jumps on the spot and stays at . If the frog is at at time , then at time
, with probability it jumps to and with probability it jumps on the spot and stays at .
What is the probability that the frog is at at time (just after its third jump)?

A. B. C. D. E.
tifr2016 probability

Answer key☟

12.1 Binomial Distribution (3) top☝

12.1.1 Binomial Distribution: TIFR CSE 2010 | Part A | Question: 6 top☝

Given 10 tosses of a coin with probability of head = . = ( - the probability of tail), the probability
of at least one head is?

A. B. C. D. E.
tifr2010 probability binomial-distribution

Answer key☟

12.1.2 Binomial Distribution: TIFR CSE 2010 | Part B | Question: 38 top☝

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?
A. B. C. D. E.
tifr2010 probability binomial-distribution

Answer key☟

12.1.3 Binomial Distribution: TIFR CSE 2011 | Part A | Question: 3 top☝

The probability of three consecutive heads in four tosses of a fair coin is

A. B. C. D. E. None of the above

tifr2011 probability binomial-distribution

Answer key☟

12.2 Conditional Probability (3) top☝

12.2.1 Conditional Probability: TIFR CSE 2010 | Part A | Question: 19, TIFR CSE 2014 | Part A |
Question: 6 top☝

Karan tells truth with probability and lies with probability Independently, Arjun tells truth

with probability and lies with probability 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. B. C. D. E.

tifr2010 probability conditional-probability tifr2014

Answer key☟

12.2.2 Conditional Probability: TIFR CSE 2012 | Part A | Question: 1 top☝

Amar and Akbar both tell the truth with probability and lie with probability . 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. B. C. D. E. None of the above

tifr2012 probability conditional-probability

Answer key☟

12.2.3 Conditional Probability: TIFR CSE 2013 | Part A | Question: 6 top☝

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 . 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 you 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. B. C. D. E.
tifr2013 probability conditional-probability

Answer key☟

12.3 Expectation (5) top☝

12.3.1 Expectation: TIFR CSE 2011 | Part A | Question: 6 top☝

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. b. c. d. e.
tifr2011 probability expectation

Answer key☟

12.3.2 Expectation: TIFR CSE 2012 | Part B | Question: 7 top☝

A bag contains 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. B. C. D. E.

tifr2012 probability expectation

Answer key☟

12.3.3 Expectation: TIFR CSE 2014 | Part A | Question: 17 top☝

A fair dice (with faces numbered ) is independently rolled repeatedly. Let denote
the number of rolls till an even number is seen and let denote the number of rolls till is seen.
Evaluate .

A. B. C. D. E.
tifr2014 expectation

Answer key☟

12.3.4 Expectation: TIFR CSE 2015 | Part A | Question: 6 top☝

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 . He repeatedly tosses the coin until he gets heads in two
consecutive tosses. The expected number of coin tosses that Ram does is.

A. B. C. D. E. None of the above


tifr2015 expectation

Answer key☟

12.3.5 Expectation: TIFR CSE 2020 | Part A | Question: 1 top☝

Two balls are drawn uniformly at random without replacement from a set of five balls numbered
What is the expected value of the larger number on the balls drawn?

A. B. C. D. E. None of the above


tifr2020 engineering-mathematics probability expectation

Answer key☟

12.4 Independent Events (1) top☝

12.4.1 Independent Events: TIFR CSE 2020 | Part A | Question: 7 top☝

A lottery chooses four random winners. What is the probability that at least three of them are
born on the same day of the week? Assume that the pool of candidates is so large that each
winner is equally likely to be born on any of the seven days of the week independent of the other
winners.

A. B. C. D. E.

tifr2020 engineering-mathematics probability independent-events

Answer key☟

12.5 Random Variable (2) top☝

12.5.1 Random Variable: TIFR CSE 2011 | Part A | Question: 7 top☝

Let and be two independent and identically distributed random variables. Then
is.

A. B. 1
C. 0 D.
E. Information is insufficient.
tifr2011 probability random-variable

Answer key☟

12.5.2 Random Variable: TIFR CSE 2014 | Part A | Question: 19 top☝

Consider the following random function of


,
where and are independent random variables uniformly distributed over . Which of
the following is FALSE?

A. is uniformly distributed over .


B. are independent random variables and both are uniformly distributed over
.
C. are independent and identically distributed random variables.
D. All of the above.
E. None of the above.

tifr2014 probability random-variable

Answer key☟

12.6 Uniform Distribution (3) top☝

12.6.1 Uniform Distribution: TIFR CSE 2013 | Part A | Question: 18 top☝

Consider three independent uniformly distributed (taking values between and ) random
variables. What is the probability that the middle of the three values (between the lowest and the
highest value) lies between and where ?

A. B.
C. D.
E. .
tifr2013 probability random-variable uniform-distribution

Answer key☟

12.6.2 Uniform Distribution: TIFR CSE 2015 | Part A | Question: 12 top☝

Consider two independent and identically distributed random variables and uniformly
distributed in . For , the probability that max is

A. B. exp C. D. E.
tifr2015 probability random-variable uniform-distribution

Answer key☟

12.6.3 Uniform Distribution: TIFR CSE 2020 | Part A | Question: 4 top☝

F ix Suppose there is a particle that moves randomly on the number line, but never
leaves the set Let the initial probability distribution of the particle be denoted by
In the first step, if the particle is at position it moves to one of the positions in with
uniform distribution; in the second step, if the particle is in location then it moves to one of the
locations in with uniform distribution.Suppose after two steps, the final ditribution of
the particle is uniform. What is the initial distribution

A. is not unique
B. is uniform

C. is non-zero for all even and zero otherwise


D. and for
E. and for

tifr2020 engineering-mathematics probability uniform-distribution

Answer Keys
12.0.1 C 12.0.2 A 12.0.3 D 12.0.4 B 12.0.5 A
12.0.6 B 12.0.7 D 12.0.8 B 12.0.9 E 12.0.10 B
12.0.11 A 12.0.12 E 12.0.13 C 12.0.14 A 12.0.15 D
12.0.16 A 12.0.17 B 12.0.18 C 12.0.19 D 12.0.20 C
12.0.21 A 12.0.22 A 12.0.23 B 12.1.1 C 12.1.2 E
12.1.3 D 12.2.1 E 12.2.2 D 12.2.3 C 12.3.1 C
12.3.2 C 12.3.3 E 12.3.4 C 12.3.5 D 12.5.1 E
12.5.2 C 12.6.1 E 12.6.2 D 12.6.3 D
13 General Aptitude: Analytical Aptitude (10)

13.1 Logical Reasoning (10) top☝

13.1.1 Logical Reasoning: TIFR CSE 2010 | Part A | Question: 1 top☝

A box contains black balls and 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?

A. The process can be applied indefinitely without any prior bound


B. The process will stop with a single white ball in the box
C. The process will stop with a single black ball in the box
D. The process will stop with the box empty
E. None of the above

tifr2010 analytical-aptitude logical-reasoning

Answer key☟

13.1.2 Logical Reasoning: TIFR CSE 2013 | Part A | Question: 10 top☝

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. B. C. D. E.
tifr2013 analytical-aptitude logical-reasoning

Answer key☟

13.1.3 Logical Reasoning: TIFR CSE 2013 | Part A | Question: 11 top☝

Let there be a pack of cards numbered to . The card states: "There are at most
true cards in this pack". Then how many cards of the pack contain TRUE statements?

A. B. C. D. E. None of the above


tifr2013 logical-reasoning

Answer key☟

13.1.4 Logical Reasoning: TIFR CSE 2013 | Part A | Question: 2 top☝

Consider the following two types of elections to determine which of two parties and forms
the next government in the 2014 Indian elections. Assume for simplicity an Indian population of
size . There are only two parties and and every citizen votes.
TYPE C: The country is divided into constituencies and each constituency has 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 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

Answer key☟

13.1.5 Logical Reasoning: TIFR CSE 2016 | Part A | Question: 1 top☝

Suppose the following statements about three persons in a room are true.
Chandni, Sooraj and Tara are in a room. Nobody else is in the room. Chandni is looking at
Sooraj. Sooraj is looking at Tara. Chandni is married. Tara is not married. A married person in the room
is looking at an unmarried person.
Then, Which of the following is necessarily true?

A. Sooraj is married
B. Sooraj is unmarried
C. The situation described is impossible
D. There is insufficient information to conclude if Sooraj is married or unmarried
E. None of the above

tifr2016 logical-reasoning

Answer key☟

13.1.6 Logical Reasoning: TIFR CSE 2017 | Part A | Question: 14 top☝

Consider the following game with two players, Aditi and Bharat. There are tokens in a bag.
The two players know , and take turns removing tokens from the bag. In each turn, a player
can either remove one token or two tokens. The player that removes the last token from the bag loses.
Assume that Aditi always goes first. Further, we say that a player has a winning strategy if she or he
can win the game, no matter what other player does. Which of the following statements is TRUE?

A. For , Bharath has a winning strategy. For , Aditi has a winning strategy.
B. For , Bharath has a winning strategy. For , Aditi has a winning strategy.
C. For both and , Aditi has a winning strategy.
D. For both and , Bharat has a winning strategy.
E. Bharat never has a winning strategy.

tifr2017 analytical-aptitude logical-reasoning

Answer key☟

13.1.7 Logical Reasoning: TIFR CSE 2018 | Part A | Question: 11 top☝

We are given a (possibly empty) set of objects. Each object in the set is colored either black or
white, is shaped either circular or rectangular, and has a profile that is either fat or thin, Those
properties obey the following principles:

1. Each white object is also circular.


2. Not all thin objects are black.
3. Each rectangular object is also either thin or white or both thin and white.

Consider the following statements:

i. If there is a thin object in the set, then there is also a white object.
ii. If there is a rectangular object in the set, then there are at least two objects.
iii. Every fat object in the set is circular.

Which of the above statements must be TRUE for the set?

A. only B. only
C. only D. None of the statements must be
TRUE
E. All of the statements must be
TRUE
tifr2018 analytical-aptitude logical-reasoning

Answer key☟

13.1.8 Logical Reasoning: TIFR CSE 2018 | Part A | Question: 8 top☝

A crime has been committed with four people at the scene of the crime. You are responsible for
finding out who did it. You have recorded the following statements from the four witnesses, and
you know one of them has committed the crime.

1. Anuj says that Binky did it.


2. Binky says that Anuj did it.
3. Chacko says that Binky is telling the truth.
4. Desmond says that Chacko is not lying.

You know that exactly three of the statements recorded are FALSE. Who committed the crime?

A.
B.
C.
D.
E.

tifr2018 logical-reasoning

Answer key☟

13.1.9 Logical Reasoning: TIFR CSE 2019 | Part A | Question: 10 top☝

Avni and Badal alternately choose numbers from the set without
replacement (starting with Avni). The first person to choose numbers of which any sum to
wins the game (for example, Avni wins if she chooses the numbers since ). A
player is said to have a winning strategy if the player can always win the game, no matter what the
other player does. Which of the following statements is TRUE?
As a hint, there are exactly ways in which numbers from the set can sum
up to , shown as the three rows, the three columns, and the two diagonals in the following square:

A. Avni has a winning strategy


B. Badal has a winning strategy
C. Both of them have a winning strategy
D. Neither of them has a winning strategy
E. The Player that picks has a winning strategy

tifr2019 general-aptitude analytical-aptitude logical-reasoning

Answer key☟

13.1.10 Logical Reasoning: TIFR CSE 2019 | Part A | Question: 11 top☝

Suppose there are guests at a party (and no hosts). As the night progresses, the guests meet
each other and shake hands. The same pair of guests might shake hands multiple times. for
some parties stretch late into the night , and it is hard to keep track.Still, they don’t shake hands with
themselves. Let Odd be the set of guests who have shaken an odd number of hands, and let even be
the set of guests who have shaken an even number of hands. Which of the following stays invariant
throughout the night?

A. B.
C. D.
E.
tifr2019 general-aptitude analytical-aptitude logical-reasoning

Answer key☟

Answer Keys
13.1.1 C 13.1.2 C 13.1.3 D 13.1.4 E 13.1.5 D
13.1.6 B 13.1.7 E 13.1.8 B 13.1.9 D 13.1.10 A
14 General Aptitude: Quantitative Aptitude (55)

14.0.1 TIFR CSE 2020 | Part A | Question: 14 top☝

A ball is thrown directly upwards from the ground at a speed of , on a planet where the
gravitational acceleration is . Consider the following statements:

1. The ball reaches the ground exactly seconds after it is thrown up


2. The ball travels a total distance of metres before it reaches the ground
3. The velocity of the ball when it hits the ground is

What can you say now?

A. Only Statement is correct B. Only Statement is correct


C. Only Statement is correct D. None of the Statements or is
correct
E. All of the Statements and
are correct
tifr2020

Answer key☟

14.1 Cartesian Coordinates (3) top☝

14.1.1 Cartesian Coordinates: TIFR CSE 2013 | Part B | Question: 9 top☝

Suppose straight lines are drawn on a plane. When these lines are removed, the plane falls
apart into several connected components called regions. region is said to be convex if it
has the following property: whenever two points are in , then the entire line segment joining them is in
. Suppose no two of the n lines are parallel. Which of the following is true?

A. regions are produced, and each region is convex.


B. regions are produced but they need not all be convex.
C. regions are produced, and each region is convex.
D. regions are produced, but they need not all be convex.
E. All regions are convex but there may be exponentially many of them.

tifr2013 quantitative-aptitude geometry cartesian-coordinates

Answer key☟

14.1.2 Cartesian Coordinates: TIFR CSE 2014 | Part A | Question: 13 top☝

Let be a line on the two dimensional plane. s intercepts with the and axes are
respectively and . After rotating the co-ordinate system (and leaving untouched), the new
intercepts are and respectively. Which of the following is TRUE?

A. . B. .
C. . D. .
E. None of the above.
tifr2014 geometry cartesian-coordinates

Answer key☟
14.1.3 Cartesian Coordinates: TIFR CSE 2015 | Part A | Question: 13 top☝

Imagine the first quadrant of the real plane as consisting of unit squares. A typical square has
corners: and , where is a pair of non-negative
integers. Suppose a line segment connecting to is drawn. We say that passes
through a unit square if it passes through a point in the interior of the square. How many unit squares
does pass through?

A. B. C. D. E.
tifr2015 quantitative-aptitude cartesian-coordinates

Answer key☟

14.2 Circle (1) top☝

14.2.1 Circle: TIFR CSE 2011 | Part A | Question: 18 top☝

The equation of the tangent to the unit circle at point ( ) is

A. B.
C. D.
E. None of the above
tifr2011 quantitative-aptitude geometry circle

Answer key☟

14.3 Clock Time (3) top☝

14.3.1 Clock Time: TIFR CSE 2010 | Part A | Question: 2 top☝

The hour hand and the minute hands of a clock meet at noon and again at mid-night. In between
they meet times, where is.:

A. B. C. D. E. None of the above


tifr2010 quantitative-aptitude clock-time

Answer key☟

14.3.2 Clock Time: TIFR CSE 2013 | Part A | Question: 20 top☝

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 ( 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 th of the circumference.

A. minutes B. minutes C. minutes D. minutes E. minutes


tifr2013 quantitative-aptitude clock-time

Answer key☟

14.3.3 Clock Time: TIFR CSE 2014 | Part A | Question: 10 top☝

A person went out between pm and pm to chat with her friend and returned between pm and
pm. 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
A. Twenty five minutes past pm.
B. Twenty six and minutes past
pm.
D. Twenty eight minutes past pm.
C. Twenty seven and minutes past
pm.
E. None of the above.
tifr2014 quantitative-aptitude clock-time

Answer key☟

14.4 Complex Number (3) top☝

14.4.1 Complex Number: TIFR CSE 2011 | Part A | Question: 13 top☝

If and , then the smallest value of is

A. B. C. D. E. None of the above


tifr2011 quantitative-aptitude complex-number

Answer key☟

14.4.2 Complex Number: TIFR CSE 2011 | Part A | Question: 5 top☝

Three distinct points lie on a unit circle of the complex plane and satisfy .
Then form the vertices of .

A. An isosceles but not equilateral B. An equilateral triangle.


triangle.
C. A triangle of any shape. D. A triangle whose shape can't be
determined.
E. None of the above.
tifr2011 quantitative-aptitude geometry complex-number non-gate

Answer key☟

14.4.3 Complex Number: TIFR CSE 2013 | Part A | Question: 7 top☝

For any complex number , defines its phase, chosen to be in the interval
. If and are three complex numbers with the same modulus but
different phases ( ), then the quantity

is a constant, and has the value

A. 2 B. C. 1 D. 3 E.
tifr2013 quantitative-aptitude complex-number non-gate

Answer key☟

14.5 Convex Sets Functions (1) top☝

14.5.1 Convex Sets Functions: TIFR CSE 2014 | Part A | Question: 12 top☝

Let . Consider the following inequality for real numbers and :


.
Consider the following 3 conditions:

1.
2.
3.

Which of the following statements is TRUE?

A. The above inequality holds under conditions and but not under condition .
B. The above inequality holds under conditions and but not under condition .
C. The above inequality holds under conditions and but not under condition .
D. The above inequality holds under all the three conditions.
E. The above inequality holds under none of the three conditions.

tifr2014 quantitative-aptitude convex-sets-functions non-gate

14.6 Cost Market Price (1) top☝

14.6.1 Cost Market Price: TIFR CSE 2012 | Part A | Question: 6 top☝

A certain pair of used shoes can be repaired for and will last for year. A pair of the
same kind of shoes can be purchased new for and will last for years. The average
cost per year of the new shoes is what percent greater than the cost of repairing the used shoes?

A. B. C. D. E.
tifr2012 cost-market-price

Answer key☟

14.7 Factors (3) top☝

14.7.1 Factors: TIFR CSE 2010 | Part A | Question: 20 top☝

How many integers from to are divisible by but not by ?

A. B. C. D. E.
tifr2010 quantitative-aptitude factors

Answer key☟

14.7.2 Factors: TIFR CSE 2011 | Part A | Question: 15 top☝

The exponent of in the product is

A. B. C. D. E. None of the above


tifr2011 quantitative-aptitude factors tricky

Answer key☟

14.7.3 Factors: TIFR CSE 2013 | Part A | Question: 12 top☝

Among numbers to how many are divisible by or ?

A. B. C. D. E. None of the above


tifr2013 quantitative-aptitude factors normal

Answer key☟
14.8 Fraction (2) top☝

14.8.1 Fraction: TIFR CSE 2014 | Part A | Question: 11 top☝

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, of the babies are born male?

A. B. C. D. E.
tifr2014 quantitative-aptitude fraction tricky

Answer key☟

14.8.2 Fraction: TIFR CSE 2017 | Part A | Question: 1 top☝

A suitcase weighs one kilogram plus half of its weight. How much does the suitcase weigh?

A. ... kilograms B. kilograms


C. ... kilograms D. kilograms
E. cannot be determined from the
given data
tifr2017 quantitative-aptitude fraction normal

Answer key☟

14.9 Geometry (9) top☝

14.9.1 Geometry: TIFR CSE 2010 | Part A | Question: 17 top☝

Suppose there is a sphere with diameter at least 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 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.

A. cu. inches B. cu. inches


C. cu. inches D. cu. inches
E. cu. inches
tifr2010 quantitative-aptitude geometry

Answer key☟

14.9.2 Geometry: TIFR CSE 2012 | Part A | Question: 4 top☝

Let be a triangle with distinct points inside. A triangulation of with respect to the
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 has been partitioned into
triangles with end points at the points or at the vertices . For example, the following figure
gives one possible triangulation of with two points inside it.

Although there are many different ways to triangulate with the points inside, the number of
triangles depends only on . In the above figure it is five. How many triangles are there in a
triangulation of with points inside it?
A. B. C. D. E.
tifr2012 quantitative-aptitude geometry

Answer key☟

14.9.3 Geometry: TIFR CSE 2012 | Part A | Question: 5 top☝

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 quantitative-aptitude geometry

Answer key☟

14.9.4 Geometry: TIFR CSE 2013 | Part A | Question: 5 top☝

The late painter Maqbool Fida Husain once coloured the surface of a huge hollow steel sphere,
of radius 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 for solving this problem. Which of the following is
true?

A. Baij is bound to succeed if the area of the red part is ;


B. Baij is bound to fail if the area of the red part is ;
C. Baij is bound to fail if the area of the red part is ;
D. Baij is bound to succeed if the area of the red part is ;
E. None of the above.

tifr2013 geometry quantitative-aptitude

Answer key☟

14.9.5 Geometry: TIFR CSE 2015 | Part A | Question: 2 top☝

Consider a circle with a circumference of one unit length. Let . Suppose that we
independently throw two arcs, each of length , 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 exactly covers length of the circumference. What can be said about the
probability that the two arcs do not intersect each other?

A. It equals B. It equals
C. It equals D. It equals
E. It equals
tifr2015 geometry

Answer key☟

14.9.6 Geometry: TIFR CSE 2015 | Part A | Question: 9 top☝

Consider a square of side length . 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 from each other.

Which of the above is true:

A. only B. only C. only D. and E. None of the above


tifr2015 geometry quantitative-aptitude easy

Answer key☟

14.9.7 Geometry: TIFR CSE 2017 | Part A | Question: 13 top☝

A set of points is convex if for any points , every point on the straight line
joining and is also in . For two sets of points , define the sum as the set
of points obtained by adding a point in to a point . That is,
. Similarly,
is the set of
points obtained by subtracting a point in from a point in . Which of the following statements is TRUE
for all convex sets ?

A. is convex but not


B. is convex but not
C. exactle one of and is convex, but it depends on and which one
D. neither nor is convex
E. both and are convex

tifr2017 quantitative-aptitude geometry

Answer key☟

14.9.8 Geometry: TIFR CSE 2017 | Part A | Question: 8 top☝

In a tutorial on geometrical constructions, the teacher asks a student to construct a right-angled


triangle ABC where the hypotenuse BC is 8 inches and the length of the perpendicular dropped
from A onto the hypotenuse is inches, and offers various choices for teh value of . For which value
of can such a triangle NOT exist?

A. 3.90 inches B. inches


C. inches D. 4.1 inches
E. none of the above
tifr2017 quantitative-aptitude geometry

Answer key☟

14.9.9 Geometry: TIFR CSE 2018 | Part A | Question: 1 top☝

Consider a point inside a circle that is at distance from the centre of a circle. Suppose
you told that there is a chord of length passing through with as its midpoint. How many
distinct chords of have integer length and pass through

A. B. C. D. E.
tifr2018 quantitative-aptitude geometry

Answer key☟

14.10 Logarithms (1) top☝


14.10.1 Logarithms: TIFR CSE 2010 | Part A | Question: 9 top☝

A table contains entries. When any one of the entries is requested, it is encoded into a
binary string and transmitted. The number of bits required is.

A. B.
C. D. Cannot be determined from the
given information.
E. None of the above.
tifr2010 quantitative-aptitude theory-of-computation logarithms

Answer key☟

14.11 Modular Arithmetic (3) top☝

14.11.1 Modular Arithmetic: TIFR CSE 2019 | Part A | Question: 2 top☝

How many proper divisors (that is, divisors other than or ) does have ?

A. B. C. D. E.
tifr2019 modular-arithmetic quantitative-aptitude

Answer key☟

14.11.2 Modular Arithmetic: TIFR CSE 2019 | Part A | Question: 7 top☝

What are the last two digits of ?

A. B. C. D. E.
tifr2019 modular-arithmetic quantitative-aptitude

Answer key☟

14.11.3 Modular Arithmetic: TIFR CSE 2019 | Part B | Question: 14 top☝

Let and be two positive integers. Which of the following is NOT always true?

A. If and are co-prime, there exist integers and such that


B.
C. The rational number is an integer
D. is a factor of
E. If is prime, then is prime

tifr2019 general-aptitude quantitative-aptitude modular-arithmetic

Answer key☟

14.12 Number Representation (1) top☝

14.12.1 Number Representation: TIFR CSE 2012 | Part A | Question: 11 top☝

Let be the sum of all numbers from to except the five primes numbers:
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 ?

A. B. C. D. E.
tifr2012 quantitative-aptitude number-representation
Answer key☟

14.13 Number Series (5) top☝

14.13.1 Number Series: TIFR CSE 2011 | Part A | Question: 8 top☝

The sum of the first terms of the series is.

A. B.
C. D.
E. None of the above
tifr2011 quantitative-aptitude number-series

Answer key☟

14.13.2 Number Series: TIFR CSE 2013 | Part A | Question: 15 top☝

Let

What is the value of the following summation?

A. B. C. D. E.
tifr2013 quantitative-aptitude number-series

Answer key☟

14.13.3 Number Series: TIFR CSE 2013 | Part A | Question: 8 top☝

Find the sum of the infinite series

A. B. C. D. E.

tifr2013 quantitative-aptitude number-series

Answer key☟

14.13.4 Number Series: TIFR CSE 2014 | Part A | Question: 7 top☝

Consider a sequence of non-negative numbers . Which of the following


statements cannot be true?

A. and .
B. and .
C. and .
D. and .
E. and .

tifr2014 quantitative-aptitude number-series

Answer key☟
14.13.5 Number Series: TIFR CSE 2015 | Part A | Question: 3 top☝

Let . Define what is

A. Can't be determined
B. C. D. E. None of the above
tifr2015 quantitative-aptitude numerical-computation number-series

Answer key☟

14.14 Number System (2) top☝

14.14.1 Number System: TIFR CSE 2020 | Part A | Question: 15 top☝

The sequence is defined as follows:

What is ?

A. B. C. D. E.
tifr2020 general-aptitude quantitative-aptitude number-system

Answer key☟

14.14.2 Number System: TIFR CSE 2020 | Part A | Question: 6 top☝

What is the maximum number of regions that the plane can be partitioned into using
lines?

A. B. C. D. E.
Hint: Let be the maximum number of partitions that can be made by lines. Observe that
etc. Come up with a recurrence equation for .

tifr2020 general-aptitude quantitative-aptitude number-system

Answer key☟

14.15 Number Theory (1) top☝

14.15.1 Number Theory: TIFR CSE 2014 | Part A | Question: 20 top☝

Consider the equation . The total number of integral solutions of this


equation in the range of the first numbers, i.e., , is

A. B. C. D. E. None of the above


tifr2014 number-theory quantitative-aptitude

Answer key☟

14.16 Numerical Computation (5) top☝


14.16.1 Numerical Computation: TIFR CSE 2010 | Part A | Question: 14 top☝

A marine biologist wanted to estimate the number of fish in a large lake. He threw a net and
found fish in the net. He marked all these fish and released them into the lake. The next
morning he again threw the net and this time caught fish, of which two were found to be marked.
The (approximate) number of fish in the lake is:

A. B. C. D. E.
tifr2010 quantitative-aptitude numerical-computation

Answer key☟

14.16.2 Numerical Computation: TIFR CSE 2014 | Part A | Question: 1 top☝

Consider the reactions

Let , , denote the numbers of molecules of chemicals in the reaction chamber.


Then which of the following is conserved by both reactions?

A. . B. .
C. . D. .
E. None of the above.
tifr2014 quantitative-aptitude numerical-computation

Answer key☟

14.16.3 Numerical Computation: TIFR CSE 2014 | Part A | Question: 4 top☝

Consider numbers greater than one that satisfy the following properties:

i. They have no repeated prime factors;


ii. For all primes , divides the number if and only if divides the number.

The number of such numbers is

A. B. C. D. Infinite E. None of the above


tifr2014 quantitative-aptitude difficult numerical-computation

Answer key☟

14.16.4 Numerical Computation: TIFR CSE 2015 | Part B | Question: 12 top☝

Let be the sum of the first natural numbers, for . A number is called triangular if it is
equal to for some . 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 is a perfect square, then so is .
iii. The sum of the reciprocals of the first triangular numbers is less than , i.e.

A. only B. only
C. only D. All of the above
E. None of the above
tifr2015 quantitative-aptitude normal numerical-computation
Answer key☟

14.16.5 Numerical Computation: TIFR CSE 2019 | Part A | Question: 9 top☝

Let and be two containers. Container contains litres of liquid and container
contains litres of liquid . Liquids and are soluble in each other.
We now take ml of liquid from container and put it into container . The mixture in container
is then thoroughly mixed and ml of the resulting mixture is put back into container .At the end of
this process let be the volume of liquid and be the volume of liquid in container .
Which of the following must be TRUE ?

A. B.
C. D.
E.
tifr2019 general-aptitude quantitative-aptitude numerical-computation

Answer key☟

14.17 Polynomials (1) top☝

14.17.1 Polynomials: TIFR CSE 2013 | Part B | Question: 2 top☝

Consider polynomials in a single variable of degree . Suppose . For such a


polynomial , let denote the -tuple . For any two such distinct polynomials
the number of coordinates where the tuples differ is.

A. At most B. At most
C. Between and D. At least
E. None of the above.
tifr2013 polynomials non-gate

Answer key☟

14.18 Quantitative Aptitude (2) top☝

14.18.1 Quantitative Aptitude: TIFR CSE 2011 | Part A | Question: 20 top☝

Let be an odd integer. The number of zeros at the end of the number is

A. B. C. D. E. None of the above


tifr2011 quantitative-aptitude combinatory

Answer key☟

14.18.2 Quantitative Aptitude: TIFR CSE 2013 | Part A | Question: 1 top☝

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. B. C. D. E.

tifr2013 quantitative-aptitude combinatory

Answer key☟

14.19 Ratio Proportion (2) top☝

14.19.1 Ratio Proportion: TIFR CSE 2012 | Part A | Question: 18 top☝

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. B. C. D. E.
tifr2012 quantitative-aptitude ratio-proportion

Answer key☟

14.19.2 Ratio Proportion: TIFR CSE 2014 | Part A | Question: 2 top☝

A body at a temperature of Celsius is immersed into a heat bath at Celsius at time .


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 Celsius divided by the time taken for the body to reach Celsius.

A. B. C. D. E. None of the above

tifr2014 quantitative-aptitude ratio-proportion

Answer key☟

14.20 Sequence Series (1) top☝

14.20.1 Sequence Series: TIFR CSE 2013 | Part A | Question: 19 top☝

Consider a sequence of numbers , such that and

for . Which of the following statements is true?


Hint: Consider the sequence of reciprocals.

A. The sequence converges to zero.


B. for all
C. The sequence is decreasing and converges to
D. The sequence is decreasing and then increasing. Finally it converges to
E. None of the above.

tifr2013 quantitative-aptitude sequence-series

Answer key☟

14.21 Speed Time Distance (2) top☝


14.21.1 Speed Time Distance: TIFR CSE 2012 | Part A | Question: 16 top☝

Walking at is normal speed a man is minute too late. Find his usual time in minutes.

A.
B.
C.
D.
E. It is not possible to determine the usual time from given data.

tifr2012 quantitative-aptitude speed-time-distance

Answer key☟

14.21.2 Speed Time Distance: TIFR CSE 2017 | Part A | Question: 3 top☝

On planet TIFR, the acceleration of an object due to gravity is half that on planet earth. An object
on planet earth dropped from a height takes time to reach the ground. On planet TIFR, how
much time would an object dropped from height take to reach the ground?

A. B. C. D. E.

tifr2017 quantitative-aptitude speed-time-distance

Answer key☟

14.22 Statistics (1) top☝

14.22.1 Statistics: TIFR CSE 2015 | Part A | Question: 15 top☝

Let and be non-empty disjoint sets of real numbers. Suppose that the average of the
numbers in the first set is and the average of the numbers in the second set is ; let the
corresponding variances be and respectively. If the average of the elements in is
, what is the variance of the elements in

A.
B.
C.
D.
E.

tifr2015 statistics

Answer key☟

14.23 Three Dimensional Geometry (1) top☝

14.23.1 Three Dimensional Geometry: TIFR CSE 2018 | Part A | Question: 2 top☝

Consider the following subset of (the first two are cylinder, the third is a plane):

Let Which of the following best describe the shape of set


A. Circle B. Ellipse
C. Triangle D. Square
E. An octagonal convex figure with
curved sides
tifr2018 quantitative-aptitude geometry three-dimensional-geometry non-gate

Answer key☟

Answer Keys
14.0.1 E 14.1.1 C 14.1.2 B 14.1.3 D 14.2.1 C
14.3.1 E 14.3.2 E 14.3.3 B 14.4.1 A 14.4.2 B
14.4.3 A 14.5.1 D 14.6.1 B 14.7.1 A 14.7.2 D
14.7.3 D 14.8.1 A 14.8.2 D 14.9.1 B 14.9.2 D
14.9.3 D 14.9.4 D 14.9.5 C 14.9.6 C 14.9.7 E
14.9.8 D 14.9.9 D 14.10.1 D 14.11.1 C 14.11.2 B
14.11.3 B 14.12.1 E 14.13.1 A 14.13.2 C 14.13.3 D
14.13.4 E 14.13.5 B 14.14.1 C 14.14.2 D 14.15.1 E
14.16.1 A 14.16.2 B 14.16.3 E 14.16.4 D 14.16.5 A
14.17.1 D 14.18.1 B 14.18.2 D 14.19.1 A 14.19.2 D
14.20.1 A 14.21.1 D 14.21.2 B 14.22.1 C 14.23.1 D
15 General Aptitude: Verbal Aptitude (2)

15.1 Quantitative Aptitude (2) top☝

15.1.1 Quantitative Aptitude: TIFR CSE 2019 | Part A | Question: 8 top☝

Consider the following toy model of traffic on a straight , single lane, highway. We think of cars
as points, which move at the maximum speed that satisfies the following constraints:

1. The speed is no more than the speed limit mandated for the highway.
2. The speed is such that when traveling at this speed, it takes at least time (where is a fixed
time representing the reaction time of drivers) to reach the car ahead, in case the car ahead stops
suddenly.

Let as assume that in the steady state, all cars on the highway move at the same speed satisfying
both the above constraints, and the distance between any two successive cars is the same. Let
denote the “density” , that is, the number of card per unit length of the highway. Which of the following
graphs most accurately captures the relationship between the speed and the density in this model ?

A. B.

C. D.

E.
tifr2019 general-aptitude quantitative-aptitude

Answer key☟

15.1.2 Quantitative Aptitude: TIFR CSE 2020 | Part A | Question: 9 top☝

A contiguous part, i.e., a set of adjacent sheets, is missing from Tharoor’s GRE preparation
book. The number on the first missing page is , and it is known that the number on the last
missing page has the same three digits, but in a different order. Note that every sheet has two pages,
one at the front and one at the back. How many pages are missing from Tharoor's book?

A. B. C. D. E.
tifr2020 general-aptitude quantitative-aptitude

Answer key☟

Answer Keys
15.1.1 C 15.1.2 C
16 Non GATE: Object Oriented Programming (1)

16.1 Object Oriented Programming (1) top☝

16.1.1 Object Oriented Programming: TIFR CSE 2011 | Part B | Question: 40 top☝

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 object-oriented-programming non-gate

Answer key☟

Answer Keys
16.1.1 B
17 Operating System (11)

17.1 Page Replacement (1) top☝

17.1.1 Page Replacement: TIFR CSE 2013 | Part B | Question: 14 top☝

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.

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 program’s
execution, how many times will the pages and be brought to the memory?

A. times, respectively B. times, respectively


C. times, respectively D. times, respectively
E. None of the above
tifr2013 operating-system page-replacement

Answer key☟

17.2 Process Synchronization (8) top☝

17.2.1 Process Synchronization: TIFR CSE 2010 | Part B | Question: 28 top☝

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 at the end of the execution of the program is:

A. B. C. D. E.
tifr2010 process-synchronization

Answer key☟

17.2.2 Process Synchronization: TIFR CSE 2010 | Part B | Question: 32 top☝

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;
while not (Turn=2) do skip od;
Critical_section_2;
Turn:=1;
end loop
end

Initially, Turn , 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

Answer key☟

17.2.3 Process Synchronization: TIFR CSE 2011 | Part B | Question: 22 top☝

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.
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

Answer key☟

17.2.4 Process Synchronization: TIFR CSE 2011 | Part B | Question: 26 top☝

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). 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

Answer key☟

17.2.5 Process Synchronization: TIFR CSE 2011 | Part B | Question: 28 top☝

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 is not equal to .
D. They will be equivalent in concurrent programming languages with shared memory.
E. None of the above.

tifr2011 process-synchronization operating-system normal

Answer key☟

17.2.6 Process Synchronization: TIFR CSE 2011 | Part B | Question: 34 top☝

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

Answer key☟

17.2.7 Process Synchronization: TIFR CSE 2012 | Part B | Question: 9 top☝

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 at the end of execution of the program is

A. B. C. D. E.
tifr2012 process-synchronization operating-system

Answer key☟

17.2.8 Process Synchronization: TIFR CSE 2015 | Part B | Question: 14 top☝

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 at the end of execution of the program is

A. B.
C. D.
E.
tifr2015 process-synchronization operating-system normal

Answer key☟

17.3 Round Robin Scheduling (1) top☝

17.3.1 Round Robin Scheduling: TIFR CSE 2020 | Part B | Question: 8 top☝

Jobs keep arriving at a processor. A job can have an associated time length as well as a priority
tag. New jobs may arrive while some earlier jobs are running. Some jobs may keep running
indefinitely. A job-scheduling policy guarantees that no job waits indefinitely for service.
Which of the following job-scheduling policies is starvation free?

A. Round – robin B. Shortest job first


C. Priority queuing D. Latest job first
E. None of the others
tifr2020 operating-system process-scheduling round-robin-scheduling

Answer key☟

17.4 Semaphore (1) top☝

17.4.1 Semaphore: TIFR CSE 2012 | Part B | Question: 10 top☝

Consider the blocked-set semaphore where the signaling process awakens any one of the
suspended process; i.e.,
Wait (S): If then , else suspend the execution of this process.
Signal (S): If there are processes that have been suspended on semaphore , then wake any one of
them, else
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 is the number of concurrent processors. Which of the following is true?

A. The program fails to achieve mutual exclusion of critical regions.


B. The program achieves mutual exclusion, but starvation freedom is ensured only for
C. The program does not ensure mutual exclusion if
D. The program achieves mutual exclusion, but allows starvation for any
E. The program achieves mutual exclusion and starvation freedom for any

tifr2012 operating-system process-synchronization semaphore

Answer key☟

Answer Keys
17.1.1 B 17.2.1 C 17.2.2 E 17.2.3 D 17.2.4 C
17.2.5 E 17.2.6 Q-Q 17.2.7 C 17.2.8 B 17.3.1 A
17.4.1 B
18 Others: Others (91)

18.0.1 TIFR CSE 2016 | Part A | Question: 2 top☝

Consider the graph shown below:

The following experiment is performed using this graph. First, an edge of the graph is
chosen uniformly at random from the set of 9 possibilities. Next, a common neighbour of and is
chosen, again uniformly from the set of possibilities. (Note that the set of possibilities is always non-
empty.) Thus, is a triangle in the graph. What is the probability that the triangle finally picked is
?

A. B. C. D. E.
tifr2016 graph-theory probability

Answer key☟

18.0.2 TIFR CSE 2016 | Part B | Question: 6 top☝

A subset of is convex if for all and all , we have .


If is a convex set, which of the following statements is necessarily TRUE?

A. For every there exist and so that


B. If and , then
C. If , then
D. If , then for all scalars
E. If , then

tifr2016

18.0.3 TIFR CSE 2021 | Part B | Question: 3 top☝

What is the prefix expression corresponding to the expression:

You may assume that has precedence over ?

A.
B.
C.
D.
E.

tifr2021

Answer key☟

18.0.4 TIFR CSE 2016 | Part B | Question: 14 top☝

Consider a family of subsets of such that for any two distinct sets and in
we have: or or . Which of the following statements is TRUE? (Hint:
what does the Venn diagram of this family look like?)

A. and there exists a family such that


B. and there exists a family such that
C. and there exists a family such that
D. and there exists a family such that
E. None of the above

tifr2016

Answer key☟

18.0.5 TIFR CSE 2016 | Part A | Question: 9 top☝

Suppose a rectangular farm has area 100 square meters. The lengths of its sides are not known.
It is known, however, that all the edges are at least 2 meters in length. Which of the following
statements about the rectangle's perimeter (in meters) is FALSE?

A. can take all values between 45 B. can be 52 for some configuration


and 50
C. can take all values between 55 D. can be 70 for some configuration
and 60
E. can be 39 for some configuration
tifr2016

Answer key☟

18.0.6 TIFR CSE 2016 | Part A | Question: 10 top☝

Consider the sequence defined as follows: , and


, for . Which of the following statements is FALSE?

A. is even, for any


B. is odd, for any
C. is odd, for any
D. is a multople of 3, for only finitely many values of
E. is even, for any

tifr2016

Answer key☟

18.0.7 TIFR CSE 2016 | Part A | Question: 11 top☝

In one of the islands that his travels took him to, Gulliver noticed that the probability that a
(uniformly) randomly chosen inhabitant has height at least 2 meters is 0.2. Also, 0.2 is the
probability that a a (uniformly) randomly chosen inhabitant has height at most 1.5 meters. What can we
conclude about the average height in meters of the inhabitants of the island?

i.
ii.
iii.

Which of the above statements is necessarily true?

A. ii only B. iii only C. i, ii and iii D. ii and iii only E. None of the above
tifr2016 probability
Answer key☟

18.0.8 TIFR CSE 2016 | Part B | Question: 15 top☝

Let be an undirected graph. For a pair of distinct vertices of , let be the


least number of edges that should be delted from so that the resulting graph has no
path. Let be three vertices in such that
. Consider the following possibilities:

i.
ii.
iii.
iv.

Which of the following is TRUE?

A. All of i, ii iii, iv are possible


B. i, ii, iii are possible but not iv
C. i and iv are possible but neither ii nor iii
D. ii and iv are possible but neither i not iii
E. iii and iv are possible but neither i nor ii

tifr2016

Answer key☟

18.0.9 TIFR CSE 2016 | Part B | Question: 5 top☝

Consider the recursive function .


int mc91(int n)
{
print n
if (n > 100) {
return n-10;
}
else {
return mc91(mc91(n+11));
}
}

Let

Then which of the following is ?

A. B.
C. D.
E.
tifr2016

Answer key☟

18.0.10 TIFR CSE 2016 | Part B | Question: 10 top☝

A in an undirected graph is a subset such that every edge of has


an endpoint in . An independent set in is a subset such that no edge has both its
endpoints in . Which of the following is TRUE of every graph and every vertex cover of ?

A. There exists an independent set of size


B. is an independent set
C.
D.
E. intersects every independent set

tifr2016

Answer key☟

18.0.11 TIFR CSE 2021 | Part B | Question: 4 top☝

Consider the following two languages.

What can you say about the languages and ?

A. is in , but is not in .
B. Neither nor are in .
C. Both and are in .
D. is not in , but is in .
E. None of the above since we can answer this question only if we resolve the status of the vs.
question.

tifr2021

Answer key☟

18.0.12 TIFR CSE 2016 | Part B | Question: 11 top☝

Let be an integer. Regard the set as a vector space over . Consider the following
undirected graph .

where . Which of the following statements is FALSE?

A. has an inifinite number of B. The diameter of is infinite


vertices
C. is conneceted D. contains an infinite clique
E. contains an infinite independent
set
tifr2016

Answer key☟

18.0.13 TIFR CSE 2016 | Part B | Question: 12 top☝

A computer program computes a function . Suppose


ahs length , where and are the lengths of and . Suppose, using this program, the
following computation is performed.
x="01"
for i=1, ... , n do
x=f("01", x)

Suppose at the end, the length of the string is . Which of the following is TRUE (assume $n \geq
10)?
A. B.
C. D.
E.
tifr2016

Answer key☟

18.0.14 TIFR CSE 2016 | Part B | Question: 13 top☝

An undirected graph is said to be -colourable if there exists a mapping


such that for every edge we have . Which of the
following statements is ?

A. is -colourable
B. is -colourable if there are no odd cycles in
C. is -colourable where is the maximum degree in
D. There is a polynomial time algorithm to check if is -colourable
E. If has no triangle then it is -colourable

tifr2016

Answer key☟

18.0.15 TIFR CSE 2016 | Part A | Question: 3 top☝

Consider the following set of linear equations in variables:

Let be the set of solutions to this set of equations. Then,

A. is empty
B. is a subspace of of dimension 1
C. is a subspace of of dimension n
D. is a subspace of of dimension
E. has exactly elements

tifr2016

Answer key☟

18.0.16 TIFR CSE 2021 | Part A | Question: 3 top☝

Let be an real matrix. Consider the following:

Let be the smallest number such that can be factorized as , where is an and
is a matrix.
Let be the smallest number such that where each is an matrix and
each is an matrix.
Let be the column-rank of .

Which of the following statements is ?

A. B.
C. D.
E. No general relationship exists
among and
tifr2021

Answer key☟

18.0.17 TIFR CSE 2021 | Part A | Question: 14 top☝

Five married couples attended a party. In the party, each person shook hands with those they
did not know. Everyone knows his or her spouse. At the end of the party, Shyamal, one of the
attendees, listed the number of hands that other attendees including his spouse shook. He got every
number from to once in the list. How many persons shook hands with Shyamal at the party?

A. B.
C. D.
E. Insufficient information
tifr2021

Answer key☟

18.0.18 TIFR CSE 2022 | Part A | Question: 5 top☝

Let be the set of all functions mapping to . Let be a function that is


chosen uniformly at random from . Let be distinct elements from the set . Let
denote the probability that . Then,

A. B. C. D. E.
tifr2022

Answer key☟

18.0.19 TIFR CSE 2021 | Part B | Question: 12 top☝

Let be an undirected graph. For any two vertices in , let be the minimum
number of edges that should be deleted from so that there is no path between and in the
resulting graph. Let be vertices in . Which of the following statements is impossible?

A. , and
B. , and
C. , and
D. , and
E. , and

tifr2021

Answer key☟

18.0.20 TIFR CSE 2021 | Part B | Question: 5 top☝

For a language over the alphabet , let denote the complement of and let
denote the Kleene-closure of . Consider the following sentences.

i. and are both context-free.


ii. is not context-free but is context-free.
iii. is context-free but is regular.
Which of the above sentence(s) is/are true if ?

A. Both (i) and (iii) B. Only (i) C. Only (iii) D. Only (ii) E. None of the above
tifr2021

Answer key☟

18.0.21 TIFR CSE 2022 | Part A | Question: 3 top☝

A binary string is a sequence of and A binary string is finite if the sequence is finite,
otherwise it is infinite. Examples of finite binary strings include , and
Which of the following is about the set of all finite binary strings and the set of all infinite binary
strings?

A. The set of all finite binary strings is countable while the set of all infinite binary strings is uncountable
B. The set of all finite binary strings is uncountable while the set of all infinite binary strings is countable
C. The set of all finite binary strings and the set of all infinite binary strings are both countable
D. The set of all finite binary strings and the set of all infinite binary strings are both uncountable
E. The set of all finite binary strings is countable while whether the set of all infinite binary strings is
countable or not is not known

tifr2022

Answer key☟

18.0.22 TIFR CSE 2021 | Part B | Question: 15 top☝

Let be an array of distinct integers. We wish to sort in


ascending order. We are given that each element in the array is at a position that is at most
away from its position in the sorted array, that is, we are given that will move to a position in
after the array is sorted in ascending order. Suppose
insertion sort is used to sort this array: that is, in the th iteration, is compared with the elements in
positions until one that is smaller is found and is inserted after that
element. Note that elements can be moved back when later insertions are made before them. Let
be the worst-case number of comparisons made by insertion sort for such inputs. Then,

A.
B.
C.
D.
E.

tifr2021

Answer key☟

18.0.23 TIFR CSE 2020 | Part B | Question: 5 top☝

Let be a point on the unit circle in the first quadrant (i.e., both coordinates of are positive).
Let be the angle subtended by and the axis at the origin. Let denote the infinite line
passing through the origin and . Consider the following operation on points in the plane.

a point on the plane

1. Reflect in the axis, obtaining .


2. Reflect in , obtaining .
3. Output .

If is the output of applying on , we write . Further, we denote by the iterates of


, i.e., and for all integers .
Consider a point in the first quadrant such that and the -axis subtend an angle at the origin.
Define Assuming and , what is the angle subtended by and the -axis
at the origin?

A. B. C. D. E.
tifr2020

Answer key☟

18.0.24 TIFR CSE 2020 | Part B | Question: 6 top☝

Consider the context-free grammar below ( denotes the empty string, alphabet is ):

What language does it generate?

A. B.
C. D. Strings of the form or
any positive integer
E. Strings with equal numbers of
and
tifr2020

Answer key☟

18.0.25 TIFR CSE 2020 | Part B | Question: 7 top☝

Consider the following algorithm (Note: For positive integers, denotes the floor of the
rational number , assume that given can be computed in one step):

Two positive integers


A positive integers
while(b>0) {
x = a – (a/b)*b;
a = b;
b = x;
}

g = a;

Suppose is an upper bound on . How many iterations does the above algorithm take in the worst
case?

A. B. C. D. E.
tifr2020

18.0.26 TIFR CSE 2020 | Part B | Question: 9 top☝

A particular Panini-Backus-Naur Form definition for a is given by the following rules:


Which of the following lexical entities can be derived from

I.
II.
III.

A. None of B. and only C. and only D. and only E. and


tifr2020

Answer key☟

18.0.27 TIFR CSE 2020 | Part B | Question: 12 top☝

Given the pseudocode below for the function , which of the following statements is
true about the output, if we pass it a positive integer ?
int remains(int n)
{
int x = n;
for (i=(n-1);i>1;i--) {
x=x%i;
}
return x;
}

A. Output is always B. Output is always


C. Output is only if is NOT a D. Output is only if is a prime
prime number number
E. None of the above
tifr2020

Answer key☟

18.0.28 TIFR CSE 2020 | Part B | Question: 13 top☝

Let be an undirected graph. An Eulerian cycle of is a cycle that traverses each edge of
exactly once. A Hamiltonian cycle of is a cycle that traverses each vertex of exactly once.
Which of the following must be true?

A. Checking if has a Eulerian cycle can be done in polynomial time


B. Deciding if has a Hamiltonian cycle is not NP-complete
C. If has an Eulerian cycle, then it has a Hamiltonian cycle
D. A complete graph always has both an Eulerian cycle and a Hamiltonian cycle
E. All of the other statements are true

tifr2020

Answer key☟

18.0.29 TIFR CSE 2020 | Part B | Question: 14 top☝

The figure below describes the network of streets in a city where Motabhai sells from
his cart. The number next to an edge is the time (in minutes) taken to traverse the corresponding
street.
At present, the cart is required to start at point and, after visiting each street at least once, reach point
. For example, Motabhai can visit the streets in the following order

in order to go from to . Note that the streets and are both visited twice in this strategy.
The total time taken for this trip is minutes [which is, (the sum of traversal times of all streets in
the network) (the sum of the traversal times of streets and )].
Motabhai now wants the cart to return to at the end of the trip. So the previous strategy is not valid,
and he must find a new strategy. How many minutes will Motabhai now take if he uses an optimal
strategy?
Hint: and are the only odd degree nodes in the figure above.

A. B. C. D. E.
tifr2020

Answer key☟

18.0.30 TIFR CSE 2021 | Part B | Question: 14 top☝

Consider the following greedy algorithm for colouring an -vertex undirected graph with
colours consider the vertices of in any sequence and assign the chosen vertex the
first colour that has not already been assigned to any of its neighbours. Let be the minimum
number of edges in a graph that causes this greedy algorithm to use colours. Which of the following is
correct?

A.
B.
C.
D.
E.
tifr2021

Answer key☟

18.0.31 TIFR CSE 2021 | Part B | Question: 6 top☝

Consider the following pseudocode:


procedure HowManyDash(n)
if n=0 then
print '-'
else if n=1 then
print '-'
else
HowManyDash(n-1)
HowManyDash(n-2)
end if
end procedure

How many ‘-’ does HowManyDash print?

A. B. C. D. E.
tifr2021

Answer key☟

18.0.32 TIFR CSE 2020 | Part B | Question: 4 top☝

A gate is an analog gate parametrized by two real numbers and , and denoted as
. It takes as input two non-negative real numbers and . Its output is defined as

Consider circuits composed only of clamp gates, possibly parametrized by different pairs of real
numbers. How many clamp gates are needed to construct a circuit that on input non-negative reals
and outputs the maximum of and

A.
B.
C.
D.
E. No circuit composed only of clamp gates can compute the max function

tifr2020

Answer key☟

18.0.33 TIFR CSE 2021 | Part B | Question: 13 top☝

Let be a matrix with real-valued entries. Matrix has rank . We construct a graph with
vertices where each vertex represents distinct column in , and there is an edge between two
vertices if the two columns represented by the vertices are linearly independent. Which of the following
statements be true of the graph constructed?

A. Each vertex has degree at most . B. The graph is connected.


C. There is a clique of size . D. The graph has a cycle of length .
E. The graph is -colourable.
tifr2021

Answer key☟
18.0.34 TIFR CSE 2021 | Part B | Question: 11 top☝

Suppose we toss a fair coin (i.e., both beads and tails have equal probability of appearing)
repeatedly until the first time by which at least heads and at least tails have appeared
in the sequence of tosses made. What is the expected number of coin tosses that we would have to
make?

A. B. C. D. E.
tifr2021

Answer key☟

18.0.35 TIFR CSE 2021 | Part B | Question: 10 top☝

Let be a connected bipartite simple graph (i.e., no parallel edges) with distinct edge weights.
Which of the following statements on (minimum spanning tree) need be true?

A. has a unique .
B. Every in contains the lightest edge.
C. Every in contains the second lightest edge.
D. Every in contains the third lightest edge.
E. No in contains the heaviest edge.

tifr2021

Answer key☟

18.0.36 TIFR CSE 2021 | Part B | Question: 9 top☝

Let be a context-free language generated by the context-free grammar


where is the finite set of variables, the finite set of terminals (disjoints from ), the finite
set of rules and the start variable. Consider the context-free grammar obtained by adding
to the set of rules in . What must be true for the language generated by ?

A. B.
C. D.
E. None of the above
tifr2021

Answer key☟

18.0.37 TIFR CSE 2021 | Part B | Question: 8 top☝

Let and be two matrices of size and with real-valued entries. Consider the following
statements.

1. If , then must be the identity matrix.


2. If is an idempotent (i.e. ) nonsingular matrix, then must be the identity matrix.
3. If , then must be the identity matrix.

Which of the above statements be true of ?

A. and B. Only and C. Only and D. Only and E. Only


tifr2021

Answer key☟
18.0.38 TIFR CSE 2021 | Part B | Question: 7 top☝

Which of the following regular expressions defines a language that is different from the other
choices?

A.
B.
C.
D.
E.

tifr2021

Answer key☟

18.0.39 TIFR CSE 2022 | Part A | Question: 4 top☝

Consider the polynomial . How many symmetric matrices with integer


entries are there whose characteristic polynomial is ? (Recall that the characteristic polynomial
of a square matrix in the variable is defined to be the determinant of the matrix where
is the identity matrix.)

A. B. C. D. E. Infinitely many
tifr2022

Answer key☟

18.0.40 TIFR CSE 2021 | Part B | Question: 2 top☝

Let be a singly-linked list and be additional pointer variables such that points to the
first element of and points to the last element of . Which of the following operations
cannot be done in time that is bound above by a constant?

A. Delete the first element of .


B. Delete the last element of .
C. Add an element after the last element of .
D. Add an element before the first element of .
E. Interchange the first two elements of .

tifr2021

Answer key☟

18.0.41 TIFR CSE 2022 | Part A | Question: 2 top☝

We would like to invite a minimum number of people (their birthdays are independent of each
other) to a party such that the expected number of pairs of people that share the same birthday
is at least What should be?
(Ignore leap years, so there are only possible birthdays. Assume that birthdays fall with equal
probability on each of the days of the year.)

A. B. C. D. E.
tifr2022

Answer key☟
18.0.42 TIFR CSE 2021 | Part A | Question: 6 top☝

A matching in a graph is a set of edges such that no two edges in the set share a common
vertex. Let be a graph on in which there is a subset of which is a
matching. Consider a random process where each vertex in the graph is independently selected with
probability and let be the set of vertices so obtained. What is the probability that there
exists at least one edge from the matching with both end points in the set ?

A. B.
C. D.
E.
tifr2021

Answer key☟

18.0.43 TIFR CSE 2022 | Part A | Question: 7 top☝

Initially, white beads are arranged in a circle. A number is chosen uniformly at random from
. Then a set of beads is chosen uniformly from the white beads, and these
beads are coloured black. The position of the beads remains unchanged. What is the probability that
the black beads occur sequentially in the circle, i.e., at most two black beads have white beads next to
them?

A. B.

C. D.

E. None of the above


tifr2022

Answer key☟

18.0.44 TIFR CSE 2022 | Part A | Question: 9 top☝

You are given the following properties of sets , and . For notation, denotes the
cardinality of set (i.e., the number of elements in ), and denotes the set of elements
that are in but not in .

1.
2.
3.
4.

Which of the following statements then be

A. B.
C. D.
E.
tifr2022

Answer key☟

18.0.45 TIFR CSE 2021 | Part A | Question: 13 top☝

What are the last two digits of ?

A. B. C. D. E.
tifr2021

Answer key☟

18.0.46 TIFR CSE 2021 | Part A | Question: 12 top☝

How many numbers in the range have exactly four ’s in their binary
representation? (Hint: is , that is,

In the following, the binomial coefficient counts the number of -element subsets of an -element
set.

A.
B.
C.

D.

E.
tifr2021

Answer key☟

18.0.47 TIFR CSE 2021 | Part A | Question: 11 top☝

Find the following sum.

A.

B.
C.

D.

E.
tifr2021

Answer key☟

18.0.48 TIFR CSE 2021 | Part A | Question: 10 top☝

Lavanya and Ketak each flip a fair coin (i.e., both heads and tails have equal probability of
appearing) times. What is the probability that Lavanya sees more heads than ketak?
In the following, the binomial coefficient counts the number of -element subsets of an -element
set.

A.

B.

C.
D.

E.
tifr2021

Answer key☟

18.0.49 TIFR CSE 2021 | Part A | Question: 9 top☝

Fix . Consider the set of binary strings of length such that the bits satisfy
the following set of equalities, all modulo : for all
and What is the size of the set ?

A. for all
B. for all
C. for all
D. If is divisible by . If is divisible by then .
E. If is divisible by . If is not divisible by then .

tifr2021

Answer key☟

18.0.50 TIFR CSE 2021 | Part A | Question: 8 top☝

Consider the sequence

for Which of the following is ?

A. The sequence does not have a limit as .


B. for all
C. exists and is equal to .
D. exists and is equal to .
E. The sequence first increases and then decreases as takes values

tifr2021

18.0.51 TIFR CSE 2021 | Part A | Question: 7 top☝

Let be the positive square integers (that is, it is a square of some integer) that are factors of
. Which of the following is true about ?

A. B.
C. D.
E.
tifr2021

Answer key☟

18.0.52 TIFR CSE 2021 | Part A | Question: 5 top☝

Let and be three positive integers such that . Let be a subset of


of size . Consider sampling a function uniformly at random from the set of all
functions mapping to . What is the probability that is not injective on the set
, i.e., there exist such that ?
In the following, the binomial coefficient counts the number of -element subsets of an -element
set.

A.

B.

C.

D.

E.
tifr2021

Answer key☟

18.0.53 TIFR CSE 2022 | Part A | Question: 1 top☝

A snail crawls up a vertical pole feet high, starting from the ground. Each day it crawls up
feet, and each night it slides down feet. When will it first reach the top of the pole?

A. day B. day C. day D. day E. day


tifr2022

Answer key☟

18.0.54 TIFR CSE 2022 | Part A | Question: 8 top☝

Let be the matrix given below, where . For , the -th row of
has every entry equal to and the last row, i.e., the -th row of has every entry
equal to .

Which of the following statements is for all

A. has rank B. has rank


C. All the eigenvalues of are D. All the eigenvalues of are
distinct
E. None of the above
tifr2022

Answer key☟

18.0.55 TIFR CSE 2021 | Part A | Question: 4 top☝

What is the probability that at least two out of four people have their birthdays in the same
month, assuming their birthdays are uniformly distributed over the twelve months?
A.

B.

C.

D.

E.
tifr2021

Answer key☟

18.0.56 TIFR CSE 2021 | Part A | Question: 2 top☝

What is the area of a rectangle with the largest perimeter that can be inscribed in the unit circle
(i.e., all the vertices of the rectangle are on the circle with radius )?

A. B. C. D. E.
tifr2021

Answer key☟

18.0.57 TIFR CSE 2021 | Part A | Question: 1 top☝

A box contains red marbles, green marbles, blue marbles, and yellow marbles. We
draw marbles uniformly at random without replacement from the box. What is the minimum
number of marbles to be drawn to ensure that out of the marbles drawn, at least are of the same
colour?

A. B. C. D. E.
tifr2021

Answer key☟

18.0.58 TIFR CSE 2022 | Part A | Question: 15 top☝

Fix . Suppose there is a particle that moves randomly on the number line, but never leaves
the set . The initial probability distribution of the particle is i.e., the probability
that particle is in location is given by . In the first step, if the particle is at position , it moves to
one of the positions in with uniform distribution; in the second step, if the particle is in
location , then it moves to one of the locations in with uniform distribution. Suppose
after two steps, the final distribution of the particle is uniform. What is the initial distribution

A. is not unique B. is uniform


C. is non-zero for all even and D. and for
zero otherwise
E. and for
tifr2022

Answer key☟

18.0.59 TIFR CSE 2022 | Part A | Question: 14 top☝

Suppose and are points that


move in the complex plane as the time varies in . Let be the point in the complex
plane such that is minimum. For each
value of , the point is unique, but moves at constant speed as varies. At what speed? That
is, what is

A. B. C. D. E.
tifr2022

18.0.60 TIFR CSE 2022 | Part A | Question: 13 top☝

Consider the transition system shown in the figure below with the initial state . A token is
initially placed at , and it moves to with probability , and to with probability . From
and , the token always moves to and respectively. A run of the system consists of an infinite
sequence of states constructed by moving the token from one state to another following the transitions
forever. Assuming such a run is chosen randomly, what is the fraction of times that the state is
expected to appear in the run?

A. B. C. D. E. None of the above


tifr2022

18.0.61 TIFR CSE 2022 | Part A | Question: 12 top☝

Alice plays the following game on a math show. There are boxes and identical prizes are
hidden inside of the boxes. Alice is asked to choose a box where a prize might be. She
chooses a box uniformly at random. From the unchosen boxes which do not have a prize, the host
opens an arbitrary box and shows Alice that there is no prize in it. The host then allows Alice to change
her choice if she so wishes. Alice chooses a box uniformly at random from the other boxes (other
than the one she chose first and the one opened by the host). Her probability of winning the prize is

A. B. C. D. E.
tifr2022

Answer key☟

18.0.62 TIFR CSE 2022 | Part A | Question: 11 top☝

Let be a finite set. A family of subsets of is said to be upward closed if the following
holds for all sets :

For families and of subsets of , let

Suppose and are upward closed families. Then which of the following is true?

A.
B.
C.
D.
E. None of the above
tifr2022

18.0.63 TIFR CSE 2022 | Part A | Question: 10 top☝

Consider a bag containing colored marbles. There are marbles in the bag such that there is
exactly one pair of marbles of color for each and the rest of the marbles are of
distinct colors (different from colors ). You draw two marbles uniformly at random (without
replacement). What is the probability that both marbles are of same color?

A. B. C. D. E.
tifr2022

Answer key☟

18.0.64 TIFR CSE 2021 | Part A | Question: 15 top☝

Let be a convex polygon with sides . For example, the following:

Consider the shape in the plane that consists of all points within distance from some point in . If is
the perimeter of the shape, which of the following is always correct?

A. cannot be determined from the B.


given information.
C. D.
E.
tifr2021

18.0.65 TIFR CSE 2022 | Part B | Question: 1 top☝

Which data structure is commonly used to implement breadth first search in a graph?

A. A queue B. A stack C. A heap D. A hash table E. A splay tree


tifr2022

Answer key☟

18.0.66 TIFR CSE 2022 | Part B | Question: 11 top☝

Consider the following function that takes as input an array of integers, and , the size
of the array.
int count(int a[], int N) {
int i, j, count_FN;
count_FN = 0;
for (i=1 ; i<N ; i++) {
j=i-1 ;
while (a[j]>a[i]) {
count_FN++;
j--;
}
}
return count_FN;
}

Further, let be the number of comparisons made by the insertion sort algorithm on the array
.
Which of the following statements is TRUE for some constant

A. For all , there exists an array of size for which , while


B. For all , there exists an array of size for which , while
C. For all , for all arrays of size
D. For all , for all arrays of size
E. None of the above

tifr2022

18.0.67 TIFR CSE 2022 | Part B | Question: 5 top☝

There is an unsorted list of integers. You are given distinct integers and you have to check if
all integers are present in the list or not. The only operation that you are allowed to perform is
a comparison. Let be an algorithm for this task that performs the least number of comparisons. Let
be the number of comparisons done by . Then,

A. B. C. D. E.
tifr2022

Answer key☟

18.0.68 TIFR CSE 2022 | Part B | Question: 9 top☝

Let be any integer. Which of the following statements is

A. divides the product of any consecutive integers

B.

C. , where

D. If is an odd prime, then divides

E. divides

tifr2022

Answer key☟

18.0.69 TIFR CSE 2022 | Part B | Question: 8 top☝

Let and be two regular expressions. They symbol stands for equivalence of two regular
expressions in the sense that if , then both regular expressions describe the same
language. Which of the following is/are ?

i.
ii.
iii.

A. Only (i) is false B. Only (ii) is false


C. Only (iii) is false D. Both (i) and (iii) are false
E. None of the above
tifr2022

18.0.70 TIFR CSE 2022 | Part B | Question: 7 top☝

Consider the following grammar: are non-terminals; are terminals; is the start
symbol; and the production rules follow.

Which of the following is False:

A. The length of every string produced by the grammar is even


B. No string produced by the grammar has an odd number of consecutive
C. No string produced by the grammar has four consecutive
D. No string produced by the grammar has three consecutive
E. Every string produced by the grammar has at least has many as

tifr2022

Answer key☟

18.0.71 TIFR CSE 2022 | Part A | Question: 6 top☝

L e t be a polynomial of degree all of whose roots are non-positive real numbers.


Suppose that . What is the maximum possible value of

A.
B.
C.
D.
E. can be arbitrarily large given only the constraints in the question

tifr2022

18.0.72 TIFR CSE 2022 | Part B | Question: 12 top☝

Given an undirected graph , an ordering of its vertices is called a perfect ordering if for every
vertex , the neighbours of which precede in form a clique in .
Recall that given an undirected graph , a clique in is a subset of vertices every two of which are
connected by an edge, while a perfect colouring of with colours is an assignment of labels from the
set to the vertices of such that no two vertices which are adjacent in receive the
same label.
Consider the following problems.
Problem SPECIAL-CLIQUE
INPUT: An undirected graph , a positive integer , and a perfect ordering of the vertices of .
OUTPUT: Yes, if has a clique of size at least , No otherwise.
Problem SPECIAL-COLOURING
INPUT: An undirected graph , a positive integer , and a perfect ordering of the vertices of .
OUTPUT: Yes, if has a proper colouring with at most colours, No otherwise.
Assume that . Which of the following statements is true?

A. Both SPECIAL-CLIQUE and SPECIAL-COLOURING are undecidable


B. Only SPECIAL-CLIQUE is in
C. Only SPECIAL-COLOURING is in
D. Both SPECIAL-CLIQUE and SPECIAL-COLOURING are in
E. Neither of SPECIAL-CLiQUE and SPECIAL-COLOURING is in but both are decidable

tifr2022

18.0.73 TIFR CSE 2022 | Part B | Question: 6 top☝

We are given a graph along with a matching and a vertex cover in it such that
. Consider the following statements:

1. is a maximum matching in .
2. is a minimum vertex cover in .
3. is a bipartite graph.

Which of the following is ?

A. Only statement is correct B. Only statement is correct


C. Only statement is correct D. Only statements and are
correct
E. All the three statements
and are correct
tifr2022

Answer key☟

18.0.74 TIFR CSE 2022 | Part B | Question: 4 top☝

Consider the following algorithm for computing the factorial of a positive integer , specified in
binary:
prod ← 1
for i from 1 to n
prod ← prod × i
output prod

Assume that the number of bit operations required to multiply a -bit positive integer with an -bit
positive integer is at least and at most . Then, the number of bit operations required by
this algorithm is

A. B. but
C. but D. but
E. None of the above
tifr2022

18.0.75 TIFR CSE 2022 | Part B | Question: 13 top☝

Consider a directed graph , where each edge has a positive edge weight .
Determine the appropriate choices for the blanks below so that the value of the following linear
program is the length of the shortest directed path in from to . (Assume that the graph has at least
one path from to .)

A.
B.
C.
D.
E.

tifr2022

18.0.76 TIFR CSE 2022 | Part B | Question: 3 top☝

Consider the problem of sorting single digit integers (base ). This problem can be solved in
time

A. but not B. but not


C. but not D.
E. None of the above.
tifr2022

Answer key☟

18.0.77 TIFR CSE 2022 | Part B | Question: 2 top☝

Let be an undirected simple graph. A subset is a matching in if distinct


edges in do not share a vertex. A matching is maximal if no strict superset of is a
matching. How many maximal matchings does the following graph have?

A. B. C. D. E.
tifr2022

Answer key☟

18.0.78 TIFR CSE 2022 | Part B | Question: 10 top☝

Consider the assertions


Given a directed graph with positive weights on the edges, two special vertices and ,
and an integer - it is -complete to determine if has an path of length at most .

Then, which of the following is true?

A. implies and implies B. implies and does not


imply
C. does not imply and D. does not imply and
implies does not imply
E. None of the above.
tifr2022
18.0.79 TIFR CSE 2022 | Part B | Question: 14 top☝

Let be a directed graph (with no self-loops or parallel edges) with vertices and
edges. Consider the incidence matrix of , whose rows are indexed by the vertices of
and the columns by the edges of . The entry is defined as follows.

Suppose every vertex of is reachable from a special source vertex of . Then, what is the rank of

A. B. C. D. E.
tifr2022

Answer key☟

18.0.80 TIFR CSE 2022 | Part B | Question: 15 top☝

Let denote the set of real numbers. Let and . Let

Then,

A. is finite or infinite depending on the value of


B. is a -dimensional vector subspace of
C. is a -dimensional vector subspace of
D. is a -dimensional vector subspace of
E. For each , the function

has a local optimum at

tifr2022

18.1 3 Sat (1) top☝

18.1.1 3 Sat: TIFR CSE 2016 | Part B | Question: 3 top☝

Assume . Which of the following is not TRUE?

A. 2-SAT in NP B. 2-SAT in coNP


C. 3-SAT is polynmial-time reducible D. 4-SAT is polynmial-time reducible
to 2-SAT to 3-SAT
E. 2-SAT in P
tifr2016 p-np-npc-nph 3-sat 2-sat

Answer key☟

18.2 Binomial Theorem (1) top☝


18.2.1 Binomial Theorem: TIFR CSE 2016 | Part A | Question: 13 top☝

Let be any integer. Which of the following statements is not necessarily true?

A.

B. divides the product of any consecutive integers

C.

D. divides , for all

E. If is an odd prime, then divides

tifr2016 binomial-theorem

Answer key☟

18.3 Closure Property (1) top☝

18.3.1 Closure Property: TIFR CSE 2016 | Part B | Question: 2 top☝

Which language class has the following properties?


It is closed under union and intersection but not complement.

A. Regular language B. Context-free language


C. Recursive language D. Recursively enumerable language
E. Languages that are not recursively
enumerable
tifr2016 theory-of-computation closure-property

Answer key☟

18.4 Complex Number (1) top☝

18.4.1 Complex Number: TIFR CSE 2016 | Part A | Question: 6 top☝

Which of the following statements about the eigen values of , the identity matrix (over
complex numbers), is true?

A. The eigen values are , where is a primitive -th root of unity


B. The only eigen value is
C. Both 0 and 1 are eigen values, but there are no other eigen values
D. The eigen values are 1
E. The only eigen value is 1

tifr2016 matrix complex-number

Answer key☟

18.5 Divergence (1) top☝

18.5.1 Divergence: TIFR CSE 2016 | Part A | Question: 5 top☝

For a positive integer , let


Which of the following statements is true?

A. As increases to infinity but coverages to a finite number


B. and the difference decreases as
C.
D.
E. As increases to infinity but coverages to a finite number

tifr2016 convergence divergence integration

Answer key☟

18.6 Dynamic Programming (1) top☝

18.6.1 Dynamic Programming: TIFR CSE 2016 | Part A | Question: 7 top☝

Let be the square grid . A in this grid


starts at and at each step either moves one unit up or one unit right. For example, fromthe
point one can in one step either move to or , but never leave .
Let the number of distinct monotone paths to reach point starting from bt . How many
distinct monotone paths are there to reach point starting from ?

A. B. C. D. E.
tifr2016 combinatory dynamic-programming

Answer key☟

18.7 Euler Graph (1) top☝

18.7.1 Euler Graph: TIFR CSE 2016 | Part B | Question: 9 top☝

Which of the following graphs DOES NOT have an Eulerian circuit? (Recall that an Eulerian
circuit in an undirected graph is a walk in the graph that starts at a vertex ans returns to the
vertex after tracelling on each edge exactly once.)

A.
B.
C.
D.
E. The graph on vertex set with edge set

tifr2016 discrete-mathematics graph-theory euler-graph normal

Answer key☟

18.8 Generalaptitude (1) top☝

18.8.1 Generalaptitude: TIFR CSE 2016 | Part A | Question: 14 top☝

A in a polygon is a straight line segment that connects two non-adjacent vertices, and
is contained in the interior of the polygon (except for its points). Two such diagonals are said to cross if
they have a point in common in the interior of the polygon. In one such polygon with vertices, a
certain number (say ) of non-crossing diagonals were drawn to cut up the inside of the polygon into
regions, each of which was a quadrilateral. how many diagonals were drawn, that is, what is ?

A. cannot be determined
B. from the information
C. given D. E.
tifr2016 graph-theory generalaptitude

Answer key☟

18.9 P Np Npc Nph (1) top☝

18.9.1 P Np Npc Nph: TIFR CSE 2016 | Part B | Question: 8 top☝

Consider the following language

Then, which of the following is TRUE?

A. is regular
B. is undecidable
C. is decidable in polynomial time
D. is context free but not regular
E. is NP-complete and P NP

tifr2016 decidability p-np-npc-nph

Answer key☟

18.10 Uniform Hashing (1) top☝

18.10.1 Uniform Hashing: TIFR CSE 2016 | Part A | Question: 4 top☝

There are balls and boxes. Each ball is placed in box chosen independently and
uniformly at random. We say that is a if , and and are placed
in the same box. WHat is the expected number of ?

A. B. C. D. E.

tifr2016 probability uniform-hashing

Answer key☟

18.11 Work Time (1) top☝

18.11.1 Work Time: TIFR CSE 2018 | Part A | Question: 4 top☝

The distance from your home to your office is kilometers and your normal walking speed is
Km/hr. On the first day, you walk at your normal walking speed and take time to reach
office.
On the second day, you walk at a speed of Km/hr from Kilometers, and at a speed of Km/hr for
the remaining Kilometers and you take time to reach office.
On the third day, you walk at a speed of Km/hr for minutes, and at Km/hr for the remaining time
and take time to reach office.
What can you say about the ordering of and

A. and B.
C. and D. and
E. and
tifr2018 quantitative-aptitude work-time

Answer key☟

Answer Keys
18.0.1 A 18.0.2 C 18.0.3 D 18.0.4 A 18.0.5 E
18.0.6 D 18.0.7 A 18.0.8 D 18.0.9 D 18.0.10 B
18.0.11 C 18.0.12 B 18.0.13 D 18.0.14 E 18.0.15 C
18.0.16 D 18.0.17 B 18.0.18 D 18.0.19 E 18.0.20 B
18.0.21 A 18.0.22 E 18.0.23 C 18.0.24 E 18.0.25 A
18.0.26 D 18.0.27 B 18.0.28 A 18.0.29 A 18.0.30 C
18.0.31 D 18.0.32 B 18.0.33 C 18.0.34 C 18.0.35 E
18.0.36 E 18.0.37 E 18.0.38 E 18.0.39 A 18.0.40 B
18.0.41 B 18.0.42 B 18.0.43 C 18.0.44 B 18.0.45 B
18.0.46 C 18.0.47 A 18.0.48 B 18.0.49 E 18.0.50 D
18.0.51 C 18.0.52 C 18.0.53 E 18.0.54 D 18.0.55 D
18.0.56 B 18.0.57 D 18.0.58 D 18.0.59 E 18.0.60 C
18.0.61 D 18.0.62 A 18.0.63 C 18.0.64 D 18.0.65 A
18.0.66 A 18.0.67 E 18.0.68 E 18.0.69 E 18.0.70 C
18.0.71 B 18.0.72 D 18.0.73 D 18.0.74 D 18.0.75 A
18.0.76 C 18.0.77 D 18.0.78 A 18.0.79 D 18.0.80 D
18.1.1 C 18.2.1 D 18.3.1 D 18.4.1 E 18.5.1 C
18.6.1 C 18.7.1 A 18.8.1 B 18.9.1 C 18.10.1 A
18.11.1 E
19 Programming and DS: DS (10)

19.1 Array (1) top☝

19.1.1 Array: TIFR CSE 2011 | Part B | Question: 30 top☝

Consider an array . It consists of a permutation of numbers . Now compute


another array as follows: for all . Which of the following is true?

A. will be a sorted array.


B. is a permutation of array .
C. Doing the same transformation twice will not give the same array.
D. is not a permutation of array .
E. None of the above.

tifr2011 data-structures array

Answer key☟

19.2 Binary Search Tree (1) top☝

19.2.1 Binary Search Tree: TIFR CSE 2010 | Part B | Question: 26 top☝

Suppose there is a balanced binary search tree with 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 and , such that , we want to find the number of elements in the tree
that lie between and , that is, . This can be done with (choose the best solution).

A. comparisons and additions.


B. comparisons but no further additions.
C. comparisons but additions.
D. comparisons but a constant number of additions.
E. comparisons and additions, using depth-first- search.

tifr2010 binary-search-tree

Answer key☟

19.3 Binary Tree (5) top☝

19.3.1 Binary Tree: TIFR CSE 2012 | Part B | Question: 16 top☝

Consider a complete binary tree of height , 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 ?

A. Exponential in . B. Cubic in .
C. Linear in . D. Logarithmic in .
E. Of the order square root of .
tifr2012 binary-tree

Answer key☟

19.3.2 Binary Tree: TIFR CSE 2013 | Part B | Question: 13 top☝

Given a binary tree of the following form and having nodes, the height of the tree is
A. B.
C. D.
E. None of the above.
tifr2013 binary-tree data-structures

Answer key☟

19.3.3 Binary Tree: TIFR CSE 2014 | Part B | Question: 1 top☝

L e t be a rooted
binary tree whose vertices are labelled with symbols
. 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 produce the following
sequences.
in-order:
post-order:
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 data-structures easy

Answer key☟

19.3.4 Binary Tree: TIFR CSE 2015 | Part B | Question: 4 top☝

First, consider the tree on the left.

On the right, the nine nodes of the tree have been assigned numbers from the set 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. B. C. D. E.
tifr2015 binary-tree combinatory

Answer key☟
19.3.5 Binary Tree: TIFR CSE 2018 | Part B | Question: 6 top☝

Consider the following implementation of a binary tree data strucrure. The operator denotes
list-concatenation.
That is,
struct TreeNode:
int value
TreeNode leftChild
TreeNode rightChild

function preOrder(T):
if T == null:
return []
else:
return [T.value] + preOrder(T.leftChild) + preOrder(T.rightChild)

function inOrder(T):
if T == null:
return []
else:
return inOrder(T.leftChild) + [T.value] + inOrder(T.rightChild)

function postOrder(T):
if T == null:
return []
else:
return postOrder(T.leftChild) + postOrder(T.rightChild) + [T.value]

For some T the functions inOrder(T) and preOrder(T) return the following:

What does postOrder(T) return ?

A.
B.
C.
D.
E.

tifr2018 data-structures binary-tree

Answer key☟

19.4 Heap (1) top☝

19.4.1 Heap: TIFR CSE 2014 | Part B | Question: 19 top☝

Consider the following tree with nodes.

Suppose the nodes of the tree are randomly assigned distinct labels from , 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)?
A. B.
C. D.
E.
tifr2014 heap

Answer key☟

19.5 Stack (1) top☝

19.5.1 Stack: TIFR CSE 2017 | Part B | Question: 3 top☝

We have an implementation that supports the following operations on a stack (in the instructions
below, is the name of the stack).

: returns if is empty, and otherwise.


: returns the top element of the stack, but does not pop the stack; returns if the stack is
empty.
: places on top of the stack.
: pops the stack; does nothing if is empty.

Consider the following code:


pop_ray_pop(x):
s=empty
for i=1 to length(x):
if (x[i] == '('):
push(s, x[i])
else:
while (top(s)=='('):
pop(s)
end while
push(s, ')')
end if
end for
while not isempty(s):
print top(s)
pop(s)
end while

What is the output of this program when


pop_ray_pop("(((()((())((((")

is executed?

A. B. C. D. E.
tifr2017 data-structures stack

Answer key☟

19.6 Tree (1) top☝

19.6.1 Tree: TIFR CSE 2012 | Part B | Question: 15 top☝

Let be a tree of nodes. Consider the following algorithm, that constructs a sequence of
leaves . Let be some leaf of tree. Let be a leaf that is farthest from . Let be
the leaf that is farthest from , and, in general, let be a leaf of that is farthest from (if there
are many choices for , pick one arbitrarily). The algorithm stops when some is visited again.
What can u say about the distance between and , as

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 and 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 .

tifr2012 data-structures tree

Answer key☟

Answer Keys
19.1.1 B 19.2.1 A 19.3.1 A 19.3.2 C 19.3.3 C
19.3.4 B 19.3.5 D 19.4.1 C 19.5.1 D 19.6.1 C
20 Programming and DS: Programming (11)

20.0.1 TIFR CSE 2011 | Part B | Question: 24 top☝

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 .

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 non-gate

20.1 Loop Invariants (4) top☝

20.1.1 Loop Invariants: TIFR CSE 2010 | Part B | Question: 30 top☝

Consider the following program for summing the entries of the array : array of
integers, where 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 ?

A.

B.

C.

D.

E.

tifr2010 programming loop-invariants


Answer key☟

20.1.2 Loop Invariants: TIFR CSE 2010 | Part B | Question: 37 top☝

Consider the program where are integers with .


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
and
Which of the following is true of the program?

A. The program will not terminate for some values of .


B. The program will terminate with
C. The program will terminate with .
D. The program will not terminate for some values of but when it does terminate, the condition
will hold.
E. The program will terminate with

tifr2010 programming loop-invariants

Answer key☟

20.1.3 Loop Invariants: TIFR CSE 2017 | Part B | Question: 5 top☝

Consider the following psuedocode fragment, where is an integer that has been initialized.
int i=1
int j=1
while (i<10):
j=j*i
i=i+1
if (i==y):
break
end if
end while

Consider the following statements:

i. or
ii. If , then
iii. If , then

Which of the above statements is/are TRUE at the end of the while loop? Choose from the following
options.

A. i only B. iii only C. ii and iii only D. i, ii, and iii E. None of the above
tifr2017 programming loop-invariants

Answer key☟
20.1.4 Loop Invariants: TIFR CSE 2019 | Part B | Question: 9 top☝

Consider the following program fragment:


var x, y: integer;
x := 1; y := 0;
while y < x do
begin
x := 2*x;
y := y+1
end;

For the above fragment , which of the following is a loop invariant ?

A. B.
C. D.
E. None of the above, since the loop
does not terminate
tifr2019 programming loop-invariants

Answer key☟

20.2 Parameter Passing (2) top☝

20.2.1 Parameter Passing: TIFR CSE 2011 | Part B | Question: 32 top☝

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

Answer key☟

20.2.2 Parameter Passing: TIFR CSE 2019 | Part B | Question: 8 top☝

Consider the following program fragment:


var a,b : integer;
procedure G(c,d: integer);
begin
c:=c-d;
d:=c+d;
c:=d-c
end;
a:=2;
b:=3;
G(a,b);

If both parameters to are passed by reference, what are the values of and at the end of the
above program fragment ?

A. and B. and C. and D. and E. None of the above


tifr2019 programming parameter-passing

Answer key☟

20.3 Programming In C (2) top☝


20.3.1 Programming In C: TIFR CSE 2018 | Part A | Question: 7 top☝

Consider the following function definition.


void greet(int n)
{
if(n>0)
{
printf("hello");
greet(n-1);
}
printf("world");
}

If you run greet(n) for some non-negative integer n, what would it print?

A. n times "hello", followed by n+1 B. n times "hello", followed by n times


times "world" "world"
C. n times "helloworld" D. n+1 times "helloworld"
E. n times "helloworld", followed by
"world"
tifr2018 programming-in-c

Answer key☟

20.3.2 Programming In C: TIFR CSE 2019 | Part B | Question: 6 top☝

Given the following pseudocode for function below, how many times is printed if we
execute
void printx(int n) {
if(n==0){
printf(“x”);
}
for(int i=0;i<=n-1;++i){
printx(n-1);
}
}

A. B. C. D. E.
tifr2019 programming programming-in-c

Answer key☟

20.4 Recursion (2) top☝

20.4.1 Recursion: TIFR CSE 2010 | Part B | Question: 31 top☝

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 w when the evaluation of does not terminate. Computing using
the parallel - innermost and parallel - outermost rule yields
A. and respectively B. and respectively
C. and respectively D. and respectively
E. none of the above

tifr2010 programming recursion

Answer key☟

20.4.2 Recursion: TIFR CSE 2011 | Part B | Question: 38 top☝

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 recursion programming

Answer key☟

Answer Keys
20.0.1 B 20.1.1 E 20.1.2 A 20.1.3 D 20.1.4 D
20.2.1 E 20.2.2 B 20.3.1 A 20.3.2 C 20.4.1 A
20.4.2 E
21 Theory of Computation (28)

21.1 Closure Property (2) top☝

21.1.1 Closure Property: TIFR CSE 2013 | Part B | Question: 11 top☝

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

Answer key☟

21.1.2 Closure Property: TIFR CSE 2014 | Part B | Question: 14 top☝

Which the following is FALSE?

A. Complement of a recursive language is recursive.


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 closure-property

Answer key☟

21.2 Decidability (3) top☝

21.2.1 Decidability: TIFR CSE 2010 | Part B | Question: 25 top☝

Which of the following problems is decidable? (Here, CFG means context free grammar and CFL
means context free language.)

A. Given a CFG , find whether , where is regular set.


B. Given a CFG , find whether .
C. Find whether the intersection of two CFLs is empty.
D. Find whether the complement of CFL is a CFL.
E. Find whether CFG and CFG generate the same language, i.e, .

tifr2010 theory-of-computation context-free-language decidability

Answer key☟

21.2.2 Decidability: TIFR CSE 2011 | Part B | Question: 25 top☝

Let be defined as follows:

And let be some complete language. Which of the following statements is FALSE?
A.
B. Every problem in is polynomial time reducible to .
C. Every problem in is polynomial time reducible to .
D. Since is complete, is polynomial time reducible to .
E. .

tifr2011 theory-of-computation decidability

Answer key☟

21.2.3 Decidability: TIFR CSE 2020 | Part B | Question: 2 top☝

Consider the following statements.

1. The intersection of two context-free languages is always context-free


2. The super-set of a context-free languages is never regular
3. The subset of a decidable language is always decidable
4. Let Let be the language of all strings in which either the number of
occurrences of is the same as the number of occurrences of OR the number occurrences of is
the same as the number of occurrences of . Then, is not context-free.

Which of the above statements are true?

A. Only B. Only and


C. Only and D. Only
E. None of are true.
tifr2020 theory-of-computation context-free-language decidability

Answer key☟

21.3 Identify Class Language (10) top☝

21.3.1 Identify Class Language: TIFR CSE 2010 | Part B | Question: 22 top☝

Let consist of all binary strings beginning with a such that its value when converted to
decimal is divisible by . Which of the following is true?

A. can be recognized by a deterministic finite state automaton.


B. can be recognized by a non-deterministic finite state automaton but not by a deterministic finite
state automaton.
C. can be recognized by a deterministic push-down automaton but not by a non-deterministic finite
state automaton.
D. can be recognized by a non-deterministic push-down automaton but not by a deterministic push-
down automaton.
E. cannot be recognized by any push-down automaton.

tifr2010 theory-of-computation identify-class-language

Answer key☟

21.3.2 Identify Class Language: TIFR CSE 2010 | Part B | Question: 35 top☝

Consider the following languages over the alphabet .

Where is the reverse of string x; e.g. . Which of the following is true?


A. Both and are regular.
B. is context-free but not regular where as is regualr.
C. Both and are context free and neither is regular.
D. is context free but is not context free.
E. Both and are not context free.

tifr2010 theory-of-computation identify-class-language

Answer key☟

21.3.3 Identify Class Language: TIFR CSE 2012 | Part B | Question: 18 top☝

Let denote a sequence with letters and let be the set of natural numbers
. Let and be two languages. Which of the
following is correct?

A. Both and are context-free languages.


B. is context-free and is recursive but not context-free.
C. Both and are recursive but not context-free.
D. is regular and is context-free.
E. Complement of is context-free.

tifr2012 theory-of-computation identify-class-language

Answer key☟

21.3.4 Identify Class Language: TIFR CSE 2014 | Part B | Question: 13 top☝

Let be a given context-free language over the alphabet . Construct as follows.


Let , and . Then,

A. Both and are regular.


B. Both and are context free but not necessarily regular.
C. is regular and is context free.
D. and both may not be context free.
E. is regular but may not be context free.

tifr2014 theory-of-computation identify-class-language

Answer key☟

21.3.5 Identify Class Language: TIFR CSE 2015 | Part B | Question: 8 top☝

Let be a one letter alphabet and be a two letter alphabet. A language


over an alphabet is a set of finite length words comprising letters of the alphabet. Let and
be the set of languages over and respectively. Which of the following is true about and :

A. Both are finite. B. Both are countably infinite.


C. is countable but is not. D. is countable but is not.
E. Neither of them is countable.
tifr2015 identify-class-language

Answer key☟

21.3.6 Identify Class Language: TIFR CSE 2017 | Part B | Question: 14 top☝

Consider the following grammar with terminals , start symbol , and non-terminals
:

A language is called prefix-closed if for every , every prefix of is also in . Which of the
following is FALSE?

A. is context free
B. is infinite
C. can be recognized by a deterministic push down automaton
D. is prefix-closed
E. is recursive

tifr2017 theory-of-computation identify-class-language

Answer key☟

21.3.7 Identify Class Language: TIFR CSE 2017 | Part B | Question: 4 top☝

Let be the language over the alphabet generated by the following grammar (with
start symbol , and non-terminals ):

Then, which of the following is TRUE?

A. is finite B. is not recursively enumerable


C. is regular D. contains only strings of even
length
E. is context-free but not regular
tifr2017 theory-of-computation identify-class-language

Answer key☟

21.3.8 Identify Class Language: TIFR CSE 2018 | Part B | Question: 11 top☝

Consider the language defined as

Which of the following answer is TRUE about the complexity of this language?

A. is regular but not context-free


B. is context-free but not regular
C. is decidable but not context free
D. The complement of defined as is regular.
E. is regular, context-free and decidable
tifr2018 identify-class-language theory-of-computation

Answer key☟

21.3.9 Identify Class Language: TIFR CSE 2018 | Part B | Question: 14 top☝

Define the language


where
denotes the description of the deterministic finite automata (DFA).Then which of the following about
is TRUE:

A. It is regular.
B. It is context-free but not regular.
C. It is Turing decidable (recursive).
D. It is Turing recognizable but not decidable.
E. Its complement is Turing recognizable but it is not decidable.

tifr2018 identify-class-language

Answer key☟

21.3.10 Identify Class Language: TIFR CSE 2019 | Part B | Question: 10 top☝

Let the language be defined in the binary alphabet as follows:

For example , while . Which of the following must be TRUE of the language ?

A. is regular B. is context-free but not regular


C. is decidable but not context-free D. is decidable but not in NP
E. is undecidable
tifr2019 theory-of-computation identify-class-language

Answer key☟

21.4 Recursive And Recursively Enumerable Languages (2) top☝

21.4.1 Recursive And Recursively Enumerable Languages: TIFR CSE 2010 | Part B | Question: 40
top☝

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-and-recursively-enumerable-languages

Answer key☟

21.4.2 Recursive And Recursively Enumerable Languages: TIFR CSE 2012 | Part B | Question: 19
top☝

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-and-recursively-enumerable-languages

Answer key☟

21.5 Regular Expression (5) top☝

21.5.1 Regular Expression: TIFR CSE 2010 | Part B | Question: 34 top☝

Let be regular expressions. Which of the following identities is correct?

A. B.
C. D.
E.
tifr2010 theory-of-computation regular-expression

Answer key☟

21.5.2 Regular Expression: TIFR CSE 2015 | Part B | Question: 7 top☝

Let be regular expressions. Which of the following identities is correct?

A. B.
C. D.
E. None of the above.
tifr2015 theory-of-computation regular-expression

Answer key☟

21.5.3 Regular Expression: TIFR CSE 2017 | Part B | Question: 9 top☝

Which of the following regular expressions correctly accepts the set of all -strings with an
even (possibly zero) number of s?

A. B.
C. D.
E.
tifr2017 theory-of-computation regular-expression

Answer key☟

21.5.4 Regular Expression: TIFR CSE 2018 | Part B | Question: 2 top☝

Consider the following non-deterministic automation, where is the start state and is the
final (accepting) state. The alphabet is A transition with label can be taken without
consuming any symbol from the input.
Which of the following regular expressions corresponds to the language accepted by this automation ?

A. B. C. D. E.

tifr2018 regular-expression finite-automata

Answer key☟

21.5.5 Regular Expression: TIFR CSE 2019 | Part B | Question: 11 top☝

Consider the following non-deterministic automaton,where is the start state and is the final
(accepting) state. The alphabet is . A transition with label can be taken without
consuming any symbol from the input.

Which of the following regular expressions correspond to the language accepted by this automaton ?

A. B. C. D. E.
tifr2019 theory-of-computation regular-expression

Answer key☟

21.6 Regular Language (6) top☝

21.6.1 Regular Language: TIFR CSE 2013 | Part B | Question: 6 top☝

Let and be languages over the alphabet . The left quotient of by is

Which of the following is true?

A. I f is regular then is B. If is regular then is regular.


regular.
C. If is regular then is regular. D. is a subset of .
E. If and are regular, then
is regular.
tifr2013 theory-of-computation regular-language

Answer key☟

21.6.2 Regular Language: TIFR CSE 2013 | Part B | Question: 8 top☝

Which one of the following languages over the alphabet is regular?

A. The language of balanced parentheses where are thought of as respectively.


B. The language of palindromes, i.e. bit strings that read the same from left to right as well as right to
left.
C.
D. The Kleene closure , where is the language in above.
E.

tifr2013 theory-of-computation regular-language

Answer key☟

21.6.3 Regular Language: TIFR CSE 2014 | Part B | Question: 12 top☝

Consider the following three statements:

i. Intersection of infinitely many regular languages must be regular.


ii. Every subset of a regular language is regular.
iii. If is regular and is not regular then 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-language

Answer key☟

21.6.4 Regular Language: TIFR CSE 2015 | Part B | Question: 10 top☝

Consider the languages

State which of the following is true?

A. and are both regular. B. Neither nor is regular.


C. is regular and is not regular. D. is not regular and is regular.
E. Both and are infinite.
tifr2015 regular-language

Answer key☟

21.6.5 Regular Language: TIFR CSE 2015 | Part B | Question: 6 top☝

Let consist of all binary strings beginning with a whose value when converted to decimal is
divisible by .

A. can be recognized by a deterministic finite state automaton.


B. can be recognized by a non-deterministic finite state automaton but not by a deterministic finite
state automaton.
C. can be recognized by a deterministic push-down automaton but not by a non-deterministic finite
state automaton.
D. can be recognized by a non-deterministic push-down automaton but not by a deterministic push-
down automaton.
E. cannot be recognized by any push down automaton, deterministic or non-deterministic.

tifr2015 theory-of-computation regular-language

Answer key☟
21.6.6 Regular Language: TIFR CSE 2018 | Part B | Question: 12 top☝

Consider the following statements:

i. For every positive integer let be the product of all primes less than or equal to
Then, is a prime, for every prime

ii. is a universal constant with value


iii. No polynomial time algorithm exists that can find the greatest common divisor of two integers given
as input in binary.
iv. Let
Then, is a regular language.

Then which of the following is TRUE ?

A. Only statement (i) is correct.


B. Only statement (ii) is correct.
C. Only statement (iii) is correct.
D. Only statement (iv) is correct.
E. None of the statements are correct.

tifr2018 regular-language

Answer key☟

Answer Keys
21.1.1 C 21.1.2 E 21.2.1 B 21.2.2 D 21.2.3 E
21.3.1 A 21.3.2 D 21.3.3 B 21.3.4 C 21.3.5 E
21.3.6 D 21.3.7 C 21.3.8 B 21.3.9 C 21.3.10 A
21.4.1 B 21.4.2 C 21.5.1 D 21.5.2 D 21.5.3 E
21.5.4 A 21.5.5 C 21.6.1 B 21.6.2 D 21.6.3 D
21.6.4 D 21.6.6 D

You might also like