Filter 5
Filter 5
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)
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:
Answer key☟
A.
B.
C.
D.
E.
tifr2011 asymptotic-notations
Answer key☟
A. B.
C. D.
E.
tifr2012 algorithms asymptotic-notations
Answer key☟
A. . B. .
C. . D. .
E. None of the above.
tifr2014 algorithms asymptotic-notations
Answer key☟
A.
B. but not
C.
D. but not
E.
tifr2016 asymptotic-notations
Answer key☟
Which of the following functions asymptotically grows the fastest as goes to infinity?
A. B.
C. D.
E.
tifr2017 algorithms asymptotic-notations
Answer key☟
Which of the following statements is TRUE for all sufficiently large integers n ?
A.
B.
C.
D.
E.
Answer key☟
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☟
A. B.
C. D.
E.
tifr2019 algorithms asymptotic-notations
Answer key☟
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☟
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☟
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☟
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☟
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☟
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);
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.
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?
Answer key☟
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☟
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
Answer key☟
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?
Answer key☟
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.
A. B. C. D. E.
tifr2014 algorithms maximum-minimum
Answer key☟
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?
Answer key☟
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 ?
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 ?
Answer key☟
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 .
Answer key☟
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.
Answer key☟
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
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,
A. B.
C. D.
E. none of the above
tifr2012 algorithms p-np-npc-nph
Answer key☟
Answer key☟
Answer key☟
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:
Answer key☟
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☟
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 ).
Answer key☟
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
Answer key☟
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.
Answer key☟
A. is when . B. is when .
C. is when . D. is when .
E. is when .
tifr2014 algorithms recurrence-relation
Answer key☟
A. is .
B. is but not .
C. is but not .
D. is but not .
E. is but not .
Answer key☟
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☟
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☟
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?
Answer key☟
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 ?
Answer key☟
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?
Answer key☟
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?
Answer key☟
Answer key☟
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?
Answer key☟
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 ?
Answer key☟
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.
Answer key☟
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?
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☟
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 ?
Answer key☟
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?
Answer key☟
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☟
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☟
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.
Answer key☟
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☟
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☟
A.
B.
C.
D.
E.
Answer key☟
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)
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.
Answer key☟
Assume that has higher precedence than , and operators associate right to left (i.e
. Consider
i.
ii.
iii.
iv.
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)
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.
Answer key☟
Answer Keys
3.1.1 D
4 Databases (2)
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☟
,
,
.
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)
.
If , then denotes the component wise negation of ; that is:
A. B.
C. D.
E. None of the above.
tifr2010 digital-logic boolean-algebra
Answer key☟
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☟
A.
B.
C.
D.
E.
tifr2016 boolean-algebra
Answer key☟
is a satisfying assignment,
A. B. C. D. E.
Answer key☟
5.2 Canonical Normal Form (1) top☝
5.2.1 Canonical Normal Form: TIFR CSE 2015 | Part B | Question: 9 top☝
tifr2015 canonical-normal-form
Answer key☟
The Boolean function obtained by adding an inverter to each and every input of an gate
is:
Answer key☟
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 ?
Answer key☟
Answer key☟
Which of the following decimal numbers can be exactly represented in binary notation with a
finite number of bits ?
Answer key☟
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)
In how many ways can the letters of the word be rearranged such that the vowels
always appear together?
tifr2011 combinatory
Answer key☟
In how many different ways can elements be picked from a set of elements if
Answer key☟
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☟
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☟
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☟
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☟
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:
Answer key☟
There are kingdoms and champions. Each kingdom gets champions. The number of
ways in which this can be done is:
Answer key☟
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.
Answer key☟
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☟
A. B.
C. D.
E.
tifr2010 generating-functions
Answer key☟
A. B. C. D. E.
tifr2018 modular-arithmetic combinatory
Answer key☟
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?
Answer key☟
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☟
Answer key☟
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)
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☟
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?
Answer key☟
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 ?
Answer key☟
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 ?
Answer key☟
A. B.
C. D.
E. None of the above
tifr2013 graph-theory graph-coloring
Answer key☟
How many vertex colouring with three colours does this graph have?
A. B. C. D. E.
tifr2017 graph-theory graph-coloring
Answer key☟
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☟
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☟
A. Only B. Only
C. Only and D. None of
E. All of
tifr2020 engineering-mathematics graph-theory graph-coloring
Answer key☟
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
Answer key☟
A.
B.
Answer key☟
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.
Answer key☟
A graph is – regular if every vertex has degree . For a – regular graph on vertices, which
of the following must be TRUE?
Answer key☟
Answer key☟
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☟
Answer key☟
Which of the following is NOT a sufficient and necessary condition for an undirected graph to
be a 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.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.
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?
is guilty
is a witness
is lying
is afraid )
Answer key☟
8.1.3 First Order Logic: TIFR CSE 2012 | Part B | Question: 3 top☝
A.
B.
C.
D.
E.
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.
Answer key☟
8.1.5 First Order Logic: TIFR CSE 2017 | Part B | Question: 11 top☝
Given that
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?
Answer key☟
8.1.7 First Order Logic: TIFR CSE 2019 | Part B | Question: 4 top☝
A. B. itself C. D. E.
tifr2019 engineering-mathematics discrete-mathematics mathematical-logic first-order-logic
Answer key☟
Answer key☟
Which of the following can be validly concluded from the above statements.
Answer key☟
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?
Answer key☟
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:
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?
Answer key☟
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☟
1. No silver glitters.
2. Some gold glitters.
Answer key☟
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.
Answer key☟
The notation " " denotes "implies" and " " denotes "and" in the following formulae.
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.1 Convex Sets Functions: TIFR CSE 2019 | Part A | Question: 6 top☝
Answer key☟
A. B. C. D. E.
tifr2012 set-theory&algebra functions
Answer key☟
Answer key☟
A. B. C. D. E.
tifr2014 set-theory&algebra functions
Answer key☟
9.2.4 Functions: TIFR CSE 2017 | Part A | Question: 11 top☝
Answer key☟
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☟
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:
Which of the above statements must be TRUE for ALL such functions and ?
Answer key☟
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
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.
Answer key☟
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.
Answer key☟
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 ?
Answer key☟
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.
Answer key☟
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.
Answer key☟
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,
Answer key☟
Answer key☟
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☟
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☟
Let , denote two integers from the set . The number of ordered pairs
such that is divisible by is.
Answer key☟
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
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☟
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☟
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?
Answer key☟
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
Answer key☟
Answer Keys
9.1.1 D 9.2.2 D 9.2.3 D 9.2.4 B 9.2.5 B
What is the area of the largest rectangle that can be inscribed in a circle of radius ?
Answer key☟
3. converges if
Answer key☟
A.
B.
C.
D.
E.
Answer key☟
Answer key☟
equals.
A. B.
C. D.
E.
tifr2015 maxima-minima calculus non-gate integration
A. B. C. D. E.
tifr2019 engineering-mathematics calculus integration
Answer key☟
A. B. C. D. E.
tifr2010 calculus limits
Answer key☟
The limit
is
A. B. C. D. E. None of the above
tifr2011 calculus limits
Answer key☟
What is
Answer key☟
Answer key☟
Let and
.
is
A. B.
C. D.
E. None of the above
tifr2014 limits
Answer key☟
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☝
What is ?
A.
B.
C.
D.
E.
Answer key☟
A. B. C. D. E.
tifr2010 calculus maxima-minima
Answer key☟
Answer key☟
10.5.3 Maxima Minima: TIFR CSE 2012 | Part A | Question: 13 top☝
is
A. B. C. D. E.
tifr2012 calculus maxima-minima
Answer key☟
Answer key☟
Answer key☟
Answer key☟
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.
Answer key☟
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)
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?
tifr2020
Answer key☟
is square matrix for which the entries in every row sum to . Consider the following
statements:
Answer key☟
Answer key☟
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☟
A. B.
C. D.
E. Inverse is not guaranteed to exist.
tifr2012 linear-algebra matrix
Answer key☟
A. B. C. D. E.
tifr2013 linear-algebra matrix
Answer key☟
are there such that (modulo )? (modulo means all operations are done modulo , i.e,
(modulo ), (modulo )).
Answer key☟
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.
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☟
Let be an invertible matrix with real entries whose row sums are all equal to . Consider
the following statements:
Answer key☟
Let be am invertible matrix with real entries whose column sums are all equal to .
Consider the following statements:
Answer key☟
11.3 Rank Of Matrix (1) top☝
Answer key☟
A. B.
C. D.
E. None of the above
tifr2010 linear-algebra vector-space
Answer key☟
i.
ii.
iii.
iv.
v.
Which of the above statements must be TRUE of ? Choose from the following options.
Answer key☟
11.4.3 Vector Space: TIFR CSE 2020 | Part A | Question: 3 top☝
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)
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☟
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)?
Answer key☟
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?
tifr2013 probability
Answer key☟
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☟
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?
Answer key☟
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.
A. B. C. D. E.
tifr2012 probability
Answer key☟
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 ?
Answer key☟
The probability of throwing six perfect dices and getting six different faces is
tifr2012 probability
Answer key☟
An unbiased die is thrown times. The probability that the product of numbers would be even is
tifr2013 probability
Answer key☟
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?
Answer key☟
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:
Answer key☟
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☟
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☟
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☟
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☟
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☟
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?
Answer key☟
A. B.
C. D.
E.
tifr2017 probability
Answer key☟
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☟
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☟
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☟
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☟
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☟
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☟
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☟
Answer key☟
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.
Answer key☟
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?
Answer key☟
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☟
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☟
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.
Answer key☟
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☟
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.
Answer key☟
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?
Answer key☟
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.
Answer key☟
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☟
Answer key☟
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☟
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☟
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
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)
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?
Answer key☟
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☟
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?
Answer key☟
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☟
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☟
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.
Answer key☟
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:
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.
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☟
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.
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☟
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:
Answer key☟
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)
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:
Answer key☟
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?
Answer key☟
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☟
A. B.
C. D.
E. None of the above
tifr2011 quantitative-aptitude geometry circle
Answer key☟
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.:
Answer key☟
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.
Answer key☟
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☟
Answer key☟
Three distinct points lie on a unit circle of the complex plane and satisfy .
Then form the vertices of .
Answer key☟
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
A. 2 B. C. 1 D. 3 E.
tifr2013 quantitative-aptitude complex-number non-gate
Answer key☟
14.5.1 Convex Sets Functions: TIFR CSE 2014 | Part A | Question: 12 top☝
1.
2.
3.
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.
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☟
A. B. C. D. E.
tifr2010 quantitative-aptitude factors
Answer key☟
Answer key☟
Answer key☟
14.8 Fraction (2) 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☟
A suitcase weighs one kilogram plus half of its weight. How much does the suitcase weigh?
Answer key☟
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.
Answer key☟
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☟
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☟
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?
Answer key☟
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☟
Consider a square of side length . We throw five points into the square. Consider the following
statements:
Answer key☟
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 ?
Answer key☟
Answer key☟
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☟
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☟
How many proper divisors (that is, divisors other than or ) does have ?
A. B. C. D. E.
tifr2019 modular-arithmetic quantitative-aptitude
Answer key☟
A. B. C. D. E.
tifr2019 modular-arithmetic quantitative-aptitude
Answer key☟
Let and be two positive integers. Which of the following is NOT always true?
Answer key☟
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☟
A. B.
C. D.
E. None of the above
tifr2011 quantitative-aptitude number-series
Answer key☟
Let
A. B. C. D. E.
tifr2013 quantitative-aptitude number-series
Answer key☟
A. B. C. D. E.
Answer key☟
A. and .
B. and .
C. and .
D. and .
E. and .
Answer key☟
14.13.5 Number Series: TIFR CSE 2015 | Part A | Question: 3 top☝
A. Can't be determined
B. C. D. E. None of the above
tifr2015 quantitative-aptitude numerical-computation number-series
Answer key☟
What is ?
A. B. C. D. E.
tifr2020 general-aptitude quantitative-aptitude number-system
Answer key☟
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 .
Answer key☟
Answer key☟
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☟
A. . B. .
C. . D. .
E. None of the above.
tifr2014 quantitative-aptitude numerical-computation
Answer key☟
Consider numbers greater than one that satisfy the following properties:
Answer key☟
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☟
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☟
A. At most B. At most
C. Between and D. At least
E. None of the above.
tifr2013 polynomials non-gate
Answer key☟
Let be an odd integer. The number of zeros at the end of the number is
Answer key☟
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.
Answer key☟
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☟
Answer key☟
Answer key☟
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.
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.
Answer key☟
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.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):
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)
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☟
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.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?
Answer key☟
Answer Keys
16.1.1 B
17 Operating System (11)
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?
Answer key☟
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☟
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.
Answer key☟
Answer key☟
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.
Answer key☟
Answer key☟
Answer key☟
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☟
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.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?
Answer key☟
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
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)
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☟
tifr2016
A.
B.
C.
D.
E.
tifr2021
Answer key☟
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?)
tifr2016
Answer key☟
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?
Answer key☟
tifr2016
Answer key☟
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.
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☟
i.
ii.
iii.
iv.
tifr2016
Answer key☟
Let
A. B.
C. D.
E.
tifr2016
Answer key☟
tifr2016
Answer key☟
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☟
Let be an integer. Regard the set as a vector space over . Consider the following
undirected graph .
Answer key☟
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☟
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☟
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☟
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 .
A. B.
C. D.
E. No general relationship exists
among and
tifr2021
Answer key☟
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☟
A. B. C. D. E.
tifr2022
Answer key☟
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☟
For a language over the alphabet , let denote the complement of and let
denote the Kleene-closure of . Consider the following sentences.
A. Both (i) and (iii) B. Only (i) C. Only (iii) D. Only (ii) E. None of the above
tifr2021
Answer key☟
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☟
A.
B.
C.
D.
E.
tifr2021
Answer key☟
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. B. C. D. E.
tifr2020
Answer key☟
Consider the context-free grammar below ( denotes the empty string, alphabet is ):
A. B.
C. D. Strings of the form or
any positive integer
E. Strings with equal numbers of
and
tifr2020
Answer key☟
Consider the following algorithm (Note: For positive integers, denotes the floor of the
rational number , assume that given can be computed in one step):
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
I.
II.
III.
Answer key☟
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;
}
Answer key☟
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?
tifr2020
Answer key☟
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☟
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☟
A. B. C. D. E.
tifr2021
Answer key☟
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☟
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?
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☟
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☟
A. B.
C. D.
E. None of the above
tifr2021
Answer key☟
Let and be two matrices of size and with real-valued entries. Consider the following
statements.
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☟
A. B. C. D. E. Infinitely many
tifr2022
Answer key☟
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?
tifr2021
Answer key☟
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☟
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.
Answer key☟
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.
A. B.
C. D.
E.
tifr2022
Answer key☟
A. B. C. D. E.
tifr2021
Answer key☟
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☟
A.
B.
C.
D.
E.
tifr2021
Answer key☟
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☟
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☟
tifr2021
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☟
A.
B.
C.
D.
E.
tifr2021
Answer key☟
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?
Answer key☟
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 .
Answer key☟
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☟
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☟
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☟
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
Answer key☟
A. B. C. D. E.
tifr2022
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?
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☟
Let be a finite set. A family of subsets of is said to be upward closed if the following
holds for all sets :
Suppose and are upward closed families. Then which of the following is true?
A.
B.
C.
D.
E. None of the above
tifr2022
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☟
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?
Which data structure is commonly used to implement breadth first search in a graph?
Answer key☟
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
tifr2022
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☟
B.
C. , where
E. divides
tifr2022
Answer key☟
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.
Consider the following grammar: are non-terminals; are terminals; is the start
symbol; and the production rules follow.
tifr2022
Answer key☟
A.
B.
C.
D.
E. can be arbitrarily large given only the constraints in the question
tifr2022
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?
tifr2022
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.
Answer key☟
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
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
Consider the problem of sorting single digit integers (base ). This problem can be solved in
time
Answer key☟
A. B. C. D. E.
tifr2022
Answer key☟
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☟
Then,
tifr2022
Answer key☟
Let be any integer. Which of the following statements is not necessarily true?
A.
C.
tifr2016 binomial-theorem
Answer key☟
Answer key☟
Which of the following statements about the eigen values of , the identity matrix (over
complex numbers), is true?
Answer key☟
Answer key☟
A. B. C. D. E.
tifr2016 combinatory dynamic-programming
Answer key☟
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
Answer key☟
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☟
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
Answer key☟
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.
Answer key☟
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)
Answer key☟
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).
tifr2010 binary-search-tree
Answer key☟
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☟
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☟
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☟
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:
A.
B.
C.
D.
E.
Answer key☟
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☟
We have an implementation that supports the following operations on a stack (in the instructions
below, is the name of the stack).
is executed?
A. B. C. D. E.
tifr2017 data-structures stack
Answer key☟
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
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)
Note that ∥ denotes the parallel operator. In which of the following cases can the program possibly
result in a final state with .
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.
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?
Answer key☟
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
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☝
A. B.
C. D.
E. None of the above, since the loop
does not terminate
tifr2019 programming loop-invariants
Answer key☟
Various parameter passing mechanisms have been in used in different programming languages.
Which of the following statements is true?
Answer key☟
If both parameters to are passed by reference, what are the values of and at the end of the
above program fragment ?
Answer key☟
If you run greet(n) for some non-negative integer n, what would it print?
Answer key☟
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☟
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))]
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
Answer key☟
Consider the class of recursive and iterative programs. Which of the following is false?
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)
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.
Answer key☟
Answer key☟
Which of the following problems is decidable? (Here, CFG means context free grammar and CFL
means context free language.)
Answer key☟
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. .
Answer key☟
Answer key☟
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?
Answer key☟
21.3.2 Identify Class Language: TIFR CSE 2010 | Part B | Question: 35 top☝
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?
Answer key☟
21.3.4 Identify Class Language: TIFR CSE 2014 | Part B | Question: 13 top☝
Answer key☟
21.3.5 Identify Class Language: TIFR CSE 2015 | Part B | Question: 8 top☝
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
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 ):
Answer key☟
21.3.8 Identify Class Language: TIFR CSE 2018 | Part B | Question: 11 top☝
Which of the following answer is TRUE about the complexity of this language?
Answer key☟
21.3.9 Identify Class Language: TIFR CSE 2018 | Part B | Question: 14 top☝
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☝
For example , while . Which of the following must be TRUE of the language ?
Answer key☟
21.4.1 Recursive And Recursively Enumerable Languages: TIFR CSE 2010 | Part B | Question: 40
top☝
Answer key☟
21.4.2 Recursive And Recursively Enumerable Languages: TIFR CSE 2012 | Part B | Question: 19
top☝
Answer key☟
A. B.
C. D.
E.
tifr2010 theory-of-computation regular-expression
Answer key☟
A. B.
C. D.
E. None of the above.
tifr2015 theory-of-computation regular-expression
Answer key☟
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☟
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.
Answer key☟
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☟
Answer key☟
Answer key☟
Which of the following gives the correct true/false evaluation of the above?
Answer key☟
Answer key☟
Let consist of all binary strings beginning with a whose value when converted to decimal is
divisible by .
Answer key☟
21.6.6 Regular Language: TIFR CSE 2018 | Part B | Question: 12 top☝
i. For every positive integer let be the product of all primes less than or equal to
Then, is a prime, for every prime
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