All Gate Subs Included
All Gate Subs Included
All Gate Subs Included
Table of Contents
Table of Contents 1
Contributors 7
1 Algorithms (57) 8
1.1 Algorithm Design (2) 8
Answers: Algorithm Design 8
1.2 Asymptotic Notations (9) 8
Answers: Asymptotic Notations 10
1.3 Graph Algorithms (3) 14
Answers: Graph Algorithms 14
1.4 Identify Function (4) 15
Answers: Identify Function 16
1.5 Minimum Maximum (3) 18
Answers: Minimum Maximum 19
1.6 Minimum Spanning Trees (2) 21
Answers: Minimum Spanning Trees 21
1.7 P Np Npc Nph (9) 22
Answers: P Np Npc Nph 24
1.8 Quicksort (1) 27
Answers: Quicksort 27
1.9 Recurrence (3) 28
Answers: Recurrence 28
1.10 Searching (2) 32
Answers: Searching 32
1.11 Shortest Path (1) 33
Answers: Shortest Path 33
1.12 Sorting (9) 34
Answers: Sorting 36
1.13 Spanning Tree (5) 40
Answers: Spanning Tree 41
1.14 Time Complexity (4) 43
Answers: Time Complexity 44
Answer Keys 46
2 Compiler Design (3) 47
2.1 Parsing (3) 47
Answers: Parsing 48
Answer Keys 49
3 Computer Networks (1) 50
3.1 Network Security (1) 50
Answers: Network Security 50
Answer Keys 50
4 Databases (2) 51
4.1 Relational Algebra (2) 51
Answers: Relational Algebra 51
Answer Keys 52
5 Digital Logic (10) 53
5.1 Boolean Algebra (3) 53
Answers: Boolean Algebra 54
5.2 Canonical Normal Form (1) 55
Answers: Canonical Normal Form 55
5.3 Digital Circuits (1) 55
Answers: Digital Circuits 55
5.4 Gray Code (1) 55
Answers: Gray Code 56
5.5 Number Representation (2) 56
Answers: Number Representation 56
5.6 Number System (1) 57
Contributors
User , Answers User Added User Done
Pragy Agarwal 767, 27 makhdoom ghaya 223 Arjun Suresh 66
Umang Raman 423, 24 Arjun Suresh 60 kenzou 46
Arjun Suresh 404, 34 Jotheeswari 57 Milicevic3306 37
srestha 363, 20 Lakshman Patel 26 Naveen Kumar 33
Anurag Pandey 308, 15 soujanyareddy13 26 Pavan Singh 19
Himanshu Agarwal 289, 10 Rohit Gupta 4 soujanyareddy13 17
Praveen Saini 189, 7 Lakshman Patel 11
Riya Roy(Arayana) 180, 6 Shikha Mallick 8
Pooja Palod 142, 9 JATIN MITTAL 8
tarun_svbk 114, 8 Rupendra Choudhary 7
Kapil Phulwani 108, 4 ankitgupta.1729 7
Akash Kanase 94, 7 Manoja Rajalakshmi 6
Shaun Patel 73, 3 Aravindakshan
Sachin Mittal 68, 1 Ajay kumar soni 6
Ayush Upadhyaya 68, 2 Sudeshna Chaudhuri 5
Anu007 60, 5 Akash Dinkar 5
Avdhesh Singh Rana 57, 2 Nikhil Dhama 4
Motamarri Anusha 56, 4 gatecse 4
Utkarsh Joshi 55, 3 Krithiga2101 4
Leen Sharma 51, 2 Sukanya Das 3
Prajwal Bhat 51, 3 Puja Mishra 3
venky.victory35 50, 3 Sourajit25 3
Saurav Shrivastava 44, 3 Subarna Das 3
Hemant Parihar 43, 2 Shaik Masthan 3
Debashish Deka 43, 4 Kapil Phulwani 2
sudipta roy 41, 2 Debashish Deka 2
Sourav Basu 40, 1 Pragy Agarwal 2
ZAHID WAKEEL 37, 3 Motamarri Anusha 2
Ahwan Mishra 36, 2 krish__ 2
Shobhit Joshi 35, 3 Sayan Bose 2
Mk Utkarsh 34, 3 Amartyap 1
Dhananjay Kumar Sharma 33, 3 Cringe is my middle 1
Ashwani Kumar 33, 6 name...
Manoja Rajalakshmi 33, 8 Tushar Kadam 1
Aravindakshan Aghori 1
Shivansh Gupta 32, 3 Chandrashis Mazumdar 1
Prateek Dwivedi 30, 2 Mk Utkarsh 1
Lakshman Patel 30, 5 Satbir Singh 1
Rupendra Choudhary 29, 4 khamer 1
ankitgupta.1729 29, 16 srestha 1
Digvijay 28, 3 Soumya Jain 1
Rameez Raza 27, 2 Pooja Palod 1
minal 26, 1 Shiva Sagar Rao 1
yes 26, 1 Manu Thakur 1
Sujit Kumar Muduli 26, 1 Hemant Parihar 1
papesh 26, 1 Ashish verma 1
sonu 25, 2 Himanshu Agarwal 1
pramod 25, 2 Prateek Dwivedi 1
Gokulnath 25, 2 SHIVESH KUMAR ROY 1
Shreya Roy 22, 1 Umang Raman 1
sarveswara rao vangala 22, 1 Nitesh Tripathi 1
kunal chalotra 22, 3 Rameez Raza 1
Manu Thakur 21, 1 KUSHAGRA गु ा 1
Amar Vashishth 21, 1 severustux 1
Mehak Sharma 20, 1 Resmi A.C. 1
Manish Joshi 20, 2 Shobhit Joshi 1
HABIB MOHAMMAD 20, 2 Shivansh Gupta 1
KHAN Pooja Khatri 1
Ravi Singh 19, 1
Mari Ganesh Kumar 19, 1
krish__ 19, 3
Vidhi Sethi 17, 1
Prabhanjan_1 17, 1
Jagdish Singh 17, 1
Aghori 17, 4
Prashant Singh 16, 1
1 Algorithms (57)
Searching, Sorting, Hashing, Asymptotic worst case time and Space complexity, Algorithm design techniques: Greedy,
Dynamic programming, and Divide‐and‐conquer, Graph search, Minimum spanning trees, Shortest paths.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 3 2 3 2 0 2 2 3 3 0 2.2 3
2 Marks Count 3 4 4 2 4 2 3 2 3 2 3 4
Total Marks 9 10 11 6 8 6 8 7 9 6 8.2 11
You are given ten rings numbered from 1 to 10, and three pegs labeled A, B, and C . Initially all the rings are on peg
A, arranged from top to bottom in ascending order of their numbers. The goal is to move all the rings to peg B in the
minimum number of moves obeying the following constraints:
Asha and Lata play a game in which Lata first thinks of a natural number between 1 and 1000. 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?
∴ Option B.
17 votes -- Umang Raman (12.2k points)
< 1 √ <
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 8 of 278
−−−−−
D. √log2 n < n1/√log2 n < n1/100
−−−−−
E. √log2 n < n1/100 < n1/√log2 n
tifr2011 asymptotic-notations
tifr2016 asymptotic-notations
Which of the following functions asymptotically grows the fastest as n goes to infinity?
A. (log log n)! B. (log log n)log n
C. (log log n)log log log n
D. (log n)log log n
E. 2√log log n
tifr2017 algorithms asymptotic-notations
Which of the following statements is TRUE for all sufficiently large integers n ?
√log log n
A. 22 < 2√log n < n
log √log log n
B. 2√ n < n < 22
√log log n
C. n < 2√log n < 22
√log log n
D. n < 22 < 2√log n
log log n
2√log n < 22
√
E. <n
Which of the following functions, given by there recurrence, grows the fastest asymptotically?
A. T(n) = 4T ( n2 ) + 10n
T(n) = 8T ( ) + 24 2
B. T(n) = 8T ( n3 ) + 24n2
C. T(n) = 16T ( n4 ) + 10n2
D. T(n) = 25T ( n5 ) + 20(n log n)1.99
E. They all are asymptotically the same
Among the following asymptotic expressions, which of these functions grows the slowest (as a function of n)
asymptotically?
A. 2log n B. n10
−−−− 2
C. (√log n )log n D. (log n)√log n
√log log n
E. 22
tifr2020 algorithms asymptotic-notations time-complexity
Since exponentials grow faster than polynomials, h(n) > g(n) for large n.
−
100 > √x for large x. Thus, h(n) > f(n) for large n.
Since linear functions grow faster than square roots, x
Since exponentials grow faster than polynomials, 2√x > − x for large −
√ √
x . Thus, f(n) > g(n) for large n.
Hence, the relation is,
g(n) < f(n) < h(n)
Thus, option (D) is correct.
48 votes -- Pragy Agarwal (18.3k points)
Take n = 21024
Just one value is not enough to confirm growth rate. So, take n = 1024.
So, as n increases, the gap between second and third function increases and also the second function overtakes the first. So,
f1 < f2 < f3 .
18 votes -- srestha (85.3k points)
en
a. en / n = = e (n − ln n)
e (ln n)
b. en−0.9 ln n = e (n − 0.9 ln n)
n
c. 2n = (e ln 2 ) = e (n ln 2)
n−1
d. (ln n)n−1 = (e ln ln n ) = e (n ln ln n − ln ln n)
Now, if we just compare the exponents of all, we can clearly see that (n ln ln n − ln ln n) grows faster than the rest. Note
that in option (C), the multiplicative ln 2 is a constant, and hence grows slower than the multiplicative ln ln n from option
(D).
This implies that e (n ln ln n − ln ln n) grows the fastest, and hence, (ln n)n−1 grows the fastest.
Thus, option (D) is the correct answer.
55 votes -- Pragy Agarwal (18.3k points)
m n = m! log n/ log log n
4 24 4/2 = 2
6 720 9/3 = 3
8 720 × 56 15/3 = 5
10 720×56×90 21/4 = 5
Let N = 2256
Let N = 216
Option B = (log log N)log N asymptotically grows the fastest, as for the same change in N , the value increased the most
(growth) for option B and this growth is monotonic (continuous).
32 votes -- Kapil Phulwani (35.2k points)
Take n = 22k
√log 22k
= 2√2
k
Option (B) gives 2
√log(log 22k ) √k
Option (C) gives 22 = 22
C is growing fastest.
15 votes -- Hemant Parihar (11.9k points)
Given that -
1 1
c1 nn+ 2 e−n ≤ n! ≤ c2 nn+ 2 e−n .
n! = Θ ( n en )
n+1/2
We can divide it by e1/2 (multiplying or dividing by a +ve constant doesn't affect the asymptotic nature of a function)
⟹ n! = Θ ( nen+1/2 ) = Θ (( ne ) )
n+1/2 n+ 12
f1 = 2lg n = nlg 2
f2 = n10
lg(√lg n lg lg n)
f4 can also be rewritten as 22 )
−−− −−− −−−−−
Now, lg(√lg n lg lg n) = lg √lg n + lg lg lg n = 12 lg lg n + lg lg lg n > √lg lg n .
-- f5 << f4 .
Hence, function
f5 grows slowest asymptotically.
Now, to get the correct order, we have to compare f2 and f3 .
Between f2 and f3 :
set n = 2m
f2 = (2m )10
m2
f3 = m 2 = (mm )m/2
Since, mm >> m! >> 2m . So,
-- f2 << f3 .
Or, we can do like this :
10
f2 = n10 = 2lg n = 210 lg n
(lg n)2
(lg n)2 (lg n)2
f3 = (lg n) 2 = 2lg((lg n) 2 ) =2 2
lg lg n
(lg n)2
∵ 10 lg n < 2 lg lg n. So, f2 << f3 .
Therefore, increasing order of growth rate is :
f5 << f4 << f1 << f2 << f3
5 votes -- ankitgupta.1729 (15.2k points)
Let G be an undirected graph with n vertices. For any subset S of vertices, the set of neighbours of S consists of the
union of S and the set of vertices S ′ that are connected to some vertex in S by an edge of G. The graph G has the nice
property that every subset of vertices S of size at most n/2 has at least 1.5|S| -many neighbours. What is the length of a
longest path in G?
A. O(1) B. O(log log n) but not O(1)
−
C. O(log n) but not O(log log n) D. O (√n ) but not O(log n)
−
E. O(n) but not O (√n )
tifr2013 graph-algorithms
Given a weighted directed graph with n vertices where edge weights are integers (positive, zero, or negative),
determining whether there are paths of arbitrarily large weight can be performed in time
A. O(n) B. O(n. log(n)) but not O(n)
C. O(n1.5 ) but not O(n log n) D. O(n3 ) but not O(n1.5 )
E. O(2n ) but not O(n3 )
tifr2013 algorithms graph-algorithms
Suppose a depth-first traversal of this graph is performed, assuming that whenever there is a choice, the vertex earlier in the
alphabetical order is to be chosen. Suppose the number of tree edges is T , the number of back edges is B and the number of
cross edges is C . Then
A. B = 1 , C = 1 , and T = 4 . B. B = 0 , C = 2 , and T = 4 .
C. B = 2 , C = 1 , and T = 3 . D. B = 1 , C = 2 , and T = 3 .
E. B = 2 , C = 2 , and T = 1 .
tifr2014 algorithms graph-algorithms
Let's start with 1 node(chose any one) & find the number of hops in which whole Graph is reachable i.e. all the n vertices are reachable.
(1) within 1 hop(1 edge traversal) we can reach atleast = 3/2 nodes
But this property is valid upto a subset of size atmost n/2 .. so, here I stuck to proceed..
O(V E)
Correct Answer: D
14 votes -- papesh pathare (573 points)
Since they said that whenever there is a choice we will have to select the node which is alphabetically earlier,
therefore we choose the starting node as A.
The tree then becomes A − B − E − C . Therefore number of tree edges is 3, that is, (T = 3) .
Now, there is one cycle B − E − C , so, we will get a back edge from C to B while performing DFS. Hence B = 1 .
Now, D becomes disconnected node and it can only contribute in forming cross edge . There are 2 cross edges D − A ,
D − B. Therefore C = 2 .
Answer is Option D.
Consider the following program operating on four variables u, v, x, y, and two constants X and Y .
x, y, u, v:= X, Y, Y, X;
While (x ≠ y)
do
if (x > y) then x, v := x - y, v + u;
else if (y > x) then y, u:= y - x, u + v;
od;
print ((x + y) / 2); print ((u + v) / 2);
Given X > 0 ∧ Y > 0 , pick the true statement out of the following:
A. The program prints gcd(X, Y ) and the first prime larger than both X and Y .
B. The program prints gcd(X, Y ) followed by lcm(X, Y ).
C. The program prints gcd(X, Y ) followed by 12 × lcm(X, Y ) .
D. The program prints 12 × gcd(X, Y ) followed by 12 × lcm(X, Y ) .
while ( n ! = 0 )
n = n & ( n-1 )
count = count + 1
return count
Here n is meant to be an unsigned integer. The operator & considers its arguments in binary and computes their bit wise
AND . For example, 22 & 15 gives 6, because the binary (say 8-bit) representation of 22 is 00010110 and the binary
representation of 15 is 00001111, and the bit-wise AND of these binary strings is 00000110, which is the binary
representation of 6. What does the function brian return?
Consider the following game. There is a list of distinct numbers. At any round, a player arbitrarily chooses two
numbers a, b from the list and generates a new number c by subtracting the smaller number from the larger one. The
numbers a and b are put back in the list. If the number c is non-zero and is not yet in the list, c is added to the list. The player
is allowed to play as many rounds as the player wants. The score of a player at the end is the size of the final list.
Suppose at the beginning of the game the list contains the following numbers: 48, 99, 120, 165 and 273. What is the score of
the best player for this game?
A. 40 B. 16 C. 33 D. 91 E. 123
tifr2014 algorithms identify-function
Which of the following statements about the contents of matrix A at the end of this program must be TRUE?
Greatest Common Divisor of two number can be calculated using Euclid's Algorithm [1]
gcd(X, 0) =X
gcd(X, Y ) = gcd(Y , X%Y )
⎧
⎪ X X=Y
gcd(X, Y ) = ⎨ gcd(X − Y , Y )
⎩
X>Y
⎪
gcd(X, Y − X) X<Y
Out of observation we learn that the given program is performing the same operation on two variable x and y initialized to X
and Y respectively. Loop terminated with x = y , therefore (x + y)/2 i.e., average of two will return x (or y), which is
essentially gcd(X, Y ) .
Next, let us propose a loop invariant [2] for this program [3]
2XY = (x × v) + (y × u)
The correctness of this program depends on this invariant, which must be true prior to the first iteration of the loop, during
the execution of loop and with the termination of the loop it must express some useful property that program exhibits. Let's
briefly show these three things.
1. Initialization: The fact that this loop invariant holds prior to the first iteration of the loop can be seen by plugging in
initial values of x, y, u and v.
2. Maintenance: Let us assume this loop invariant holds before ith iteration and we need to show that it holds after ith
iteration as well. During ith iteration for x > y , x = (x − y) and u = (u + v). Substitue these new values in loop
invariant we get
2XY = (x − y) × v + y(u + v)
= (x × v) + (y × u)
2XY = (x × v) + (x × u) = x(u + v)
2XY = gcd(X, Y )(u + v)
HTH
REFERENCES
P.S In competitive examinations like GATE/TIFR the better strategy for such unfamiliar program is to try executing the program on different
values, observe the result and compare with given options. However, in my opinion, understanding the underlining crux of such problems (when we
are outside examination hall) is more important than just getting answers.
References
00001111
^ 00001110
---------------------
00001110
9 votes -- Avdhesh Singh Rana (2.3k points)
Option D is correct
So the numbers like (3, 6, 9 − − − −99) are added. Total numbers = 99/3 = 33
//y Gcd(48, 120) = 24,so the numbers % 24 are added like (24, 48, − − −120). Total numbers = 120/24 = 5
//y Gcd(48, 165) = 3,so the numbers (3, 6, 9, − − 24 − −48 − −99 − −120 − − − 165) are added. Totally,
165/3 = 55
At end, Gcd(48, 273) = 3,so the numbers (3, 6, 9 − −24 − − − 48 − −99 − − − 120 − −165 − − − 273) are
added(which covers all the above numbers)
1.for i=1 to n:
2. for j=1 to n:
3. temp=A[i][j]+10
4. A[i][j]=A[j][i]
5. A[j][i]=temp-10
6. end for
7.end for
Given a set of n distinct numbers, we would like to determine both the smallest and the largest number. Which of the
following statements is TRUE?
Consider the problem of computing the minimum of a set of n distinct numbers. We choose a permutation uniformly at
random (i.e., each of the n! permutations of ⟨1, . . . . , n⟩ is chosen with probability (1/n!) and we inspect the numbers
in the order given by this permutation. We maintain a variable MIN that holds the minimum value seen so far. MIN is
initialized to ∞ and if we see a value smaller than MIN during our inspection, then MIN is updated. For example, in the
inspection given by the following sequence, MIN is updated four times.
5942680317
What is the expected number of times MIN is updated?
n −
A. O(1) B. Hn = ∑i=1 1/i C. √n D. n/2 E. n
tifr2014 algorithms minimum-maximum
Given a set of n distinct numbers, we would like to determine the smallest three numbers in this set using comparisons.
Which of the following statements is TRUE?
Here, at first level we are Given n elements, out of which we have to find smallest 3 numbers.
We compare 2 − 2 elements as shown in figure & get n/2 elements at Second level.
Note: Minimum element is in these n/2 elements.
So, comparisons for this is n/2.
Similarly for next level we have n/4 Comparisons & n/2 elements and so on.
Total Comparisons till now is n/2 + n/4 + n/8 + … + 4 + 2 + 1 = (2log n − 1) = n − 1 {Use G.P. sum}
Minimum Element must have descended down from some path from top to Bottom.
Every element that is just below m1 (first minimum) is a candidate for second minimum.
So, O(log n) Comparisons for finding second smallest.
Similarly for 3rd minimum we get O(log n) time. As every element that is just below 1st & 2nd minimum is a candidate for
3rd minimum.
40 votes -- Himanshu Agarwal (12.4k points)
Let n ≥ 3, and let G be a simple, connected, undirected graph with the same number n of vertices and edges. Each
edge of G has a distinct real weight associated with it. Let T be the minimum weight spanning tree of G. Which of the
following statements is NOT ALWAYS TRUE ?
How many distinct minimum weight spanning trees does the following undirected, weighted graph have ?
with one extra edge. So, using BFS we can find the cycle in the graph and just eliminate the maximum edge weight in it.
Time complexity will be O(n).
Hence, B is answer
9 votes -- Anu007 (14.4k points)
Two choices for edge of weight 4 for each of the outer triangle, ie, (21) ∗ (21) ∗ (21) ∗ (21) = 24 and two choices for edge of
weight 2 for each of the inner triangle ie, (21) ∗ (21) = 22 .
24 ∗ 22 = 64
8 votes -- Manoja Rajalakshmi Aravindakshan (7.7k points)
A. L ∈ NP
B. Every problem in P is polynomial time reducible to L.
C. Every problem in NP is polynomial time reducible to L.
D. The Hamilton cycle problem is polynomial time reducible to L.
E. P ≠ NP and L ∈ P .
Given an integer n ≥ 3 , consider the problem of determining if there exist integers a, b ≥ 2 such that n = ab . Call
this the forward problem. The reverse problem is: given a and b, compute ab (mod b). Note that the input length for the
forward problem is ⌊log n⌋ + 1, while the input length for the reverse problem is ⌊log a⌋ + ⌊log b⌋ + 2 . Which of the
following statements is TRUE?
A. Both the forward and reverse problems can be solved in time polynomial in the lengths of their respective inputs.
B. The forward problem can be solved in polynomial time, however the reverse problem is NP -hard.
C. The reverse problem can be solved in polynomial time, however the forward problem is NP -hard.
D. Both the forward and reverse problem are NP -hard.
E. None of the above.
This question concerns the classes P and NP . If you are familiar with them, you may skip the definitions and go
directly to the question.
Let L be a set. We say that L is in P if there is some algorithm which given input x decides if x is in L or not in time bounded
by a polynomial in the length of x. For example, the set of all connected graphs is in P , because there is an algorithm which,
given a graph graph, can decide if it is connected or not in time roughly proportional to the number of edges of the graph.
The class NP is a superset of class P . It contains those sets that have membership witnesses that can be verified in polynomial
time. For example, the set of composite numbers is in NP . To see this take the witness for a composite number to be one of its
divisors. Then the verification process consists of performing just one division using two reasonable size numbers. Similarly,
the set of those graphs that have a Hamilton cycle, i.e. a cycle containing all the vertices of the graph, is in in NP . To verify
that the graph has a Hamilton cycle we just check if the witnessing sequence of vertices indeed a cycle of the graph that passes
through all the vertices of the graph. This can be done in time that is polynomial in the size of the graph.
More precisely, if L is a set in P consisting of elements of the form (x, w), then the set
M = {x : ∃w, |
is in N P .
Let G = (V , E) be a graph. G is said to have perfect matching if there is a subset M of the edges of G so that
G ∈ MATCH ↔ ∀S ⊆ V o(G − S) ≤ |
Two undirected graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are said to be isomorphic if there exist a bijection
π : V1 → V2 such that for all u, v ∈ V1 , (u, v) ∈ E1 if and only (π(u), π(v)) ∈ E2 . Consider the following
language.
L={(G, H)| G and H are undirected graphs such that a subgraph of G is isomorphic to H }
Then which of the following are true?
(i) L ∈ NP .
(ii) L is NP - hard.
(iii) L is undecidable.
A. Only (i) B. Only (ii) C. Only (iii) D. (i) and (ii) E. (ii) and (iii)
tifr2015 p-np-npc-nph non-gate
A multivariate polynomial in n 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
−2x31 − x1 x2 + 2 has the binary root (x1 = 1, x2 = 0) . Then determining whether a multivariate polynomial, given as the
sum of monimials, has a binary root:
A. is trivial: every polynomial has a B. can be done in polynomial time
binary root
C. is NP-hard, but not in NP D. is in NP, but not in P and not NP-hard
E. is both in NP and NP-hard
tifr2017 algorithms p-np-npc-nph
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
G respresents an undirected graph and a cycle refers to a simple cycle (no repeated edges or vertices).
Define the following two languages.
SCY CLE = {(G, k) ∣ G contains a cycle of length at most k}
and
LCY CLE = {(G, k) ∣ G contains a cycle of length at least k}
Which of the following is NOT known to be TRUE (to the best of our current knowledge) ?
A. SCY CLE ∈ P
B. LCY CLE ∈ NP .
C. LCY CLE ≤p SCY CLE (i.e, there is a polynomial time many-to -one reduction
from LCY CLE to SCY CLE ).
D. LCY CLE is NP-complete.
E. SCY CLE ≤p LCY CLE (i.e, there is a polynomial time many-to-one reduction
from SCY CLE to LCY CLE ).
A formula is said to be a 3-CF-formula if it is a conjunction (i.e., an AND) of clauses, and each clause has at most 3
literals. Analogously, a formula is said to be a 3-DF-formula if it is a disjunction (i.e., an OR) of clauses of at most 3
literals each.
Define the languages 3-CF-SAT and 3-DF-SAT as follows:
Which of the following best represents our current knowledge of these languages ?
The reverse problem can be solved in polynomial time as ab requires at most log b recursive calls using the
approach given below:
pow(int a, int b)
{
if(b%2)
return a* pow(a*a, b/2);
else
return pow(a*a, b/2);
}
Now, the forward problem is also solvable in polynomial time. We need to check for all the roots of n (from √−
1
n till n log n )
whether it is an integer . But each of these check can be done in log n time using a binary search on the set of integers from
2..n and so, the overall complexity will be (log n)2 which is polynomial in log n ( log n is the size of input). So, ( a) must be
the answer.
1. We say MATCH ∈ P if given a graph G we can say in polynomial time using a deterministic Turing machine if G
has a perfect matching.
2. We say MATCH ∈ NP if given a graph G we can say in polynomial time using a non-deterministic Turing machine
if G has a perfect matching.
1. Equivalently given a subset M of edges of G we can say in polynomial time using a deterministic Turing machine, if
it is a perfect matching for G.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
2. Similarly, we say MATCH ∈ NP if given a subset M of edges of G we can say in polynomial time using a
deterministic Turing machine, if it is NOT a perfect matching for G.
So, we can see if point 2.1 given above is possible. To do this for the given subset of edges M we have to see
If the answer to steps 1 and 2 are "Yes", then M is a perfect matching for G and we proved that MATCH ∈ NP .
If the answer to any one of steps 1 or 2 above is "No", then M is not a perfect matching for G and we proved that
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
MATCH ∈ NP .
Thus, both the problems are in NP .
Option C is correct.
Further Read: http://mathworld.wolfram.com/PerfectMatching.html
References
Clearly we can talk about the intractability of any problem if we know at least one algorithm t o solve the problem, if
there is no algorithm to solve a problem how can we talk about efficiency?
What P = NP implies?
"Any problem that is solved by a non deterministic Turing machine in polynomial time also be solved by some
deterministic Turing machine in polynomial time, even if the degree of the polynomial is higher."
and
There is neither a Non Deterministic Turing Machine nor Deterministic Turing Machine that can solve the Halting
Problem.
So any inference about P & NP is not going to affect the solvability of Halting Problem, since it is undecidable.
11 votes -- Anurag Pandey (10.5k points)
This problem is similar to Boolean Satisfiability Problem (SAT) problem which is First NP-Complete problem.
A problem is NP-Complete it means it is in NP as well as NP-Hard, i.e. intersection of both NP and NP-Hard is NP-
Complete.
Hence, option (E) is right.
3 votes -- SHIVESH KUMAR ROY (785 points)
E. All of them. Because all of them can be solved by Depth first traversal.
Every P problem is a subset of NP.
3 SAT where all the clauses are in conjunctive normal form is the well known NP-complete problem.
3 SAT with clauses in Disjunctive normal form lies in P class. Now one doubt you might get while solving this
question is, if 3 SAT with CNF is NP-complete and 3 SAT with DNF belongs to P, then why not to convert CNF formula to
equivalent DNF formula?? If we can do this conversion, then we can solve 3 SAT CNF too in polynomial time using the
algorithm for checking 3 SAT DNF.
But please note that this conversion process is not polynomial. When you convert a CNF formula to equivalent DNF formula,
it can have much much larger terms than that of original CNF formula, so this conversion process is not polynomial, it is
exponential. Hence the idea of converting 3CNF to 3DNF won't work.
Option A is correct.
Nice read: https://math.stackexchange.com/questions/159591/solving-sat-by-converting-to-disjunctive-normal-form
References
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 n
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 ?
1 2
A. ( ) B. ( )
n n
1 1
C. Θ ( ) D. O ( 2 )
n log n n
1
E. Θ ( )
n log2 n
tifr2018 algorithms sorting quicksort
Answers: Quicksort
Probability that the smallest and the largest elements in the array are compared during a run of the randomized
quicksort algorithm.
After the first split, first subpart of array will contain the minimum element and second subpart contains the maximum
element. (Why?)
Choose any element say x, greater than or equal to smallest element. After partition, smallest element will be present in the
left of it. The largest element will be present on the right sub array.
After the first split, there will be no more comparison between the largest and smallest element.
To have comparison between largest and smallest element we must choose anyone of the as the pivot element in the first split
itself.
Among the N elements we have to choose either the smallest element or the largest element. Selection will be uniform.
Probability = 2/n.
28 votes -- Hemant Parihar (11.9k points)
Let T(a, b) be the function with two arguments (both nonnegative integral powers of 2) defined by the following
recurrence:
T(a, b) = T ( a2 , b) + T (a, b2 ) if a, b ≥ 2 ;
T(a, 1) = T ( a2 , 1) if a ≥ 2 ;
T(1, b) = T (1, b2 ) if b ≥ 2 ;
T(1, 1) = 1 .
What is T(2r , 2s ) ?
A. rs B. r + s
2r + 2s r+s
C. ( ) D. ( )
2r r
r−s
E. 2 if r ≥ s , otherwise 2s−r
tifr2017 algorithms recurrence
Answers: Recurrence
Considering when k = 3
T(n) = T( n3 ) + T( 34 ) + n
Below is the recursion tree
Since, the combine work according to recurrence is linear in term of the size of the sub-problem
so at Level 1, total combine work is n
Combined work at level 2 = n + 3n = 13n
3 4 12
At level 3 combine work = + 3n + 3n + 9n = ( 13 2
12 ) n
n
9 12 12 16
So, at level k, when the recursion bottoms out at T(1), the combine work will be ( 13
12 )
k−1 . n
for the purpose of upper bound consider right height and then sum up total combine work from root till the leaf level
log 4 n−1
n+ 13 n + ( 13 2 13
12 ) . n + … + ( 12 ) n
3
12
= n [1 + ]
log 4 n−1
13 + … + ( 13
12 )
3
12
log 4 n
= n [1. ]
( 13
12
) 3 −1
13
12
−1
Using property
alogb c = clogb a
and ignoring denominator as constant term for upper bound
13
n. [n
log 4
3
12
− 1] = n1.27 (approximately)
Option (A) : O(n1.5 ) is surely an upper bound when k=3. Correct option.
Option (B): O(n log n)
this means n. n0.27 ≤ c. n. log n
n0.27 ≤ c. log n
This is clearly false as polynomials grow faster than poly-logarithms.
Option(B) can never be an upper bound, yes lower bound possible when k = 3.
When k = 4.
T(n) = T( n4 ) + T( 3n
4 )+n
If we draw recursion tree for this, at every level cost comes to be n and there would be maximum log 4 n levels
3
So, in this case T(n) = O(n log n). Option (C) correct.
When k = 5,
T(n) = T( n5 ) + T( 3n
4 )+n
It's recursion tree would look like below:
n. [1 + ]
log 4 n−1
19 + … + ( 19
20 )
3
20
log 4 n
= n. [ ]
1−( 19
20
) 3
1− 19
20
= n. [1 − ( 19 ]
log 4 n
20 )
3
19
= n [1 − n ]
log 4 20
3
= n[1 − n−0.17 ]
= n − n0.82
So, option(E) is correct.
Option(D) which says O(n log n) might not look convincing but
n − n0.82 ≤ c. n log n
1 ≤ c log n
1 − n0.17
for c = 1, no = 2 this satisfies big-oh.
Option (D) is also correct.
Answer: option(B)
47 votes -- Ayush Upadhyaya (28.5k points)
Let n = 2k
T (2k ) = 2T (2k/2 ) + k
S(k) = 2S(k/2) + k
This gives S(k) = Θ(k log k) (Master theorem case 2)
= Θ(log n log log n)
So ans is b
Value of T(2r , 2s ) is nothing but the number of leaf nodes in its recursion tree. The reason for this is that there is
only one base condition T(1, 1) which returns 1 which are all ultimately added. Here is an example recursion tree for
T(22 , 23 ) .
We will try to use some combinatorial technique to count the number of leaf nodes. One way of counting the number of leaf
nodes in the recurrence tree is by counting all possible paths that one can take from the root to the leaf node. The reason for
doing this would be clear in a moment. This idea would be used to establish a link with a very common combinatorial
problem.
Claim: If we consider a grid of size r × s then the possible paths from (r, s) to (0, 0) in that grid such that we can either
move backwards or downward is nothing but all possible paths in recurrence tree from the root node to leaf node.
This happens to be true because arguments of recurrence relation are in powers of two, and at each level of recurrence tree,
the power of one of the arguments get reduced by one.
Continuing from our previous example here is a grid of size 2 × 3 with two valid paths highlighted.
The number of valid paths possible in this grid will give us the count of the number of leaf nodes in the recurrence tree.
Interestingly this problem, when interpreted exactly in opposite way, happens to be a very well known problem of
combinatory.
In a grid of size r × s, count the number of possible paths from (0, 0) to (r, s) such that we can either move forward(F) or
upward(U).
Video:
So there are (r+s
r ) many different valid paths on this grid to reach (r, s) from (0, 0) or vice versa. And in turn, there are
same numbers of leaf nodes in the recursion tree. Therefore, we can conclude with -
r+s
T(2r , 2s ) = ( )
r
Video:
References
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
Consider the following three version of the binary search program. Assume that the elements of type T can be
compared with each other; also assume that the array is sorted.
i, j, k : integer;
a : array [1....N] of T;
x : T;
Program 1 : i := 1; j := N;
repeat
k := (i + j) div 2;
if a[k] < x then i := k else j := k
until (a[k] = x) or (i > j)
Program 2 : i := 1; j := N;
repeat
k := (i + j) div 2;
if x < a[k] then j := k - 1;
if a[k] < x then i := k + 1;
until i > j
Program 3 := i := 1; j := N
repeat
k := (i + j) div 2;
if x < a[k] then j := k else i := k + 1
until i > j
A binary search program is called correct provided it terminates with a[k] = x whenever such an element exists, or it
terminates with a [k] ≠ x if there exists no array element with value x. Which of the following statements is correct?
Answers: Searching
First program wont work if array has elements same..it may go into infinite loop .To make it work it properly we
have to do following changes j = k − 1 and i = k + 1
So, answer is E.
20 votes -- Pooja Palod (24.1k points)
Let G = (V , E) be a DIRECTED graph, where each edge e has a positive weight ω(e), and all vertices can be
reached from vertex s. For each vertex v, let ϕ(v) be the length of the shortest path from s to v. Let G′ = (V , E) be
a new weighted graph with the same vertices and edges, but with the edge weight of every edge e = (u → v) changed to
ω′ (e) = ω(e) + ϕ(v) − ϕ(u). Let P be a path from s to a vertex v, and let ω(P) = ∑e∈P ωe , and
ω′ (P) = ∑e∈P ω′e .
Which of the following options is NOT NECESSARILY TRUE ?
= ϕ(v) + ϕ(v)
= 2.ϕ(v)
= 2. ∑e ωe
= 2.ω(P )
(C is correct)
ω′ (P ) = ω(P ) + ϕ(v)
≤ ω(P ) + ω(P )
= 2 ∗ ω(P )
′
or ω (P ) ≤ 2ω(P )
(D is correct)
If P is the shortest path in G, (Say from s to v)
ω(P ) = ϕ(v)
ω′ (P ) = ω(P ) + ϕ(v)
Suppose you are given n numbers and you sort them in descending order as follows:
First find the maximum. Remove this element from the list and find the maximum of the remaining elements, remove
this element, and so on, until all elements are exhausted. How many comparisons does this method require in the worst case?
A. Linear in n. B. O (n2 ) but not better.
C. O (n log n) D. Same as heap sort.
E. O (n1.5 ) but not better.
tifr2010 algorithms time-complexity sorting
Consider the Insertion Sort procedure given below, which sorts an array L of size n (≥ 2) 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 n(n − 1)/2 comparisons. Which of the following is true?
Let S = {x1 , . . . . , xn } be a set of n numbers. Consider the problem of storing the elements of S in an array A [1...n]
such that the following min-heap property is maintained for all 2 ≤ i ≤ n : A[⌊i/2⌋] ≤ A[i] . (Note that ⌊x⌋ is the
largest integer that is at most x). Which of the following statements is TRUE?
Given a set of n = 2k distinct numbers, we would like to determine the smallest and the second smallest using
comparisons. Which of the following statements is TRUE?
The first n cells of an array L contain positive integers sorted in decreasing order, and the remaining m − n cells all
contain 0. Then, given an integer x, in how many comparisons can one find the position of x in L?
An array A contains n integers. We wish to sort A in ascending order. We are told that initially no element of A is
more than a distance k away from its final position in the sorted list. Assume that n and k are large and k is much
smaller than n. Which of the following is true for the worst case complexity of sorting A?
A. A can be sorted with constant . kn comparison but not with fewer comparisons.
B. A cannot be sorted with less than constant . n log n comparisons.
C. A can be sorted with constant . n comparisons.
D. A can be sorted with constant . n log k comparisons but not with fewer comparisons.
E. A can be sorted with constant . k2 n comparisons but not fewer.
Consider the quick sort algorithm on a set of n numbers, where in every recursive subroutine of the algorithm, the
algorithm chooses the median of that set as the pivot. Then which of the following statements is TRUE?
Suppose n processors are connected in a linear array as shown below. Each processor has a number. The processors
need to exchange numbers so that the numbers eventually appear in ascending order (the processor P1 should have the
minimum value and the the processor Pn should have the maximum value).
The algorithm to be employed is the following. Odd numbered processors and even numbered processors are activated alternate
steps; assume that in the first step all the even numbered processors are activated. When a processor is activated, the number it
holds is compared with the number held by its right-hand neighbour (if one exists) and the smaller of the two numbers is
retained by the activated processor and the bigger stored in its right hand neighbour.
How long does it take for the processors to sort the values?
A. n log n steps B. n2 steps
C. n steps D. n1.5 steps
E. The algorithm is not guaranteed to sort
tifr2013 algorithms sorting
An array of n distinct elements is said to be un-sorted if for every index i such that 2 ≤ i ≤ n − 1 , either
A[i] > max{A[i − 1], A[i + 1]}, or A[i] < min{A[i − 1], A[i + 1]}. What is the time-complexity of the fastest
algorithm that takes as input a sorted array A with n distinct elements, and un-sorts A?
−
A. O(n log n) but not O(n) B. O(n) but not O(√n )
−
C. O(√n ) but not O(log n) D. O(log n) but not O(1)
E. O(1)
tifr2017 algorithms sorting
Answers: Sorting
The given procedure resembles something like Bubble sort or Selection Sort.
Every time, for every input it will take O(n2 ) so, B is the answer.
If you are thinking about heap sort, where in the procedure, it is talked about building a heap? You can do extract_max only
on a heap. Right ? The procedure is nearly same as bubble sort or selection sort.
Read qsn again: "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."
Just follow the steps. Find max, take it to right side of array. Shift.
So n − 1 comparisons & n − 1 shifts in the worst case.
Total n − 1 + n − 2 + n − 3+. . . . +1 + n − 1 + n − 2 + n − 3+. . +1 which is O(n2 )
Only number of comparisons is asked... which is also O(n 2 )
18 votes -- Ahwan Mishra (10.2k points)
n(n−1)
Option D: In the worst case, the number of comparisons for given Insertion Sort are 2 .
Consider the set of numbers 1, 2, 3, 4, 5 . Some examples for which the number of comparisons are maximum are
I. Descending order: 5, 4, 3, 2, 1
II. 3, 5, 4, 2, 1
III. 3, 5, 4, 1, 2
There is more than 1 sequence for which the number of comparisons is maximum.
∴ Correct answer: D
Let us see why other options are false.
Option A: Since option D is true, option A is false.
Option B: Given Insertion Sort makes (n − 1) comparisons when the input is already sorted in ascending order.
Hence option B is false.
n(n−1)
Option C: Insertion Sort makes 2 comparisons only when the input is sorted in descending order.
Since the word only is used, this option is false.
n(n−1)
Option E: Insertion Sort makes 2 comparisons whenever all the elements of L are not distinct.
Not distinct means either all the elements are same or few elements are same and few are distinct.
When elements are same, number of comparisons are n − 1.
n(n−1)
When few elements are same and few are distinct, number of comparisons are always less than 2 because while
comparing same elements we don’t enter while loop.
Hence option E is false.
Note: There can be more than 1 sequence for maximum number of comparisons in insertion sort but maximum number of
movements or swaps occur only when input is in Descending Order for this question.
7 votes -- Shiva Sagar Rao (4.1k points)
Store the elements in an array and then call build_heap(A). the build_heap takes O(n) time.
So, option 'b' is correct.
But, if we try building heap by inserting each element one by one, the total complexity will be then O(n log n). Because
insertion takes O(log n) and inserting ' n' elements will take O(n log n).
26 votes -- Sujit Kumar Muduli (283 points)
Option (c) n + k − 2
Here is a nice explanation of the algorithm: http://www.codinghelmet.com/?path=exercises/two-smallest
" it is solution to the problem known for ages, and it has to do with tennis tournaments. The question was, knowing
the outcome of the tennis tournament, how can we tell which player was the second best? The defeated finalist is a good
candidate, but there are other players that were defeated directly by the tournament winner and any of them could also
be a good candidate for the second best. So the solution to the problem is quite simple: Once the tournament finishes,
pick up the
log N competitors that were beaten by the tournament winner and hold a mini-tournament to find which one is the best
among them. If we imagine that better players correspond with smaller numbers, the algorithm now goes like this. Hold
the tournament to find the smallest number (requires
N − 1 comparisons). During this step, for each number construct the list of numbers it was smaller than. Finally, pick
the list of numbers associated with the smallest number and find their minimum in
log N − 1 steps. This algorithm requires
N + log N − 2 comparisons to complete, but unfortunately it requires additional space proportional to N (each element
except the winner will ultimately be added to someone’s list); it also requires more time per step because of the
relatively complex enlisting logic involved in each comparison. When this optimized algorithm is applied to example
array, we get the following figure. Tournament held among numbers promotes
value
1 as the smallest number. That operation, performed on an array with nine numbers, requires exactly eight comparisons.
While promoting the smallest number, this operation has also flagged four numbers that were removed from competition
by direct comparison with the future winner:
6, 2, 3 and
8 in that order. Another sequence of three comparisons is required to promote number
2 as the second-smallest number in the array. This totals
11 comparisons, while naive algorithm requires
17 comparisons to come up with the same result. All in all, this algorithm that minimizes number of comparisons looks
to be good only for real tournaments, while number cracking algorithms should keep with the simple logic explained
above. Implementation of simple algorithm may look like this:
a – array containing n elements
min1 = a[0] – candidate for the smallest value
min2 = a[1] – candidate for the second smallest value
if min2 < min1
min1 = a[1]
min2 = a[0]
for i = 2 to n – 1
if a[i] < min1
min2 = min1
min1 = a[i]
else if a[i] < min2
min2 = a[i]
References
Once we hit a 0, the largest possible value (worst case) of i can be 2n − 2. This will happen if n = 2k + 1 for some k.
Then, our 2nd last value of i will be 2k , and then we get 2k+1 , which is equal to 2n − 2.
Now that we've hit a 0, and the array contains positive numbers in decreasing order, if x is present in L, it must be in the first
i elements.
We can binary search the first i elements in O(log i) comparisons.
Since the largest possible value of i = 2n − 2, our algorithm takes O(log(2n − 2)) = O(log n) comparisons.
Let Array element be {4, 3, 2, 1, 7, 5, 6, 9, 10, 8} and K be 3 here no element is more than 3 distance away from
its final position
So if we take
arr(1 to 6) and sort then surely first three element will be sorted in its final position {12345769108} O(6 log 6)
then sort arr(3 to 9) then 3 to 6 will be sorted {12345679108} O(6 log 6 )
then at last arr(6 to 9) less than O(6 log 6) {12345678910}
in general
Sort arr(0 to 2k)
Now we know that arr[0 to k) are in their final sorted positions
and arr(k to 2k) may be not sorted.
Median at
( n2 −1) n
th (n− n2 )
2
elements elements
location
T(n) = T (
n
− 1) + T (n − ) + Θ(n)
n
2 2
= Θ(n log n)
Answer: C.
17 votes -- Vidhi Sethi (8.3k points)
A pairwise swap will make the sorted array unsorted. Hence, the option ( B) is correct.
For eg - if an array is 1 2 3 4 5 6 7 8
The array will become after a pair wise swap to 2 1 4 3 6 5 8 7. For all i between 2 and n − 1, a[i] is either lower, or either
greater than their adjacent elements.
Since, each element is being swapped exactly once. The operation has O(n) time complexity.
19 votes -- tarun_svbk (1.4k points)
Let G be a connected simple graph (no self-loops or parallel edges) on n ≥ 3 vertices, with distinct edge weights. Let
e1 , e2 , . . . , em be an ordering of the edges in decreasing order of weight. Which of the following statements is
FALSE?
In a connected weighted graph with n vertices, all the edges have distinct positive integer weights. Then, the maximum
number of minimum weight spanning trees in the graph is
A. 1 B. n
C. equal to number of edges in the graph. D. equal to maximum weight of an edge
of the graph.
E. nn−2
tifr2013 spanning-tree
Consider the following undirected graph with some edge costs missing.
Suppose the wavy edges form a Minimum Cost Spanning Tree for G. Then, which of the following inequalities NEED NOT
hold?
A. cost(a, b) ≥ 6. B. cost(b, e) ≥ 5 .
C. cost(e, f) ≥ 5 . D. cost(a, d) ≥ 4 .
E. cost(b, c) ≥ 4 .
tifr2014 algorithms graph-algorithms spanning-tree
L et G = (V , E) be an undirected connected simple (i.e., no parallel edges or self-loops) graph with the weight
function w : E → R on its edge set. Let w(e1 ) < w(e2 ) < ⋅ ⋅ ⋅ < w(em ) , where E = {e1 , e2 , . . . , em } . Suppose T
is a minimum spanning tree of G. Which of the following statements is FALSE?
Consider the following undirected connected graph G with weights on its edges as given in the figure below. A
minimum spanning tree is a spanning tree of least weight and a maximum spanning tree is one with largest weight. A
second best minimum spanning tree whose weight is the smallest among all spanning trees that are not minimum spanning
trees in G.
Which of the following statements is TRUE in the above graph? (Note that all the edge weights are distinct in the above graph)
A. There is more than one minimum spanning tree and similarly, there is more than one maximum spanning tree here.
B. There is a unique minimum spanning tree, however there is more than one maximum spanning tree here.
C. There is more than one minimum spanning tree, however there is a unique maximum spanning tree here.
D. There is more than one minimum spanning tree and similarly, there is more than one second-best minimum spanning tree
here.
E. There is unique minimum spanning tree, however there is more than one second-best minimum spanning tree here.
a) & c) are trivially true. Edge with max value e1 must be present in Maximum spanning tree & same with
minimum.
e) This is true, because all edge weights are distinct. maximum spanning tree is unique.
b) e1 & e2 must be present in Maximum spanning tree. I'll prove it using Kruskal Algorithm.
We will first insert weight with biggest value, e1 . Then we insert e2 (second highest) . 2 edges do not create cycle. Then we
can go on from there inserting edges according to edge weights. As they have just asked for top 2 edges, using Kruskal Algo
we can say that top 2 edges must be in Maximum spanning tree.
d) This is false. There are chances that this em weight edge is cut edge(Bridge) Then it must be inserted to from any
spanning tree.
D is answer.
We can not say the same for Top 3 as they can create cycle & They we can not take a3 to make spanning tree.
Kruskal Algo Reference: http://stackoverflow.com/questions/4992664/how-to-find-maximum-spanning-tree
References
There will be unique min weight spanning tree since all weights are distinct.
Option is A.
18 votes -- Umang Raman (12.2k points)
Now check this diagram, this is forest obtained from above given graph using Kruskal's algorithm for MST.
So, according to the question edge d − e has weight 5 and it is included in the formation of MST. Now if edges b − e and
e − f has weight greater than 5 than it is not a problem for our MST because still we will get the given tree as Kruskal's
algorithm takes the smallest weighted edge without forming a cycle.
Cost of edge b − c ≥ 4 may also lead us to the same tree as above though Kruskal's algorithm will have choice between
c − f and b − c.
Now if the edge weight of a − d becomes 4, it is guaranteed that Kruskal's algorithm will not select edge d − e because its
edge cost is 5, and hence the tree structure will change. But there can be the case where edge weight is greater than 4 and we
still get the same tree (happens when a − d ≥ 5). Because in the question they asked to point out an unnecessary condition
this case is not the answer as we need a − d ≥ 5 which implies a − d ≥ 4.
Now notice option A. Put a − b = 5. The given MST would not change. So, this condition is not always necessary and
hence is the answer.
Therefore, option A is the answer.
21 votes -- Riya Roy(Arayana) (5.3k points)
Answer is E. The catch here is edge-weights belongs to real number. Therefore, edge weight can be negative. In
that case the minimum spanning tree may be different.
e1= −5
e2 = 1
e3 = 2
T is:
e1 = 25
e2 = 1
e3 = 4
EDIT:
(Here every edge weight is distinct, therefore MST is unique.)
Option A is True. If we apply Kruskal's algorithm, it will choose e1
Option B is True. If we apply Kruskal's algorithm then it will also choose e2 , and 2 edges can not form a cycle. ( e3 is not
guaranteed in MST, as it may form a cycle)
Option C is also true. If we apply Prims algorithm also on any vertex (say u), it chooses minimum
weight edge incident on vertex u.
Option D is true. Because every edge weight is distinct.
40 votes -- Riya Roy(Arayana) (5.3k points)
In the graph we have all edge weights are distinct so we will get unique minimum and maximum spanning tree.
Each Cycle must exclude maximum weight edge in minimum spanning tree.
Here, we have two cycle of 3 edges, a − d − e and c − g − k.
For second best minimum spanning tree, exclude a − e edge and include d − e edge
Other way for second best minimum spanning tree: exclude c − g edge and include g − k edge.
It takes O(n) time to find the median in a list of n elements, which are not necessarily in sorted order while it takes
only O(1) time to find the median in a list of n sorted elements. How much time does it take to find the median of 2n
elements which are given as two lists of n sorted elements each?
A. O(1) B. O (log n) but not O(1)
− −
C. O(√n ) but not O (log n) D. O(n) but not O(√n )
E. O (n log n) but not O(n)
tifr2013 algorithms time-complexity
Let S be a set of numbers. For x ∈ S , the rank of x is the number of elements in S that are less than or equal to x. The
procedure Select(S, r) takes a set S of numbers and a rank r (1 ≤ r ≤ |S|) and returns the element in S of rank r.
The procedure MultiSelect(S, R) takes a set of numbers S and a list of ranks R = {r1 < r2 < … < rk } , and returns the list
{x1 < x2 <. . . < xk } of elements of S , such that the rank of xi is ri . Suppose there is an implementation for Select (S, r)
that uses at most ‘‘ constant · |S| " binary comparisons between elements of S . The minimum number of comparisons needed
to implement MultiSelect(S, R) is
Consider the following code fragment in the C programming language when run on a non-negative integer n.
int f (int n)
{
if (n==0 || n==1)
return 1;
else
return f (n - 1) + f(n - 2);
}
Assuming a typical implementation of the language, what is the running time of this algorithm and how does it compare to the
optimal running time for this problem?
A. This algorithm runs in polynomial time in n but the optimal running time is exponential in n.
B. This algorithm runs in exponential time in n and the optimal running time is exponential in n.
C. This algorithm runs in exponential time in n but the optimal running time is polynomial in n.
D. This algorithm runs in polynomial time in n and the optimal running time is polynomial in n.
E. The algorithm does not terminate.
tifr2015 time-complexity
1. Calculate the medians m1 and m2 of the input arrays ar1[ ] and ar2[ ] respectively.
2. If m1 and m2 both are equal,
return m1 (or m2)
3. If m1 is greater than m2, then median is present in one of the below two subarrays.
(a) From first element of ar1 to m1 (ar1[0 to n/2])
(b) From m2 to last element of ar2 (ar2[n/2 to n − 1])
4. If m2 is greater than m1, then median is present in one of the below two subarrays.
http://www.geeksforgeeks.org/median-of-two-sorted-arrays/
Correct Answer: B
References
2) Check for each member, take it's rank of element and search in input list of required ranks; if found print it !
we have an entry in list of Ranks R, As R is given as sorted we perform binary search over it .
So Comparison : Constant * |S| * Log |R|
Total Comparison : Constant * |S| + Constant * |S| * Log |R| = Constant * |S| ( 1 + log |R| ) Ans (E)
Here, If we consider log n as a term (which is common in all 3), first 1 is a log function, second one is sqrt function and third
one is linear function of log n. Order of growth of these functions are well known and log is the slowest growing followed
by sqrt and then linear. So, option A is the correct answer here.
PS: After taking log is we arrive at functions distinguished by some constant terms only, then we can not conclude the order
of grpwth of the original functions using the log function. Examples are f(n) = 2n , g(n) = 3n .
References
Answer: C.
It is fibanacci series generation. it takes exponential time if we won't use dynamic programming.
Answer Keys
1.1.1 B 1.1.2 A 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 C 1.3.2 D 1.3.3 D 1.4.1 B
1.4.2 C 1.4.3 D 1.4.4 E 1.5.1 C 1.5.2 B
1.5.3 C 1.6.1 B 1.6.2 D 1.7.1 E 1.7.2 A
1.7.3 C 1.7.4 B 1.7.5 D 1.7.6 E 1.7.7 E
1.7.8 C 1.7.9 A 1.8.1 B 1.9.1 B 1.9.2 B
1.9.3 D 1.10.1 D 1.10.2 E 1.11.1 E 1.12.1 B
1.12.2 D 1.12.3 B 1.12.4 C 1.12.5 D 1.12.6 D
1.12.7 B 1.12.8 C 1.12.9 B 1.13.1 D 1.13.2 A
1.13.3 A 1.13.4 E 1.13.5 E 1.14.1 B 1.14.2 E
1.14.3 A 1.14.4 C
Lexical analysis, Parsing, Syntax-directed translation, Runtime environments, Intermediate code generation.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 1 2 2 2 1 2 2 1 1 1 1.5 2
2 Marks Count 3 2 1 2 2 2 1 3 2 1 2 3
Total Marks 7 6 4 6 5 6 4 7 5 4 5.5 7
A. The input string is alternately scanned left to right and right to left with k reversals.
B. Input string is scanned once left to right with rightmost derivation and k symbol look-ahead.
C. LR(k) grammers are expressively as powerful as context-free grammers.
D. Parser makes k left-to-right passes over input string.
E. Input string is scanned from left to right once with k symbol to the right as look-ahead to give left-most derivation.
Assume that ∗ has higher precedence than +, − and operators associate right to left (i.e (a + b + c = (a + (b + c))).
Consider
i. 2+a−b
ii. 2+a−b∗a+b
iii. (2 + ((a − b) ∗ (a + b)))
iv. 2 + (a − b) ∗ (a + b)
Consider the following grammar (the start symbol is E) for generating expressions.
With respect to this grammar, which of the following trees is the valid evaluation tree for the expression
2 ∗ 3 ∗ 4 − 5 ∗ 6 + 7?
A.
B.
D.
C.
E.
tifr2015 parsing
Answers: Parsing
a. Does not make any sense. false.
b. This is definition of LR( k) Parser. True
c. False. LR(k) is subset of CFL.
d. False.
e. LR(k) , bottom up parser . We have Right most derivation. This is False.
Answer :- B
17 votes -- Akash Kanase (36.1k points)
e is correct
Because as the precedence is right to left, expression evaluated in (ii) is 2 + (a − ((b ∗ a) + b)), which is not a correct
evaluation as the given parse tree.
14 votes -- srestha (85.3k points)
Answer is option B.
The corresponding parse tree is drawn for the given expression according to the given grammar.
Answer Keys
2.1.1 B 2.1.2 E 2.1.3 B
Concept of layering.OSI and TCP/IP Protocol Stacks; Basics of packet, circuit and virtual circuit-switching; Data link
layer: framing, error detection, Medium Access Control, Ethernet bridging; Routing protocols: shortest path, flooding,
distance vector and link state routing; Fragmentation and IP addressing, IPv4 , CIDR notation, Basics of IP support protocols
(ARP, DHCP, ICMP), Network Address Translation (NAT); Transport layer: flow control and congestion control, UDP, TCP,
sockets; Application layer protocols: DNS, SMTP, HTTP, FTP, Email.
.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 1 1 2 1 3 2 3 2 3 1 2 3
2 Marks Count 4 3 2 4 2 3 1 4 3 1 2.8 4
Total Marks 9 7 6 9 7 8 5 10 9 5 7.7 10
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.
A worm is a parasite. False
ANS: worm is a standalone malware computer program that replicates itself in order to spread to other computers.
ANS: since worm are standalone software and do not require a host program or human help to propagate.
So, D is choice.
16 votes -- Prashant Singh (47.2k points)
Answer Keys
3.1.1 D
4 Databases (2)
ER‐model. Relational model:Relational algebra, Tuple calculus, SQL. Integrity constraints, Normal forms. File
organization, Indexing (e.g., B and B+ trees). Transactions and concurrency control.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 2 1 2 2 2 2 2 3 2 1 2 3
2 Marks Count 3 3 3 3 2 3 3 1 2 1 2.5 3
Total Marks 8 7 8 8 6 8 8 5 6 6 7.1 8
Customers = C (C Name)
Shops = S (S Name)
Buys = B (C Name, S Name)
Customers = C (CName),
Shops = S (SName),
Buys = B(CName, SName).
Which of the following relational algebra expressions returns the names of shops that have no customers at all? [Here Π is the
projection operator.]
A. ΠSName B B. S − B
C. S − ΠSName B D. S − ΠSName ((C × S) − B)
E. None of the above
tifr2013 databases relational-algebra
Answer Keys
4.1.1 C 4.1.2 C
Boolean algebra. Combinational and sequential circuits. Minimization. Number representations and computer
arithmetic (fixed and floating point)
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 2 3 2 4 2 3 2 3 3 2 2.6 4
2 Marks Count 2 2 1 2 2 0 4 2 0 0 1.6 4
Total Marks 6 7 4 8 6 3 10 7 3 3 6 10
Consider the following Boolean valued function on n Boolean variables: f(x1 , … , xn ) = x1 + ⋯ + xn (mod 2) ,
where addition is over integers, mapping ‘FALSE’ to 0 and ‘TRUE’ to 1. Consider Boolean circuits (with no
feedback) that use only logical AND and OR gates, and where each gate has two input bits, each of which is either an input
bit of f or the output bit of some other gate of the circuit. The circuit has a distinguished gate whose value is the output of the
circuit. The minimum size of such a circuit computing f (asymptotically in n) is :
¬x = {
1 iff x = 0
0 iff x = 1
.
If x ∈ {0, 1}n , then ¬ x denotes the component wise negation of x; that is:
(¬ x)i = (¬ xi ∣ i ∈ [1..n])
Consider a circuit C , computing a function f : {0, 1}n → {0, 1} using AND (∧), OR (∨),and NOT (¬) gates. Let D be the
circuit obtained from C by replacing each AND gate by an OR gate and replacing each OR gate by an AND. Suppose D
computes the function g. Which of the following is true for all inputs x?
A. g(x) = ¬ f(x) B. g(x) = f(x) ∧ f(¬x)
C. g(x) = f(x) ∨ f(¬x) D. g(x) = ¬f(¬x)
E. None of the above.
tifr2010 digital-logic boolean-algebra
Let f : {0, 1}n → {0, 1} be a boolean function computed by a logical circuit comprising just binary AND and binary
OR gates (assume that the circuit does not have any feedback). Let PARITY : {0, 1}n → {0, 1} be the boolean
function that outputs 1 if the total number of input bits set to 1 is odd. Similarly, let MAJORITY be the boolean function that
outputs 1 if the number of input bits that are set to 1 is at least as large as the number of input bits that are set to 0. Then, which
of the following is NOT possible?
A. f(0, 0, . . . , 0) = f(1, 1, . . . , 1) = 0 .
B. f(0, 0, . . . , 0) = f(1, 1.. . . , 1) = 1
C. f is the MAJORITY function.
D. f is the PARITY function.
E. f outputs 1 at exactly one assignment of the input bits.
tifr2014 boolean-algebra
A Boolean formula is said to be a tautology if it evaluates to TRUE for all assignments to its variables. Which one of
the following is NOT a tautology?
tifr2016 boolean-algebra
The circuit D is the dual of the function f(x) (i.e., replace AND by OR and vice versa)
for two boolean variables, p1 = 1 ,p2 = 1 , neither p1 ∧ p2 nor p1 ∨ p2 is 0. ie, f(1, 1) is never 0.
for j < n, if all pj = 0 and pn−j = 1,then f(pj , pn−j ) = majority if each 0 is AND with each 1.The remaining 1′ s or 0′ s
are OR with the result.
Option C is possible.
To check odd number of 1′ s, for PARITY function, we have to get the result 0 for even number of 1′ s which is not possible
with just AND and OR operations, how might we combine(since NOT is absent in f );
D is not possible.
For option E, we check by symmetry. When the inputs are complemented among 0′ s and 1′ s, can f change to f ′ ? f is not
always fixed for a particular input,. example, f(0, 1) = 0 ∨ 1 = 1 0 ∧ 1 = 0 ,hence f can take multiple values for same
input. Therefore E is also not right.
A) evaluate to TRUE
C) evaluate to TRUE
D) evaluate to TRUE
E) evaluate to TRUE
7 votes -- kunal chalotra (13.6k points)
A Boolean expression is an expression made out of propositional letters (such as p, q, r ) and operators ∧, ∨ and ¬; e.g.
p ∧ ¬(q ∨ ¬r). An expression is said to be in sum of product form (also called disjunctive normal form) if all ¬ occur
just before letters and no ∨ occurs in scope of ∧; e.g. (p ∧ ¬q) ∨ (¬p ∧ q). The expression is said to be in product of sum
form (also called conjunctive normal form) if all negations occur just before letters and no ∧ occurs in the scope of ∨; e.g.
(p ∨ ¬q) ∧ (¬p ∨ q). Which of the following is not correct?
tifr2015 canonical-normal-form
The Boolean function obtained by adding an inverter to each and every input of an AND gate is:
Invert-AND = NOR
¯¯¯¯¯¯¯¯¯¯¯¯¯¯
For example, A′ B′ = A + B
For any natural number n, an ordering of all binary strings of length n is a Gray code if it starts with 0n , 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
n = 3 , 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 n?
1. In the question it is stated that -> Thus, for n = 3 , the ordering (000, 100, 101, 111, 110, 010, 011, 001) is a
Gray code.
2. We have to find orderings such that they start with 0n , must contain all bit strings of length n and successive strings must
differ in one bit.
Which of the following decimal numbers can be exactly represented in binary notation with a finite number of bits ?
As there are only 13 possible values a variable can take, we need to use ⌈13⌉ = 4 − bits.
PS: As variable can take only 13 values, we don't need to worry what those values are.
Answer : Option D
15 votes -- Akash Kanase (36.1k points)
Binary representation of 0.5, 0.12 is the only fraction that is terminating in the given options. So it can be
represented exactly.
All other options have non-terminating fraction part and cannot be represented exactly with finite number of bits.
4 votes -- Manoja Rajalakshmi Aravindakshan (7.7k points)
Consider the (decimal) number 182, whose binary representation is 10110110. How many positive integers are there
in the following set?
A. 91 B. 70 C. 54 D. 35 E. 27
tifr2020 digital-logic number-system number-representation
Total Bits = 8
So, in the remaining 7 Bits, you need to choose 4 bits as 1 ==> (74) = 35
case 2 : Starts with 1, then next bit should be 0 for total decimal value ≤ 182.
So, in the remaining 6 Bits, you need to choose 3 bits as 1 ==> (63) = 20
but in this 20 patterns, 10111000 is grater than given number. SO only 19 patterns are matching with our condition.
Total = 35+19 = 54
4 votes -- Shaik Masthan (50.6k points)
Answer Keys
5.0.1 E 5.1.1 D 5.1.2 D 5.1.3 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
In how many ways can the letters of the word ABACUS be rearranged such that the vowels always appear together?
(6 + 3)! 6! 3!3! 4!3!
A. B. C. D. E. None of the above
2! 2! 2! 2!
tifr2011 combinatory
A 1 × 1 chessboard has one square, a 2 × 2 chessboard has five squares. Continuing along this fashion, what is the
number of squares on the regular 8 × 8 chessboard?
Answers:
Take AAU together and treat it like 1 entity. Now arrange AAU BCS in 4! ways.
3!
Then, the AAU can be arranged in ways because A has been repeated twice.
2!
4!3!
So, total arrangements =
2!
Option (D) is the correct answer.
26 votes -- yes (1.1k points)
It is required to divide the 2n members of a club into n disjoint teams of 2 members each. The teams are not labelled.
The number of ways in which this can be done is:
(2n)! (2n)! (2n)! n!
A. 2n B. n! C. 2n.n! D. 2 E. None of the above
tifr2012 combinatory balls-in-bins
There are n kingdoms and 2n champions. Each kingdom gets 2 champions. The number of ways in which this can be
done is:
(2n)! (2n)! (2n)! n!
A. 2n B. n! C. 2n.n! D. 2 E. None of the above
tifr2013 combinatory discrete-mathematics normal balls-in-bins
There is a set of 2n people: n male and n female. A good party is one with equal number of males and females
(including the one where none are invited). The total number of good parties is.
2
A. 2n B. n2 C. (⌊nn/2⌋) D. (2n
n) E. None of the above
tifr2015 combinatory discrete-mathematics normal balls-in-bins
How many distinct ways are there to split 50 identical coins among three people so that each person gets at least 5
coins?
E. (37
2)
tifr2017 combinatory discrete-mathematics normal balls-in-bins
2n member to be n teams with 2 member each and teams are unordered so we can exchange n team member
among them.
(2n)!
=
2!.2!.2! … 2! × n!
n times
(2n)!
= n
2 × n!
Option C.
26 votes -- Umang Raman (12.2k points)
We have n Kingdoms as k1 , k2 , … , kn .
2n
=
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 60 of 278
Distinct ways are there to split 50 identical coins among three people so that each person gets at least 5 coins
x1 + 5 + x2 + 5 + x3 + 5 = 50
x1 + x2 + x3 = 35
Solving Non-integral solution n = 35, r = 3
(n+r−1)C (35+3−1) C 37
r−1 = 3−1 = C2 .
Hence E is Answer
31 votes -- Prajwal Bhat (7.6k points)
In how many different ways can r elements be picked from a set of n elements if
In a tournament with 7 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. 13 B. 12 C. 11 D. 10 E. 9
tifr2016 combinatory discrete-mathematics normal
How many distinct words can be formed by permuting the letters of the word ABRACADABRA?
11! 11!
A. 5! 2! 2! B. 5! 4! C. 11! 5! 2! 2! D. 11! 5! 4! E. 11!
tifr2017 combinatory discrete-mathematics easy
A row of 10 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?
i. Repetition is not allowed and the order of picking matters =r arrangement with no repetition
=n Pr = n!
(n−r)!
ii. Repetition is allowed and the order of picking does not matter = combination with unlimited repetition
=(n−1+r) Cr = n−1+r!
(n−1)!r!
Given that the order among the teams with the same total are determined by a whimsical tournament referee.
So, He/She can order the top 3 teams like ABC, ABD, BCD, ACD, …
But, Question says " team must earn in order to be guaranteed a place in the next round "
Hence, Not to depend on that whimsical referee, the minimum total number of points a team must earn in order to be
guaranteed a place in the next round = 9 + 1 = 10 points
Correct Answer: D
30 votes -- Kapil Phulwani (35.2k points)
ABRACADABRA
A → 5B → 2R → 2
Now,we have to remove word from total permutation of words which have repetition of letter,
11!
=
5!2!2!
Hence option (A) is correct.
13 votes -- kunal chalotra (13.6k points)
Let T(n) denote the number of ways to color ′ n′ houses such that house immediately right to the red or the
blue is green.
Consider the first house in the row. It can be either red, green or blue. (Dividing the problem into three cases).
Suppose the first house is painted green so for next house, we don't have any condition, It can be painted by using any of the
colors,(R, G or B).
Hence If the first house is green we can paint the rest of the houses in T(n − 1) ways.
Suppose the first house is red, then for the next house we don't have any choice, it must be green.
So, if the first house is red, the number of ways of painting the rest of the houses is T(n − 2). (excluding the second house).
Same applies if the first house is blue, in that case also in T(n − 2) ways we can paint the houses.
Summing up all the mutually exclusive cases,
T(1) T(2) T(3) T(4) T(5) T(6) T(7) T(8) T(9) T(10)
3 5 11 21 43 85 171 341 683 1365
Option (C).
42 votes -- Utkarsh Joshi (5.3k points)
A. 214 B. 31
C. ( 33 ) + ( 101 ) D. ( 33 ) + 2 ( 10
1 )
E. ( 33 ) ( 10
1 2
) 9
tifr2010 generating-functions
A. 1 B. 2 C. 5 D. 7 E. 8
tifr2018 modular-arithmetic combinatory
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?
What is the minimum number of students needed in a class to guarantee that there are at least 6 students whose
birthdays fall in the same month ?
A. 6 B. 23 C. 61 D. 72 E. 91
tifr2018 pigeonhole-principle combinatory
There are 12 months and we have to get 5 people having birthdays in the same month in order to form a team.
Pigeon hole principle can be applied here :
⌈ 12
N ⌉ = 5,
N = 49.
Hence answer is D
26 votes -- Riya Roy(Arayana) (5.3k points)
Using pigeonhole principle: With n pigeon and m holes atleast p pigeo will be on m holes are:
n−1
m +1=p
n − 1 + 12 = 6 × 12
n − 1 = 72 − 12 = 60
n = 60 + 1 = 61
Correct Answer: C
14 votes -- Anu007 (14.4k points)
The Fibonacci sequence is defined as follows: F0 = 0, F1 = 1, and for all integers n ≥ 2, Fn = Fn−1 + Fn−2 . Then
which of the following statements is FALSE?
Answers: Recurrence
F0 F1 F2 F3 F4 F5 F6 F7
0 1 1 2 3 5 8 13
Sn = 2Sn−1 + Sn−2
Putting S(0) = 0 , C1 + C2 = 0
– –
Putting S(1) = 1 , C1 × (1 + √2) + C2 × (1 − √2) = 1
– –
– ((1 + √2)n − (1 − √2)n )
1
Sn = 2√2
S0 = 0, S1 = 1, S2 = 2, S3 = 5, S4 = 12, S5 = 29, S6 = 70
Answer Keys
6.0.1 D 6.0.2 C 6.1.1 C 6.1.2 A 6.1.3 D
6.1.4 E 6.2.1 A 6.2.2 D 6.2.3 A 6.2.4 C
6.3.1 A 6.4.1 D 6.5.1 D 6.5.2 C 6.6.1 E
6.6.2 C
An undirected graph is complete if there is an edge between every pair of vertices. Given a complete undirected graph
on n vertices, in how many ways can you choose a direction for the edges so that there are no directed cycles?
A. n n(n−1)
B. 2
C. n! D. 2n
n(n−1)
E. 2m , where m = 2
tifr2017 graph-theory counting
Answers: Counting
They are asking to convert Complete Undirected graph into Directed graph without cycle by choosing direction
for the edges.
See this K3 graph-
(Image ref)
By this time you must have got the problem statement meaning- our resultant graph should be acyclic.
Lets say we have a complete graph G which has n vertices, v1 , v2 , … vn . To convert it into the resultant graph we have to
assign direction to each edge. Now see, our resultant graph is acyclic therefore it must have a topological order.
These two permutation shows that undirected edge between V1 and V2 , was first chosen as V1 → V2 and then V2 → V1
Don't think about the labeling of vertices, If I do unlabelling of all n! permutations then all structures are same. But it doesn't
matter If I am arriving at the same structure, What matters is, In how many ways I can reach to that.
See this-
All the above 3 structures are Isomorphic. But still, there are 3! ways to reach such structure.
i. a, b, c
ii. a, c, b
iii. b, a, c
iv. b, c, a
v. c, a, b
vi. c, b, a
Let's take each order, and check in how many ways we can make it as directed edges ( remember there are 3 edges in K3 )
with it
ex :- b, a, c : we make b → a → c. Now the remaining edge must be b → c; there is no other possibility for it, as if
we make c → b then it is cyclic.
So, there is only one way to assign edges, to each order !
Now, you got doubt that " There may be many assignment of direction of edges than permutations ? "
Answer for this question is, Should be NO. ( think about it, let there be an edge u → v, then u should be before v)
In how many ways we can choose direction for the edges so that there are no directed cycles? → Number of permutations of
vertices = n!
Correct Answer: C
References
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?
In a graph, the degree of a vertex is the number of edges incident (connected) on it. Which of the following is true for
every graph G?
In an undirected graph G with n vertices, vertex 1 has degree 1, while each vertex 2, … , n − 1 has degree 10 and the
degree of vertex n is unknown, Which of the following statement must be TRUE on the graph G?
Since 7 edges come to every vertex, total no. of edges leaving n vertices must be 7n. So, option (A) is a
possibility but it needn't be always true. We can have 8 edges leave one vertex and 6 edges leave another (and
similarly any other combination of outgoing edges ensuring total no. of outgoing edges remain constant). But option (C) must
always be true as if none of the n vertices have at least 7 edges leaving, sum of outgoing edges can never be 7n.
37 votes -- Arjun Suresh (334k points)
Hence, Ans is (c)There are the even number of vertices of odd degree.
17 votes -- Umang Raman (12.2k points)
Now in this question graph G has n − 2 vertices with degree 10, one vertex with degree 1.
Because of theorem (1), vertex n and vertex 1 should be in the same connected component.
Proof: Lets suppose vertex 1 and vertex n are not in the same connected component. Also assume that vertex 1 is in
component C1 . Now C1 has only one vertex with odd degree which is vertex 1, because vertex 2 to vertex n − 1 has even
degree (10) and this violates theorem (1). So, C1 must have vertex 1 as well as vertex n and vertex n should have odd
degree.
Now, since vertex 1 and vertex n are in the same connected component and the given graph is undirected so, there must be a
path from vertex 1 to vertex n. Hence option (a) is true.
Lets take graph G where n = 12 and each pair of vertices from vertex 2 to vertex n are connected with each other by an
edge and additionally there is an ede between vertex n and vertex 1. Hence, vertex 1 has degree 1 and vertex 2, … , vertex
n − 1 has degree 10 and vertex n has degree 11. In this graph vertex n has degree 11, and hence option C is wrong.
A vertex colouring with three colours of a graph G = (V , E) is a mapping c : V → {R, G, B} so that adjacent
vertices receive distinct colours. Consider the following undirected graph.
How many vertex colouring with three colours does this graph have?
A. 39 B. 63 C. 3 × 28 D. 27 E. 24
tifr2017 graph-theory graph-coloring
A vertex colouring of a graph G = (V , E) with k coulours is a mapping c : V → {1, … , k} such that c(u) ≠ c(v)
for every (u, v) ∈ E . Consider the following statements:
i. If every vertex in G has degree at most d then G admits a vertex coulouring using d + 1 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
How many ways are there to assign colours from range {1, 2, … , r} to vertices of the following graph so that
adjacent vertices receive distinct colours?
A. r4 B. r4 − 4r3
C. r4 − 5r3 + 8r2 − 4r D. r4 − 4r3 + 9r2 − 3r
E. r4 − 5r3 + 10r2 − 15r
tifr2018 graph-theory graph-coloring
Independence number : Size of largest maximum independent set : a (G) (it covers all adjacent vertices)
Chromatic Number : Minimum No. of color required to properly color the graph : χ (G)
The vertices of G can be partitioned into χ (G) monochromatic classes. Each class is an independent set, and hence cannot
have size larger than α (G) .
i. is true, since in worst case the graph can be complete. So, d + 1 colours are necessary for graph containing
vertices with degree atmost ′ d′ . Example : Consider a complete graph of 4 vertices ... K4
iii. is true, since each level of the tree must be coloured in an alternate fashion. We can do this with two colours. Its a
theorem that a tree is 2 colourable ...
The graph can be colored using minimum 3 colors and maximum 4 colors.
No. of ways using 3 colors = r(r − 1)(r − 2).
No. of ways using 4 colors = r(r − 1)(r − 2)(r − 3).
Total no. of ways = r(r − 1)(r − 2) + r(r − 1)(r − 2)(r − 3)
= r4 − 5r3 + 8r2 − 4r
OPTION (C)
28 votes -- ZAHID WAKEEL (1.6k points)
A graph G = (V (G), E(G)) is said to be Bipartite if and only if there exists a partition V (G) = A ∪ B and
A ∩ B = ∅. Hence all edges share a vertex from both set A and B, and there are no edges formed between two
vertices in the set A, and there are not edges formed between the two vertices in B.
(OR)
A bipartite graph, also called a bigraph, is a set of graph vertices decomposed into two disjoint sets such that no two graph
vertices within the same set are adjacent.
https://en.wikipedia.org/wiki/Petersen_graph
https://www.win.tue.nl/~aeb/graphs/Petersen.html
https://www.win.tue.nl/~aeb/graphs/Petersen.html
https://graph.subwiki.org/wiki/Petersen_graph
Reference:
http://mathworld.wolfram.com/BipartiteGraph.html
http://discrete.openmathbooks.org/dmoi2/sec_matchings.html
References
⎛0 1 0 0 0 1⎞
⎜1 0⎟
⎜ ⎟
0 1 0 0
⎜0 1⎟
Suppose ⎜ ⎟
1 0 1 0
⎜0 0⎟
⎜ ⎟
⎜ ⎟
0 1 0 1
⎜0 0 0 1 0 1⎟
⎝1 0 1 0 1 0⎠
is the adjacency matrix of an undirected graph with six vertices: that is, the rows and columns are indexed by vertices of the
graph, and an entry is 1 if the corresponding vertices are connected by an edge and is 0 otherwise; the same order of vertices is
used for the rows and columns. Which of the graphs below has the above adjacency matrix?
ii.
i.
iii. iv.
A. Only (i)
B. Only (ii)
C. Only (iii)
D. Only (iv)
E. (i) and (ii)
Let G = (V , E) be a directed graph with n(≥ 2) vertices, including a special vertex r. Each edge e ∈ E has a strictly
positive edge weight w(e). An arborescence in G rooted at r is a subgraph H of G in which every vertex u ∈ V ∖{r}
has a directed path to the special vertex r. The weight of an arborescence H is the sum of the weights of the edges in H .
Let H ∗ be a minimum arborescence rooted at r, and w∗ the weight of H ∗ . Which of the following is NOT always true?
Consider directed graphs on n labelled vertices {1, 2, … , n} , 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 ?
n−1
2 [ ∑k=1 k(n−k) ]
A. ∑k=1 k!(n − k)! n! n−1 1
B.
n!(n−1)
k]
C. n![ ∑k=1
n−1 1 D. 2
A graph is d – regular if every vertex has degree d. For a d – regular graph on n vertices, which of the following must
be TRUE?
A. d divides n B. Both d and n are even
C. Both d and n are odd D. At least one of d and n is odd
E. At least one of d and n is even
tifr2019 graph-connectivity graph-theory
So the number of edges in the graph must be equal to half the number of 1's in the adjacency matrix.
Hence number of edges will be 7 in the graph.
All the other graphs except (iii), have 7 edges.So it is clear that the adjacency matrix does not represents graph (iii).
Isomorphism:
From the definition of Isomorphic graphs, it can be inferred that,
Isomorphic graphs must have same (adjacency matrix) representation.
Thus after eliminating graph (iii) we have to check for isomorphism among graphs (i), (ii) & (iv).
It can clearly be observed that graphs (ii) & (iv) are not isomorphic to each other.
It can also be observed that graph (i) & (ii) are isomorphic(Rotate graph (i) by 90 degree left/right.
Graph (ii) is looking like a closed envelope in the figure, try to view it like an open envelope, like a trapezium over a
rectangle.)
So now it can be inferred that either the adjacency matrix is representing both graphs (i) & (ii) or it is only representing (iv).
Cycles of length 6 :
Now from the adjacency matrix it can be observed that there should be a cycle of length 6 in the graph, since
[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 1] are all 1's in the matrix.(as 1 at any position [x, y] represents an edge between x & y
in the graph).
& both graphs (i) & (ii) have cycles of length 6, but graph (iv) does not has any cycle of length 6, it has cycles of length
4 & 5 only.
Thus graph (iv) can not have the above adjacency matrix.
Hence the adjacency matrix represents graphs (i) & (ii).
28 votes -- Anurag Pandey (10.5k points)
For these questions it is better to get some counter examples by trying small graphs. Consider the following graph:
Now, as per the question, an arborescence is a subgraph with all incoming edges to the special vertex r. So, for the above
graph it is just the edge a − r which is of weight 2.
Now, option A says that if we sum up all the outgoing edge weights (minimum weight in case multiple outgoing edges exist)
of all vertices excluding r, the sum will be greater than or equal to the weight of the minimum arborescence. This is true
because all the edges in the minimum arborescence will be included here as the outgoing edges of the other vertices.
Now, option B is false. Because instead of outgoing edges we are adding the weights of incoming edges. And these edges
are not part of the arborescence. For example, in the above graph, only one vertex a ∈ V ∖{r}.
∑u∈V ∖{r} min(v,u)∈E w((v, u)) = w(r, a) = 5 > w∗ .
Options C and D are straightforward TRUE as for minimum arborescence we only need to consider the incoming edges to r
from n − 1 other vertices thus making it acyclic too.
For option E, suppose a graph has a directed Hamiltonian cycle. In an arborescence every vertex is connected and we need
"one more" edge to make it a cycle. But this may or may not be a Hamiltonian cycle as a Hamiltonian cycle requires that in
the path from the start and end of any vertex, no vertex is repeated. But if we take any directed Hamiltonian cycle, every
vertex has a directed path to every other vertex (special vertex r can be any of the given vertices) and so it is an arborescence.
What will happen if we remove an edge (u, v) from such a minimum weighted directed Hamiltonian cycle?. Then we no
longer have a path to vertex v but all vertices still have a path to vertex u and so u can be the special vertex making it still
an arborescence. Since the weight of this edge (u, v) is guaranteed to be positive, this means the weight of this arborescence
must be STRICTLY less than the weight of the minimum Hamiltonian cycle. Thus option E is TRUE.
So, Correct answer: B.
9 votes -- Arjun Suresh (334k points)
We need to find from {1, 2, … , n} vertices how many graphs exist which are having exactly two cycles when
self loops are allowed.
When n = 1 there is no such graph with two cycles.
0 graph.
When n = 2
1 graph exists.
When n = 3
3 graphs exist.
When n = 4
11 graphs exist.
For n = 4
(A) ∑n−1
k=1 k!(n − k)! = 16
n! [∑n−1 1
(B) 2 k=1 k(n−k) ] = 11
(C) n![∑n−1 1
k=1 k ] = 44
n!(n−1)
(D) 2 = 36
Option B is answer.
14 votes -- Shubhgupta (6.5k points)
For an undirected graph G = (V , E) , the line graph G′ = (V ′ , E ′ ) is obtained by replacing each edge in E by a
vertex, and adding an edge between two vertices in V ′ if the corresponding edges in G are incident on the same vertex.
Which of the following is TRUE of line graphs?
How many distinct minimum weight spanning trees does the following undirected, weighted graph have ?
A. 1 B. 2 C. 4 D. 6 E. 8
tifr2018 graph-theory minimum-spanning-trees
n(n−1)
Let Kn be the complete graph on n vertices labeled {1, 2, … , n} with m = 2 edges. What is the number of
spanning trees of Kn ?
m
A. n−1 B. mn−1 C. nn−2 D. nn−1 E. None of the above
tifr2015 graph-theory spanning-tree
Which of the following is NOT a sufficient and necessary condition for an undirected graph G to be a tree?
A. G is connected and has n − 1 edges. B. G is acyclic and connected.
C. G is acyclic and has n − 1 edges. D. G is acyclic, connected and has n − 1
edges.
E. G has n − 1 edges.
tifr2011 graph-theory trees
Answers: Trees
You need at least n − 1 edges to have a connected graph. This leaves no edges to make any cycles. Thus, Option a
⟹ G is acyclic.
A connected graph with n − 1 edges is acyclic, as shown above. Now, if we add any more edges to this graph, we will
be connecting two vertices that are already connected. Thus, adding any more than edges to a connected graph will cause
cycles. So, if a graph is acyclic and connected, it has exactly (n − 1) edges.
You can't fit (n − 1) edges between (n − 1) vertices without causing cycles. Thus, if graph with (n − 1) edges is
acyclic, it must connect n vertices. Hence, an acyclic graph with (n − 1) edges is connected.
Thus, all options a to d are both necessary and sufficient for an undirected graph G to be a tree.
Option e ⟹
/ G is a tree.
Since G is not constrained to be acyclic, we can create a cyclic graph with (n − 1) edges. This graph will be cyclic, and
it won't be connected. And thus, it won't be a tree.
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
Which of the following is NOT necessarily true? { Notation: The symbol '' ¬''notes negation; P (x, y) means that for
given x and y, the property P (x, y) is true }.
I f Mr. M is guilty, then no witness is lying unless he is afraid. There is a witness who is afraid. Which of the
following statements is true?
G − Mr. M is guilty
W(x) − x is a witness
L(x) − x is lying
A(x) − x is afraid )
A. Mr. M is guilty. B. Mr. M is not guilty.
C. From these facts one cannot conclude D. There is a witness who is lying.
that Mr. M is guilty.
E. No witness is lying.
tifr2012 mathematical-logic first-order-logic
For a person p, let w(p), A(p, y), L(p) and J(p) denote that p is a woman, p admires y, p is a lawyer and p is a judge
respectively. Which of the following is the correct translation in first order logic of the sentence: "All woman who are
lawyers admire some judge"?
In the following, A stands for a set of apples, and S(x, y) stands for " x is sweeter than y. Let
Ψ ≡ ∃x : x ∈ A
Φ ≡ ∀x ∈ A : ∃y ∈ A : S(x, y).
Which of the following statements implies that there are infinitely many apples (i.e.,, A is an inifinite set)?
Given that
Consider the First Order Logic (FOL) with equality and suitable function and relation symbols. Which of the following
is FALSE?
Let φ be a propositional formula on a set of variables A and φ be a propositional formula on a set of variables B ,
such that φ ⇒ ψ . A Craig interpolant of φ and ψ is a propositional formula μ on variables A ∩ B such that φ ⇒ μ
and μ ⇒ ψ. Given propositional formula φ = q ∨ (r ∧ s) on the set of variables A = {q, r, s} and propositional formula
ψ = ¬q → (s ∨ t) on the set of variables B = {q, s, t} , which of the following is a Craig interpolant for φ and ψ ?
A. q B. φ itself C. q ∨ s D. q ∨ r E. ¬q ∧ s
tifr2019 engineering-mathematics discrete-mathematics mathematical-logic first-order-logic
a. is TRUE as both LHS and RHS are equivalent- English would be for every x, and for every y, P (x, y) is TRUE.
Changing y and x wouldn't change the meaning.
b. is TRUE as both LHS and RHS are equivalent- RHS is obtained by double negation of LHS.
Both are not equivalent. LHS is stronger and implies RHS. For example, on the natural number set, we have x = 1 such
that for every y, P (x ≤ y) is TRUE. Clearly, this implies for all y there exists some x (here x could be different for
different y but on LHS, it must be the same).
As explained in d, these are not equivalent and here RHS is stronger than LHS, making the implication false. For
example, consider the "<=" relation on the integer set. LHS is true here as for every integer we have another integer
which is greater. But RHS is false as there is no single integer (infinity is not an integer) which is greater than all other
integers.
If Mr. M is guilty, then if we pick a witness, we know that the witness won't lie unless he is afraid. If the witness
is afraid, it may lie or it may lot lie (nothing is guaranteed).
However, unless we know what the victim said in the court (whether he said that Mr. M was guilty or not guilty), we can't
say anything about Mr. M .
All we know is that we've a witness who is afraid, so he may or may not lie in the court. We haven't been told anything about
what actually happened in the court proceeding.
So, we can't logically conclude anything about Mr. M being guilty or not guilty.
Thus, options (a) and (b) are False.
Furthermore, that witness who was afraid, he may or may not lie. Since he is afraid, we know that he "can" lie, but we're not
guaranteed that he will lie.
Thus, options (d) and (e) are False too.
This leaves option c, and as we have seen earlier, we cannot conclude anything about Mr. M being guilty or not guilty.
Hence, option (c) is the correct answer.
Although not necessary, the logic equivalent of the given statement will be:
[G ⇒ ¬∃x : (W(x) ∧ L(x) ∧ ¬A(x))] ≡
A. S(x, x) is not possible … I do not have that in S … so satisfied … and still finite A
B. S(x, x) should be there … well, I will make S = {(1, 2)(2, 1), (1, 1), (2, 2)} … satisfied and still finite A
C. take the same case as above … satisfied and still finite A
D. Now I can not have (1, 1) and (2, 2)
but even with S = {(1, 2). (2, 1)} this condition is satisfied … still finite A
E. I can not do this with (1, 2) and (2, 1) because the transitivity makes it (1, 1) which should not be there and whatever
elements I add the transitivity will lead me to (x, x) because any element added to A should occur at least once on the
left side of an ordered pair … so only solution is infinite A.
If x is a fly, then for all y which eats x, y is a bat. This means only bats eat flies.
Option (E).
39 votes -- Arjun Suresh (334k points)
Transitive: ∀x∀y∀z; x ≤ y ∧ y ≤ z ⟹ x ≤ z
Reflexive: ∀x; x ≤ x
Antisymmetric: ∀x∀y; x ≤ y ∧ y ≤ x ⟹ x = y
' In general, logical consequence in first-order logic is only semidecidable: if a sentence A logically implies a
sentence B then this can be discovered (for example, by searching for a proof until one is found, using some effective,
sound, complete proof system). However, if A does not logically imply B, this does not mean that A logically implies
the negation of B. There is no effective procedure that, given formulas A and B, always correctly decides whether A
logically implies B.
So, B is TRUE.
Axioms of natural numbers are called Peano Axioms. There are 9 of them and only one of them (axiom of induction) cannot
be represented in FOL (requires second order).
So, C is TRUE.
Options D and E are more theoretical and related to fields. If interested you can read here.
Correct option: A
Reference: https://en.wikipedia.org/wiki/First-order_logic
References
Answer is C.
Set of variables for A={q, r, s }
Set of variables for B={q, s, t }
∴Variables in A ∩ B ={q, s }
φ = q ∨ (r ∧ s)
Ψ = ¬q(s ∨ t)
Ψ = ¬¬q ∨ (s ∨ t)
Ψ= q∨s∨t
According to problem we have two conditions:
i. φ ⟹ μ
Which of the following can be validly concluded from the above statements.
The action for this problem takes place in an island of Knights and Knaves, where Knights always make true statements
and Knaves always make false statements and everybody is either a Knight or a Knave. Two friends A and B lives in a
house. The census taker (an outsider) knocks on the door and it is opened by A. The census taker says ''I need information
about you and your friend. Which if either is a Knight and which if either is a Knave?". "We are both Knaves" says A angrily
and slams the door. What, if any thing can the census taker conclude?
A. A is a Knight and B is a Knave. B. A is a Knave and B is a Knight.
C. Both are Knaves. D. Both are Knights.
E. No conclusion can be drawn.
tifr2011 mathematical-logic logical-reasoning
Long ago,in a planet far far away, there lived three races of intelligent inhabitants: the blues (who always tell the truth),
the whites (who always lie), and the pinks (who, when asked a series of questions, start with a lie and then tell the truth
and lie alternately). To three creatures, chosen from the planet and seated facing each other at A, B, and C (see figure), the
following three questions are put:
Three candidates, Amar, Birendra and Chanchal stand for the local election. Opinion polls are conducted and show that
fraction a of the voters prefer Amar to Birendra, fraction b prefer Birendra to Chanchal and fraction c prefer Chanchal
to Amar. Which of the following is impossible?
A. (a, b, c) = (0.51, 0.51, 0.51); B. (a, b, c) = (0.61, 0.71, 0.67);
C. (a, b, c) = (0.68, 0.68, 0.68); D. (a, b, c) = (0.49, 0.49, 0.49);
E. None of the above.
tifr2013 set-theory&algebra logical-reasoning
1. No silver glitters.
2. Some gold glitters.
B′ → (5)
L′ → (6)
F′
Ans is (b). Bank receipt is not forged.
24 votes -- Pooja Palod (24.1k points)
It is told in the question "If the people suffer, the government will be unpopular". And "government will not be
unpopular" means, people will not suffer.
It is like A → B is true and ~B is given. So, ~A must be true.
So, (B) and (D) are valid (always true) and (C) and (E) are not valid.
18 votes -- Arjun Suresh (334k points)
Option (B) should be the correct answer, that is A is a Knave & B is a Knight.
A must be either a Knight or a Knave.
Suppose A is a Knight, it means that the statement "We are both Knaves." must be true.
This is contradicting our assumption.
So the assumption that "A is a Knight" is not logically satisfiable simultaneously with the statement he made, which implies
that A must be a Knave.
Now since A is a Knave, the statement made by him : "We are both Knaves." must be false.
The statement "We are both Knaves." will be false in any one of the following 3 conditions :
1. A is a Knight, B is a Knave.
2. A is a Knave, B is a Knight.
3. A is a Knight, B is a Knight.
Bus since we have already deduced that A is a Knave so in order to make the statement "We are both Knaves." false, we are
only left with condition 2.
So B must be a Knight.
29 votes -- Anurag Pandey (10.5k points)
However, there is another option (E), which says Cannot be determined from the above data.
So, what if there are multiple solutions that satisfy these constraints? If that is the case, option e will be correct. Sadly, there
is no way of proving that no other solutions work except checking each one of them (using branch and bound to somewhat
improve). Sadly, that will be lengthy.
Here is a Python3 program that finds all solutions to this problem: http://ideone.com/7EFXCn
References
Glitters(x) ⟹ Gold(x) ⟹ ¬ Silver(x) . Hence, Claim 1 follows. If something Glitters, it cannot be Silver.
For claim 2:
The set of things that Glitter could be empty.
We can still assert that All that Glitters is Gold, because nothing Glitters in the first place.
So, in the case when nothing Glitters, there is no Gold that Glitters. Glitters is still a subset of Gold, but there is no element in
the subset Glitters.
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.
The notation " ⇒" denotes "implies" and " ∧" denotes "and" in the following formulae.
a. a. If Kareena and Parineeti do not go to the shopping mall then it is not raining.
i.e., ¬p → ¬q
Not matching with the given implication.
b. b.If Kareena and Parineeti do not go to the shopping mall then it is raining.
i.e., ¬p → q
Not matching with the given implication.
c. If it is raining then Kareena and Parineeti go to the shopping mall.
i.e., q → p
Not matching with the given implication.
d. If it is not raining then Kareena and Parineeti do not go to the shopping mall.
i.e., ¬q → ¬p ≡ q ∨ ¬p ≡ p → q
Matces with the given implication.
Since we only have to deal with 2 variables ( a and b), solving this with truth table is feasible.
Truth table for
X will be:
a b b⇒a a⇒b (b ⇒ a ) ⇒ (a ⇒ b )
0 0 1 1 1
0 1 0 1 1
1 0 1 0 0
1 1 1 1 1
a b a⇒b (a ⇒ b ) ∧ b
0 0 1 0
0 1 1 1
1 0 0 0
1 1 1 1
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 Q-Q 8.2.3 B
8.2.4 C 8.2.5 C 8.2.6 E 8.3.1 D 8.3.2 D
A twice differentiable function of one variable is convex on an interval if and only if its second derivative is non-
negative.
For eg :- f(x) = x2 ⟹ f ′′ (x) = 2 > 0 so f is a convex function.
References :-
https://en.wikipedia.org/wiki/Convex_function
References
For x, y ∈ {0, 1}n , let x ⊕ y be the element of {0, 1}n obtained by the component-wise exclusive-or of x and y. A
Boolean function F : {0, 1}n → {0, 1} is said to be linear if F(x ⊕ y) = F(x) ⊕ F(y) , for all x and y. The number
of linear functions from {0, 1}n to {0, 1} is.
Consider a function Tk,n : {0, 1}n → {0, 1} which returns 1 if at least k of its n inputs are 1. Formally, Tk,n (x) = 1
i f ∑n1 xi ≥ k . Let y ∈ {0, 1}n be such that y has exactly k ones. Then, the function
Tk,n−1 (y1 , y2 , . . . . yi−1 , yi+1 , . . . , yn ) (where yi is omitted) is equivalent to
L e t k be an integer at least 4 and let [k] = {1, 2, . . . , k} . Let f : [k]4 → {0, 1} be defined as follows:
f(y1 , y2 , y3 , y4 ) = 1 if an only if the yi′ s are all distinct. For each choice z = (z1 , z2 , z3 ) ∈ [k]3 , let
gz : [k] → {0, 1} be defined by gz (Y ) = f(Y , z1 , z2 , z3 ) . Let N be the number of distinct functions gz that are obtained as z
varies in {1, 2, . . . , k} 3 , that is, N =∣ {gz : z ∈ {1, 2, . . . , k} 3 }∣ . What is N ?
( k3 )
A. k3 + 1 B. 2 C. ( k3 ) D. ( k3 ) + 1 E. 4 ( k3 )
tifr2014 set-theory&algebra functions
Let f ∘ g denote function composition such that (f ∘ g)(x) = f(g(x)) . Let f : A → B such that for all g : B → A
and h : B → A we have f ∘ g = f ∘ h ⇒ g = h . Which of the following must be true?
A. f is onto (surjective) B. f is one-to-one (injective)
C. f is both one-to-one and onto D. the range of f is finite
(bijective)
E. the domain of f is finite
tifr2017 set-theory&algebra functions
For two n bit strings x, y ∈ {0, 1}n , define z = x ⊕ y to be the bitwise XOR of the two strings (that is, if xi , yi , zi
denote the ith bits of x, y, z respectively, then zi = xi + yi mod 2 ). A function h : {0, 1}n → {0, 1}n is called
linear if h(x ⊕ y) = h(x) ⊕ h(y), for every x, y ∈ {0, 1}n . The number of such linear functions for n ≥ 2 is:
2 n 2
A. 2n B. 2n C. 22 D. 24n E. 2n +n
tifr2018 functions
Let f be a function with both input and output in the set {0, 1, 2, … , 9} , and let the function g be defined as
g(x) = f(9 − x). The function f is non-decreasing, so that f(x) ≥ f(y) for x ≥ y . Consider the following
statements:
Which of the above statements must be TRUE for ALL such functions f and g ?
A. Only (i) B. Only (i) and (ii)
C. Only (iii) D. None of them
E. All of them
tifr2019 engineering-mathematics discrete-mathematics set-theory&algebra functions
Answers: Functions
Take an example
Now, here we have to find the number of functions possible from {0, 1}3 to {0, 1} such that
Now, observe that if we maintain the linearity of XOR then the values f(000), f(101), f(110), f(011) and f(111) are
dependent on the values f(100), f(010) and f(001) (Reason given below)
So, if we fix the values of f(100), f(010) and f(001) then we will get the whole function.
Now, we can see how the values f(000), f(101), f(110), f(011) and f(111) are dependent on the values f(100), f(010)
and f(001).
Now,
So, we have seen how the values f(000), f(101), f(110), f(011) and f(111) are dependent on the values f(100), f(010)
and f(001)
In this case if we fix the values of f(100 … 0), f(010 … 0), f(001 … 0), … , f(000 … 1) then we will get the whole
function since rest of the values are dependent on the above n values.
Now, each of the n values f(100 … 0), f(010 … 0), f(001 … 0), … , f(000 … 1) has 2 options - either 0 or 1.
00 ⊕ 00 = 00
00 ⊕ 01 = 01
00 ⊕ 10 = 10
00 ⊕ 11 = 11
01 ⊕ 01 = 00
01 ⊕ 10 = 11
01 ⊕ 11 = 10
10 ⊕ 10 = 00
10 ⊕ 11 = 01
11 ⊕ 11 = 00
Since, ⊕ is commutative not considering the remaining 6 combinations.
If F maps every thing to 0, it does preserve linearity. This way we get 1 linear function.
Now, F(00) must map to 0, because it equals F(01) ⊕ F(01) which is 0 irrespective of the value of F(01). Now, lets
assume F(01) = 1. Since F(01) ⊕ F(10) = F(11), either F(10) or F(11) but not both must be 1. Both of these are
valid. Now, if we take F(01) = 0, both F(10) and F(11) must be 1 (both can also be 0 but this we considered as our first
case). Thus, we get 4 linear functions in total
So, 2n should be the answer. General case discussion can be seen here:
https://math.stackexchange.com/questions/496185/number-of-linear-binary-function-in-a-vector-space
https://math.stackexchange.com/questions/2244907/the-number-of-linear-functions-from-left-0-1-right-n-to-left-0-1-ri?
noredirect=1&lq=1
References
The function gz (Y ) is defined as [k] → {0, 1} where [k] is the set of positive integers till k. That is, given a
triplet (z1 , z2 , z3 ) , Y can take any value from 1 to k. If Y happen to be any of z1 , z2 , z3 , gz (Y ) = 0 due to the
definition of f and gz . Now even for different z, gz may be the same. Otherwise, the answer would have been how many
ways we can form a triplet z - which gives k3 and for each z we get a function gz .
For all unique combinations of z1 , z2 , z3 are unique, we are guaranteed that we get a distinct function gz . This is clear from
the definition of gz . For example, suppose k = 4 . The triplets are
(1, 2, 3)
(1, 2, 4)
(1, 3, 4)
(2, 3, 4)
For the triplet (1, 2, 3), Y can be made in 4 ways as (1, 2, 3, 1), (1, 2, 3, 2), (1, 2, 3, 3) and (1, 2, 3, 4). Now, as per
definition of gz , we get g(1,2,3) = {{1 → 0}, {2 → 0}, {3 → 0}, {4 → 1}} .
Similarly, for the next three triplets, gz are different as in second only 3 maps to 1, in third one only 2 maps to 1 and in
fourth one only 1 maps to 1.
So, in general, for any given k, we have k C3 ways of forming distinct triplets and each of them guarantees a unique function
gz where exactly k − 3 elements map to 1 and 3 elements map to 0. Now, if any of the elements in the triplet are same, then
the function becomes {{1 → 0}, {2 → 0}, … , {k → 0}} , (all k elements mapping to 0) and this remains the same for any
triplet. So, total number of possible functions are
k
3 +1
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 95 of 278
k
C3 + 1
Correct Answer: D
10 votes -- Arjun Suresh (334k points)
Let us prove (∀g, h : f(g(x)) = f(h(x)) → g(x) = h(x)) → f is one − to − one is true.
This is equivalent to, f is not one − to − one → (∃g, h : f(g(x)) = f(h(x)) ∧ g(x) ≠ h(x))
Let g and h be some functions out of all possible functions from B to A such that g ≠ h ,
∴ f(g(x)) = f(c) = a and f(h(x)) = f(d) = a and g(x) ≠ h(x) , i.e. RHS is also true.
Domain of f need not be finite. Let f : A → B be identity function and A and B be infinite sets. Assume that f ∘ g = f ∘ h
is true,
then f(g(x)) = f(h(x)) → g(x) = h(x)) will be true ∀g, h since f is an identity function. So, even if domain of f is not
finite, the condition holds true.
Correct Answer: B
References
For a generic function mapping to {0, 1}2 we have 22 = 4 options for each of the four 2 bit strings thus giving 24 = 16
2
functions (in general 22 ). But here, our function must be linear.
Lemma: Once we assign values to h(x) for all x having exactly one 1, the other values are fixed.
For example, for n = 2 we can only fix h(01) and h(10) and the remaining two values h(00) and h(11) are fixed as h(00)
must be h(01) ⊕ h(01) = 00 and h(11) = h(01) ⊕ h(10).
In this way for any n we have only n combinations possible from the domain set for a linear function instead of 2n for a
normal function. Here, each of these n possible combinations can be mapped to any of the 2n bit strings thus giving rise to
2
.
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 96 of 278
2
(2n )n possible LINEAR functions which equals 2n .
Correct Option: B.
4 votes -- Arjun Suresh (334k points)
Option A.
We have 10 elements for the domain set to map to. If we want to ensure x ≠ f(x) lets do as follows:
f(0) = 1, f(1) = 2, f(2) = 3, … , f(8) = 9. Now the only option is for f(9) = 9 or else we will break the non-
decreasing condition.
Like this for any mapping we will get at least one x such that x = f(x).
Let f(0) = f(1) = f(2) = … = f(8) = 0, f(9) = 1. Now, for no x, x = f(x) + g(x) mod 10. So, (iii) is FALSE.
10 votes -- Arjun Suresh (334k points)
Let ∧, ∨ denote the meet and join operations of lattice. A lattice is called distributive if for all x, y, z,
x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z)
It is called complete if meet and join exist for every subset. It is called modular if for all x, y, z
z ≤ x ⇒ x ∧ (y ∨ z) = (x ∧ y) ∨ z
The positive integers under divisibility ordering i.e. p ≤ q if p divides q forms a.
A. Complete lattice.
B. Modular, but not distributive lattice.
C. Distributive lattice.
D. Lattice but not a complete lattice.
E. Under the give ordering positive integers do not form a lattice.
Answers: Lattice
It is distributive
It is complete semi-meet lattice. As there is no upper bound it is not complete semi-join lattice.
ANS: C
6 votes -- pramod (2.8k points)
Let m and n be any two positive integers. Then, which of the following is FALSE?
2n −1
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 97 of 278
A. m + 1 divides m2n − 1.
B. For any prime p, mp ≡ m( mod p) .
C. If one of m, n is prime, then there are integers x, y such that mx + ny = 1.
D. If m < n, then m! divides n(n − 1)(n − 2) … (n − m + 1).
E. If 2n − 1 is prime, then n is prime.
(a) m divides m2n . Now we can observe that now if we divide m2n by m + 1 then remainder will always be 1.
Now to make remainder 0 we have to subtract 1 from m2n so in that way we can say that m + 1 divides m2n − 1.
(b) It is popular theorem by Mathematician Fermat
https://en.wikipedia.org/wiki/Fermat%27s_little_theorem
(c) To make mx + ny = 1, n and m both must have to be relatively prime. If only one is prime and then other, when it is a
multiple of that prime, sum cannot be 1.
like 5x + ny = 1 if n is 10, 15, 20 … result cannot be 1. Basically the theorem is
For any positive integers a and b, there exist integers x and y such that
mx+ny= gcd(m, n).
Now when m and n are relatively prime then their gcd will be 1 so eventually equation would be like mx + ny = 1
(d) We know that n Cm means choose m out of n and result of this will always be integer. If we see carefully what's being
asked is n Cm , which is always an integer so yes m! will have to divide n × (n − 1)(n − 2) … (n − m + 1).
(e) https://en.wikipedia.org/wiki/Mersenne_prime
So, option C must be false.
References
Let R be a binary relation over a set S . The binary relation R is called an equivalence relation if it is reflexive
transitive and symmetric. The relation is called partial order if it is reflexive, transitive and anti symmetric. (Notation:
Let aRb denote that order pair (a, b) ∈ R. ) The relation R is called a well-order if R is a partial order and there does not exist
an infinite descending chain (with respect to R) within S . An infinite sequence x1 , x2 . . . of elements of S is called an infinite
descending chain if for all i we have xi+1 Rxi and xi ≠ xi+1 .
Take S = ℵ × ℵ and let the binary relation ⊑ over S be such that (i1 , j1 ) ⊑ (i2 , j2 ) if and only if either (i1 < i2 ) or
((i1 = i2 ) ∧ (j1 ≤ j2 )) . Which statement is true of ⊑?
A set S together with partial order ≪ is called a well order if it has no infinite descending chains, i.e. there is no
infinite sequence x1 , x2 , … of elements from S such that xi+1 ≪ xi and xi+1 ≠ xi for all i.
Consider the set of all words (finite sequence of letters a − z), denoted by W , in dictionary order.
A. Between ‘‘aa " and ‘‘az " there are B. Between ‘‘aa " and ‘‘az " there are
only 24 words. only 224 words.
C. W is not a partial order. D. W is a partial order but not a well
order.
E. W is a well order.
tifr2013 set-theory&algebra partial-order
Consider the set N ∗ of finite sequences of natural numbers with x ≤p y denoting that sequence x is a prefix of
sequence y. Then, which of the following is true?
A. N ∗ is uncountable.
B. ≤p is a total order.
C. Every non-empty subset of N ∗ has a least upper bound.
D. Every non-empty subset of N ∗ has a greatest lower bound.
E. Every non-empty finite subset of N ∗ has a least upper bound.
Consider the ordering relation x ∣ y ⊆ N × N over natural numbers N such that x ∣ y if there exists z ∈ N such that
x ∙ z = y . A set is called lattice if every finite subset has a least upper bound and greatest lower bound. It is called a
complete lattice if every subset has a least upper bound and greatest lower bound. Then,
A. ∣ is an equivalence relation. B. Every subset of N has an upper bound
under |.
C. ∣ is a total order. D. (N, ∣) is a complete lattice.
E. (N, ∣) is a lattice but not a complete
lattice.
tifr2014 set-theory&algebra partial-order
Answer: C
S = (i1 j1 ) ⊑ (i2 j2 ) iff (i1 < i2 ) or ((i1 = i2 ) ∧ (j1 ≤ j2 ))
1. (m, n)R(m, n) ?
yes, here m ≮ n, so we go at second criteria.
Now, m = n & n = n. So, this is reflexive.
2. Antisymmetric
(1, 2)R(2, 3) ⟹ (2, 3)R(1, 2)?
No, as 2 ≮ 1.
If you see the definition, it is clear that other than diagonal element no other element is related to itself. So, antisymmetric.
3. Transitivity
(1, 2)R(2, 3) & (2, 3)R(2, 4) ⟹ (1, 2)R(2, 4)?
Yes. It can be seen easily from the definition of S. Same for any other pairs. Not going to prove this formally.
4. It is not symmetric (1, 2)R(2, 3) but (2, 3)R(1, 2)
5. This is well ordered. We do not have infinite descending chain. As we have least element (0, 0) our chain stops there.
Ref :-
https://en.wikipedia.org/wiki/Infinite_descending_chain
https://en.wikipedia.org/wiki/Well-order#Examples_and_counterexamples
References
Answer = D.
The set A of all words (finite sequence of letters a − z), denoted by W , in dictionary order.
W is a Poset as it is Reflexive, Antisymmetric and transitive. W is even a Total Ordered structure as Every Two elements of
Set A are comparable.
Let's catch the bigger fish here i.e. Well-order. :
' A set S together with partial order ≪ is called a well order if it has no infinite descending chains, i.e. there is no
infinite sequence x1,x2,..... of elements from S such that xi+1≪ xi and xi+1≠xi for all i.
We know a different definition of Well-ordered set which is "A well-ordered set is a structure of the form (S, ≤) such that ≤
is a partial order on S and Every nonempty subset of S has a ≤ −smallest element...We will call this definition as
Definition 1 of Well Order. If (S, ≤) is a well-ordered set, we may express this by saying that the relation ≤ well-orders
S . (NOTE that We need not say that S first should be a Total ordered set to be a Well Ordered set Because the first and
second condition of the definition together itself imply that (S, ≤)) is a Total ordered structure)
Now, there is an Equivalent definition to the above definition of Well-Ordered set which is "A total ordered structure is well-
ordered if and only if it does not contain infinite descending chains; that is, a linearly ordered set (S, ≤) is a well-ordered set
if and only if there does not exist a sequence a0 , a1 , a2 , . . . of elements of S such that a0 > a1 > a2 >. . . . ..We will call it
as Definition 2 of well order.
We can prove that Definition 1 and Definition 2 are Equivalent (Proof is given below, after the answer to the asked question).
Since now that we know both the definitions are equivalent. We can use the Definition 1 to check for Well-ordering.
Now consider the following Subset of the given set A :
S = {an b | n ≥ 0} .. this Subset has No least element. Hence, The given Structure (A, dictionary order) is NOT Well-
Ordered Structure.
' Prove that a structure is well-ordered if and only if it does not contain infinite descending chains; that is, prove that
a linearly ordered set (S, ≤) is a well-ordered set if and only if there does not exist a sequence a0, a1, a2, . . . of elements
of S such that a0 > a1 > a2 > . . . .
(Only if Part) If a0 > a1 > a2 , . . . is an infinite descending sequence in S , then the set { a0, a1, a2, . . . } does not have a
minimum element, so S is not well-ordered.
(If part) Suppose that S is not well-ordered, and fix a nonempty A ⊆ S that does not have a minimum element. Fix a0 ∈ A .
Since a0 is not a minimum element of A, there exists a1 ∈ A . such that a0 > a1 . Since a1 is not a minimum element of A,
there exists a2 ∈ A such that a1 > a2 . Continuing this construction inductively, we find an infinite descending chain in A.
8 votes -- Deepak Poonia (23.8k points)
Consider two sequences ⟨43, 9⟩ and ⟨52, 2⟩. These two are not comparable as there is no common prefix and also
there can be no sequence which can be higher than these in the prefix relation - so no upper bound for these. So,
options B, C and E are ruled out. Option D is correct as for any two sequences their common prefix acts as the greatest lower
bound, and in case there is nothing common, empty sequence will act as the greatest lower bound.
A. Taking an example, {4, 2} is not symmetric as 4|2 is not equal to 2|4. So, it cannot be an equivalence.
B. It is not necessary that every subset will have an upper bound.
C. For being total every element in the subset should be comparable have it is not total as well. We have counter example:
{1, 2, 3, 9, 15}. Here, 2&3 are incomparable. 9&15 are also not comparable in this division relation.
D. Not every subset is a complete lattice. Counter example: {1, 2, 3, 24, 30} Here, 2&3 have no LUB.
So, E is the answer.
4 votes -- bharti (2.3k points)
For the polynomial p(x) = 8x10 − 7x3 + x − 1 consider the following statements (which may be true or false)
Answers: Polynomials
At f(0) it is negative, at f(1) it is positive, and at f(−1) it is positive, which means there will be roots between
(0, 1) and (−1, 0). Any values below −1 and above 1 will always yield positive values for f(x), which means no
roots available.
Correct Answer: E
13 votes -- Shaun Patel (6.1k points)
Let A, B be sets. Let Ā denote the compliment of set A (with respect to some fixed universe), and (A − B) denote the
set of elements in A which are not in B. Set (A − (A − B)) is equal to:
A. B B. A ∩ B̄ C. A − B D. A ∩ B E. B̄
tifr2010 set-theory&algebra sets
Let X be a set of size n. How many pairs of sets (A, B) are there that satisfy the condition A ⊆ B ⊆ X ?
Let m, n denote two integers from the set {1, 2, … , 10} . The number of ordered pairs (m, n) such that 2m + 2n is
divisible by 5 is.
Suppose (S1 , S2 , … , Sm ) is a finite collection of non-empty subsets of a universe U. Note that the sets in this
collection need not be distinct. Consider the following basic step to be performed on this sequence. While there exist
sets Si and Sj in the sequence, neither of which is a subset of the other, delete them from the sequence, and
In each step we delete two sets from the sequence and add at most two sets to the sequence. Also, note that empty sets are never
added to the sequence. Which of the following statements is TRUE?
A. The size of the smallest set in the sequence decreases in every step
B. The size of the largest set in the sequence increases in every step
C. The process always terminates
D. The process terminates if U is finite but might not if U is infinite
E. There is a finite collection of subsets of a finite universe U and a choice of Si and Sj in each step such that the process
does not terminate
How many pairs of sets (A, B) are there that satisfy the condition A, B ⊆ {1, 2, . . . , 5} , A ∩ B = {}?
Let A and B be finite sets such that A ⊆ B . Then, what is the value of the expression:
∑ (−1)∣C∖A∣,
C:A⊆C⊆B
Where C ∖ A = {x ∈ C : x ∉ A} ?
A. Always 0 B. Always 1
C. 0 if A = B and 1 otherwise D. 1 if A = B and 0 otherwise
E. Depends on the size of the universe
tifr2016 set-theory&algebra sets
For a set A define P (A) to be the set of all subsets of A. For example, if A = {1, 2} then
P (A) = {∅, {1, 2}, {1}, {2}}. Let A → P (A) be a function and A is not empty. Which of the following must be
TRUE?
A. f cannot be one-to-one (injective) B. f cannot be onto (surjective)
C. f is both one-to-one and onto D. there is no such f possible
(bijective)
E. if such a function f exists, then A is
infinite
tifr2017 set-theory&algebra sets functions easy
Let X be a set with n elements. How many subsets of X have odd cardinality?
A. n
B. 2n
C. 2n/2
D. 2n−1
E. Can not be determined without knowing whether n is odd or even
Answers: Sets
(A − (A − B)) = A ∩ (A ∩ B′ )′ Since A − B = A ∩ B′
= A ∩ B Option D
12 votes -- Umang Raman (12.2k points)
But since it is given that A must be a subset of B, it is not possible that it can be present in A & absent from B.
So, total choices available for formation of sets A & B = 3n , which will give 3n such different (A, B) pairs.
55 votes -- Anurag Pandey (10.5k points)
Ending in 2 : {21 , 25 , 29 }
There are m sets in the initial sequence. If we pick two sets Si and Sj NEITHER of which are subsets of each
other we add
1. Si ∪ Sj
2. Si ∩ Sj if it is not NULL.
So, the two added sets are not eligible to be picked as a pair as INTERSECTION is always a subset of UNION. So, in each
step we are removing a pair of eligible sets. But the addition of set(s) can cause more eligible pairs to be created.
With m sets we can only have mC pairs possible. So, if we repeat the procedure for mC times, and number of times
2 2
Si ∩ Sj = ϕ is k,
Option C.
2 votes -- Arjun Suresh (334k points)
Alternative Solution:
for each element in [n], you have 3 choices:
Total terms = 2n .
Total terms when |C∖A| even = nC0 + nC2 + nC4 + … + nC(n − 1) { if n is odd, nCn otherwise }
Similarly, for odd = 2n − |C∖A|
Even contributes to 1 whereas odd contributes to −1.
Therefore, Summation = 0 as 2n terms are present with half as 1 & half as −1.
Case 2: r = 1, total terms = 2n−1
Total terms when |C∖A| even = nCr + nCr+2 + … + nCn { if n is odd n − 1 otherwise }
Total terms when |C∖A| odd = nCr+1 + nCr+3 + …
Again we are end up with total even terms with half contributing to 1 & half −1.
same situation will arise for every r ≠ n (as for such r, 2r is always even) i.e summation = 0 for all r, r ≠ n.
Case n: r = n, total terms = 2n−n = 1. This is the case when B = A.
∴ |C∖A| = 0 as both are equal.
Summation = 1.
Therefore, answer is : 1 if A = B, 0 otherwise.
Correct Answer: D
8 votes -- Aghori (4.4k points)
But, It cannot be onto,because, the number of elements in domain (A) < the number of elements in co-domain ( P (A)) . For
a function to be onto, the domain should be able to cover all elements of co-domain with each element of the domain having
exactly one image in co-domain.
So, option(B)
23 votes -- Motamarri Anusha (8.6k points)
X is a set of n elements then there are total 2n subsets out of which 2n−1 have odd cardinality and 2n−1 have
even cardinality.
D is correct option.
12 votes -- Mk Utkarsh (25.7k points)
Answer Keys
9.1.1 D 9.2.1 E 9.2.2 D 9.2.3 D 9.2.4 B
9.2.5 B 9.2.6 B 9.3.1 C 9.4.1 C 9.5.1 C
9.5.2 E 9.5.3 D 9.5.4 E 9.6.1 E 9.7.1 D
9.7.2 C 9.7.3 C 9.7.4 C 9.7.5 D 9.7.6 D
9.7.7 B 9.7.8 D
Syllabus: Limits, Continuity, and Differentiability, Maxima and minima, Mean value theorem, Integration.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 1 1 1 1 1 0 1 1 1 0 0.88 1
2 Marks Count 0 0 0 0 0 1 0 0 0 0 0.1 1
Total Marks 1 1 1 1 1 2 1 1 1 1 1.1 2
What is the area of the largest rectangle that can be inscribed in a circle of radius R?
Answers:
(R + R)2 = x2 + y 2 ⇒ y 2 = 4R2 − x2
Area of Rectange, A = xy ⇒ A2 = x2 y 2 = x2 (4R2 − x2 ) = 4R2 x2 − x4
d(A2 )
For area of largest rectange, =0 dx
– –
So, 8R2 x − 4x3 = 0 ⇒ x = 0, ±√2R. Only x = +√2R is possible.
– d2 (A2 )
For x = √2R, dx2 < 0
–
So, at x = √2R, the area of rectangle which is inscribed in a circle of radius R is maximum.
–
Now, y 2 = 4R2 − x2 ⇒ y 2 = 4R2 − 2R2 . So, possible value of y is also √2R.
– –
Hence, the area of the largest rectangle that can be inscribed in a circle of radius R is : √2R × √2R = 2R2
Edit:
Alternatively, we can take the help of Lagrangian Multiplier,
L = xy– λ(x2 + y 2 – 4R2 )
∂L y ∂L
∂x
=0⇒x= 2λ
and ∂y
=0⇒y= x
2λ
So, x = ±y for λ ≠ 0
x2 + y 2 = 4R2 ⇒ x2 + x2 = 4R2 ⇒ x2 = 2R2
Hence, Area = xy = x2 = 2R2
1 votes -- ankitgupta.1729 (15.2k points)
Answers: Convergence
–
1. for a large value of i, bi and bi + 1 becomes equal... so bi2 = bi + √2. this is quadratic. solving this results to a
fix number.
2. cos(i) <= i, So cos(i) <= i2 that means series is decreasing that will return again a fix value.
3. it is the condition of convergence. if b(i + 1) < b(i) then series will always convergent.
A. xx
B. xx ln x
C. xx + xx ln x
D. (xx )(xx ln x)
E. None of the above; function is not differentiable for x > 0
Answers: Differentiation
Let y = xx
Taking natural log on both the sides, we get
ln y = x ln x
Differentiate both the sides wrt to x we get
1 dy = (1) ln x + x x1 (Product Rule)
y dx
dy
dx
= y ln x + y
Substitute y = xx
dy
dx
= xx ln x + xx
Hence, option C is correct answer.
8 votes -- Ashwani Kumar (13.1k points)
1
∫ loge (x)dx =
0
Answers: Integration
1 1
x300
∫ dx ≤ ∫ x300 dx(∵ 1 + x2 + x3 ≥ 1)
0 1 + x2 + x3 0
1
≤ [ x301 ] ≤
301 1
301 ≤ 0.0033
0
10n
The limit of as n → ∞ is.
n!
A. 0 B. 1 C. e D. 10 E. ∞
tifr2010 calculus limits
The limit
d sin2 x
lim
x→0 dx x
is
1
A. 0 B. 2 C. 1 D. 2 E. None of the above
tifr2011 calculus limits
What is
2x − 1
lim
x→0 x
−−−−−−
The limit lim (√n2 + n − n) equals.
n→∞
Let x0 = 1 and
3+2xn
xn+1 = 3+xn , n ≥ 0.
x∞ = lim xn is
n→∞
– –
A. (√5 − 1) /2 B. (√5 + 1) /2
−− −−
C. (√13 − 1) /2 D. (−√13 − 1) /2
E. None of the above
tifr2014 limits
We are given a collection of real numbers where a real number ai ≠ 0 occurs ni times. Let the collection be
enumerated as {x1 , x2 , . . . xn } so that x1 = x2 =. . . = xn1 = a1 and so on, and n = ∑i ni is finite. What is
−1/k
lim (∑ )
n
1
?
k→∞
i=1 |xi |k
A. maxi (ni |ai |) B. mini |ai |
C. mini (ni |ai |) D. maxi |ai |
E. None of the above
tifr2014 limits
⎡ ⎤
1 1
⎡2 0⎤
1 1
A=⎢ 1 ⎥
2
⎢0 4 ⎥
3
⎣0 ⎦
4
1 3
4 4
What is lim An ?
n→∞
⎡0 0 0⎤
A. ⎢ 0 0 0⎥
⎣0 0 0⎦
⎡4 2 2 ⎤
1 1 1
B. ⎢
⎢4 2
1 1 1 ⎥
⎥
⎣1 1 1 ⎦
2
4 2 2
⎡ 4 ⎤
1 1 1
C. ⎢ 1 ⎥
2 4
⎢ 4 ⎥
1 1
⎣ 1 ⎦
2 4
1 1
2 4 4
⎡0 2 ⎤
1 1
D. ⎢ 1 ⎥
2
⎢0 2 ⎥
1
⎣0 1 ⎦
2
1
2 2
E. The limit exists, but it is none of the above
Answers: Limits
10n
lim
n→∞ n!
n times
10 × 10 × 10 × … × 10 × 10
=
1 × 2 × 3 × ⋯ × (n − 1) × n
≈2755 ⋘1
= 10 10 10
1 ⋅ 2 … 10 ⋅
10 … ⋅10 10 10 ⋅ 10 … goes forever
… 10000
11 100 101 10001
≪1
Now we can see that after the 10 term, all subsequent terms are < 1, and keep decreasing. As we increase the value of n the
10
product will get close to 0.
10n
So as n → ∞ → 0.
n!
Hence, the answer is option A.
26 votes -- minal (13.1k points)
Answer is 1.
d sin2 x
lim
x→0 dx x
2
( )
x
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 110 of 278
d sin2 x
Find ( )
dx x
x sin 2x sin2 x
= lim ( − )
x→0 x2 x2
x sin 2x sin x 2
= lim − lim ( )
x→0 x2 x→0 x
cos 2x.2
= lim −1
x→0 1
= 2[cos 2(0)] − 1
= 2(1) − 1 ⇒ 1.
17 votes -- Prabhanjan_1 (8.5k points)
2x − 1
L = lim
x→0 x
d (2x − 1)
dx
= lim d x
x→0
dx
2x ln 2
= lim
x→0 1
= ln 2
L = loge (2)
L = lim √−−−−−−
n2 + n − n
n→∞
−−−−−−
−−−−−− √n2 + n + n
= lim (√n2 + n − n) × ( −−−−−− )
n→∞ √n2 + n + n
n2 + n − n2
= lim −−−−−−
n→∞ √n2 + n + n
n
= lim −−−−−
n (√1 + n1 + 1)
n→∞
1
=
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 111 of 278
1
= lim −−−−−
√1 + n1 + 1
n→∞
= 1
√1+ ∞
1
+1
L= 1
2
Hence, option C is the correct answer.
17 votes -- Jagdish Singh (413 points)
Answer : C
x(n)
xn+1 = 1 +
3 + x(n)
⟹ x2 + x − 3 = 0
−− −−
−1 + √13 −1 − √13
The roots are: ,
2 2
Since, xn is positive,
−−
−1 + √13
x=
2
7 votes -- Vikranth Inti (579 points)
−1/k
lim (∑ )
n
1
k→∞
i=1 |xi |k
−1/k
= lim (∑ ni )
1
(The i here is different from the previous expression and denote the i unique real values
k→∞
i |ai |k
repeated ni times each.
−1/k
= lim (∑ ni |ai | ) −k
k→∞
i
Since, k is very large (→ ∞), the summation above will be dominated by the largest value for ni |ai |−k which will come for
min |ai | due to −k in exponent. We can also say that the summation series converges to ni (min |ai |) −k . So, our limit
becomes
−1/k
= lim (ni (min |ai |) −k ) = n−1
i
/k
((min |ai |)−k )−1/k
k→∞
= n0i min |ai | = min |ai |
Correct Option: B.
3 votes -- Arjun Suresh (334k points)
We observe that given matrix A is a right stochastic matrix. That is, for every row the row sum is 1. What does that
mean? It means the given matrix corresponds to some Markov system. which is: A 3 state system as follows : (with
each edge being the probability of the system going from a state to other.)
⎢
2
⎥
⎢ ⎥
[x1 , x2 , x3 ] ⎢
⎢ 1 ⎥ = [x , x , x ]
4 ⎥
⎢ ⎥
0 3
⎢ ⎥
4 1 2 3
⎢ ⎥
⎣0 1 3 ⎦
4 4
We know that, in a Markov chain, A∞ is nothing but all rows steady-state vector.
⎡0 ⎤
1 1
⎢
2 2
⎥
⎢ ⎥
=⎢
⎢
⎥
⎥
⎢ ⎥
Therefore, A∞ 0 1 1
⎢ ⎥
2 2
⎢ ⎥
⎣0 1 1 ⎦
2 2
Ref: If you want to know more about Markov chains and stochastic matrices:
https://en.wikipedia.org/wiki/Stochastic_matrix#Definition_and_properties
References
A. 0 B. 1 C. 2 D. 3 E. 4
Consider the problem of maximizing x2 − 2x + 5 such that 0 < x < 2 . The value of x at which the maximum is
achieved is:
The minimum of the function f(x) = x loge (x) over the interval [ 12 , ∞) is
− loge (2) −1
A. 0 B. −e C. 2 D. e E. None of the above
tifr2013 calculus maxima-minima
x + y ≥ 10,
2x + 3y ≥ 20,
x ≥ 4,
y ≥ 4.
Let f(x), x ∈ [0, 1] , be any positive real valued continuous function. Then
1
lim (n + 1) ∫ xn f(x)dx
n→∞ 0
equals.
A. maxx∈[0,1] f(x) B. minx∈[0,1] f(x)
C. f(0) D. f(1)
E. ∞
tifr2015 maxima-minima calculus non-gate integration
Suppose that f(x) is a continuous function such that 0.4 ≤ f(x) ≤ 0.6 for 0 ≤ x ≤ 1 . Which of the following is
always true?
A. f(0.5) = 0.5.
B. There exists x between 0 and 1 such that f(x) = 0.8x.
C. There exists x between 0 and 0.5 such that f(x) = x .
D. f(0.5) > 0.5.
E. None of the above statements are always true.
Consider a function f : [0, 1] → [0, 1] which is twice differentiable in (0, 1). Suppose it has exactly one global
maximum and exactly one global minimum inside (0, 1). What can you say about the behaviour of the first derivative
f ′ and and second derivative f ′′ on (0, 1) (give the most precise answer)?
x2 − 4x + 5,
this quadratic expression can be written as (x2 − 4x + 4) + 1 which is equal to (x − 2)2 + 1.
now since (x − 2)2 can not be less than 0, so (x − 2)2 + 1 can not be less than 1.
Also (x − 2)2 + 1 will be at its minimum value (= 1), when x = 2.
P (x) = x2 − 2x + 5
Since a polynomial is defined and continuous everywhere, we only need to check the critical point and the boundaries.
d
P (x) = 2x − 2
dx
Critical point: 2x − 2 = 0 ⟹ x = 1 gives P (x) = 4, which is the minimum.
Boundaries: limx→0+ P (x) = limx→2− P (x) = 5
Since P (x) increases as x goes farther away from the 1. But P (x) being defined on an open interval, it never attains a
maximum!
Hence, e. None of the above is the correct answer.
14 votes -- Pragy Agarwal (18.3k points)
x2 + y 2 + z 2 − 23 (x + y + z) + 1
3
= x2 + y 2 + z 2 − 2
3 + 1
3
= (x + y + z)2 − 1
3 − 2(xy + yz + xz)
= 2 − 2(xy + yz + xz)
3
Now to maximize it, we need to minimize (xy + yz + xz). As all x, y and z are non-negative xy + yz + xz ≥ 0. So, the
maximum value is 23 .
Correct Option: B.
7 votes -- Dhruv Patel (1.6k points)
Here, dx/dt is neither constant nor function of variable t. So, on solving for x, we get exponential decay
function something similar to radioactive decay dN /dt = −KN; K > 0.
For any equilibrium point, we have dx/dt = 0 ⟹ x = 1, 2, 3.
Now if we consider sign scheme of dx/dt for different ranges of x, we have :
For x → 2, dx/dt changes from negative to positive. So, x = 2 is a point of unstable equilibrium.
Since, here dx/dt is a function of x not t, so condition for checking stable / unstable points (aka local minima / local
maxima) is opposite to what we apply in case of dy/dx = f(x). Here we have dy/dx = f(y) which is actually exponential
function in y and x.
We can understand equilibrium in terms of radioactive decay.
Let dN /dt = −KN; K > 0 its significance is that an element is loosing energy so it is getting stability because we know
more energy an element gets,more de-stability it gains and vice versa.
Correct Answer: C
12 votes -- Shashank Kumar (2.3k points)
f ′ (x) = 1 + log x
Equate it to 40
1
x=
e
′′ (x) 1
=
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 116 of 278
1
f ′′ (x) =
x
1 1
Put x = f ′′ (x) = e so minima at .
e e
1
But = 0.36
e
But x ∈ [ 12 , ∞]
So min occurs at 1
2
So, answer is C
12 votes -- Pooja Palod (24.1k points)
x + y ≥ 10, Satisfied , 5 + 5 = 10
2x + 3y ≥ 20. Satisfied.
Other options:
4, 4 ⟹ x + y ≥ 10 constraint fail
4, 5 ⟹ x + y ≥ 10 fail
Another approach...
It may be possible that... ->
Function f is differentiable in domain [0, 1], it means f is continuous in the given domain and no corner edge is
present.
Since, f has exactly one global maxima and one global minima but it can have many local maxima/minima, So, f ′ must be
zero at atleast 2 points which is shown below.
Now, consider some function f(x) as given below which eliminates option (c) :
Answer Keys
10.0.1 D 10.1.1 D 10.2.1 C 10.3.1 B 10.3.2 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 D 10.5.8 B
10.5.9 D
Syllabus: Matrices, determinants, System of linear equations, Eigenvalues and eigenvectors, LU decomposition.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 0 1 0 1 1 1 1 1 2 0 0.88 2
2 Marks Count 1 1 1 1 1 2 1 0 0 0 0.88 2
Total Marks 2 3 2 3 3 5 3 1 2 1 2.66 5
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 12 noon, thus both needles are together at the 12 mark. After how much time do the
two needles meet again?
10 11 12 19
A. hour B. hour C. hour D. hour E. One hour
11 12 13 22
tifr2020
Answers:
Since, minute needle takes 60 minutes to cover 360∘ , So, in 1 minute, it will cover 6∘ . Similarly, hour needle takes
12 × 60 = 720 minutes to cover 360∘ , So, in 1 minute, it will cover ( 12 )∘ .
When both needles are at 12 and starts traveling in their direction. Suppose, after t minutes, minute needle covers x∘ with the
speed of 6∘ /min and in the same time, hour needle covers (360 − x)∘ with the speed of ( 12 )∘ /min .
x∘ (360−x)∘
When they meet, then t = 6∘ /min
=
( 12 )∘ /min
⇒ x = ( 12∗360
13 )
∘
Since, t = x∘
6∘ /min
( 12∗360 )∘
So, t = 13
6∘
min
t= 12 × 60 min
13
t= 12 Hour
13
2 votes -- ankitgupta.1729 (15.2k points)
A is n × n square matrix for which the entries in every row sum to 1. Consider the following statements:
A. Only (i) B. Only (ii) C. Only (i) and (ii) D. Only (i) and (iii) E. (i), (ii) and (iii)
tifr2019 engineering-mathematics linear-algebra eigen-value
⎡1 0 0⎤
(iii) is clealy incorrect. Example : ⎢ 0 0 1⎥
⎣0 1 0⎦
∑nj=1 xij = 1 ∀ i = 1, … , n
As, Av = v
A − λI = ⎢
…⎥
⎢ ⎥
x21 x22 − 1 x23
⎢ x31 x33 − 1 …⎥
⎣ … …⎦
x32
… …
C1 ← ∑nj=1 Cj
⎡ 0 x12 x13 …⎤
As C1 is completely 0 , so |A − λI | = 0
(ii) is correct
D. M −1 = M − I
E. M −1 exists and can be determined from the data but the choices (c) and (d) are incorrect.
A is symmetric positive definite matrix ( i.e., xT Ax > 0 for all non zero x). Which of the following statements is
false?
A. At least one element is positive. B. All eigen values are positive real.
C. Sum of the diagonal elements is D. det (A) is positive.
positive.
E. None of the above.
tifr2010 linear-algebra matrices
⎛0 1 1⎞
M1 = ⎜ 1 0 1 ⎟
⎝1 1 0⎠
⎛1 0 1⎞
M2 = ⎜ 0 0 0 ⎟
⎝1 0 1⎠
How may 0 − 1 column vectors of the form
⎛ x1 ⎞
X = ⎜ x2 ⎟
⎝x ⎠
3
are there such that M1 X = M2 X (modulo 2)? (modulo 2 means all operations are done modulo 2, i.e, 3 = 1 (modulo 2),
4 = 0 (modulo 2)).
An n × n matrix M with real entries is said to be positive definite if for every non-zero n-dimensional vector x with
real entries, we have xT Mx > 0. Let A and B be symmetric, positive definite matrices of size n × n with real
entries.
Consider the following matrices, where I denotes the n × n identity matrix:
1. A + B
2. ABA
3. A2 + I
Let A be an n × n invertible matrix with real entries whose row sums are all equal to c. Consider the following
statements:
Let A be am n × n invertible matrix with real entries whose column sums are all equal to 1. Consider the following
statements:
Answers: Matrices
λ2 − λ − 1 = 0
⟹ M2 − M − I = 0
⟹ I = M2 − M
Now premultiplying by M −1
M −1 I = M −1 M 2 − M −1 M
M −1 = M − I
Correct Answer: D
18 votes -- Umang Raman (12.2k points)
xT Ax > 0 means that matrix is positive definite. And properties of positive definite matrix (relevant to question)
is :
Take any matrix and try to anlayse the validity of these points.
So, (E) is the answer here.
3 votes -- Manish Joshi (20.5k points)
Given Ak = 0
I − Ak = I → (1)
Now I − Ak can be written as,
I = (I − A)(I + A + A2 + A3 + … Ak−1 )
(I − A)−1 = (I + A + A2 + A3 + … + Ak−1 )
OPTION A is correct
Whenever the 1st row is 0 then its determent is 0, and similarly if any 2 or more rows are linearly dependent then its
|det| = 0
In order to find the odd determinant the 1st row must be non zero
⇒ totally(24 − 1) possibilities ∣ 01 01 01 01 ∣ like totally = 16 − 1
2nd row must be non zero and not linearly depending on 1st row ⇒ totally (24 − 2) possibilities
For 3rd row it must be non-zero as well as not linearly depending on first 2 rows (not start with 0) ⇒ totally (24 − 4)
⎛0 1 1 ⎞ ⎛ x1 ⎞ ⎛ x2 + x3 ⎞
M1 X = ⎜ 1 0 1 ⎟ ⎜ x2 ⎟ =⎜ x1 + x3 ⎟
⎝1 1 0 ⎠ ⎝ x3 ⎠ ⎝ x1 + x2 ⎠
⎛1 0 1 ⎞ ⎛ x1 ⎞ ⎛ x1 + x3 ⎞
M2 X = ⎜ 0 0 0 ⎟ ⎜ x2 ⎟ = ⎜ 0 ⎟
⎝1 0 1 ⎠ ⎝ x3 ⎠ ⎝x + x ⎠
1 3
Given M1 X = M2 X mod 2
⎛0⎞ ⎛1⎞
Eventually there can be two ⎜ 0 ⎟ and ⎜ 1 ⎟ 0 − 1 column vectors for X.
⎝0⎠ ⎝1⎠
Correct Answer: B
11 votes -- Rupendra Choudhary (11.4k points)
Note
- The sum of two positive definite matrices is positive definite. (xT (A + B)x = xT Ax + xT Bx > 0) .
Take a matrix:
[ ]
a b
b a
Sum of each row = a + b [ matrix is invertible hence determinant is not 0 i.e. a and b are different]
Now lets prove:
2a 2b
2×[ ]=[ ] : Sum of each row = 2(a + b)
a b
b a 2b 2a
a2 + b2 ab + ba
[ ]×[ ]=[ ] : Sum of each rows = (a2 + b2 + 2ab) = (a + b)2
a b a b
b a b a ab + ba a2 + b2
a −b
[ ]=
1 (a−b) (a−b) 1
= (a+b)(a−b)
=
a2 −b2 −b a a2 −b2 a+b
1 0
Let A = [ ]
0 1
1 0 1 0 1 0
A2 = A ⋅ A = [ ]⋅[ ]=[ ]
0 1 0 1 0 1
1 0 1 0 1 0
A3 = A2 ⋅ A = [ ]⋅[ ]=[ ]
0 1 0 1 0 1
1 0
A−1 = [ ]
0 1
Every column in the matrix A−1 sums to 1. ⟹ True
Lets take another example for statement 3 :
3 −6
A=[ ]
−2 7
a b −1 1 d −b
A=[ ] = [ ]
c d ad − bc −c a
In other words: swap the positions of a and d, put negatives in front of b and c, and divide everything by the determinant
(ad − bc).
1 7 6
A−1 = [ ]
9 2 3
Let M be a real n × n matrix such that for every non-zero vector x ∈ Rn , we have xT Mx > 0. Then
A. Such an M cannot exist B. S u c h Ms exist and their rank is
always n
C. Such Ms exist, but their eigenvalues D. No eigenvalue of any such M can be
are always real real
E. None of the above
tifr2020 engineering-mathematics linear-algebra rank-of-matrix eigen-value
1 0
-- For a) and d), counter-examples are identity matrices like M = [ ] for n = 2.
0 1
=[ ]
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 125 of 278
1 0
b][ ] [ ] = a2 + b2 > 0. So, such Ms exist and eigen values can be real.
a
Now, xT Mx = [ a
0 1 b
2k 2k
-- For (c), counter-example is : M = [ ] where k ≥ 1
−2k 2k
2k 2k
b][ ] [ ] = 2k(a2 + b2 ) > 0. So, such Ms exist and eigen values can be complex here.
a
Now, xT Mx = [ a
−2k 2k b
-- Now, for (b), Suppose, x ∈ Rn is a non-zero eigen vector associated with matrix M .
Then, Mx = λx
⇒ xT Mx = xT λx
⇒ xT Mx = λxT x
So, For positive eigenvalues λ and a non-zero eigen-vectors x, xT Mx > 0 is always true.
Since, determinant is the product of eigen values. So, if all eigen values are positive then determinant will be positive and
matrix M will be non-singular and has full rank n. So, (b) is true.
1 votes -- ankitgupta.1729 (15.2k points)
−−
n−−−
∥X∥ = √∑ x2i
i=1
Given two vectors X = (x1 , … , xn ) and Y = (y1 , … , yn ) , which of the following measures of discrepancy between X and
Y is insensitive to the length of the vectors?
A. ∥X − Y ∥ B. ∥X − Y ∥ / ∥x∥ ∥y∥
C. ∥X∥ − ∥Y ∥ D. ∥ X Y ∥
∥ ∥X∥ − ∥Y∥ ∥
E. None of the above
tifr2010 linear-algebra vector-space
−−−−−
For vectors x, y in Rn , define the inner product ⟨x, y⟩ = Σni=1 xi yi , and the length of x to be ∥x∥ = √⟨x, x⟩ . Let
a, b be two vectors in Rn so that ∥b∥ = 1 . Consider the following statements:
i. ⟨a, b⟩ ≤ ∥b∥
ii. ⟨a, b⟩ ≤ ∥a∥
iii. ⟨a, b⟩ = ∥a∥∥b∥
iv. ⟨a, b⟩ ≥ ∥b∥
v. ⟨a, b⟩ ≥ ∥a∥
Which of the above statements must be TRUE of a, b? Choose from the following options.
means that The discrepancy, as measured by the formula, between two vectors x and y is same as the discrepancy between
the vectors c1 x and c2 y , for any constant scalars c1 , c2 . That is,
D(x, y) = D(c1 x, c2 y), ∀c1 , c2 ∈ R
Now, lets think about which formula achieves that.
Let us also define two pairs of vectors as follows:
x1 = (0.1067, 0.9619, 0.0046, 0.7749, 0.8173)
y1 = (0.8687, 0.0844, 0.3998, 0.2599, 0.8001)
x2 = 0.4314 × x1 = (0.0460, 0.4150, 0.0020, 0.3343, 0.3526)
y2 = 0.9106 × y1 = (0.7911, 0.0769, 0.3641, 0.2367, 0.7286)
A) ∥x − y∥
Since the definition of ∥x∥ is sensitive to scaling, option A won't be insensitive to scaling either.
For example,
D(x1 , y1 ) = ∥x1 − y1 ∥ ≈ 1.3313
D(x2 , y2 ) = ∥x2 − y2 ∥ ≈ 0.9754
D(x1 , y1 ) ≠ D(x2 , y2 )
∥x−y∥
B) ∥x∥∥y∥
Once we've subtracted the vectors, scaling them according to their original lengths won't help at all.
For example,
∥x1 −y1 ∥
D(x1 , y1 ) = ∥x1 ∥∥y1 ∥
≈ 0.7024
∥ 2− 2 ∥
D( 2 , 2) = ≈ 1.3099
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 127 of 278
∥x2 −y2 ∥
D(x2 , y2 ) = ∥x2 ∥∥y2 ∥
≈ 1.3099
D(x1 , y1 ) ≠ D(x2 , y2 )
C) ∥x∥ − ∥y∥
We aren't doing any scaling in this definition of discrepancy. So, this definition is certainly sensitive to scaling, and thus, not
the correct answer.
For example,
D(x1 , y1 ) = ∥x1 ∥ − ∥y1 ∥ ≈ 0.2086
D(x2 , y2 ) = ∥x2 ∥ − ∥y2 ∥ ≈ −0.5217
D(x1 , y1 ) ≠ D(x2 , y2 )
D) ∥
y ∥
∥ ∥x∥ −
x
∥y∥ ∥
In this, we first scale each vector x and y down to their unit vectors, and then calculate the discrepancy.
Since x2 = c1 x1 , x2 will have the same unit vector as x1 .
Similarly, y2 will have the same unit vector as y1 .
Thus, no matter how we scale x2 and y2 , as long as they are derived from x1 and y1 , their discrepancy will be the same.
Therefore, our formula will be insensitive to scaling, which is exactly what we want!
For example,
D(x1 , y1 ) = ∥∥ ∥xx1 ∥ −
y1 ∥
∥y1 ∥ ∥
≈ 0.9551
1
D(x2 , y2 ) = ∥∥ ∥xx2 ∥ −
y2 ∥
∥y2 ∥ ∥
≈ 0.9551
2
D(x1 , y1 ) = D(x2 , y2 )
%% Create two more vectors x2 and y2, which are multiples of x1 and y1
x2 = rand()*x1;
y2 = rand()*y1;
%% Calculate the answers for (x1, y1) and (x2, y2) and see which option
% remains unaffected.
isequalRel(answers(x1,y1), answers(x2,y2), 1e-6)
Let n = 1 then,
if a = {2}, b = {1}
< a, b > = 2
|| b || = 1
Hence, i is incorrect.
< a, b >= −1
|| a || || b || = 1 x 1 = 1
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
Syllabus: Random variables, Uniform, Normal, Exponential, Poisson and Binomial distributions. Mean, median, mode
and standard deviation. Conditional probability and Bayes theorem
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 1 1 0 2 1 1 0 1 1 0 0.88 2
2 Marks Count 2 2 1 1 1 0 3 1 0 0 1.22 3
Total Marks 5 5 2 4 3 1 6 3 1 1 3.33 6
Suppose we toss m = 3 labelled balls into n = 3 numbered bins. Let A be the event that the first bin is empty while B
be the event that the second bin is empty. P (A) and P (B) denote their respective probabilities. Which of the
following is true?
A. P(A) > P(B) 1
B. P(A) =
27
C. P(A) > P(A ∣ B) D. P(A) < P(A ∣ B)
E. None of the above
tifr2020
Answers:
Suppose, we have 3 labelled balls as {B1 , B2 , B3 } and 3 numbered bins as {U1 , U2 , U3 }. Now, number of ways to
throw these balls into bins is same as total number of functions from set {B1 , B2 , B3 } to set {U1 , U2 , U3 }. So,
sample size = 33
Now, A be the event that first bin is empty and we have to throw balls into bins. So, number of favorable outcomes is total
3
number of functions from set {B1 , B2 , B3 } to set {U2 , U3 } which is 23 . So, P(A) = 23 .
3
Now, B be the event that second bin is empty and we have to throw balls into bins. So, in this case, number of favorable
3
outcomes is total number of functions from set {B1 , B2 , B3 } to set {U1 , U3 } which is 23 . So, P(B) = 23 .
3
Now, P(A|B) means given second bin is empty, what is the probability that first bin is empty. So,
1
P(A∩B)
P(A|B) = P(B)
= 33
23
= 1
23
33
So, P(A) ≠ 1
27 , P(A) = P(B) and P(A) > P(A|B)
4 votes -- ankitgupta.1729 (15.2k points)
Given 10 tosses of a coin with probability of head = . 4 = ( 1 - the probability of tail), the probability of at least one head
is?
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. ( 13 ) B. ( 18 ) C. ( 14 ) D. ( 14 + 18 ) E. ( 23 )
tifr2010 probability binomial-distribution
Correct Answer: C
10 votes -- Digvijay (44.9k points)
(e) is correct
1
Now, probability of choosing any coin is , as we can chose any of the three coins.
3
Case A: 1st coin : either H or T can come.
so, HHT, THT possible.only HHT is favorable.
1 1 1
which gives ( ) × ( ) = .
3 2 6
Case C: 3rd coin : Table already contains two H ′ s so, whatever comes is favourable.
1 1
which gives ( ) × 1 = .
3 3
1 1 1 2
Summing up the total gives + + = .
6 6 3 3
25 votes -- Himanshu Agarwal (12.4k points)
P = Pq × Pr × (Pp + Ps − Pp Ps )
atleast one
= × ×( + − ⋅ )
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 131 of 278
1 1 1 1 1 1
= × ×( + − ⋅ )
2 2 2 2 2 2
3
P = 16 .
Hence, option D is the correct answer.
1 2 3
Karan tells truth with probability and lies with probability . Independently, Arjun tells truth with probability
3 3 4
1
and lies with probability . Both watch a cricket match. Arjun tells you that India won, Karan tells you that India lost. What
4
probability will you assign to India's win?
1 2 3 5 6
A. ( ) B. ( ) C. ( ) D. ( ) E. ( )
2 3 4 6 7
tifr2010 probability conditional-probability tifr2014
3 1
Amar and Akbar both tell the truth with probability and lie with probability . Amar watches a test match and talks
4 4
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?
9 6 7 10
A. ( ) B. ( ) C. ( ) D. ( ) E. None of the above
16 16 16 16
tifr2012 probability conditional-probability
You are lost in the National park of Kabrastan. The park population consists of tourists and Kabrastanis. Tourists
3
comprise two-thirds of the population the park and give a correct answer to requests for directions with probability .
4
The air of Kabrastan has an amnesaic quality, however, and so the answers to repeated questions to tourists are independent,
even if the question and the person are the same. If 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?
1 1 1 2 3
A. ( ) B. ( ) C. ( ) D. ( ) E. ( )
4 3 2 3 4
tifr2013 probability conditional-probability
If really India wins, then Karan lies (P = 2) and Arjun tells truth (P = 3)
3 4
2 3 1
Now probability of Karan lying and Arjun telling truth = × =
3 4 2
1 1 1
Now probability of Arjun lying and Karan telling truth = × =
4 3 12
So, by Bayes theorem,
1
© Copyright GATE Overflow 2021. Some rights reserved. = =
GATE Overflow April 2021 132 of 278
1
2 6
Probability of India winning = =
1 1 7
+
2 12
So, answer is (e)
X ) and P ( X ) :
Calculation of P ( W W¬
X ) = P ( Case 1 ) ∪ P ( Case 4 )
P (W W W
P ( Case 1) = 3 × 3 = 9
W 4 4 16
P ( Case 4) = 1 × 1 = 1
W 4 4 16
X)=
So P ( W 9 + 1 = 10
16 16 16
X ) = P ( Case 6 ) ∪ P ( Case 7 )
P ( W¬ W¬ W¬
P ( Case 6) = 3 × 1 = 3
W¬ 4 4 16
P ( Case 7) = 1 × 3 = 3
W¬ 4 4 16
X )=
So P ( W¬ 3 + 3 = 6
16 16 16
10
Hence, P ( W )= 16
= 10 .
X 10 6
+ 16 16
16
We have to find the probability of East being correct given that we twice get the answer as East from some
person.
Let's denote:
Probability of East being correct = P (E)
2 3 3
1. When we're asking a tourist & she tells 2− times East as answer and East is correct. Probability of this = × ×
3 4 4
2. When we're asking a Kabrastani & she tells 2− times East as answer and East is correct. Probability of this
1
= × 0 × 0 as Kabrastani always lies.
3
2 3 3 1 2 3 3
∴ P (E ∣ E) = Case 1 + Case 2 = ( × × ) + ( × 0 × 0) = × ×
′′
3 4 4 3 3 4 4
′′
P (E ∣ W) = Probability of getting 2-times East given that West is correct.
This we can get in 2 ways -
2 1 1
1. When we're asking a tourist & she tells 2− times East as answer and East is wrong. Probability of this = × ×
3 4 4
1
2. When we're asking a Kabrastani & she tells 2− times East as answer and East is wrong. Probability of this = × 1 × 1
3
2 1 1 1
P (E |W) = Case 1 + Case 2 = ( × × ) + ( × 1 × 1)
′′
3 4 4 3
′′
P (E ∣ E)
′′
∴ P (E ∣ E ) =
P (E ′′ ∣ E) + P (E ′′ ∣ W)
2 3 3
( × × )
3 4 4
=
2 3 3 2 1 1 1
( × × ) + ( × × ) + ( × 1 × 1)
3 4 4 3 4 4 3
3
= 8
3 1 1
( )+( )+( )
8 24 3
3
= 8
(9 + 1 + 8)
24
( )
=
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 134 of 278
3
( )
8
=
18
( )
24
3 24
=( )×( )
8 18
1
=
2
Correct Answer: C
8 votes -- Subarna Das (11.2k points)
Assume that you are flipping a fair coin, i.e. probability of heads or tails is equal. Then the expected number of coin
flips required to obtain two consecutive heads for the first time is.
a. 4 b. 3 c. 6 d. 10 e. 5
tifr2011 probability expectation
A bag contains 16 balls of the following colors: 8 red, 4 blue, 2 green, 1 black, and 1 white. Anisha picks a ball
randomly from the bag, and messages Babu its color using a string of zeros and ones. She replaces the ball in the bag,
and repeats this experiment, many times. What is the minimum expected length of the message she has to convey to Babu per
experiment?
3 15 31
A. B. log 5 C. D. E. 2
2 8 16
tifr2012 probability expectation
A fair dice (with faces numbered 1, . . . , 6 ) is independently rolled repeatedly. Let X denote the number of rolls till an
even number is seen and let Y denote the number of rolls till 3 is seen. Evaluate E(Y |X = 2) .
A. 6 56 B. 6 C. 5 12 D. 6 13 E. 5 23
tifr2014 expectation
Ram has a fair coin, i.e., a toss of the coin results in either head or tail and each event happens with probability exactly
half (1/2). He repeatedly tosses the coin until he gets heads in two consecutive tosses. The expected number of coin
tosses that Ram does is.
Two balls are drawn uniformly at random without replacement from a set of five balls numbered 1, 2, 3, 4, 5. What is
the expected value of the larger number on the balls drawn?
Answers: Expectation
Answer is (C)
Let the expected number of coin flips be X . The case analysis goes as follows:
a. If the first flip is a tails, then we have wasted one flip. The probability of this event is 12 and the total number of flips
required is X + 1.
b. If the first flip is a heads and second flip is a tails, then we have wasted two flips. The probability of this event is 14 and the
total number of flips required is X + 2. as the same scenario as beginning is there even after 2 tosses.
c. If the first flip is a heads and second flip is also heads, then we are done. The probability of this event is 14 and the total
number of flips required is 2.
Solving, we get X = 6 .
Thus, the expected number of coin flips for getting two consecutive heads is 6.
48 votes -- Avdhesh Singh Rana (2.3k points)
Answer is (C)
Using static Huffman compression you can encode the more common colours in fewer bits than the rare colours, that
being the case on can expect that common colours will usually be chosen.
eg:
red 1
blue 01
green 001
white 0001
black 0000
On average from 16 draws there will be
8 reds = 8 bits
4 blues = 8 bits
2 greens = 6 bits
1 white = 4 bits
1 black = 4 bits
30 15
for a total of = bits on average.
16 8
28 votes -- sudipta roy (381 points)
Answer is (E)
X : The value of X denotes the number of rolls till an even number is seen.
Y : The value of Y denotes the number of rolls till a 3 is seen.
For example:
X = 2 implies an even number first time occurred on second roll, or outcome of the first roll is odd & outcome of the
second roll is even.
Y = 4 implies 3 appeared for first time in the 4th die roll.
Ranges of Random Variables X & Y
X : {1, 2, 3, … , ∞}
Y : {1, 2, 3, … , ∞}
E[Y ∣ X = 2] : Expected number of rolls till a 3 is seen given that an even number appeared for the first time in the second
roll.
nd
It is sure that 3 cannot appear on 2nd toss, i.e. P [Y = 2 ∣ X = 2] = 0 and henceforth E[Y = 2 ∣ X = 2] = 0.
Now, there are two cases possible:
Case 1: 3 appears on the first toss given that outcome of first toss is odd.
i.e., E[Y = 1 ∣ X = 2]
Here we need not to concern about outcomes of rolls other than the first roll.
1
Probability of getting 3 in first toss given that o/c of the first toss is odd = P (Y = 1 ∣ X = 2) = = 0.33
3
So, Expectation E[Y = 1 ∣ X = 2] = y × P (Y = 1 ∣ X = 2) = 1 × 0.33 = 0.33
Case 2: 3 appears on any toss after the second toss given that outcome of first toss is odd, & that of second toss is even
P [Y = y ∣ X = 2] = given that 1st roll is an odd number and 2nd roll is an even number, Probability that out of y rolls,
None of the first (y– 1) roll’s outcome is 3 &
Outcome of the y th roll is 3.
So P [Y = y ∣ X = 2]
2
= ( ) (for first o/c odd but not 3)
3
5 (y–3)
×( ) (for not getting a 3 from 3rd to 0(y– 1)th rolls)
6
1
× ( ) (for y th o/c to be 3).
6
2 5 (y–3) 1
P [Y = y ∣ X = 2] = ( ) × ( ) ×( )
3 6 6
So E[Y = y ∣ X = 2] = Summation from y = 3 to infinity(y × P (Y = y ∣ X = 2)) = 5.33 (where y ≥ 3 )
This summation will give sum of all the expectations from Y = 3 to infinity.
Now:
Net Expectation is given as:
E[Y = y ∣ X = 2] = E[Y = 1 ∣ X = 2] + E[Y = 2 ∣ X = 2] + E[Y = y ′ ∣ X = 2] where y ′ ≥ 3.
Putting all the values,
E[Y = y ∣ X = 2] = 0.33 + 0 + 5.33
17
So, E[Y = y ∣ X = 2] = 5.66 = .
3
22 votes -- Anurag Pandey (10.5k points)
Answer is (C)
By drawing the tree diagram we can find the following series :
E = ∑ k. P (k)
= 2.(1.x2 ) + 3.(1.x3 ) + 4.(2.x4 ) + 5.(3.x5 ) + 6.(5.x6 ) + 7.(8.x7 ) + … ∞
Above series is a nice combination of AP , generating function and Fibonacci numbers !!!!
E
⇒ = 2.(1.x1 ) + 3.(1.x2 ) + 4.(2.x3 ) + 5.(3.x4 ) + 6.(5.x5 ) + 7.(8.x6 ) + … ∞
x
⇒∫
E
. dx = 1.x2 + 1.x3 + 2.x4 + 3.x5 + 5.x6 +. . . . . ∞
x
⇒∫
E
. dx = x2 . (1.x0 + 1.x1 + 2.x2 + 3.x3 + 5.x4 + … ∞)
x
x2
⇒∫
E
. dx =
x 1 − x − x2
d x2
[ ]
E
⇒ =
x dx 1 − x − x2
E 2x(1 − x − x2 ) + (1 + 2x)x2
⇒ =
x (1 − x − x2 )2
2x(1 − x − x2 ) + (1 + 2x)x2
⇒ E = x. { }
(1 − x − x2 )2
⇒ E = .{ 2
2. 1 (1 − 12 − 14 ) + (1 + 2. 12 ). 14
}
1
2 (1 − 12 − 14 )2
⇒E=6
Similar Kind of Question as a Reference
https://gateoverflow.in/3778/gate2005-it-32
References
5 balls we have.
2 balls can be drawn in 10 ways
Ball1, Ball2
Ball1, Ball3
Ball1, Ball4
Ball1, Ball5
Ball2, Ball3
Ball2, Ball4
Ball2, Ball5
Ball3, Ball4
Ball3, Ball5
Ball4, Ball5
Let x be the larger number on the balls drawn
x P(x)
1 0
2 1
3 2
4 3
5 4
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.
17 48 105 175 294
A. B. C. D. E.
2401 2401 2401 2401 2401
tifr2020 engineering-mathematics probability independent-events
P (exactly3) = (43) ∗ 1 ∗ 1
7 ∗ 1
7 ∗ 6
7 = 168
2401 P (exactly4) = (44) ∗ 1 ∗ 1
7 ∗ 1
7 ∗ 1
7 = 7
2401 P (atleast3) = P (exactly3) + P (ex
P(exactly 3) means Probability of exactly 3 people out of 4 having their birthdays on the same day of the week. And so on.
3 votes -- undecided (35 points)
A drawer contains 2 Blue, 4 Red and 2 Yellow balls. No two balls have the same radius. If two balls are randomly
selected from the drawer, what is the probability that they will be of the same colour?
2 2
A. ( ) B. ( )
7 5
3 1
C. ( ) D. ( )
7 2
( )
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 139 of 278
3
E. ( )
5
tifr2010 probability
A cube whose faces are colored is split into 1000 small cubes of equal size. The cubes thus obtained are mixed
thoroughly. The probability that a cube drawn at random will have exactly two colored faces is:
Three dice are rolled independently. What is the probability that the highest and the lowest value differ by 4?
1 1 1 5 2
A. ( ) B. ( ) C. ( ) D. ( ) E. ( )
3 6 9 18 9
tifr2011 probability
You have to play three games with opponents A and B in a specified sequence. You win the series if you win two
consecutive games. A is a stronger player than B. Which sequence maximizes your chance of winning the series?
A spider is at the bottom of a cliff, and is n inches from the top. Every step it takes brings it one inch closer to the top
with probability 1/3 , and one inch away from the top with probability 2/3 , unless it is at the bottom in which case, it
always gets one inch closer. What is the expected number of steps for the spider to reach the top as a function of n?
A. It will never reach the top. B. Linear in n.
C. Polynomial in n. D. Exponential in n.
E. Double exponential in n.
tifr2012 probability
An electric circuit between two terminals A and B is shown in the figure below, where the numbers indicate the
probabilities of failure for the various links, which are all independent.
There are 1000 balls in a bag, of which 900 are black and 100 are white. I randomly draw 100 balls from the bag.
What is the probability that the 101st ball will be black?
A. 9/10 B. More than 9/10 but less than 1.
C. Less than 9/10 but more than 0. D. 0
E. 1
tifr2012 probability
The probability of throwing six perfect dices and getting six different faces is
6! 6!
A. 1 − B. C. 6−6 D. 1 − 6−6 E. None of the above
66 66
tifr2012 probability
Doctors A and B perform surgery on patients in stages III and IV of a disease. Doctor A has performed a 100
surgeries (on 80 stage III and 20 stage IV patients) and 80 out of her 100 patients have survived ( 78 stage III and 2
stage IV survivors). Doctor B has also performed 100 surgeries (on 50 stage III and 50 stage IV patients). Her success rate
is 600
100 ( 49 stage III survivors and 11 stage IV survivors). A patient has been advised that she is equally likely to be suffering
from stage III or stage IV of this disease. Which doctor would you recommend to this patient and why?
tifr2013 probability
An unbiased die is thrown n times. The probability that the product of numbers would be even is
1 1
A. B. C. 1 − 6−n D. 6−n E. None of the above
(2n) [(6n)!]
tifr2013 probability
A stick of unit length is broken into two at a point chosen at random. Then, the larger part of the stick is further divided
into two parts in the ratio 4 : 3 . What is the probability that the three sticks that are left CANNOT form a triangle?
A biased coin is tossed repeatedly. Assume that the outcomes of different tosses are independent and probability of
2
heads is in each toss. What is the probability of obtaining an even number of heads in 5 tosses, zero being treated as
3
an even number?
121 122 124 125 128
A. ( ) B. ( ) C. ( ) D. ( ) E. ( )
243 243 243 243 243
tifr2013 probability
Let m, n be positive integers with m a power of 2. Let s = 100n2 log m . Suppose S1 , S2 , … , Sm are subsets of
1, 2, … , s such that ∣Si ∣= 10n log m and ∣Si ∩ Sj ∣≤ log m for all 1 ≤ i < j ≤ m . Such a collection of sets
S1 , … , Sm is an example of a so-called Nisan-Wigderson design. We now consider the set membership problem, where we
have to store an arbitrary subset T ⊆ {1, 2, . . . . , m} , ∣ T ∣= n as an array A of s bits so that given any integer
x, 1 ≤ x ≤ m , we can discover whether x ∈ T by reading only one bit of A. Consider the following strategy to solve this
problem. Array A is initialized to all zeroes. Given the set T to be stored, we put a one in all the locations of A indexed by the
union ∪t∈T St . Now, given the integer x, we read a random location in A from Sx and declare that x ∈ T if the bit in that
location is one. This strategy gives the correct answer with probability
tifr2013 probability
Consider a 6-sided die with all sides not necessarily equally likely such that probability of an even number is
1 1
P ({2, 4, 6}) = , probability of a multiple of 3 is P ({3, 6}) = 1/3 and probability of 1 is P ({1}) = . Given the
2 6
above conditions, choose the strongest (most stringent) condition of the following that must always hold about P ({5}), the
probability of 5.
1 1
A. P({5}) = B. P({5}) ≥
6 6
1 1
C. P({5}) ≤ D. P({5}) ≤
6 3
E. None of the above
tifr2015 probability
There are two rocks A and B, located close to each other, in a lily pond. There is a frog that jumps randomly between
the two rocks at time t = 0, 1, 2, … . The location of the frog is determined as follows. Initially, at time t = 0 , the frog
is at A. From then on, the frog's location is determined as follows. If the frog is at A at time t, then at time t + 1, with
probability 2/3 it jumps to B and with probability 1/3 , it jumps on the spot and stays at A. If the frog is at B at time t, then at
time t + 1, with probability 1/2 it jumps to A and with probability 1/2 it jumps on the spot and stays at B. What is the
probability that the frog is at B at time 3 (just after its third jump)?
1 31 14 61 2
A. 2 B. 54 C. 27 D. 108 E. 3
tifr2016 probability
Consider the majority function on three bits, maj : {0, 1}3 → {0, 1} where maj (x1 , x2 , x3 ) = 1 if and only if
x1 + x2 + x3 ≥ 2 . Let p(α) be the probability that the output is 1 when each input is set to 1 independently with
probability α. What is p′ (α) = dα
d p(α) ?
A. 3α B. α2
C. 6α(1 − α) D. 3α2 (1 − α)
E. 6α(1 − α) + α2
tifr2017 probability
Let C be a biased coin such that the probability of a head turning up is p. Let pn denote the probability that an odd
number of heads occurs after n tosses for n ∈ {0, 1, 2, …}, Then which of the following is TRUE ?
1
A. pn = for all n ∈ {0, 1, 2, …}.
2
B. pn = (1 − p)(1 − pn−1 ) + p. pn−1 for n ≥ 1 and p0 = 0.
C. pn = ∑ni=1 p(1 − 2p)i−1 for n ≥ 1.
1 1
D. If p = , then pn = for all n ∈ {0, 1, 2, …} .
2 2
E. pn = 1 if n is odd and 0 otherwise.
tifr2018 probability
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 5 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. 5
(26)10
5
B. 1 − (1 − 1 )
(26)10
C. 1 − {( )( )( )( )( )}
(26)10 −1 (26)10 −2 (26)10 −3 (26)10 −4 (26)10 −5
(26)10 (26)10 (26)10 (26)10 (26)10
D. 1
(26)10
E. None of the above
tifr2018 probability
Suppose a box contains 20 balls: each ball has a distinct number in {1, … , 20} 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 ‘‘1 "
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 ‘‘2 " on it is present in the box?
A drawer contains 9 pens, of which 3 are red, 3 are blue, and 3 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 ?
What is the probability that a point P = (α, β) picked uniformly at random from the disk x2 + y 2 ≤ 1 satisfies
α + β ≤ 1?
1
A. π B. 34 + 1
4 ⋅ 1
π
3 1 2
C. 4 + 4 ⋅ π D. 1
2
E. π
tifr2019 engineering-mathematics discrete-mathematics probability
In a certain year, there were exactly four Fridays and exactly four Mondays in January. On what day of the week did
the 20th of the January fall that year (recall that January has 31 days)?
Answers: Probability
If any 2 balls selected from 8 balls then we can choose 8 C 2 ways=28 ways
8 2
So, required probability= =
28 7
Correct Answer: A
13 votes -- srestha (85.3k points)
3! × 2
Case 2: largest is 5, smallest 1 and middle is 1 or 5 :
2!
Case 3: largest is 6, smallest 2 and middle is 3 or 4 or 5 : 3 × 3!
3! × 2
2:
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 144 of 278
3! × 2
Case 4: largest is 6, smallest 2 and middle is 6 or 2 :
2!
So, probability the highest and the lowest value differ by 4,
3! × 2 3! × 2
(3 × 3! + + 3 × 3! + )
2! 2! 2
= = .
63 9
Correct Option: E
22 votes -- Shreya Roy (3.8k points)
Let the three games in a series be called G1 , G2 and G3 respectively, and the probability of winning the game x
be denoted as P (x)
You can win the series if and only if: You win G2 and you win atleast one of {G1 , G3 } .
Let the probability of winning against player A be a and the probability of winning against player B be b.
Then, a < b. (A is a stronger player thanB, so probability of winning against A
is smaller compared to B)
Let P (xyz) be the probability of winning the series in which the games played are against x, y and z in order.
We can see that not all probabilities are equal, so option E is not correct .
We can also see that options A and D result in the same value, so they are not correct either .
Comparing option B and option C.
Since a < b and a, b ≥ 0 , we have that 2ab − a2 b > 2ab − ab2
Hence, option B is the correct answer.
40 votes -- Pragy Agarwal (18.3k points)
It will be linear to n
From the given information, we can calculate the probabilities of events P , Q and R as follow:
(as I already consumed letter (capital) P denoting an event so here by I will use letter (small) p to denote probabilities,
e.g. p (X) denotes probability of happening of event X ).
4 4 16
p (P ) =
× = ,
5 5 25
16 9
⇒ p (Pˆ) = 1 − = ,
25 25
2
p (Q) = ,
3
1
⇒ p (Q̂) = ,
3
3 3 9
p (R) = × = ,
4 4 16
9 7
⇒ p (R̂) = 1 − = .
16 16
The situation here can be represented using the following Venn Diagram:
Here Red region denotes the event Ŵ in which A&B are disconnected.
Different gradients of Green colour represent the W in which terminals A&B are connected.
We have to find p (W)
Events W and Ŵ are mutually exclusive & totally exhaustive,
since either terminals A and B will be connected or they will be disconnected.
So we can write p (W) in terms of p (Ŵ ) as follow:
p (W) = 1 − p (Ŵ ) .
Also it can be seen that
p (Ŵ ) = p (Pˆ) ∩ (Q̂) ∩ (R̂) where Pˆ, Q̂ and R̂ are independent events.
That is terminals A & B will be disconnected only when all of the links will fail simultaneously.
Using independence we can write,
p (Ŵ ) = p (W) = p (Pˆ) × (Q̂) × (R̂) ,
9 1 7 21
⇒ p (Ŵ ) = × × =
25 3 16 400
21 379
⇒ p (W) = 1 − = .
400 400
Correct Answer: B
24 votes -- Anurag Pandey (10.5k points)
Here we are having a total of 1000 Balls, out of which we firstly draw 100 balls , and then 101st ball..
Firstly we have to find expected number of white and black balls in drawn 100 balls , as both can occur in 100
balls..
We have a situation like this:
100
= 100 × ( ) = 10
W
Expected number of white balls =n ×
N 1000
900
= 100 × ( ) = 90
B
Expected number of black balls =n ×
N 1000
So, we have drawn 100 balls(90 black, 10 white)
Left balls = (810 Black , 90 White) = 900 total
Now,
810 9
probability for 101st ball to be black = = .
900 10
So, option (A) is Correct
32 votes -- Himanshu Agarwal (12.4k points)
1 6!
the probability is 6
and then for 6! different permutations : 6 .
6 6
9 votes -- Shaun Patel (6.1k points)
Answer will be d)
78
As, % of Doctor A successful for stage III = × 100 = 97.5
80
2
For stage IV= × 100 = 10
20
49
As, % of Doctor B successful for stage III = × 100 = 98
50
11
For stage IV= × 100 = 22
50
In both cases Doc B is more successful.
13 votes -- srestha (85.3k points)
3 0 3 n
= 1 − nCn × ( ) × ( )
6 6
1 n
=1−( )
2
Correct Answer: E
20 votes -- Umang Raman (12.2k points)
Let the stick be broken to x and l − x with x being the larger part.
To not get a triangle, sum of two sides must be smaller than the third one.
It is given that x > l/2 ( x being the larger part) ⟹ (7l/8, l) is the favorable case from (l/2, l) which gives probability
= (1/8)/(1/2) = 1/4 .
8 votes -- Arjun Suresh (334k points)
probability of obtaining an even number of heads in 5 tosses, zero being treated as an even number
number of event = 0 head or 2 head or 4 head
2
Probability of head =
3
1
Probability of tail =
3
0 5 2 3 4 1
2 1 2 1 2 1
Probability = 5 C 0 ( ) ( ) + 5 C 2 ( ) ( ) + 5 C 4 ( ) ( )
3 3 3 3 3 3
121
= .
243
Option A
14 votes -- Umang Raman (12.2k points)
Option D is correct
Let
S1 = {1, 2, … , 37, 38, 39, 40}S2 = {121, 122, … , 160}S3 = {37, 38, 41, 42, … , 78} here ∣ S1 ∩ S2 ∣= 2S4 = {39, 40
1 2 3 … 36 37 38 39 40 41 42 … 78 … 118 … 800
0 0 0 … 0 1 1 1 1 1 1 … 1 … 1 … 0
1 1 1
P {3, 5} = 1 − P {2, 4, 6} − P {1} = − =
2 6 3
1 1 1 1
Can P 3 = 0 ? then P {6} = and P {2, 4} = − = .
3 2 3 6
And
1
P {5} = . Possible.
3
So, option D.
10 votes -- Arjun Suresh (334k points)
In such cases where the events are mutually exclusive and collectively exhaustive, it is preferable to use tree
diagram to find the final outcome. The tree diagram for the given problem is as shown:
The frog is at B at t = 3
⟹ P (A. A. B) + P (A. B. B) + P (B. A. B) + P (B. B. B)
= 13 × 13 × 23 + 13 × 23 × 12 + 23 × 12 × 23 + 23 × 12 × 12
= 2 + 1 + 2 + 1 = 31
27 9 9 6 54
Hence we have P (frog is at B at t = 3) = 31/54
Correct Answer: B
17 votes -- HABIB MOHAMMAD KHAN (67.6k points)
3
⇒ [maj {xi } = 1] ⇔ ([∑ xi ] ≥ 2)
i=1
3 3 3
⇒ P rob ([∑ xi ] ≥ 2) = P rob ([∑ xi ] = 2) + P rob ([∑ xi ] = 3)
i=1 i=1 i=1
3
⇒ P rob ([∑ xi ] ≥ 2) = ( ) ∗ {α. α. (1 − α)} + α3
3
i=1
2
3
⇒ P rob ([∑ xi ] ≥ 2) = 3.α2 (1 − α) + α3
i=1
3
⇒ P rob ([∑ xi ] ≥ 2) = 3.α2 − 2.α3
i=1
′ d
⇒ P (α) = [3.α2 − 2.α3 ]
dα
′
⇒ P (α) = 6.α (1 − α)
Correct Answer: C
14 votes -- Debashish Deka (40.8k points)
p0 = 0
p1 = p
p2 = 2 C1 p(1 − p)
p3 = 3 C1 p(1 − p)2 + 3 C3 p3
= 12 [1 − (1 − 2p)n ]
From option C,
= 12 [1 − (1 − 2p)n ]
10
Out of which, total (26 4−1) sets will contain password.
( )
10 −1
(264 )
10 −1
So required probability that his guessed set contains the password will be .
(265 )
10
(n−1
r−1 )
And if you simplify , it will be r → 5 .
(nr) n 2610
→ So, Option A
17 votes -- Shivansh Gupta (2k points)
a) When both 1 and 2 remain after 10 are chosen. Later 1 will be chosen with probability 1 and hence, 2 will remain.
b) When 1 is thrown along with some other 9, and 2 remains. Later we have to multiply with probability that 2 will not be
thrown.
P (2 remains after all the events) = P (1 and 2 are not thrown out) + P (1 is thrown out , 2 remains) * P (from remaining 10 2
is not chosen)
18 C+18 C∗ 9
→ 10 9
20 C
10
10
→ 9
19
Hence, B.
13 votes -- Shivansh Gupta (2k points)
Number of different ways = Number of permutations of 9 objects where 3 are of type A, next 3 of type B and final 3 of
type C
9!
=
3!3!3!
Now, when we have two red pens in succession, this is equivalent to 2 objects being close to each other in permutation. So,
7! ways. Now, this group of 2 can be placed in 8 positions around the 7
ignoring these two we can arrange the rest 7 in 3!3!
objects -- wait -- here is the problem. A RED pen is already there and if we put RED,RED on its left or right side we get
the same arrangement. So, effectively we have only 7 unique positions for the 2 RED pens. This gives our required number
of permutations as 7!.7
3!3!
.
7!.7 9! 3!.7 7
÷ = =
3!3! 3!3!3! 8.9 12
22 votes -- Arjun Suresh (334k points)
3
coloured region ∗π+ 1 3
Required P roabability = total area of disk
= 4 π 2 = 4 + 12 . 1
π
So, (c) should be correct. Correct me If I'm wrong
22 votes -- Shobhit Joshi (3.9k points)
Then remaining days 31 − 7(4) = 3. Since mentioned there are exactly 4 Mondays and 4 Fridays then these Mondays and
Fridays are already covered in the 4 complete weeks.Hence for these 3 days we need 3 consecutive days other than Monday
and Friday.
Thus
Let X and Y be two independent and identically distributed random variables. Then P (X > Y ) is.
A. 12 B. 1
C. 0 D. 13
E. Information is insufficient.
tifr2011 probability random-variable
Let the probability P (X = Y ) > 0 . This can happen if X and Y are discrete random variables. Also, if X and
Y are continuous random variables, it could be that some values have a non-zero probability of getting selected.
1 − P (X = Y )
Then P (X > Y ) = P (Y > X ) =
2
Since nothing is said about the value of P (X = Y ), the correct answer will be option e. Information is insufficient.
10 votes -- Pragy Agarwal (18.3k points)
Here as U and V are uniformly distributed, they will have equal probabilities for each point in {0,1,2,3,4} which by
the rule of probability comes 1/5 . Now for being uniformly distributed F(1), F(2), F(3) must have same values at
points {0,1,2,3,4}
So,
so all three are uniformly distributed as they all same value for all points.
but not identical as they have values different from each other.
Consider three independent uniformly distributed (taking values between 0 and 1) random variables. What is the
probability that the middle of the three values (between the lowest and the highest value) lies between a and b where
0 ≤ a < b ≤ 1?
A. 3(1 − b)a(b − a) B. 3((b − a) − (b2 − a2 )/2)
C. 6(1 − b)a(b − a) D. (1 − b)a(b − a)
E. 6((b2 − a2 )/2 − (b3 − a3 )/3) .
tifr2013 probability random-variable uniform-distribution
Consider two independent and identically distributed random variables X and Y uniformly distributed in [0, 1]. For
α ∈ [0, 1], the probability that α max (X, Y ) < XY is
Fix n ≥ 4. Suppose there is a particle that moves randomly on the number line, but never leaves the set {1, 2, … , n}.
→
Let the initial probability distribution of the particle be denoted by π . In the first step, if the particle is at position i, it
moves to one of the positions in {1, 2, … , i} with uniform distribution; in the second step, if the particle is in location j, then
it moves to one of the locations in {j, j + 1, … , n} with uniform distribution.Suppose after two steps, the final ditribution of
→
the particle is uniform. What is the initial distribution π ?
→
A. π is not unique
→
B. π is uniform
−→
−
C. π(i) is non-zero for all even i and zero otherwise
D.
→
π (1) = 1 and → π (i) = 0 for i ≠ 1
E.
→
π (n) = 1 and → π (i) = 0 for i ≠ n
Let X, Y and Z be the three random variables. For the middle value to lie between a and b we have the following
cases
Since, all these cases are mutually exclusive (no overlapping) and exhaustive (no other favorable case) we can get the
required probability by adding the probabilities for the four cases as
(b − a) [(b − a)2 + 3(b − a)a + 3(b − a)(1 − b) + 6a(1 − b)]
= (b − a) [(b − a)2 + 3(b − a)a + 3(1 − b)(b + a)]
= (b − a) [(b − a)2 + 3(ab − a2 + b + a − b2 − ab)]
= (b − a) [(b − a)2 + 3(−a2 − b2 + b + a)]
= (b − a) [a2 + b2 − 2ab − 3a2 − 3b2 + 3b + 3a]
= (b − a) [−2a2 − 2b2 − 2ab + 3b + 3a]
= −2a2 b − 2b3 − 2ab2 + 3b2 + 3ab + 2a3 + 2ab2 + 2a2 b − 3ab − 3a2
= 2(a3 − b3 ) + 3(b2 − a2 )
= 3(b2 − a2 ) − 2(b3 − a3 )
= 6((b2 − a2 )/2 − (b3 − a3 )/3)
Correct Option: E
P (α max(X, Y ) < XY )
= (1 − α)2
Option D.
5 votes -- Arjun Suresh (334k points)
Answer Keys
12.0.1 C 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.4.1 D 12.5.1 A 12.5.2 A
12.5.3 E 12.5.4 B 12.5.5 D 12.5.6 B 12.5.7 A
12.5.8 B 12.5.9 D 12.5.10 E 12.5.11 A 12.5.12 B
12.5.13 D 12.5.14 D 12.5.15 B 12.5.16 C 12.5.17 C
12.5.18 A 12.5.19 B 12.5.20 A 12.5.21 C 12.5.22 A
12.6.1 E 12.6.2 C 12.7.1 E 12.7.2 D 12.7.3 D
A box contains 731 black balls and 2000 white balls. The following process is to be repeated as long as possible.
Arbitrarily select two balls from the box. If they are of the same color, throw them out and put a black ball into the box
( enough extra black balls are available to do this). If they are of different color, place the white ball back into the box and
throw the black ball away. Which of the following is correct?
Three men and three rakhsasas arrive together at a ferry crossing to find a boat with an oar, but no boatman. The boat
can carry one or at the most two persons, for example, one man and one rakhsasas, and each man or rakhsasas can row.
But if at any time, on any bank, (including those who maybe are in the boat as it touches the bank) rakhsasas outnumber men,
the former will eat up the latter. If all have to go to the other side without any mishap, what is the minimum number of times
that the boat must cross the river?
A. 7 B. 9 C. 11 D. 13 E. 15
tifr2013 analytical-aptitude logical-reasoning
Let there be a pack of 100 cards numbered 1 to 100. The ith card states: "There are at most i − 1 true cards in this
pack". Then how many cards of the pack contain TRUE statements?
Consider the following two types of elections to determine which of two parties A and B forms the next government in
the 2014 Indian elections. Assume for simplicity an Indian population of size 545545(= 545 ∗ 1001). There are only
two parties A and B and every citizen votes.
TYPE C: The country is divided into 545 constituencies and each constituency has 1001 voters. Elections are held for each
constituency and a party is said to win a constituency if it receive a majority of the vote in that constituency. The party that
wins the most constituencies forms the next government.
TYPE P: There are no constituencies in this model. Elections are held throughout the country and the party that wins the most
votes (among 545545 voters forms the government.
Which of the following is true?
A. If the party forms the govt. by election TYPE C winning at least two-third of the constituencies, then it will also forms the
govt. by election TYPE P.
B. If a party forms govt. by election TYPE C, then it will also form the govt. by election TYPE P.
C. If a party forms govt. by election TYPE P, then it will also form the govt. by election TYPE C.
D. All of the above
tifr2013 logical-reasoning
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.
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
Consider the following game with two players, Aditi and Bharat. There are n tokens in a bag. The two players know n,
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 n = 3 , Bharath has a winning strategy. For n = 4 , Aditi has a winning strategy.
B. For n = 7 , Bharath has a winning strategy. For n = 8 , Aditi has a winning strategy.
C. For both n = 3 and n = 4 , Aditi has a winning strategy.
D. For both n = 7 and n = 8 , Aditi has a winning strategy.
E. Bharat never has a winning strategy.
Edit : Option (D) is : For both n = 7 and n = 8 , Bharat has a winning strategy. ( Source)
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 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. Anuj
B. Binky
C. Chacko
D. Desmond
E. Either Anuj or Binky; the information is insufficient to pinpoint the criminal
tifr2018 logical-reasoning
Avni and Badal alternately choose numbers from the set {1, 2, 3, 4, 5, 6, 7, 8, 9} without replacement (starting with
Avni). The first person to choose numbers of which any 3 sum to 15 wins the game (for example, Avni wins if she
chooses the numbers 8, 3, 5, 2 since 8 + 5 + 2 = 15 ). 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 8 ways in which 3 numbers from the set {1, 2, 3, 4, 5, 6, 7, 8, 9} can sum up to 15, shown as the
three rows, the three columns, and the two diagonals in the following square:
8 1 6
3 5 7
4 9 2
A. Avni has a winning strategy
B. Badal has a winning strategy
C. Both of them have a winning strategy
D. Neither of them has a winning strategy
E. The Player that picks 9 has a winning strategy
Suppose there are n 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. ∣Odd ∣ mod 2 B. ∣Even∣
C. ∣Even ∣– ∣ Odd∣ D. 2 ∣ Even ∣– ∣ Odd∣
E. 2 ∣ Odd ∣– ∣ Even∣
tifr2019 general-aptitude analytical-aptitude logical-reasoning
The total number of balls is 2371 and in each round 1 ball is removed. So after 2370 steps, we will have 1 ball in
the box and we must stop.
Here, white balls are even and every time either it gets removed in a pair or remains unchanged.
So, the last ball remaining can never be a white ball.
Since at each step the number of black balls changes from odd to even or even to odd, so at the end only 1 black ball will be
in the box.
Hence, option C is the correct answer.
7 votes -- Umang Raman (12.2k points)
Why?
Because if the statement written on card number x is true then all the statements written in card numbers x + 1 to 100 must
be true.
For Example if Card number 3 is true, then according to the statement written in this card, "There are at most
3 − 1(= 2) true cards in the pack".
This implies number of true cards must be less than 3.
Now the statement on card number 4 will imply that the number of true cards must be less than 4.
similarly the statement on card number 100 will imply that the number of true cards must be less than 100.
So if statement written on card number 3 is true then all the statements written on the card numbers 4 to 100 will vacuously
be true.
But now the the number of true cards will be 98 (from card number 3 to 100) hence the statement on the card number 3 must
be false.
Clearly this is inconsistent so card number 3 can not be a true card.
Conclusion:
If card number x is a true card then:
1. There are at least (100 − x) + 1 true cards. and
2.Total Number of true cards must be less then or equal to x − 1
(where x belongs to Integers between 1 and 100).
For any value of x ≤ 50 both of the above statements can not be true simultaneously, so none of the cards from 1 to 50 is a
true card.
For any value of x ≥ 51 both of the above statements can be true at the same time, so all of the cards from 51 to 100 must
be true cards & the total number of true cards will be 50.
It can be observed that comparing one of the boundary cases of each of the above two statements will give us of the boundary
cases of our answer.
that is, on solving:
(100 − x) + 1 = x − 1
we get x = 51 which indeed is our smallest true card.
13 votes -- Anurag Pandey (10.5k points)
Minimum condition for Type C winning: if any party wins 273 constituencies out of 545 and with vote 501 out
of 1001 for each.
Minimum condition for Type P winning: if any party wins 272773 votes out of 545545
Option A:
Type C : Let party A wins 2/3 of constituencies i.e., 364 wins by 1 vote and 181 loss by all vote
364 × 501 + 181 × 0 = 182364
Type P : If A wins it should have more than half of vote i.e., 272773
"A married person in the room is looking at an unmarried person " ---this is satisfied when Sooraj is made
married
Chandni ⟶ Sooraj ⟶ Tara
married married unmarried
"A married person in the room is looking at an unmarried person " ---this is satisfied when Sooraj is made unmarried
Chandni ⟶ Sooraj ⟶ Tara
married unmarried unmarried
As both are possible we cannot finalize it to A or B --- we need extra information so answer should be D
8 votes -- Pavan Kumar Munnam (7.4k points)
Point to be noted-
1. Always Aditi starts the game.
2. A player loses the game if he/she has to remove the last item.
3. A player always removes 1 or 2 items with a winning strategy.
A. For n =3. // Here I am trying to make Bharat win, Let's see if he can win or not.
Aditi - removes 2 item , n = 3-2 = 1
Now only 1 item remains, so Bharat is forced to remove the last item and loses the game. Hence for n=3, Aditi has
a winning strategy.
The first part of A - False.
For n =4. // Here I am trying to make Aditi win, Let's see if she can win or not.
Case -1: case 2:
Aditi - removes 1 item , n = 4-1 = 3 Aditi - removes 2 item , n = 4-2 = 1
Bharat- removes 2,item , n = 3 -2 =1 Bharat- removes 1,item , n = 2 -1 =1
Now only 1 item remains in both the case, so Aditi is forced to remove the last item and loses the game. Hence for n=4,
Bharat has a winning strategy.
The 2nd part of A - True.
Hence, A- False.
B. For n =7. // Here I am trying to make Aditi win, Let's see if she can win or not.
Case 1: Case 2:
Aditi - removes 1 item , n = 7- 1 = 6 Aditi - removes 2 item , n = 7- 2 = 5
Bharat- removes 2 item , n = 6 -2 = 4. Bharat- removes 1 item , n = 5 -1 = 4.
Now remaining tokens in both the case, n = 4.
case 1: case 2:
Aditi - removes 1 item ,n=4-1 = 3 Aditi - removes 2 item , n = 4-2= 2.
Bharat- removes 2,item ,n=3-2=1, Bharat- removes 1,item , n = 2-1 = 1.
Now in both the case, only 1 item remains, so Aditi is forced to remove the last item and loses the game. Hence for n=7,
Bharat has a winning strategy. Aditi could not win the game even taking all possibility of Aditi's turn.
For n = 8. // Here I am trying to make Aditi win taking all possibility of Bharat's turn, Let's see if she can win or not.
Now in both the case, only 1 item is remaining so Bharat is forced to remove the last item and loses the game. Hence for
n=8, Aditi has a winning strategy.
B- True.
Ans - B.
15 votes -- Dhananjay Kumar Sharma (18.8k points)
1. Each white object is also circular.
2. Not all thin objects are black.
3. Each rectangular object is also either thin or white or both thin and white.
i. If there is a thin object in the set, then there is also a white object.
"Not all thin objects are black." means there is a thin object which is not black and white is the only other color possible.
So, this is TRUE.
ii. If there is a rectangular object in the set, then there are at least two objects.
"Each rectangular object is also either thin or white or both thin and white". So each rectangular object is either thin or
white or both. But "Each white object is also circular" means, a rectangular object cannot be white and hence it must be
thin. Now, "Not all thin objects are black" means there is a white object and this is circular as per (1). So, if there is a
rectangular object there are at least two objects and this statement is TRUE.
iii. Every fat object in the set is circular.
Can a fat object be rectangular? No, because as seen in (ii) a rectangular object must be thin (as it cannot be white). This
means every fat object must be circular as there are no other possibilities. This statement is also TRUE.
Correct Answer: E.
0 votes -- Arjun Suresh (334k points)
If statement 4 is true then it implies statement 3 is also true (but only 1 statement can be true).
If statement 3 is true then it implies statement 2 is also true (again only 1 statement can be true).
If statement 2 is true then all other statements are false including statement 3 which states " Chacko says that Binky is
telling the truth". This means Binky is not telling the truth, so statement 2 can not be true.
1. 9+5+1
2. 9+4+2
3. 8+6+1
4. 8+5+2
5. 8+4+3
6. 7+6+2
7. 7+5+3
8. 6+5+4
Consider each digits from 1 to 9
1. For 1, {5, 9} and {8, 6} are the winning combinations. So, if a player picks 1 the other player should avoid picking any
number from {5, 6, 8, 9} and if the first player then picks 5 the second player must pick 9 and if the first player picks 8
the second player must pick 6 (same for reverse order too) thus blocking all the winning combinations.
2. Like above for all digits from 2 to 9 the winning combinations can be blocked by the other player because if one element
is picked there are no common elements in the winning combinations.
According to Handshaking Lemma, number of person with odd number of handshake is always even.
answer: A
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
Syllabus: Numerical computation, Numerical estimation, Numerical reasoning and data interpretation
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 1 2 1 2 3 2 3 1 2 1 1.8 3
2 Marks Count 3 2 3 3 4 4 4 3 3 2 3.2 4
Total Marks 7 6 7 8 11 10 11 7 8 6 8.3 11
A ball is thrown directly upwards from the ground at a speed of 10 ms−1 , on a planet where the gravitational
acceleration is 10 ms−2 . Consider the following statements:
Answers:
According to the equations of motion for a particle in a straight line under uniform acceleration :
1) v = u + at
2) s = ut + 12 at2
3) v2 = u2 + 2as
In this case, u = 10 m/sec, a = g = −10 m/s2 (because I assumed displacement s as positive in upward direction) and
v = 0 at maximum height.
from (2), s = 10 ∗ 1 − 1 ∗ 10 ∗ 12 ⇒ s = 5 m
2
In this case, u = 0 m/sec, a = g = +10 m/s2 (because I assumed displacement s as negative in downward direction)
Suppose n straight lines are drawn on a plane. When these lines are removed, the plane falls apart into several
connected components called regions. A region R is said to be convex if it has the following property: whenever two
points are in R, then the entire line segment joining them is in R. Suppose no two of the n lines are parallel. Which of the
following is true?
Let L be a line on the two dimensional plane. L′ s intercepts with the X and Y axes are respectively a and b. After
rotating the co-ordinate system (and leaving L untouched), the new intercepts are a′ and b′ respectively. Which of the
following is TRUE?
1 1 1 1 1
A. a + b = a + b . B. a2
+ 12 = a1′2 + 1′2 .
′
b b
b b′ a′
C. a2
+ a2 = ab′2 + a′2
. D. b a
a + b = a′ + b′ .
b b
E. None of the above.
tifr2014 geometry cartesian-coordinates
Imagine the first quadrant of the real plane as consisting of unit squares. A typical square has 4 corners:
(i, j), (i + 1, j), (i + 1, j + 1),and (i, j + 1), where (i, j) is a pair of non-negative integers. Suppose a line segment l
connecting (0, 0) to (90, 1100) is drawn. We say that l passes through a unit square if it passes through a point in the interior
of the square. How many unit squares does l pass through?
Hence C is correct.
2 votes -- Nitesh Tripathi (123 points)
x y
+ =1 → (1)
a b
We can prove it by considering two points on the line, (a, 0) as (x1 , y1 ) and (0, b) as (x2 , y2 )
So, equation of line will be : y − y1 = ( x22 −x11 ) (x − x1 )
y −y
⇒ (y − 0) = ( ) (x − a)
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 165 of 278
⇒ (y − 0) = ( 0−a
b−0
) (x − a)
⇒ −ay = bx − ab
On dividing by ab and rearranging,
⇒ xa + yb = 1
Now, if a point (x, y) lies on the X − Y plane and if we rotate the co-ordinate system by θ degree then this point becomes
(x′ , y ′ ) on new co-ordinate system and relationship is given by :
cos θ sin θ x′
[ ][ ] = [ ′ ]
x
− sin θ cos θ y y
So,
( sina′ θ + cos θ )
b′
= 1
b
The equation of the tangent to the unit circle at point ( cos α, sin α ) is
A. x cos α − y sin α = 1 B. x sin α − y cos α = 1
C. x cos α + y sin α = 1 D. x sin α − y cos α = 1
E. None of the above
tifr2011 quantitative-aptitude geometry circles
Answers: Circles
Assuming that the unit circle is centered at the origin, the equation of the unit circle is: x2 + y 2 = 1
The slope of the tangent to the unit circle at point (x, y) can be derived by implicit differentiation as follows:
x2 + y 2 =1
d 2 d
(x + y 2 ) = 1
dx dx
dy
2x + 2y =0
dx
dy x
=−
dx y
cos α
Thus, the slope of the tangent at the point (cos α, sin α) is −
sin α
The equation of the tangent line then will be:
y − y1 = m(x − x1 )
cos α
y − sin α =− (x − cos α)
sin α
The hour hand and the minute hands of a clock meet at noon and again at mid-night. In between they meet N times,
where N is.:
Consider a well functioning clock where the hour, minute and the seconds needles are exactly at zero. How much time
later will the minutes needle be exactly one minute ahead (1/60 th of the circumference) of the hours needle and the
seconds needle again exactly at zero?
Hint: When the desired event happens both the hour needle and the minute needle have moved an integer multiple of 1/60 th
of the circumference.
A person went out between 4pm and 5pm to chat with her friend and returned between 5pm and 6pm. On her return,
she found that the hour-hand and the minute-hand of her (well-functioning) clock had just exchanged their positions
with respect to their earlier positions at the time of her leaving. The person must have gone out to chat at
122
Let δ be the difference in minutes between hour and minute hand at 1 : 05 . So, the meeting times are
1 : 05 + δ
2 : 10 + 2δ
3 : 15 + 3δ
4 : 20 + 4δ
5 : 25 + 5δ
6 : 30 + 6δ
7 : 35 + 7δ
8 : 40 + 8δ
9 : 45 + 9δ
10 : 50 + 10δ
11 : 55 + 11δ
We have 11δ = 5
5
⟹ δ=
11
minutes as the meeting time is 0 : 00 . So, we have N = 10.
Alternatively,
Speed of minute hand = 360 degrees per 60 minutes = 6 degrees per minute.
Speed of hour hand = 360 degree per 12 ∗ 60 minutes = 0.5 degree per minute.
For first meeting, distance traveled by minute hand = 360 + distance traveled by hour hand
Let, x be the minutes after which the hands intersect.
So, 6x = 360 + 0.5x
⟹ 5.5x = 360
720
⟹ x=
11
In 12 hours we have 12 × 60 minutes.
12 × 60
So, no. of intersections = = 11 .
720/11
But the last intersection is at midnight and must be excluded as per given question. So, N = 10 .
Correct Answer: E
11 votes -- Arjun Suresh (334k points)
The minute needle should be exactly one minute ahead of hour needle.
Difference between min. needle and hr. needle is equal to one minute.
360∘
In 1 minute, distance covered by minute needle = = 6∘
60
Suppose, after x minutes, hour needle and minute needle are separated by 6∘ .
360∘
In x minutes, distance covered by minute needle = × x = 6x∘
60
360∘ x∘
In x minutes, distance covered by hour needle = ×x=
12 ∗ 60 2
x∘
∴ Difference between minute needle and hour needle in x minutes = (6x∘ − )
2
x∘
∴ (6x∘ − ) = 6∘
2
⟹ 12x − x = 12
⟹ 11x = 12
12
⟹ x=
11
It is given in question that second hand is 0 or minute hand has traversed an integral multiple of minutes. So, smallest
possible value of x = 12 × 11 = 132 minutes.
Option e.
10 votes -- Sukanya Das (10k points)
4 360 x
Angle made by hour hand during departure = × 360 + x = 120 + .
12 12 × 60 2
This angle is equal to the angle made by the minute hand on arrival which is 6y. So,
Similarly, the angle made by the hour hand on arrival is equal to the angle made by the minute hand on departure, which
gives
5 y
× 360 + = 6x ⟹ 300 + y = 12x → (2).
12 2
Eliminating y from (1) and (2),
122
240 + x = 12(12x − 300) ⟹ 143x = 3840 ⟹ x = 26
143
Correct Answer: B
13 votes -- Arjun Suresh (334k points)
√–3 − i 97
If z = and (z 95 + i67 ) = z n , then the smallest value of n is
2
Three distinct points x, y, z lie on a unit circle of the complex plane and satisfy x + y + z = 0 . Then x, y, z form the
vertices of .
For any complex number z, arg z defines its phase, chosen to be in the interval 0 ≤ argz < 360∘ . If z1 , z2 and z3 are
three complex numbers with the same modulus but different phases (argz3 < argz2 < argz1 < 180∘ ), then the
quantity
arg(z1 /z2 )
arg[(z1 −z3 )/(z2 −z3 )]
is a constant, and has the value
1 1
A. 2 B. 3 C. 1 D. 3 E. 2
tifr2013 quantitative-aptitude complex-number non-gate
1 –
z= (√3 − i)
2
1 – 1 –
z2 = (3 − 1 − 2√3 i) = (1 − √3 i)
4 2
1 – 1 –
z 4 = (1 − 3 − 2√3 i) = (−1 − √3 i)
4 2
1 – 1 –
z 8 = (1 − 3 + 2√3 i) = (−1 + √3 i)
4 2
1 – 1 –
z 16 = (1 − 3 − 2√3 i) = (−1 − √3 i) = z 4
4 2
z = z × z = z × z = z8
32 16 16 4 4
z 64 = z 32 × z 32 = z 8 × z 8 = z 16 = z 4
z 95 = z 64 × z 16 × z 15
= z 4 × z 4 × z 15
= z 16 × z 7
= z4 × z7
= z8 × z2 × z
1 – 1 – 1 –
= (−1 + √3 i) × (1 − √3 i) × (√3 − i)
2 2 2
1 –
= (√3 + i)
2
i67 = i64 × i3
= 1 × (−i)
= −i
1 –
z 95 + i67 = (√3 + i) − i
2
1 –
= (√3 − i)
2
=z
97
(z 95 + i67 ) = z 97 = z 95 × z 2
1 – 1 –
= (√3 + i) × (1 − √3 i)
2 2
1 –
= (√3 − i)
2
=z
Hence, option a is the correct answer.
15 votes -- Pragy Agarwal (18.3k points)
In the left figure, these 2 possibilities are shown for point y. The angle between lines ox and oy is 120∘ and 240∘ .
We do the same thing for point z, so, divide by y both sides in x + y + z = 0 and do the same thing as above and we get the
middle figure. Now, out of 2 possibilities for each y and z, if we fix y then the other will be z, and suppose, we get the figure
which is on the right side.
In the figure which is on the right side, since ox = oy, so angle between lines oy & yx and lines ox & yx will be same and
it will be of 30∘ because angle between ox and oy is 120∘ .
If we do the same for triangles yoz and zox, we get all 3 angles ∡zyx, ∡yxz, ∡xzy = 60∘ .
Hence, Option (B)
1 votes -- ankitgupta.1729 (15.2k points)
reiθ2
z1
θ1 −θ3
)
−2 sin2 ( )+i sin(θ1 –θ3 )
= arg( 2
θ2 −θ3
−2 sin2 ( 2
)+i sin(θ2 –θ3 )
∴= π + tan−1 ( )– π– tan−1 ( )
sin(θ1 –θ3 ) sin(θ2 –θ3 )
θ −θ θ2 −θ3
−2 sin2 ( 1 2 3 ) −2 sin2 ( 2
)
= −( θ3 –2θ1 ) + θ3 –θ2
2 = θ1 –θ2
2
(θ1 –θ2 )
Therefore, arg( zz12 ) = (θ1 – θ2 ) and arg( zz12−–zz33 ) = 2
Answer: A
1 votes -- ankitgupta.1729 (15.2k points)
Let f(x) = 2x . Consider the following inequality for real numbers a, b and 0 < λ < 1 :
f(λa + b) ≤ λf(a) + (1 − λ)f( 1−λ
b ).
1. λ = 0.5
2. 0 < a ≤ 2, b > 0
3. a/λ > 2, 0 < b ≤ 1 − λ
A. The above inequality holds under conditions (1) and (2) but not under condition (3).
B. The above inequality holds under conditions (2) and (3) but not under condition (1).
C. The above inequality holds under conditions (1) and (3) but not under condition (2).
D. The above inequality holds under all the three conditions.
E. The above inequality holds under none of the three conditions.
A certain pair of used shoes can be repaired for Rs.1250 and will last for 1 year. A pair of the same kind of shoes can
be purchased new for Rs.2800 and will last for 2 years. The average cost per year of the new shoes is what percent
greater than the cost of repairing the used shoes?
A. 5 B. 12 C. 15 D. 3 E. 24
tifr2012 cost-market-price
% greater of new shoes cost than the cost of repaired shoes (1400 − 1250/1250) = 12% (option b)
5 votes -- khush tak (5.9k points)
How many integers from 1 to 1000 are divisible by 30 but not by 16?
A. 29 B. 31 C. 32 D. 33 E. 25
tifr2010 quantitative-aptitude factors
Answers: Factors
Now, since LCM of 30, 16 = 240 , only the numbers that are divisible by 240 between 1 to 1000 will divisible by both 30
& 16.
So, number of integers between 1 to 1000 that are divisible by 240 (i.e., divisible by both 30 and 16 = ⌊ 1000
240 ⌋ = 4.
So, total number of integers that are divisible by 30 but not divisible by 16 = 33 − 4 = 29.
15 votes -- Anurag Pandey (10.5k points)
Exponent of p in n!, where p is a prime number, and n is an integer greater than p is:
Ep (n!) = ⌊ ⌋ + ⌊ 2 ⌋ + ⌊ 3 ⌋ + ⋯ + ⌊ S ⌋
n n n n
p p p p
So,
= 33 + 11 + 3 + 1 + 0
= 48
Correct Answer: D
16 votes -- sonu (1.8k points)
1000
Divisible by 3 = = 333
3
1000
Divisible by 7 = = 142
7
1000 1000
Divisible by both = = = 47
LCM OF 3 & 7 21
n(A ∪ B) = n(A) + n(B) − n(A ∩ B)
= 333 + 142 − 47 = 428.
Correct Answer: D
9 votes -- Umang Raman (12.2k points)
A large community practices birth control in the following peculiar fashion. Each set of parents continues having
children until a son is born; then they stop. What is the ratio of boys to girls in the community if, in the absence of birth
control, 51% of the babies are born male?
A. 51 : 49 B. 1 : 1 C. 49 : 51 D. 51 : 98 E. 98 : 51
tifr2014 quantitative-aptitude fractions tricky
A suitcase weighs one kilogram plus half of its weight. How much does the suitcase weigh?
A. 1.3333 ... kilograms B. 1.5 kilograms
C. 1.666 ... kilograms D. 2 kilograms
E. cannot be determined from the given
data
tifr2017 quantitative-aptitude fractions normal
Answers: Fractions
In the community we know that each set of parents will have exactly 1 boy.
The number of girls might differ.
To find the ratio of boys to girls in the community, we are going to find the the expected number of girls that each parent set
can have.
Henceforth in this question we are going to use the word "family" to denote a "parent set".
Now the expected number of girls in any family will be denoted by E [X] .
Here,
E [X] = ∑∞
i=0 i ⋅ P (X = i) .
but P (X = i) = (0.49)i (0.51) . So, we get,
E [X] = ∑∞ i
i=0 i ⋅ (0.49) (0.51) .
This implies E [X] = (0.51) ∑∞ i
i=0 i ⋅ (0.49) .
The formula for summation of series of type ∑∞
k=0 k ⋅ x can be found by differentiating
k
∑∞ k
k=0 x with respect to x.(See the reference below).
This gives
∑∞
k=0 k ⋅ x =
k x
(x−1)2
So, ∑∞
i=0 i ⋅ (0.49) =
i 0.49
(0.49−1)2
Hence,
E [X] = (0.51) ⋅ 0.49 = 0.49
(0.51)2 0.51
Now the ratio of boys to girls can be given by number of boys in each family/expected number of girls in each family.
i.e., Ratio (B to G) = 1
E[X]
So, Ratio (B to G) = 1 = 51
0.49 49
0.51
D. 2 Kg
Let x be the weight of suitcase.
A suitcase weighs one kilogram plus half of its weight. So,
(1 + x/2 = x) ⟹ x = 2.
13 votes -- Prajwal Bhat (7.6k points)
Suppose there is a sphere with diameter at least 6 inches. Through this sphere we drill a hole along a diameter. The part
of the sphere lost in the process of drilling the hole looks like two caps joined to a cylinder, where the cylindrical part
has length 6 inches. It turns out that the volume of the remaining portion of the sphere does not depend on the diameter of the
sphere. Using this fact, determine the volume of the remaining part.
A. 24π cu. inches B. 36π cu. inches
C. 27π cu. inches D. 32π cu. inches
E. 35π cu. inches
tifr2010 quantitative-aptitude geometry
Let ABC be a triangle with n distinct points inside. A triangulation of ABC with respect to the n points is obtained by
connecting as many points as possible, such that no more line segments can be added without intersecting other line
segments. In other words ABC has been partitioned into triangles with end points at the n points or at the vertices A,B,C. For
example, the following figure gives one possible triangulation of ABC with two points inside it.
Although there are many different ways to triangulate ABC with the n points inside, the number of triangles depends only on
n. In the above figure it is five. How many triangles are there in a triangulation of ABC with n points inside it?
A. 3n − 1 B. n2 + 1 C. n + 3 D. 2n + 1 E. 4n − 3
tifr2012 quantitative-aptitude geometry
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
The late painter Maqbool Fida Husain once coloured the surface of a huge hollow steel sphere, of radius 1 metre, using
just two colours, Red and Blue. As was his style however, both the red and blue areas were a bunch of highly irregular
disconnected regions. The late sculptor Ramkinkar Baij then tried to fit in a cube inside the sphere, the eight vertices of the
cube touching only red coloured parts of the surface of the sphere. Assume π = 3.14 for solving this problem. Which of the
following is true?
A. Baij is bound to succeed if the area of the red part is 10sq. metres;
B. Baij is bound to fail if the area of the red part is 10sq. metres;
C. Baij is bound to fail if the area of the red part is 11sq. metres;
D. Baij is bound to succeed if the area of the red part is 11sq. metres;
E. None of the above.
1
Consider a circle with a circumference of one unit length. Let d < . Suppose that we independently throw two arcs,
6
each of length d, randomly on this circumference so that each arc is uniformly distributed along the circle circumference. The
arc attaches itself exactly to the circumference so that arc of length d exactly covers length d of the circumference. What can
be said about the probability that the two arcs do not intersect each other?
A. It equals (1 − d) B. It equals (1 − 3d)
C. It equals (1 − 2d) D. It equals 1
E. It equals (1 − d) (1 − d)
tifr2015 geometry
Consider a square of side length 2. We throw five points into the square. Consider the following statements:
A. (i) only B. (ii) only C. (iii) only D. (ii) and (iii) E. None of the above
tifr2015 geometry quantitative-aptitude easy
A set of points S ⊆ R2 is convex if for any points x, y ∈ S , every point on the straight line joining x and y is also in
S . For two sets of points S, T ⊂ R2 , define the sum S + T as the set of points obtained by adding a point in S to a
p o i n t T . That is, S + T := {(x1 , x2 ) ∈ R2 : x1 = y1 + z1 , x2 = y2 + z2 , (y1 , y2 ) ∈ S, (z1 , z2 ) ∈ T} . Similarly,
S − T := {(x1 , x2 ) ∈ R2 : x1 = y1 − z1 , x2 = y2 − z2 , (y1 , y2 ) ∈ S, (z1 , z2 ) ∈ T} is the set of points obtained by
subtracting a point in T from a point in S . Which of the following statements is TRUE for all convex sets S, T ?
In a tutorial on geometrical constructions, the teacher asks a student to construct a right-angled triangle ABC where the
hypotenuse BC is 8 inches and the length of the perpendicular dropped from A onto the hypotenuse is h inches, and
offers various choices for teh value of h. For which value of h can such a triangle NOT exist?
–
A. 3.90 inches B. 2√2 inches
–
C. 2√3 inches D. 4.1 inches
E. none of the above
tifr2017 quantitative-aptitude geometry
Consider a point A inside a circle C that is at distance 9 from the centre of a circle. Suppose you told that there is a
chord of length 24 passing through A with A as its midpoint. How many distinct chords of C have integer length and
pass through A?
A. 2 B. 6 C. 7 D. 12 E. 14
tifr2018 quantitative-aptitude geometry
Answers: Geometry
Any polygon can be split into triangles, so any n−triangulate for any n will always be composed of triangles.
Given an (n − 1) triangulate, we can add the point in the following three ways:
I. The point lies on a point that is already there. In this case, the point has already been connected to all possible vertices
that it can be connected to (since we started with a (n − 1) triangulate). Example:
II. The point lies on a line that is already there, but not on a point. In this case, since the line is the common edge of at
most 2 triangles, the point can only be connected to 2 vertices (the opposite ends of the triangles). For example:
III. This creates 4 new triangles, but destroys the original 2 triangles. Thus, the number of triangles increase by 2. This is an
optimal case.
IV. The point lies inside of a triangle. The new point can then be connected to exactly 3 vertices of the bounding triangle.
Example:
V. This creates 3 new triangles, but destroys the original triangle. So, the number of triangles increase by 2. So, this is also
an optimal case.
We can see that the nth triangulate has exactly 2 more triangles than the (n − 1)th triangulate.
This gives us the following recurrence:
T(n) = 2n + 1
A similar problem which is used to solve the given question is given in the following link :
Question No. 9 here.
The solution is explained for the given problem by TA as :
Black colored surface : x%
White colored surface : (100 − x)% = y% = y/100
So, x + y = 100
Now, probability that a particular vertex has black color is = x
100
y
and probability that a particular vertex has white color is = 100
Now, define a random variable Xi as :
th
{
if vertex is colored white
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 178 of 278
Two points on the circumference of any circle divides the circle in two arcs, the length of smaller arc must be less than or
equal to half of the circumference, & length of the larger arc must be greater than or equal to half the circumference.
but since here given length of the arc under consideration is strictly less than 1, so henceforth in this answer, whenever I will
2
use the term "arc", I'll be referring to the smaller of those two arcs.
Process of Arc drawing: I am going to follow a specific procedure for drawing any arc of length d, which is as follows:
1. Pick any point on the circumference of the circle, this will be the starting point.
2. Move d units CLOCKWISE on the circumference of the circle & mark that point as the finishing point.
Suppose we choose our first arc AB of length d, randomly anywhere on the circumference on the circle.
Here A is the starting point & B is the end point.
After drawing the arc AB, we have to draw another arc P Q on the circle of length d, where P will be the starting point & Q
will be the end point.
Now if we have to make sure that arc P Q does not intersects with arc AB, we have to keep following things in mind hile
choosing our starting point P :
1. P can not lie within arc AB, otherwise AB and P Q will intersect each other.
2. P can not lie anywhere within the anticlockwise distance d from the point A other wise, end part of arc P Q will
intersect with starting part of arc AB.
So, we can conclude that "If P lies anywhere on the circumference of the circle within a distance d from A then the arc P Q
& AB will intersect."
P lies at least d distance away from A
So P robability (Arc PQ does not intersects with Arc AB) = P lies anywhere in the circumference
1−2d
⇒ P robability (Arc PQ does not intersects with Arc AB) = 1 = (1 − 2d) .
8 votes -- Anurag Pandey (10.5k points)
1. Not necessarily true. There can be a line connecting a pair of points such that two other points lie on one side of
the line and the remaining point on the other.
2. This is also not necessarily true as even all the 5 points can be collinear (lie on same line).
3. This is TRUE.
We are given a square of side 2 and so it takes 2 × 2 square units of area. This area can be divided into 4 equal squares
of side 1 taking an area of 1 square units each. The maximum separation of two points in each square is the diagonal of
–
the small square which is √2. This means we cannot put more than 2 points in each of these squares and since we have 5
points and only 4 such squares, at least one square must have more than 1 points (Pigeonhole Principle) which means
–
there are at most √2 units apart.
Now since the points are set therefore the closure property would hold on union and intersection because the space will move
accordingly.
Note : Take a bunch of points as set and try to perform the operation b/w those sets all points will come in linear
straight line therefore it will be convex too.
3 votes -- Akshay Saxena (8.3k points)
also, AC2+AB2 = BC 2
AC2+AB2 = 64
Since, AM>= GM
(AC2+AB2)/2 >= AC*AB
Hence, AC*AB <= 32
Therefore, area <= 16
Hence, 4*h <= 16
=> h <=4
Therefore, option (d) is correct.
6 votes -- tarun_svbk (1.4k points)
Since A is the midpoint of the chord, the diameter bisects it. The diameter of the circle is 30 (Using Pythagoras
Theorem). It is the shortest chord that passes through A and the longest chord is the diameter. All the integers
between 24 and the diameter i.e. 30 account for 2 distinct chords. This is a consequence of Intermediate Value Theorem i.e.,
the length of the chord is a decreasing function of the smaller of the angles it makes with the diameter. Therefore we have the
number of distinct chords as : 1 + 1 + 2 × (30 − 24 − 1) = 12.
Correct Option: D.
11 votes -- krish__ (4.6k points)
A table contains 287 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. 8 B. 9
C. 10 D. Cannot be determined from the given
information.
E. None of the above.
tifr2010 quantitative-aptitude theory-of-computation logarithms
Answers: Logarithms
In order to encode all the information of a row/entry, we must know what is the size of that information.But it is not
mentioned in the question.
but we CAN NOT ENCODE an entry, without knowing the size of that entry
So I don't think it is possible to tell how many bits are required to encode & transmit an entry unless any information is given
about the data contained in entries.
8 votes -- Anurag Pandey (10.5k points)
How many proper divisors (that is, divisors other than 1 or 7200) does 7200 have ?
A. 18 B. 20 C. 52 D. 54 E. 60
tifr2019 modular-arithmetic quantitative-aptitude
A. 00 B. 13 C. 30 D. 33 E. 73
tifr2019 modular-arithmetic quantitative-aptitude
Let m and n be two positive integers. Which of the following is NOT always true?
9 votes -- (points)
1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120.
After 4, factorials of all numbers end in 0.
So, unit digit = Unit digit of (1+2+6+4) = Unit digit of 13 = 3 .
6! = 720, 7! = _ _40, 8! = _ _ 20, 9! = _ _ 80, 10! = _ _ _ 800.
After 9, factorials of all numbers end in 00.
Tens digit = Unit digit of (1+2+2+2+4+2+8) = Unit digit of 21 = 1 .
Last 2 digits = 13.
Source: https://www.quora.com/What-are-the-last-2-digits-of-1-2-3-100
References
Consider m and n are not co-primes. Then this result will not hold.
For example, m = 9, n = 3
93−1 mod 3 ≠ 1
5 votes -- Manoja Rajalakshmi Aravindakshan (7.7k points)
Let N be the sum of all numbers from 1 to 1023 except the five primes numbers: 2, 3, 11, 17, 31. Suppose all numbers
are represented using two bytes (sixteen bits). What is the value of the least significant byte (the least significant eight
bits) of N ?
This is another way of saying , what will be the remainder when N is divided by 28 = 256 ?
1024
Here N = 1023 × − (2 + 3 + 11 + 17 + 31)
2
= 1023 × 512 − 64
So option e) is correct.
13 votes -- sudipta roy (381 points)
The sum of the first n terms of the series 1, 11, 111, 1111, … , is.
1 1
A. 81 (10n+1 − 9n − 10) B. n
81 (10 − 9n)
1 1
C. 9 (10n+1 − 1) D. 9 (10
n+1
− n10n )
E. None of the above
tifr2011 quantitative-aptitude number-series
Let sgn(x) = {
+1 if x ≥ 0
−1 if x < 0
What is the value of the following summation?
50
∑ sgn((2i − 1)(2i − 3) … (2i − 99))
i=0
A. 0 B. −1 C. +1 D. 25 E. 50
tifr2013 quantitative-aptitude number-series
Consider a sequence of non-negative numbers xn : n = 1, 2, . . . . Which of the following statements cannot be true?
A. ∑∞
n=1 xn = ∞ and ∑∞ 2
n=1 xn = ∞ .
B. ∑∞
n=1 xn
∞
= ∞ and ∑n=1 x2n < ∞ .
C. ∑∞
n=1 xn < ∞ and ∑∞ 2
n=1 xn < ∞ .
D. ∑∞
n=1 xn
∞ 2
≤ 5 and ∑n=1 xn ≥ 25 .
E. ∑∞
n=1 xn < ∞ and ∑∞ 2
n=1 xn = ∞ .
S = (1 + 11 + 111 + ⋯ n terms)
1
= × (9 + 99 + 999 + ⋯ n terms)
9
1
= (((10 − 1) + (100 − 1) + (1000 − 1) + ⋯ n terms))
9
1
= (((10 + 100 + ⋯ 10n ) − (1 + 1 + ⋯ n terms)))
9
1 10n+1 − 10
= ( − n)
9 10 − 1
1 10n+1 − 10 − 9n
= ( )
9 9
10n+1 − 9n − 10
=
81
So, the correct answer is option A.
13 votes -- Pooja Palod (24.1k points)
i = 0, sgn((−1)(−3) … (−99)) = +1
Because we know that there are 50 terms present in product which is an even number so it will be +1.
i = 1, sgn((1)(−1) … (−97)) = −1
Because in product there are 49 negative terms and 1 term is positive, answer will be negative.
From i = 0 and i = 1, we understood that summation is giving +1 for even values of i and −1 for odd values of i.
We note that:
1 1 5−1
= ⋅( )
1×3×5 4 1×3×5
1 1 1
= ⋅( − )
4 1×3 3×5
Now, we can rewrite the original series as a Telescoping series and simplify as follows:
1 1 1
( + + + ⋯)
1×3×5 3×5×7 5×7×9
1 1 1 1 1 1 1
= ⋅( − + − + − + ⋯)
4 1×3 3×5 3×5 5×7 5×7 7×9
= ⋅(
1 1 1 1 1 1 1
− + − + − + ⋯)
4 1×3 3×5 3×5 5×7 5×7 7×9
1 1
= ⋅( )
4 1×3
1
=
12
Hence (D) is the Answer.
17 votes -- Leen Sharma (28.7k points)
I think (b) could be the answer, because if summation of Xn=infinite,then summation of Xn^2 cannot be less than Xn
value
1 votes -- srestha (85.3k points)
1 − (z 10 )10
n
=
1 − z 10
n
(n+1)
1 − z 10
=
1 − z 10
n
10 (n+1)
1−z
Mn (z) =
1 − z 10
n
Now,
∏∞
i=0 Mi (z) = M0 (z)×M1 (z)×M2 (z)× …
=( ) ( ) ( ) ( ) ( )×…
1 2 3 (k+1)
1 − z 10 1 − z 10 1 − z 10 1 − z 10 1 − z 10
k
0
× 1
× 2
× … × (k−1)
×
1 − z 10 1 − z 10 1 − z 10 1 − z 10
k
1 − z 10
1
=
1−z
for ending terms, as |z| < 1, z ∞ tends to 0, 1 − z ∞ tends to 1.
Correct Answer: B
7 votes -- Praveen Saini (42k points)
s0 = s1 + 1
2si = si−1 + si+1 + 2 for 1 ≤ i ≤ 8
2s9 = s8 + 2
What is s0 ?
What is the maximum number of regions that the plane R2 can be partitioned into using 10 lines?
A. 25 B. 50 C. 55 D. 56 E. 1024
Hint: Let A(n) be the maximum number of partitions that can be made by n lines. Observe that
A(0) = 1, A(2) = 2, A(2) = 4 etc. Come up with a recurrence equation for A(n).
s0 = s1 + 1 → (1)
2si = si−1 + si+1 + 2 for 1 ≤ i ≤ 8 → (2)
2s9 = s8 + 2 → (3)
Now,
2s8 = s7 + s9 + 2
2s7 = s6 + s8 + 2
2s6 = s5 + s7 + 2
2s5 = s4 + s6 + 2
2s4 = s3 + s5 + 2
2s3 = s2 + s4 + 2
2s2 = s1 + s3 + 2
2s1 = s0 + s2 + 2
Adding all the terms, and we get
2(s8 + s7 + s6 + s5 + s4 + s3 + s2 + s1 ) = s7 + s9 + 2 + s6 + s8 + 2 + s5 + s7 + 2 + s4 + s6 + 2 + s3 + s5 + 2 + s2 +
⟹ s8 + s1 = s9 + s0 + 16
Given that : 2s9 = s8 + 2 ⟹ s8 = 2s9 − 2
⟹ 2s9 − 2 + s0 − 1 = s9 + s0 + 16
⟹ s9 = 19 → (4)
Now, again
2s1 = s0 + s2 + 2
From the equation (1), we get
s1 = s0 − 1
2(s0 − 1) = s0 + s2 + 2
⟹ 2s0 − 2 = s0 + s2 + 2
⟹ s0 = s2 + 4
⟹ s2 = s0 − 4(1 + 3)
2s2 = s1 + s3 + 2
2(s0 − 4) = s0 − 1 + s3 + 2
⟹ 2s0 − 8 = s0 − 1 + s3 + 2
⟹ s0 = s3 + 9
⟹ s3 = s0 − 9(4 + 5)
2s3 = s2 + s4 + 2
2(s0 − 9) = s0 − 4 + s4 + 2
⟹ 2s0 − 18 = s0 − 4 + s4 + 2
⟹ s0 = s4 + 16
⟹ s4 = s0 − 16(9 + 7)
Similarly,
⟹ s5 = s0 − 25(16 + 9)
⟹ s6 = s0 − 36(25 + 11)
⟹ s7 = s0 − 49(36 + 13)
⟹ s8 = s0 − 64(49 + 15)
⟹ 2s9 − 2 = s0 − 64
Put the value of s9 from the equation (4) and we get
s0 = 2(19) − 2 + 64 = 36 + 64 = 100.
So, the correct answer is (C).
0 votes -- Lakshman Patel (69.5k points)
The recurrence is given by A(n) = A(n − 1) + n. Each new nth line drawn is creating n new partitions. While
creating partitions,draw the new line in such a way that it cuts the all the previously drawn n − 1 lines, then the nth
line will create n new partitions and previous A(n − 1) partitions will remain the same.
A(4) = A(3) + 4 = 7 + 4 = 11
⋮ ⋮ ⋮
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 187 of 278
⋮ ⋮ ⋮
A(10) = A(9) + 10 = 46 + 10 = 56
P.S. Try dividing R2 by n = 3, n = 4, n = 5 lines using the method above, you'll get the idea.
2 votes -- Sourajit25 (2k points)
Consider the equation x2 + y 2 − 3z 2 − 3t2 = 0 . The total number of integral solutions of this equation in the range
of the first 10000 numbers, i.e., 1 ≤ x, y, z, t ≤ 10000 , is
The Square of a natural number other than one is either a multiple of 3 or exceeds a multiple of 3 by 1.
In other words, a perfect square leaves remainder 0 or 1 on division by 3.
Given equation is
x2 + y 2 = 3(z 2 + t2 ) This implies x2 + y 2 would be a multiple of 3.
There are 4 possibilities for x2 and y 2
A marine biologist wanted to estimate the number of fish in a large lake. He threw a net and found 30 fish in the net.
He marked all these fish and released them into the lake. The next morning he again threw the net and this time caught
40 fish, of which two were found to be marked. The (approximate) number of fish in the lake is:
X + 2Y → 3Z
2X + Z → Y .
Let nX , nY , nZ denote the numbers of molecules of chemicals X, Y , Z in the reaction chamber. Then which of the following
is conserved by both reactions?
A. nX + nY + nZ . B. nX + 7nY + 5nZ .
C. 2nX + 9nY − 3nZ . D. 3nX − 3nY + 13nZ .
E. None of the above.
tifr2014 quantitative-aptitude numerical-computation
Consider numbers greater than one that satisfy the following properties:
Let tn be the sum of the first n natural numbers, for n > 0 . A number is called triangular if it is equal to tn for some
n. Which of the following statements are true:
i. There exists three successive triangular numbers whose product is a perfect square.
ii. If the triangular number tn is a perfect square, then so is t4n(n+1).
iii. The sum of the reciprocals of the first n triangular numbers is less than 2, i.e.
1 + 1 + 16 +. . . . + t1n < 2
1 3
Let A and B be two containers. Container A contains 50 litres of liquid X and container B contains 100 litres of
liquid Y . Liquids X and Y are soluble in each other.
We now take 30 ml of liquid X from container A and put it into container B. The mixture in container B is then thoroughly
mixed and 20 ml of the resulting mixture is put back into container A.At the end of this process let VAY be the volume of
liquid Y and VBX be the volume of liquid X in container B. Which of the following must be TRUE ?
A. VAY < VBX B. VAY > VBX
C. VAY = VBX D. VAY + VBX = 30
E. VAY + VBX = 20
tifr2019 general-aptitude quantitative-aptitude numerical-computation
The problem given is equivalent to the problem in which an urn contains some number of white balls in it. We take 30 balls
out of it, mark them and put them back into the urn. Now, we randomly take 40 balls out of the urn, 2 of them are found to
be marked. What is the approximate number of balls that were present in the urn initially?
Basically here we need to find the number of molecules are same before and after the reaction ie. the conservation
of mass.
To check that just take options and eliminate one by one. Following is the breakdown of options
In first reaction put the values of option (a) n + 2n = 3n is true for first equation but if we put the values for second
equation, we get 2n + n = n which is not possible. So, option (a) is conserving mass for equation one but not for equation
two.
Similarly, eliminating all the options we can conclude option (b) is correct. As for equation one, n + 2 ∗ 7n = 3 ∗ 5n, for
equation two, 2n + 5n = 7n. So, mass is conserved for both reactions.
Correct option: B
3 votes -- curious_karan (75 points)
(2 − 1) divides 30 ✓
However, (3 − 1) divides 30 ✓ and thus it doesn't satisfy the 2nd constraint.
(5 − 1) divides 30 ×
One can prove that for n to satisfy these properties, n = p(p − 1) for some prime p and that (p − 1) satisfies the properties
too.
2
2×3= 6
6 × 7 = 42
42 × 43 =1806
Now 1807 is not a prime and hence breaks the sequence. So, number of such numbers is 4.
Correct Answer: E.
6 votes -- Pragy Agarwal (18.3k points)
n(n + 1)
Triangular number, tn =
2
Product of three consecutive Triangular numbers , tm × tm+1 × tm+2
m(m + 1) 2 m(m + 3)
=( ) ×( )
2 2
At m = 3, t3 × t4 × t5 is a perfect square.
(i) is True.
(4n2 + 4n)(4n2 + 4n + 1)
t4n(n+1) = t4n2 +4n =
2
n(n + 1)
= 4 × (2n + 1)2 × = 22 × (2n + 1)2 × tn
2
If tn is a perfect square, then t4n(n+1) is also a perfect square
(ii) is True
1 1 1 1 1
+ + + +…+
1 3 6 10 tn
2 2 2 2 2
= + + + +…+
1.(1 + 1) 2.(2 + 1) 3.(3 + 1) 4.(4 + 1) n. (n + 1)
1 1 1 1 1
=2×( + + + +…+ )
1.(1 + 1) 2.(2 + 1) 3.(3 + 1) 4.(4 + 1) n. (n + 1)
1 1 1 1 1
=2×( + + + +…+ )
1.2 2.3 3.4 4.5 n. (n + 1)
1 1 1 1 1 1 1 1 1 1
= 2 × (( − )+( − )+( − )+( − )+…+( − ))
1 2 2 3 3 4 4 5 n (n + 1)
1
= 2 × (1 − )
(n + 1)
n
=2×
n+1
n n
for any n > 0 , will be < 1, so 2 × will be < 2.
n+1 n+1
1 1 1 1 1
So, + + + +…+ <2
1 3 6 10 tn
Correct Answer: D
20 votes -- Praveen Saini (42k points)
In Container B :
In Container B :
30 − ( 30 ∗ 20) = 3000300
30 ∗ 20) =
Volume of X (VBX ) = 30 − ( 100030 3000300
100030
Consider polynomials in a single variable x of degree d. Suppose d < n/2 . For such a polynomial p(x), let Cp denote
the n-tuple (P (i))1≤i≤n . For any two such distinct polynomials p, q, the number of coordinates where the tuples
Cp , Cq differ is.
A. At most d B. At most n − d
C. Between d and n − d D. At least n − d
E. None of the above.
tifr2013 polynomials non-gate
Answers: Polynomials
let p(x)=x and q(x)=2x-1 these are two polynomials of degree 1 suppose n=4 so n/2=2 so d<n/2 both these
polynomials are satisfying these relation of degree if we put different values p(1) will be same for both the
polynomials but p(2), p(3),p(4) will be different for both the polynomials hence 3 different values 1 same value hence i can
say that n-d that 4-1=3 differ values. Hence option d is the answer.
0 votes -- Yash wadhwani (831 points)
Let n > 1 be an odd integer. The number of zeros at the end of the number 99n + 1 is
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?
1 1
A. 3 B. 2 C. 1 D. ( ) E. ( )
2 3
tifr2013 quantitative-aptitude combinatory
For odd n,
Alternative way:
99 × 01 = 99
99 × 099 = 9801
99 × (…)801 = (…)299
99 × (…)299 = (…)601
99 × (…)601 = (…)499
99 × (…)499 = (…)401
99 × (…)401 = (…)699
99 × (…)699 = (…)201
99 × (…)201 = (…)899
99 × (…)899 = (…)001
Thus, 99n always ends in a 99 when n is odd, but never in a 999.
Hence, 99n + 1 will always end with exactly 2 zeros.
Note: We couldn't just say that 993 + 1 ends with exactly 2 zeros, so b must be correct. This is because we also have an
option e which says None of the above. Had it not been there, we could have marked b without having to prove that the
pattern will continue.
Correct Answer: B
13 votes -- Pragy Agarwal (18.3k points)
ηladdoo = 6 (1 + 2 + 3)
ηmouse = 4 (22 )
As we continue we get a series which depends upon the no. of lines per direction (let say l)
l(l+1)
So, ηladdoo = 2
2
ηmouse = (l − 1)
η
lim laddoo = 1/2.
l→∞ ηmouse
A large community practices birth control in the following peculiar fashion. Each set of parents continues having
children until a son is born; then they stop. What is the ratio of boys to girls in the community if, in the absence of birth
control, 51% of the babies are born male?
A. 51 : 49 B. 1 : 1 C. 49 : 51 D. 51 : 98 E. 98 : 51
tifr2012 quantitative-aptitude ratio-proportion
A body at a temperature of 30 Celsius is immersed into a heat bath at 0 Celsius at time t = 0 . The body starts cooling
at a rate proportional to the temperature difference. Assuming that the heat bath does not change in temperature
throughout the process, calculate the ratio of the time taken for the body to reach 1 Celsius divided by the time taken for the
body to reach 5 Celsius.
log 29
A. log 5 B. C. e5 D. 1 + log6 5 E. None of the above
log 25
tifr2014 quantitative-aptitude ratio-proportion
ϵ1 is positive.
In the formula for ϵn+1 , we only add, multiply and divide positive numbers. Thus, all ϵn are positive.
Also, ϵn+1 < ϵn
Proof:
20 ⋅ ϵn
ϵn+1 − ϵn = − ϵn
20 + ϵn
20 ⋅ ϵn − 20 ⋅ ϵn − (ϵn )2
=
20 + ϵn
−(ϵn )2
=
20 + ϵn
<0
ϵn+1 − ϵn <0
ϵn+1 < ϵn
Thus, the sequence is decreasing.
Since the sequence is decreasing and is bounded below by 0, we know that the sequence converges (Monotone Convergence
Theorem).
The only fixed point of the sequence can be found as follows:
20 ⋅ ϵf
ϵf =
20 + ϵf
20 ⋅ ϵf + (ϵf )2 = 20 ⋅ ϵf
(ϵf )2 = 0
ϵf = 0
Hence, the sequence converges to 0.
Option a is correct.
2 votes -- Pragy Agarwal (18.3k points)
Walking at 4/5 is normal speed a man is 10 minute too late. Find his usual time in minutes.
A. 81
B. 64
C. 52
D. 40
E. It is not possible to determine the usual time from given data.
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 h takes time t to reach the ground. On planet TIFR, how much time would an object dropped
from height h take to reach the ground?
–
A. ( –) D. ( ) E. ( )
t h h
B. √2t C. 2t
√2 t 2t
tifr2017 quantitative-aptitude speed-time-distance
d = st → (1)
4
d= × s(t + 10) → (2)
5
From (1) and (2)
5
t − t = 10
4
So, t = 40
Ans is d.
5 votes -- Pooja Palod (24.1k points)
g
and the acceleration due to gravity on TIFR = G = .
2
−−
−
2h
Time taken to reach the ground on earth = t = √ .
g
−−
− −−
−
2h 4h
Similarly, on TIFR planet, time taken = T = √ .= √ .
G g
–
⇒ T = √2t.
Let A and B be non-empty disjoint sets of real numbers. Suppose that the average of the numbers in the first set is μA
and the average of the numbers in the second set is μB ; let the corresponding variances be vA and vB respectively. If
the average of the elements in A ∪ B is μ = p. μA + (1 − p). μB , what is the variance of the elements in A ∪ B?
A. p. vA + (1 − p). vB
B. (1 − p). vA + p. vB
C. p. [vA + (μA − μ)2 ] + (1 − p). [vB + (μB − μ)2 ]
D. (1 − p). [vA + (μA − μ)2 ] + p. [vB + (μB − μ)2 ]
E. p. vA + (1 − p). vB + (μA − μB )2
tifr2015 statistics
Answers: Statistics
1 n
We have v = ∑(xi − μ)2
n i=1
1 n
= ∑ [x2 − 2xi μ + μ2 ]
n i=1 i
1 n 2 1 n
= ∑ xi − 2μ ∑ xi + μ2
n i=1 n i=1
1 n 2
= ∑ x − 2μ2 + μ2
n i=1 i
1 n 2
= ∑ x − μ2
n i=1 i
Thus,
(∑ x2i ) − μ2A
nA
1
vA = → (1)
nA i=1
(∑ x2i ) − μ2B
nB
1
vB = → (2)
nB i=1
(∑ x ) − μ2
1 n 2
v=
n i=1 i
(∑ xi + ∑ x2i ) − μ2
1 nA 2 nB
=
n i=1 i=1
1
= (nA (vA + μ2A ) + nB (vB + μ2B )) − μ2 (From (1) and (2))
n
n n
= A (vA + μ2A − μ2 ) + B (vB + μ2B − μ2 ) (Since, nA + nB = n)
n n
= p[vA + μ2A − μ2 ] + (1 − p)[vB + μ2B − μ2 ] (Since, nnA = p)
= p[vA + (μA − μ)2 + 2μμA − 2μ2 ] + (1 − p)[vB + (μB − μ)2 + 2μμB − 2μ2 ]
= p[vA + (μA − μ)2 ] + (1 − p)[vB + (μB − μ)2 ] + 2pμμA + 2(1 − p)μμB − 2μ2
= p[vA + (μA − μ)2 ] + (1 − p)[vB + (μB − μ)2 ] + 2μ [pμA + (1 − p)μB ] − 2μ2
= p[vA + (μA − μ)2 ] + (1 − p)[vB + (μB − μ)2 ] + 2μ2 − 2μ2
= p[vA + (μA − μ)2 ] + (1 − p)[vB + (μB − μ)2 ]
So, Correct option C.
Consider the following subset of R3 (the first two are cylinder, the third is a plane):
C1 = {(x, y, z) : y 2 + z 2 ≤ 1} ;
C2 = {(x, y, z) : x2 + z 2 ≤ 1} ;
H = {(x, y, z) : z = 0.2} ;
The intersection of two perpendicular cylinders forms a solid called Steinmetz Solid. And the intersection with the
plane z = 2 can be visualized as below.
The enclosed intersection is a square of sides a, where a2 = r2 + z 2 (Apply Pythagoras Theorem). And here
−−−−−
a = √1 − z 2 .
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
Syllabus: English grammar, Sentence completion. Verbal analogies, Word groups. Instructions, Critical reasoning and
Verbal deduction
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Min. Avg. Max.
1 Mark 2 2 4 3 2 3 2 4 3 2 2.7 4
Count
2 Marks 1 1 1 2 0 1 1 2 2 0 1.2 2
Count
Total 4 4 6 7 2 5 4 8 7 2 5.2 8
Marks
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 v that satisfies the following constraints:
1. The speed is no more than the speed limit vmax mandated for the highway.
2. The speed is such that when traveling at this speed, it takes at least time t0 (where t0 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 v 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 v and the
density ρ in this model ?
A. B.
C. D.
E.
tifr2019 general-aptitude quantitative-aptitude
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 183, 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?
As cars are moving at constant speed there is no chance of collision until all cars occupy v ∗ t0 space. So upto
certain limit which is v ∗ t0 there is no effect of density of speed. After that, the system seems to follow mass flow
rate equation which implies v ∝ ρ1 . So, C is correct.
References
The last missing page number is 318.Hence number of pages missing is given by 318 − 183+1 = 136 .
Few more points:
Since each sheet has page numbers on front and back.Hence if we start numbering the pages from 1(front) and 2(back) of
the 1st sheet, then odd page numbers will be on front of every sheet and even page number in the back.As given last page
of the missing sheet,hence it should be even page number(8 as last digit)
The +1 for counting the number of pages(as shown above) is for counting page no. 183 as well.
Answer Keys
15.1.1 C 15.1.2 C
Consider the class of object oriented languages. Which of the following is true?
ans is B .in programming language like java when object is created it cannot reside on stack so it uses heap........
A is wrong because pascal is procedure oriented but object pascal is object oriented.
C is also wrong coz we can implement some oops concept through c.
d and e also wrong..........
3 votes -- khamer (333 points)
Answer Keys
16.1.1 B
System calls, Processes, Threads, Inter‐process communication, Concurrency and synchronization. Deadlock. CPU
scheduling. Memory management and Virtual memory. File systems. Disks is also under this
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 4 2 2 2 3 2 2 1 1 1 2.1 4
2 Marks Count 1 3 4 4 3 2 2 4 3 1 2.8 4
Total Marks 6 8 10 10 9 6 6 9 7 6 7.8 10
Assume a demand paged memory system where ONLY THREE pages can reside in the memory at a time. The
following sequence gives the order in which the program references the pages.
1, 3, 1, 3, 4, 2, 2, 4
Assume that least frequently used page is replaced when necessary. If there is more than one least frequently used pages then
the least recently used page among them is replaced. During the program’s execution, how many times will the pages 1, 2, 3
and 4 be brought to the memory?
A. 2, 2, 2, 2 times, respectively B. 1, 1, 1, 2 times, respectively
C. 1, 1, 1, 1 times, respectively D. 2, 1, 2, 2 times, respectively
E. None of the above
tifr2013 operating-system page-replacement
Now for page no. 2 we have fault. We will replace less frequently used I.e. 4
Now page no. 12 and 3 all are used 2 times so, we will replace page 1 to accomodate page 4 (least recently used is 1)
So, page 123 are brought once in memory and page 4 is brought two times so, answer is ( B).
30 votes -- Pooja Palod (24.1k points)
Reading and writing of variables is atomic, but the evaluation of an expression is not atomic.
The set of possible values of variable x at the end of the execution of the program is:
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 = 1, Assume that the two process run forever and that no process stays in its critical and non-critical section
infinitely. A mutual exclusion program is correct if it satisfies the following requirements.
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.
Reading and writing of a variable is atomic, but evaluation of an expression is not atomic. The set of possible values of
variable x at the end of execution of the program is
Consider the following concurrent program (where statements separated by | | with-in cobegin-coend are executed
concurrently).
x:=1
cobegin
x:= x + 1 || x:= x + 1 || x:= x + 1
coend
Reading and writing of variables is atomic but evaluation of expressions is not atomic. The set of possible values of x at the
end of execution of the program is
A. {4} B. {2, 3, 4}
C. {2, 4} D. {2, 3}
E. {2}
tifr2015 process-synchronization operating-system normal
' cobegin
x:= x + 3 || x := x + x + 2
coend
This implies that the two statements x:=x+3 and x :=x+x+2 can execute sequentially as well as parallelly..
Now,
Sequential part :
x := x + 3 || x := x + x + 2
x = 1 ( initial value )
First run x = x + 3 , value of x becomes 4
Now x = 4 , run x = x + x + 2 value of x will be 4 + 4 + 2 = 10
Finally x becomes 10.
Parallel part:
Initialized value of x = 1
Both will take x as 1 initially and then run independently, so
x=x+3=1+3=4
x=x+x+2=1+1+2=4
But final write will be done by the process x = x + x + 2
It will give value 4.
x = x + x + 2 completed its execution before x = x + 3.
Then, x= x+3 will read value of x as 4 and then x = x + 3 i.e. x = 4 + 3 = 7
So, here we get {4, 7}
Final answer is combination of both sequential and parallel part:
which is {4, 7, 10}
Option (C) .
15 votes -- Soumya Jain (12.5k points)
begin
loop
Non_critical_section;
while (Turn!=1) do{
skip od;}
Critical_section_1;
Turn=2;
end loop
end
Process P2 code is
begin
loop
Non_critical_section;
while (turn!=2) do{
skip od;}
Critical_section_2;
Turn=1;
end loop
end
Given assumption
' Assume that the two process run forever and that no process stays in its critical and non-critical section infinitely.
This means that a process will execute its non-critical section for a finite amount of time and it will execute the critical
section for a finite amount of time. But will a process get to execute its critical section in the finite amount of time? let's find
out.!!
Initially Turn=1.
Only one process will be in critical region at any point of time: How? : The process which gets to execute CS must have
completed its while loop. For process P1, this will be true when turn=1 and for process P2 it will be true when turn =2.
However, the turn variable can be only 1 or 2 at a time but not both, means one of the processes among P1 and P2 must be
waiting in while loop, while another one will get to execute CS. So Mutual Exclusion is ensured.
Yes, the program is deadlock free, for the program to be in a deadlock, both the processes should have been executing in
their while loop continuously which is possible only when turn=1 and turn =2 both at the same time which is impossible!!.
Now we need to check whether
' Program is starvation-free; i.e, a process trying to enter the critical region eventually manages to do so.
Focus on the word eventually in the definition of " starvation free". A process eventually manages to enter CS. After how
long does it get to execute CS, it is not told but it is told it will do so. So, starvation-freedom does not ensure bounded
waiting but bounded waiting does ensure starvation freedom because a process will then "eventually" gets to execute
CS (it is mentioned in question that no process stays in CS forever).
Suppose that turn=2. Process P1 will keep waiting in while loop. Process P2 will get to execute CS and it is given in
assumption that CS will be executed for a finite amount of time. Means after a "finite amount of time" process P2 will come
out of CS and set turn=1. This will give chance to process P1. Hence the entry of P1 into CS, it bounded by 1 entry of
process P2 into CS.
The same reasoning goes when turn =1.
So, bounded waiting is being ensured. → "starvation free".
Both the programs are equivalent in the sense that the output will be the same at the end of execution. Q just
writes 1 to u but this will be overwritten by the following write of 0. So, in any computer both P and Q should
produce the same result at the end of execution.
Correct Answer: D
14 votes -- Arjun Suresh (334k points)
i. is a solution to Dining Philosophers problem mentioned in Galvin. Of course this assumes that the number of
forks is 5 and the number of philosophers is 4. This guarantees no deadlock, but starvation is possible as here a
philosopher who finishes his meal can again get access to the forks whereas some philosopher may not get fork ever
leading to his starvation. So, option (C) is TRUE.
ii. is the Dining Philosophers problem with no restriction on the number of philosophers which can cause deadlock and
deadlock implies starvation. So, options (D) and (E) are FALSE.
(E)
As in 1st z = a[j] = y
(a) True. A test and set primitive can be used in place of a semaphore
(b) True (Example: multiple process synchronization to a critical section access)
(c) False. A split binary semaphore is essentially an array of binary semaphores
(http://bluehawk.monmouth.edu/rclayton/web-pages/u03-598/us.html)
(d) False as (a) and (b) are true
(e) False as seen from the definition of inhibitor arc here
(https://en.wikipedia.org/wiki/Petri_net
References
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 $\textit{starvation free} job-
scheduling policy guarantees that no job waits indefinitely for service. Which of the following job-scheduling policies is
starvation free?
A. Round – robin B. Shortest job first
C. Priority queuing D. Latest job first
E. None of the others
tifr2020 operating-system process-scheduling round-robin
Option A) is correct
Consider the blocked-set semaphore where the signaling process awakens any one of the suspended process; i.e.,
Wait (S): If S > 0 then S ← S − 1 , else suspend the execution of this process.
Signal (S): If there are processes that have been suspended on semaphore S , then wake any one of them, else S ← S + 1
Consider the following solution of mutual exclusion problem using blocked-set semaphores.
s := 1;
cobegin
P(1) || P(2) || ..... || P(N)
coend
Answers: Semaphores
There are two concurrent processes lets say P1 and P2, which are trying to to access critical section, by executing P (1) and
P (2) respectively.
Suppose P (1) gets executed first, and it makes s = 0 . when P (2) executes Wait(S) then P2 will be blocked when P 1
executes Signal(S) , there is one suspended process, hence P 2 will be waken up and be placed into ready queue, now it can
execute its critical section. The value of S is still 0, hence ME is satisfied .
There is only 1 process in the suspended state, hence there is no chance that it will starve because as soon as the other
process performs signal operation this process will be waken up.
If N > 2, then there is a chance that multiple processes are blocked, and a random process will be unblocked when a
process perform signal(S) operation, there is a chance that one blocked process is not getting its chance hence it might
starve. So, (E) is not correct option.
PS: A blocked queue semaphore awakens processes in the order they are suspended- hence no starvation even for N > 2 if
used in this question.
21 votes -- Manu Thakur (34k points)
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
A box contains 5 red marbles, 8 green marbles, 11 blue marbles, and 15 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 7 are of the same colour?
A. 7 B. 8 C. 23 D. 24 E. 39
tifr2021
A vertex cover in an undirected graph G is a subset C ⊆ V (G) such that every edge of G has an endpoint in C . An
independent set in G is a subset I ⊆ V (G) such that no edge has both its endpoints in I . Which of the following is
TRUE of every graph G and every vertex cover C of G?
tifr2016
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 1)?
A. 1 B. 2 C. 3 D. 4 E. 5
tifr2021
Let A [i] : i = 0, 1, 2, … , n − 1 be an array of n distinct integers. We wish to sort A in ascending order. We are
given that each element in the array is at a position that is at most k away from its position in the sorted array, that is,
we are given that A[i] will move to a position in {i − k, i − k + 1, … , i, … , i + k − 1, i + k} after the array is sorted in
ascending order. Suppose insertion sort is used to sort this array: that is, in the i th iteration, A[i] is compared with the elements
in positions A[i − 1], A[i − 2], … until one that is smaller is found and A[i] is inserted after that element. Note that elements
can be moved back when later insertions are made before them. Let t(n) be the worst-case number of comparisons made by
insertion sort for such inputs. Then,
A. t (n) = Θ (n2 )
B. t (n) = Θ (n log2 n)
C. t (n) = Θ (nk log k)
D. t (n) = Θ (n log2 k)
E. t (n) = Θ (nk)
tifr2021
Suppose X1a , X1b , X2a , X2b , … , X5a , X5b are ten Boolean variables each of which can take the value TRUE or
FLASE. Recall the Boolean XOR X ⊕ Y := (X ∧ ¬Y ) ∨ (¬X ∧ Y ) . Define the Boolean logic formulas
F := (X1a ∨ X1b ) ∧ (X2a ∨ X2b ) ∧ (X3a ∨ X3b ) ∧ (X4a ∨ X4b ) ∧ (X5a ∨ X5b ),
H := F ∧ G1 ∧ G2 ∧ G3 ∧ G4 ∧ G5 .
A truth assignment to the ten Boolean variables Xia , Xib , 1 ≤ i ≤ 5 is said to be a satisfying assignment if H takes the value
TRUE for example,
is a satisfying assignment,
A. 20 B. 30 C. 32 D. 160 E. 1024
tifr2020
Let L be a singly-linked list X and Y be additional pointer variables such that X points to the first element of L and Y
points to the last element of L. Which of the following operations cannot be done in time that is bound above by a
constant?
tifr2021
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 p (in
meters) is FALSE?
A. p can take all values between 45 and B. p can be 52 for some configuration
50
C. p can take all values between 55 and D. p can be 70 for some configuration
60
E. p can be 39 for some configuration
tifr2016
Consider the sequence ⟨sn : n ≥ 0⟩ defined as follows: s0 = 0, s1 = 1, s2 = 1 , and sn = sn−1 + sn−2 + sn−3 , for
n ≥ 3 . Which of the following statements is FALSE?
A. s4k is even, for any k ≥ 0
B. s4k+1 is odd, for any k ≥ 0
C. s4k+2 is odd, for any k ≥ 0
D. sn is a multople of 3, for only finitely many values of n
E. s4k+3 is even, for any k ≥ 0
tifr2016
print n
if (n > 100) {
return n-10;
}
else {
return mc91(mc91(n+11));
}
}
Let
Out = {n : there is an x ∈ {0, 1, … , 100} such that n is one of the integers printed by mc91(x)}
Then which of the following is Out?
A. {n : −∞ < n ≤ 100} B. {n : 0 ≤ n ≤ 101}
C. {n : 0 ≤ n ≤ 110} D. {n : 0 ≤ n ≤ 111}
E. {n : 0 ≤ n < +∞}
tifr2016
A subset X of Rn is convex if for all x, y ∈ X and all λ ∈ (0, 1) , we have λx + (1 − λ)y ∈ X . If X is a convex set,
which of the following statements is necessarily TRUE?
tifr2016
Let G be an undirected graph. An Eulerian cycle of G is a cycle that traverses each edge of G exactly once. A
Hamiltonian cycle of G is a cycle that traverses each vertex of G exactly once. Which of the following must be true?
tifr2020
Let n ≥ 4 be an integer. Regard the set Rn as a vector space over R. Consider the following undirected graph H .
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?
25
A. 48
5
B. 8
C. 5
12
D. 41
96
55
E. 96
tifr2021
A computer program computes a function f {0, 1}∗ × {0, 1}∗ → {0, 1}∗ . Suppose f(a, b) ahs length ∣b∣2 , where ∣a∣
and ∣b∣ are the lengths of a and b. Suppose, using this program, the following computation is performed.
x="01"
for i=1, ... , n do
x=f("01", x)
Suppose at the end, the length of the string x is t. Which of the following is TRUE (assume $n \geq 10)?
A. t ≤ 2n B. n < t ≤ n2
C. n2 < t ≤ nlog2 n D. nlog2 n < t ≤ 2(2n)
E. 2(2n) < t
tifr2016
An undorected graph G = (V , E) is said to be k-colourable if there exists a mapping c : V → {1, 2, … k} such that
for every edge {u, v} ∈ E we have c(u) ≠ c(v). Which of the following statements is FALSE?
A. G is ∣V ∣ -colourable
B. G is 2-colourable if there are no odd cycles in G
C. G is (Δ + 1)-colourable where Δ is the maximum degree in G
D. There is a polynomial time algorithm to check if G is 2-colourable
E. If G has no triangle then it is 3-colourable
tifr2016
Consider a family F of subsets of {1, 2, … , n} such that for any two distinct sets A and B in F we have: A ⊂ B or
B ⊂ A or A ∩ B = ∅ . Which of the following statements is TRUE? (Hint: what does the Venn diagram of this family
look like?)
tifr2016
Let G be an undirected graph. For a pair (x, y) of distinct vertices of G, let mincut(x, y) be the least number of edges
that should be delted from G so that the resulting graph has no x − y path. Let a, b, c be three vertices in G such that
mincut(a, b) ≤ mincut(b, c) ≤ mathsf mincut(c, a) . Consider the following possibilities:
tifr2016
A clamp gate is an analog gate parametrized by two real numbers a and b, and denoted as clampa,b . It takes as input
two non-negative real numbers x and y. Its output is defined as
clampa,b(x, y) = {
ax + by when ax + by ≥ 0, and
0 when ax + by < 0.
Consider circuits composed only of clamp gates, possibly parametrized by different pairs (a, b) of real numbers. How many
clamp gates are needed to construct a circuit that on input non-negative reals x and y outputs the maximum of x and y?
A. 1
B. 2
C. 3
D. 4
E. No circuit composed only of clamp gates can compute the max function
tifr2020
Let u be a point on the unit circle in the first quadrant (i.e., both coordinates of u are positive). Let θ be the angle
subtended by u and the x axis at the origin. Let ℓu denote the infinite line passing through the origin and u. Consider
the following operation Ou on points in the plane.
Operation Ou
INPUT: a point v on the plane
1. Reflect v in the x axis, obtaining ~
v.
2. Reflect ~
v in ℓu , obtaining v^ .
3. Output v^.
Ifv^ is the output of applying Ou on v, we write Ou (v) = v^ . Further, we denote by Oku the iterates of Ou , i.e.,
1
Ou (v) := Ou (v) and Oku (v) := Ou (Ok−1
u (v)) for all integers k > 1 .
Consider a point v in the first quadrant such that v and the x-axis subtend an angle ϕ at the origin. Define w = O8u (v).
Assuming θ = 5∘ and ϕ = 10∘ , what is the angle subtended by w and the x-axis at the origin?
Consider the context-free grammar below ( ϵ denotes the empty string, alphabet is {a, b}):
p
Consider the following algorithm (Note: For positive integers, p, q, p/q denotes the floor of the rational number , assume
q
that given p, q, p/q can be computed in one step):
Input: Two positive integers a, b, a ≥ b.
Output: A positive integers g.
while(b>0) {
x = a – (a/b)*b;
a = b;
b = x;
}
g = a;
Suppose K is an upper bound on a. How many iterations does the above algorithm take in the worst case?
A particular Panini-Backus-Naur Form definition for a < word > is given by the following rules:
< word >::= < letter >∣< letter > < pairlet >∣< letter > < pairdig >
< pairlet >::= < letter > < letter >∣< pairlet > < letter > < letter >
< pairdig >::= < digit > < digit >∣< pairdig > < digit > < digit >
< letter >::= a ∣ b ∣ c ∣ ⋯ ∣ y ∣ z
< digit >::= 0 ∣ 1 ∣ 2 ∣ ⋯ ∣ 9
Which of the following lexical entities can be derived from < word >?
I. word
II. words
III. c22
A. None of I, II or III B. I and II only C. I and III only D. II and III only E. I, II and III
tifr2020
Given the pseudocode below for the function remains() , which of the following statements is true about the output,
if we pass it a positive integer n > 2 ?
int remains(int n)
{
int x = n;
for (i=(n-1);i>1;i--) {
x = x % i ;
}
return x;
}
Let k1 be the smallest number such that M can be factorized as A ⋅ B, where A is an n × k1 and B is a k1 × m matrix.
Let k2 be the smallest number such that M = ∑ki=1 2
ui vi , where each ui is an n × 1 matrix and each vi is an 1 × m
matrix.
Let k3 be the column-rank of M .
x1 − x2 = 0 x4 − x5 = 0 … x3n−2 − x3n−1 = 0
x2 − x3 = 0 x5 − x6 = 0 x3n−1 − x3n = 0
x1 − x3 = 0 x4 − x6 = 0 x3n−2 = x3n = 0
3n
Let S ⊆ R be the set of solutions to this set of equations. Then,
A. S is empty
B. S is a subspace of R3n of dimension 1
C. S is a subspace of R3n of dimension n
D. S is a subspace of R3n of dimension n − 1
E. S has exactly n elements
tifr2016
Let n, m and k be three positive integers such that n ≥ m ≥ k. Let S be a subset of {1, 2, … , n} of size k. Consider
sampling a function f uniformly at random from the set of all functions mapping {1, … , n} to {1, … , m} . What is
the probability that f is not injective on the set S , i.e., there exist i, j ∈ S such that f(i) = f(j)?
In the following, the binomial coefficient (nk) counts the number of k-element subsets of an n-element set.
k!
A. 1 −
kk
m!
B. 1 − mk
k!(mk)
C. 1 − mk
k!(nk)
D. 1 − nk
k!(nk)
E. 1 − mk
tifr2021
A. 67 B. 07 C. 27 D. 01 E. 77
tifr2021
Consider the shape in the plane that consists of all points within distance 1 from some point in P . If ℓ is the perimeter of the
shape, which of the following is always correct?
A. ℓ cannot be determined from the given B. 20 ≤ ℓ < 21
information.
C. 21 ≤ ℓ < 22 D. 22 ≤ ℓ < 23
E. 23 ≤ ℓ < 24
tifr2021
i. ¯L
¯¯¯
and L∗ are both context-free.
¯¯¯¯
ii. L is not context-free but L∗ is context-free.
iii. ¯L
¯¯¯
is context-free but L∗ is regular.
A. Both (i) and (iii) B. Only (i) C. Only (iii) D. Only (ii) E. None of the above
tifr2021
The figure below describes the network of streets in a city where Motabhai sells pakoras 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 s and, after visiting each street at least once, reach point t. For example,
Motabhai can visit the streets in the following order
s−a−c−s−e−c−d−a−b−d−f−e−d−b−t−f−d−t
in order to go from s to t. Note that the streets {b, d} and {d, f} are both visited twice in this strategy. The total time taken for
this trip is 440 minutes [which is, 380 (the sum of traversal times of all streets in the network) +60 (the sum of the traversal
times of streets {b, d} and {d, f})].
Motabhai now wants the cart to return to s 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: s, t, b and f are the only odd degree nodes in the figure above.
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 0 to 8 once in the list. How many persons shook hands with
Shyamal at the party?
A. 2 B. 4
C. 6 D. 8
E. Insufficient information
tifr2021
A matching in a graph is a set of edges such that no two edges in the set share a common vertex. Let G be a graph on n
vertices in which there is a subset M of m edges which is a matching. Consider a random process where each vertex
in the graph is independently selected with probability 0 < p < 1 and let B be the set of vertices so obtained. What is the
probability that there exists at least one edge from the matching M with both end points in the set B?
m
A. p2 B. 1 − (1 − p2 )
m
C. p2m D. (1 − p2 )
m
E. 1 − (1 − p (1 − p))
tifr2021
A. 9 B. 10 C. 55 D. 89 E. 1024
tifr2021
Which of the following regular expressions defines a language that is different from the other choices?
tifr2021
Let A and B be two matrices of size n × n and with real-valued entries. Consider the following statements.
Let L be a context-free language generated by the context-free grammar G = (V , Σ, R, S) where V is the finite set of
variables, Σ the finite set of terminals (disjoints from V ) , R the finite set of rules and S ∈ V the start variable.
Consider the context-free grammar G′ obtained by adding S → SS to the set of rules in G. What must be true for the
language L′ generated by G′ ?
A. L′ = LL B. L′ = L
C. L′ = L∗ D. L′ = {xx ∣ x ∈ L}
E. None of the above
tifr2021
How many numbers in the range 0, 1, … , 1365 have exactly four 1’s in their binary representation? (Hint: 136510 is
101010101012 , that is,
1365 = 210 + 28 + 26 + 24 + 22 + 20 . )
In the following, the binomial coefficient (nk) counts the number of k-element subsets of an n-element set.
A. (64)
B. (10
4)
C. (10 8 6 5
4 ) + (3) + (2) + (1)
D. (11 9 7 5
4 ) + (3) + (2) + (1)
E. 1024
tifr2021
tifr2021
Let G be a connected bipartite simple graph (i.e., no parallel edges) with distinct edge weights. Which of the following
statements on MST (minimum spanning tree) need NOT be true?
tifr2021
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 two heads and at least two tails have appeared in the sequence of tosses made. What is the expected
number of coin tosses that we would have to make?
Let G be an undirected graph. For any two vertices u, v in G, let cut(u, v) be the minimum number of edges that
should be deleted from G so that there is no path between u and v in the resulting graph. Let a, b, c, d be 4 vertices in
G. Which of the following statements is impossible?
tifr2021
Let A be a 3 × 6 matrix with real-valued entries. Matrix A has rank 3. We construct a graph with 6 vertices where
each vertex represents distinct column in A, and there is an edge between two vertices if the two columns represented
by the vertices are linearly independent. Which of the following statements MUST be true of the graph constructed?
A. Each vertex has degree at most 2. B. The graph is connected.
C. There is a clique of size 3. D. The graph has a cycle of length 4.
E. The graph is 3-colourable.
tifr2021
Consider the following greedy algorithm for colouring an n-vertex undirected graph G with colours c1 , c2 , ⋯ :
consider the vertices of G in any sequence and assign the chosen vertex the first colour that has not already been
assigned to any of its neighbours. Let m(n, r) be the minimum number of edges in a graph that causes this greedy algorithm to
use r colours. Which of the following is correct?
A. m (n, r) = Θ (r)
B. m (n, r) = Θ (r ⌈log2 r⌉)
C. m (n, r) = (r2)
D. m (n, r) = nr
E. m (n, r) = n(r2)
tifr2021
1 1 1 1
+ 2 + 2 +⋯+ 2
22 −1 4 −1 6 −1 40 − 1
20
A. 41
10
B. 41
C. 10
21
D. 20
21
E. 1
tifr2021
Lavanya and Ketak each flip a fair coin (i.e., both heads and tails have equal probability of appearing) n times. What is
the probability that Lavanya sees more heads than ketak?
In the following, the binomial coefficient (nk) counts the number of k-element subsets of an n-element set.
1
A. 2
2
(ni)
2 (1 )
1 n
B. − ∑i=0 2 2n
(1 − )
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 222 of 278
(ni)
C. 1 (1 − ∑ni=0 )
2 22n
D. 1 (1 − 1 )
2 22n
n (ni)
E. ∑i=0 2n
tifr2021
Fix n ≥ 6 . Consider the set C of binary strings x1 , x2 … xn of length n such that the bits satisfy the following set of
equalities, all modulo 2: xi + xi+1 + xi+2 = 0 for all 1 ≤ i ≤ n − 2, xn−1 + xn + x1 = 0, and
xn + x1 + x2 = 0. What is the size of the set C?
A. 1 for all n ≥ 6
B. 4 for all n ≥ 6
C. 0 for all n ≥ 6
D. If n ≥ 6 is divisible by 3 |C| = 1 . If n ≥ 6 is not divisible by 3 then |C| = 4 .
E. If n ≥ 6 is divisible by 3 |C| = 4 . If n ≥ 6 is not divisible by 3 then |C| = 1 .
tifr2021
tifr2021
Let d be the positive square integers (that is, it is a square of some integer) that are factors of 205 × 215 . Which of the
following is true about d?
A. 50 ≤ d < 100 B. 100 ≤ d < 150
C. 150 ≤ d < 200 D. 200 ≤ d < 300
E. 300 ≤ d
tifr2021
A. ∗ + + 987 ∗ ∗ 6 + + 5432
B. ∗ + + + 987 ∗ ∗ 6 + 5432
C. + ∗ + + 987 ∗ ∗ 6 + 5432
D. + + ∗ + 987 ∗ ∗ 6 + 5432
E. + ∗ + ∗ 987 + + 6 ∗ 5432
tifr2021
Answers:
Consider the worst case scenario. We have 6 each of different colours(but note that there are only 5 red ones).
Now adding one more marble ensures that we have at least 7 of the same colour (By pigeonhole principle).
Threrefore, 23 + 1 = 24
Option (D)
3 votes -- vishnu_m7 (745 points)
option A: False
There exists an independent set of size ∣C∣
This may not be true always as the independent set can be empty .ie, all the vertices may be included in the vertex cover(
even both the end points of every edge as it is not a minimum vertex cover).
option B True
Reason: there will be no edge between the vertices of I set as per the definition of vertex cover. There is no edge with both
sides belonging to independent set(if so then the subset is not vertex cover)
option C & D can be proved wrong using a complete graph with a vertex in the centre.
option E : False
Consider a graph with an isolated vertices. It falls in independent set. So intersection is empty.
1 votes -- Manoja Rajalakshmi Aravindakshan (7.7k points)
Solution :
For max area, the rectangle will be a square. So, if x is the side of the square, we have
x2 + x2 = (2(1))2
Here, the diagonal of the square will be equal to the diameter of the circle.
–
Solving this, we get x = √2 or the area of the square as 2 sq.units.
0 votes -- shashanks1999 (11 points)
Let me recall that in insertion sort we have two parts in the array. First one is where element are sorted and second
one is in which elements are not sorted. In each step but we do we pick an element (starting element) from the
unsorted array and put it into the right place in the sorted array part by comparisons. To insert an element into its exact
position elements from the sorted part might need to be shift.
Coming to the question we are promised that each element is at most k distance from its actual position. Now when an
element (Say x) will be picked from the unsorted part. To insert x into its correct position we only need to compare it with
O(k) many elements and also need to move/shift at most O(k) elements (as given in the question statement that element is k
distance away from its actual position). Now to insert n elements intio their right position it will take O(nk) time.
1 votes -- Shivdutt (31 points)
Here, we have,
G1 = (X1a ⊕ X2a ) ∨ (X1b ⊕ X2b )
G2 = (X2a ⊕ X3a ) ∨ (X2b ⊕ X3b )
G3 = (X3a ⊕ X4a ) ∨ (X3b ⊕ X4b )
G4 = (X4a ⊕ X5a ) ∨ (X4b ⊕ X5b )
G5 = (X5a ⊕ X1a ) ∨ (X5b ⊕ X1b )
F = (X1a ∨ X1b ) ∧ (X2a ∨ X2b ) ∧ (X3a ∨ X3b ) ∧ (X4a ∨ X4b ) ∧ (X5a ∨ X5b )
H = F ∧ G1 ∧ G2 ∧ G3 ∧ G4 ∧ G5
Now, we have to assign boolean variables X1a to X5a and X1b to X5b as 1 or 0 in such a way that H becomes 1
To make H as 1, F and all G1 to G5 should be 1. Now, either we start with G1 or G2 or any Gi , 1 ≤ i ≤ 5 , answer will
remain same.
So, first to make both G1 and F as 1 , possibilities are :
(i) X1a = 1 and X1b = 1
(ii) X1a = 1 and X1b = 0
(iii) X1a = 0 and X1b = 1
So, case (i) X1a = 1 and X1b = 1
Now, to make F = 1 and G1 = 1 ⇒ (1 ⊕ X2a ) ∨ (1 ⊕ X2b ) = 1 means both (1 ⊕ X2a ) and (1 ⊕ X2b ) should not be 0.
As we know, that x ⊕ x = 0. . So, X2a ≠ 1 and X2b ≠ 1 .
So, when X1a = 1 and X1b = 1 ,
X2a = 1, X2b = 0
X2a = 0, X2b = 1 .
So, (1, 1) maps to either (1, 0) or (0, 1) i.e.
(1, 1) ↦ (1, 0) (or) (1, 1) ↦ (0, 1)
Similarly,
To make F = 1 and G2 = 1 ⇒ (1 ⊕ X3a ) ∨ (0 ⊕ X3b ) = 1 (or) (0 ⊕ X3a ) ∨ (1 ⊕ X3b ) = 1 means both (1 ⊕ X3a )
and (0 ⊕ X3b ) should not be 0 and . As we know, that x ⊕ x = 0. . So, X3a ≠ 1 and X3b ≠ 0 (or) X3a ≠ 0 and X3b ≠ 1 .
So, when X2a = 1, X2b = 0 then X3a = 0, X3b = 1 (or) X3a = 1, X3b = 1 and
when X2a = 0, X2b = 1 then X3a = 1, X3b = 0 (or) X3a = 1, X3b = 1
So, (1, 0) ↦ (0, 1) (or) (1, 0) ↦ (1, 1) and
(0, 1) ↦ (1, 0) (or) (0, 1) ↦ (1, 1).
Like this we can find the values of other boolean variables very easily if we know the following mappings :
Using these mappings, we can get the possible values of other boolean variables.
So, here, (Xia , Yib ) represents the value of boolean variables Xia and Xib at level i where 1 ≤ i ≤ 5
Now, G5 will be 0 when (X1a , X1b ) ⊕ (X5a , X5b ) = 0 which says those leaf nodes which have value same as (1, 1), G5
will be zero. So, we have to exclude (1, 1) from leaf nodes. Out of 16 leaf nodes, 6 has values as (1, 1). So, remaining
values will be 16 − 6 = 10.
So, when X1a = 1 and X1b = 1 , H = 1 for 10 assignments.
Now for case (ii)X1a = 1 and X1b = 0
Tree structure will be like :
Here, total 6 (1, 0)(starting node) in leaf nodes. So, total 16 − 6 = 10 assignments for which H = 1
Now, for case (iii)X1a = 0 and X1b = 1
Tree structure will be like :
Here, also 6 (0, 1)(starting node) in leaf nodes. So, total 16 − 6 = 10 assignments for which H = 1
So, Total assignments in all 3 cases = 10 + 10 + 10 = 30.
Now, since, structure is symmetric, so, you can start with either (X2a , X2b ) or (X3a , X3b ) or take any case, answer will
remain the same.
2 votes -- ankitgupta.1729 (15.2k points)
(A)
Y → next = Y → next → next
X = Y → next
(C)
(D)
temp = (int *)(malloc(sizeof(int)))
temp → data = val
temp → next = X
Y → next = temp
X = temp
(E)
temp = X → next → data
X → next → data = X → data
X → data = temp
Y → data = X → data
Y → next = X → next
X=Y
Now we need to point Y to the previous node of the newly set X . How do we do that in constant time?
For that, we need to iterate starting from X to the last node which will take O(n) time where n is the number of nodes in the
list.
Taking
x=0
#include <stdio.h>
int mc91(int );
int main(void)
{
int i = mc91(0);
printf("%d",i);
return 0;
}
int mc91(int n)
{
printf("%d\n",n);
if (n > 100)
{
return (n-10);
}
else
{
return (mc91(mc91(n+11)));
}
}
Output :
0 // Minimum Value printed for the given range of
x
11
22
33
44
55
66
77
88
99
110
100
111 // Maximum Value printed for the given range of
x
101
91
102
92
103
93
104
94
105
95
106
96
107
97
108
98
109
99
110
100
111
101 // Maximum value returned for the given range of
x
............................................................
........................................................
.......................................................
Taking
x = 100
#include <stdio.h>
int mc91(int );
int main(void)
{
int i = mc91(100);
printf("%d",i);
return 0;
}
int mc91(int n)
{
printf("%d\n",n);
if (n > 100)
{
return (n-10);
}
else
{
return (mc91(mc91(n+11)));
}
}
Output :
100
111 // Maximum Value printed for the given range of
x
101 // Maximum value returned for the given range of
x
91
3 votes -- Kapil Phulwani (35.2k points)
(a) True. To check whether a given graph has Eulerian cycle or not, can be done in linear time in terms of input of
the graph. So, we can check it in polynomial time. We can store the given undirected graph G in adjacency list and
first using DFS, check whether the graph is connected or not. If the graph is connected then check whether each vertices has
even degree or not in the adjacency list representation of the graph and if the graph is not connected then do the same thing
for each component of the graph. It takes O(|V | + |E|) time.
(b) False. To check whether the graph G has Hamiltonian cycle or not, is an NPC problem.
(c) False.
Counter-Example :
Option (B)
I would like to strongly recommend to watch this video of legendary 3b1b for understanding what are basis vectors.
Basis vectors are linearly independent vectors that can span full space.
Lets first understand what this graph is about.
Vertices of this graph are set of basis vectors. (Note: In nth dimensional vector space there are n linearly independent
basis vectors).
So each vertex will be of the form S={v1,v2,v3,..vn} where S is set of basis vectors.
and here Vi = [x1,x2,x3,x4 , xn] can be any n dimensional vector.
Edge between any two vectors is present if only if there is exactly one basis vector different among two vertices.
Now we can see for the given vertex there can be infinite adjacent vertices cause we have infinite options for replacing one
of the basis vectors. Hence (a) is true.
Graph will be connected cause suppose even if we have two vertices Vi not equals Vj such that each basis vector among
two of them is different , even then we can reach to other vertex by replacing one of the basic vector at time (See the
condition of Adjacency) and eventually we will reach our desired vertex in at max n steps (changing each basis vertex at
time).
Hence the diameter of the graph will be finite and n.
Graph has infinite vertices and there will infinite cliques of size 3 , for example Vi , Vj , Vk and each of them has exactly
one basis vector different.
Similarly, we can show it has infinite independent set by considering all the vertices with two or more different basis vectors
cause such vertices are not connected to each other.
We can relate this graph with the graph of hamming distances even there, an edge is present between two vertices when only
one bit is swapped (here in this case : one basis vector is changed).
References
Answer (D)
P (Atleast two have same birthday month) = 1– P (No one have birthday in the same month)
= 1– 12 11 10 9
12 . 12 . 12 . 12
= 41
96
0 votes -- JATIN MITTAL (2.2k points)
Initially x is of 2 bits.
lly, after n iterations(at the end of loop ) the size of x is 2(2∗2∗2∗2∗.......n times)
ie, t = 22
n
Option E
https://gateoverflow.in/30708/graph-coloring
References
The answer is d. Consider a path a->c->b , then mincut(a,b) >= min(mincut(b,c),mincut(a,c)) . So if considering
this condition to be always true , option i and iii violate the conditions.
0 votes -- Vikram Bhat (737 points)
max(x, y) = 12 (x + y + |x − y|)
Here, x ≥ 0,y ≥ 0
Now,
Case 1 : When x ≥ y
So, we need only 2 clamp gates as clamp1,0 (x, y) and clamp0,1 (x, y) to find max(x, y).
1 votes -- ankitgupta.1729 (15.2k points)
The reflection matrix, to reflect a point (x, y) about the line y = mx where m = tanθ is given by,
[ ]
cos2θ sin2θ
sin2θ −cos2θ
So, if we have a point (x, y) and after reflection, new point is (x′ , y ′ ) then we can write it as :
x′
[ ]= [ ][ ]
cos2θ sin2θ x
y′ sin2θ −cos2θ y
Ou (v) = v [ ][ ] = v[ ]
cos10 sin10 cos10 cos20
sin10 −cos10 −sin10 sin20
O2u (v) = v [ ][ ] = v[ ]
cos10 sin10 cos20 cos30
sin10 −cos10 −sin20 sin30
O3u (v) = v [ ][ ] = v[ ]
cos10 sin10 cos30 cos40
sin10 −cos10 −sin30 sin40
Similarly,
O8u (v) = v [ ][ ] = v[ ]
cos10 sin10 cos80 cos90
sin10 −cos10 −sin80 sin90
S → ϵ ∣ aSb ∣ bSa ∣ SS
S → a−
Sb
−
S → a−
S Sb
−
S → aa−
S bSb
−
S → aab−
−S abSb
S → aabab− Sb
−
S → aababb
https://www.cs.wcupa.edu/rkline/fcs/cfls.html#equal-as-bs
https://stackoverflow.com/questions/55374248/cfg-of-language-which-contains-equal-of-as-and-bs
https://www.cs.umd.edu/~gasarch/COURSES/250/S15/equal.pdf
https://courses.engr.illinois.edu/cs373/sp2009/lectures/disc_07.pdf
https://cs.nyu.edu/courses/fall03/V22.0453-001/ans3.pdf
https://www.cs.usfca.edu/~galles/cs411/lecture/lecture8.printable.pdf
https://www.cs.odu.edu/~toida/nerzic/390teched/cfl/cfg.html
BASIC point :-
1%1 = 0
1% x = 1, for x > 1
x+1%x = 1, for all x.
for(i=(n-1);i>1;i--)
x=x%i;
first method and second method are basically same things. They are just alternative ways to look at matrix
multiplication.
Matrix multiplication can be treated as taking linear combinations of first matrix with scalars as columns of second matrix. or
another way to look at it is taking linear combinations of second matrix with scalars as rows of first matrix, Consider either
way of matrix multiplication in this example.
for a 3*3 matrix M if rank is 3 the same matrix can be given as M*I.
for rank<3, suppose 2, columns can be treated as c1,c2= x*c1, c3.(or r1, x*r1, r3).
now putting c1 and c3 in one matrix and multiplying them with appropriate matrix we can get original matrix as c2(x*c1) is
scalar multiple of c1. And c1,c3 can be derived in this multiplication from themselves easily. similar is case if we consider
the row way. just the way of multiplication will be changed(i.e. first matrix will be holding multiples and second will be
holding independent rows of original matrix).
x1 = x2 = x3
x4 = x5 = x6
…...
…...
⎧
⎪⎛ x1 ⎞⎫ ⎪
⎪
⎪ ⎪
⎪⎜ x1 ⎟⎪
⎪
⎪
⎪
⎪
⎪
⎪
⎪⎜ ⎟⎪
⎪
⎪
⎪
⎪
⎪⎜ ⎟
1 ⎟⎪⎪
⎪⎜
⎪
⎪⎜ x ⎟⎪ ⎪
⎪
x
⎪
⎪⎜ ⎟⎪
⎪
⎪
⎪ ⎟⎪
⎪⎜
⎜ x4 ⎟⎪
⎪
4
⎧
⎪ ⎛ 1 ⎞ ⎛ 0 ⎞ ⎛ 0 ⎞⎫ ⎪
⎪
⎪ ⎪
⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪
⎪ ⎜
1
⎟ ⎜
0
⎟ ⎜
0
⎟⎪
⎪
⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪ ⎜ ⎟
1 ⎜ ⎟
0 ⎜ ⎟⎪0 ⎪
⎪
⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎜ ⎟ ⎜ ⎟ ⎜ ⎟
0 1 0
⎪ ⎜ 0 ⎟ ⎜ 1 ⎟ ⎜ 0 ⎟⎪
⎜ ⎟ ⎜ ⎟ ⎜ ⎟
= ⎨x1 ⎜ ⎟ + x4 ⎜ ⎟ + … … + x3n ⎜ ⎟⎬ → (1)
⎪
⎪ ⎜ 0 ⎟ ⎜ 1 ⎟ ⎜ 0 ⎟⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪ ⎪
⎪
⎪
⎪ ⎜...⎟ ⎜...⎟ ⎜ . . . ⎟⎪
⎪
⎪
⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ 1 ⎟⎪⎟⎪
⎪
⎪ ⎜ 0 ⎟ ⎜ 0 ⎟ ⎜ ⎪
⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎩ ⎝ ⎠
⎪
0
⎝
0
⎠ ⎝
1
⎠⎪
⎭
⎪
0 0 1
⎧⎛ 1 ⎞ ⎛ 0 ⎞
⎪ ⎛ 0 ⎞⎪ ⎫
⎪
⎪ ⎪
⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪
⎪⎜
1
⎟ ⎜
0
⎟ ⎜
0
⎟⎪
⎪
⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪
⎪⎜ 1 ⎟ ⎜ 0 ⎟ ⎜ 0 ⎟⎪
⎪
⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎜ ⎟ ⎜ ⎟ ⎜ ⎟
0 1 0
⎪⎜ 0 ⎟ ⎜ 1 ⎟ ⎜ 0 ⎟⎪
⎜ ⎟ ⎜ ⎟ ⎜
⎨⎜ ⎟ , ⎜ ⎟ , … … , ⎜ ⎟⎬ ⎟
⎪
⎪⎜ 0 ⎟ ⎜ 1 ⎟ ⎜ 0 ⎟⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪ ⎪
⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ . . . ⎟⎪
⎪
⎪
⎪
⎪
⎪⎜ . . . ⎟ ⎜ . . . ⎟ ⎜ ⎟⎪
⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
0 0 1
⎪
⎪⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎪
⎪
⎪
⎪
⎩ ⎪
⎪
⎭
⎪⎝ ⎠ ⎝ ⎠ ⎪
0 0 1
0 0 ⎝ 1 ⎠
These vectors are orthogonal and so they form a linearly independent set and
from (1), it is clear that they span the whole solution space.
Option (C)
(choosing k values from m)∗(permuting each value from set S to these k values)
= 1– mk
(mk)×k!
= 1– mk
0 votes -- JATIN MITTAL (2.2k points)
Option (B)
So, 72020 will give last two digits as 01 and 72021 will give 07 as the last two digits.
2 votes -- JATIN MITTAL (2.2k points)
Option (B)
L∗ = (an bn )∗ will always be CFL as CFL are closed under kleene-closure but it is not regular as it requires b to match with
the a before starting with another runs of a.
0 votes -- JATIN MITTAL (2.2k points)
The way to approach this question is to know that proof of "Euler Circuit" problem. Know the proof to get the idea
why the following that I am writing, makes sense.
Here we have 4 vertices of odd degree, so, Euler circuit doesn't exist But if you still want to go from S to S by visiting every
edge at least once and with minimum cost (i.e. visiting every edge at least once and as minimum repetition as possible) then
for every odd degree vertex you have to re-visit one edge incident on that vertex. So, to get minimum cost,
For S, you can revisit(i.e. visit two times ) s-a (cost 10)
For t, f, you can revisit(i.e. visit two times ) t-f (cost 20)
For b, you can revisit(i.e. visit two times ) b-a (cost 20)
There are 10 attendees in total,Shyamal counts all the hands shaken by everyone other than him.
no. of hands that other attendees including his spouse shook (expcept him)
Hand shaking lemma state that,The sum of total hand shakes(sum of degrees) should be even,total no. of handshakes e
Therefore, No of persons who shook hands with Shyamal should be even. (Let it be n)
There are 5 different possible values of n {0,2,4,6,8}, and 5 different degree sequences as follows:
n = 6, degree sequence: 8, 7, 6, 6, 5, 4, 3, 2, 1, 0 0, 6, 5, 5, 4, 3, 2, 1, 0, 0 0, 0, 4, 4, 3, 2, 1, 0, 0, 0 0, 0, 0
n = 4, degree sequence: 8, 7, 6, 5, 4, 4, 3, 2, 1, 0 0, 6, 5, 4, 3, 3, 2, 1, 0, 0 0, 0, 4, 3, 2, 2, 1, 0, 0, 0 0, 0, 0
Hence B is Answer.
0 votes -- Nikhil Dhama (2.7k points)
Answer (D)
Array index starts from 0 and A[i] stores the value of the function for index i –
1 1 2 3 5 8 13 21 34 55 89
A[0] = A[1] = 1
for rest of the table use, A[i] = A[i − 1] + A[i − 2]
Answer = 89
0 votes -- JATIN MITTAL (2.2k points)
Language of options (a), (b), (c) and (d) is the set of strings over {a, b} containing at least two a′ s.
Language of option (e) is the set of strings over {a, b} containing at least one a.
1 votes -- JATIN MITTAL (2.2k points)
(1). If
AB = B , then A must be the identity matrix. → False
−1
If B is invertible, then B exists,
and ABB−1 = BB−1 ⟹ AI = I ⟹ A = I
But B may not be invertible, in such case A may or may not be identity matrix.
For example, If A = B , then we have A2 = A , here A can be a non-singular matrix.
1 0
For A = B = [ ] , we have AB = B , and A is not identity.
0 0
Hence this is False.
(2). If
A is an idempotent nonsingular matrix, then
A must be the identity matrix. → True.
A is nonsingular, means A−1 exists,
A2 = A ⟹ AAA−1 = AA−1 ⟹ AI = I ⟹ A = I
Hence true.
(3). If
A−1 = A , then
A must be the identity matrix. → False.
A is an Involutory matrix, It not necessary that A = I
⎡1 0 0⎤
For example: P = P −1 = ⎢ 0 0 1 ⎥ (Interchange row/column 2 and 3)
⎣0 1 0⎦
Hence False.
Option (E) is correct.
E
′ ′
For starters, the language L isn’t really the complement of L, it is defined by G defined by adding a new-rule S → SS .
So, for this problem let’s consider L = {a, b, c} (RG is a CFG) so we’ve a simple derivation S → a/b/c , for L‘ use the
added rule which generates L‘ = {a, b, c, aa, ab … , cc, aaa, aab … . ccc. . . } .
A. Concatenation of every string of L with every string of L itself will produce {aa, ab, … , cc} which is only a subset of
the language L‘ .
B. B.If this was true, we can’t generate aa for instance, the L‘ doesn’t only comprise the original elements but newly-
generated too.C.
C. The original language needn’t necessarily contain ϵ, which in-turn can’t be used generated a ϵ int the new-language. The
above Language provides the counter-example for this statement. So, not true...D.
D. All strings generated by the above grammar do belong in L‘ but, there are other elements such as {ab, ac, bc} which
aren’t generated so it isn’t true.E.
E. None are true so ?
1365 = (10101010101)2
Now if I keep MSB = 0 , then from the remaining 10 bits, I can select any 4 bits ans set them as 1. So total cases become
(10
4 ).
Now keep the MSB = 1 , now we cannot replace 0 on the second last bit from LHS with 1 as it will increase the number.
This will apply to every 0 as we move forward. So, now we have 10 on the LHS and the third bit from LHS, we set to 0, now
we have 8 bits remaning from which we have to select 3 bits (Why 3? as we are keeping MSB as 1 and in total we only need
4 bits to be set to 1). Total cases will become (83) .
Similarly, we will move forward and will get (62) and (41) .
I think there is a typo in the (C) option. They have the last term as (51) instead of (41) .
0 votes -- JATIN MITTAL (2.2k points)
PRIME is in P :
References: AKS primality test
Primality testing with Gaussian periods
FACTOR is also in P :
Algorithm:
if (b − a + 1) ≥ n : return “Yes”else if (a mod n == 0) or (a mod n > b mod n) : return “Yes”else : retrun “
Time complexity is O(1) : polynomial time.
(C) is correct.
References
It’s a simple connected graph and edge weights are given distinct, therefore we’ll have a unique MST for every such graph.
0 votes -- Nikhil Dhama (2.7k points)
rank of matrix A is 3, Therefore 3 of the columns must be linearly independent of each other, Hence a clique of size 3.
0 votes -- Nikhil Dhama (2.7k points)
to newly selected vertex we’ll assign first color that has not already been assigned to any of its neighbors,
we’ll get a new color only if new node is connected to all the other vertices which have a distinct color assigned to them,
recursively to get rth color , new vertex should be connected to at-least all vertices having (r − 1) distinct colors,
Option (A)
= 1 + 1 +. . . + 1
22 −1 42 −1 402 −1
= 1 + 1 1
+. . . + (40+1)(40−1)
(2+1)(2−1) (4+1)(4−1)
1
= [ (2+1)(2−1) + 1 1
+. . . + (40+1)(40−1) ] 22
(4+1)(4−1)
2
= [ (2+1)(2−1) + 2 2
+. . . + (40+1)(40−1) ] 12
(4+1)(4−1)
1
= [ (2−1) − 1 + 1 − 1 +. . . + 1 − 1 ]1
(2+1) (4−1) (4+1) (40−1) (40+1) 2
= [ 11 − 1
3 + 1
3 − 15 +. . . + 39
1 − 1 1
41 ] 2
= [1 − 1 1
41 ] 2
= 20
41
2 votes -- JATIN MITTAL (2.2k points)
Now since, P (H(L) > H(K)) and P (H(K) > P (L)) are symmetrical, they will be equal (lets say = Y ).
So, X + 2 ∗ Y = 1
⇒ Y = (1 − X)/2
And, X = P (H(L) == 0 AND H(K) == 0) + P (H(L) == 1 AND H(K) == 1) + .... + P (H(L) == n AND
H(K) == n)
2 2 2
X = (n0) /22n + (n1) /22n +. . . . +(nn) /22n
2
X = ∑ni=0 (ni) /22n
2
Y = 12 (1 − ∑ni=0 (ni) /22n )
1 votes -- JATIN MITTAL (2.2k points)
Answer (E)
= 205 × 215
= (22 × 51 )5 × (7 × 3)5
= 210 × 55 × 75 × 35
Now to form the numbers which are perfect squares, for each of 2, 3, 5, 7 we should pick ONLY even powers.
So the numbers possible to be present in the perfect square are {22 , 24 , 26 , 28 , 210 , 32 , 34 , 52 , 54 , 72 , 74 }
Now, we can take any subset of this and multiply the numbers present in that subset to get the perfect square number. For
example, if we pick the subset {24 , 72 } , then the number will be 24 × 72 = 784 = (28)2
But, we don’t have to consider the empty set (as 0 is only factor of itself and question also asks for positive numbers only).
Option (D)
Steps to convert Infix to Prefix:
1. Reverse the Infix expression, replace ‘(’ with ‘)’ and vice-versa.
2. Convert into Postfix expression.
3. Reverse the postfix expression.
References
Answers: 3 Sat
2-SAT is P problem.
So C is false.
0 votes -- Akash Sheoran (1.5k points)
Let n ≥ 2 be any integer. Which of the following statements is not necessarily true?
n−1 n−1
A. ( ) = ( )+( ) , where 1 ≤ i ≤ n − 1
n
i i i−1
B. n! divides the product of any n consecutive integers
Σni=0 ( ) = 2n
n
C.
i
n divides ( ) , for all i ∈ {1, 2, … , n − 1}
n
D.
i
E. If n is an odd prime, then n divides 2n−1 − 1
tifr2016 binomial-theorem
Now,
2n−1 ≡ 1(modn)
⇒ 2n−1 − 1 ≡ 0(modn)
Therefore E is true.
n(n−1)(n−2)...(n−k+1)
For i = k, k between 1 & n-1. n divides k!
, Since there is n at numerator always. Therefore True.
Which of the following statements about the eigen values of In , the n × n identity matrix (over complex numbers), is
true?
A. The eigen values are 1, ω, ω2 , … , ωn−1 , where ω is a primitive n-th root of unity
B. The only eigen value is −1
C. Both 0 and 1 are eigen values, but there are no other eigen values
D. The eigen values are 1 , 1/2, 1/3, … , 1/n
E. The only eigen value is 1
Be it real matrix or complex matrix , the identity matrix remains the same ..So we will have in In , 1's only in the
principal diagonal elements and the rest of the elements of the matrix will be 0..So the characteristic equation will be
:
[A - λ I] = 0
==> (1 - λ) . (1 - λ) ...............(1 - λ) [n times] = 0
==> (1 - λ) n = 0
==> λ = 1 as the only solution the reason being complex roots of unity only holds if it were λ n - 1 = 0 which is
not the case here..
Hence E) is the correct answer..
3 votes -- HABIB MOHAMMAD KHAN (67.6k points)
Answers: Divergence
Option C
Let S be the 4 × 4 square grid {(x, y) : x, y ∈ {0, 1, 2, 3}} . A monotone path in this grid starts at (0, 0) and at
each step either moves one unit up or one unit right. For example, fromthe point (x, y) one can in one step either move
t o (x + 1, y) ∈ S or (x, y + 1) ∈ S , but never leave S . Let the number of distinct monotone paths to reach point (2, 2)
starting from (0, 0) bt z. How many distinct monotone paths are there to reach point (3, 3) starting from (0, 0)?
A. 2z + 6 B. 3z + 6 C. 2z + 8 D. 3z + 8 E. 3z + 4
tifr2016 combinatory dynamic-programming
Ans : C] 2z+8
Clearly a path of the desired type must consist of 3 moves to right and 3 moves to up.
Therefore, each such path can be represented by a bit string of 3 0’s and 3 1’s, with the 0’s representing moves to the right
and the 1’s representing moves up.
( 6! )
© Copyright GATE Overflow 2021. Some rights reserved.
GATE Overflow April 2021 244 of 278
6! ) = 20.
The number of bit strings of length 3+3 containing exactly 3 0’s and 3 1’s is ( 3!∗3!
4! ) = 6.
The number of bit strings of length 2+2 containing exactly 2 0’s and 2 1’s is z = ( 2!∗2!
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. K9,9
B. K8,8
C. K12,12
D. K9
E. The graph G on vertex set {1, 2, … , 9} with edge set
A connected undirected multi graph has Euler's circuit iff all vertices are of Even degree
1.K9,9 is Bipartite graph with each side having 9 vertices and each of the vertex on one side are connected to all
vertices of other side,hence degree of all vertices are 9 which is odd degree, Therefore No Eulers Circuit
2 &3 .K8,8 and K 12,12 is Bipartite graph with each side having 8 vertices and each of them are connected to all vertices of
other side,hence degree of all vertices are 8 and 12 respectively which is Even, Therefore Eulers Circuit exists
4. K9 Complete graph with 9 vertices with each vertex connected to all other therefore degree is 8, Therefore Eulers Circuit
exists
5.
In this graph also all vertices have even degree. So, Euler circuit exists.
Hence Option A doesn't have Euler's circuit
7 votes -- Prajwal Bhat (7.6k points)
A diagonal 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 n vertices, a certain number (say k) 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 k?
B. n2the
A. cannot be determined from −information
2 given C. n
4 −1 D. n − 4 E. n2 − 9.5n + 22
tifr2016 graph-theory generalaptitude
Answers: Generalaptitude
The following experiment is performed using this graph. First, an edge e = {i, j} of the graph is chosen uniformly at random
from the set of 9 possibilities. Next, a common neighbour k of i and j is chosen, again uniformly from the set of possibilities.
(Note that the set of possibilities is always non-empty.) Thus, {i, j, k} is a triangle in the graph. What is the probability that the
triangle finally picked is {1, 2, 3}?
1 1 1 2 5
A. 6 B. 4 C. 3 D. 3 E. 6
tifr2016 graph probability
Answers: Graph
First we select edge 1-3 with probability 1 now common neighbor of (1,3) are (4,2)
9
Probability of choosing 2 as neighbor is so that {1,2,3} can from triangle is 1 so total probabiltiy is 1 ∗ 1
2 9 2
similar for edge 1-2 and edge 2-3 as both have only 2 neighbour common {3,5} and {1,6} respectively
total probability is 1 ∗ 1 ∗ 3= 1
9 2 6
5 votes -- Keval Malde (13.3k points)
{ {111 … 11 : p is prime
PRIMES =
p times
A. PRIMES is regular
B. PRIMES is undecidable
C. PRIMES is decidable in polynomial time
D. PRIMES is context free but not regular
E. PRIMES is NP-complete and P ≠ NP
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 h in meters of the inhabitants of the
island?
i. 1.5 ≤ h ≤ 2
ii. h ≥ 1.3
iii. h ≤ 2.2
A. ii only B. iii only C. i, ii and iii D. ii and iii only E. None of the above
tifr2016 probability
Answers: Probability
On taking the average of minimum values:(as the options are comparing values of heights <= or >=)
So answer is option A
1 votes -- Manoja Rajalakshmi Aravindakshan (7.7k points)
There are n balls b1 , … , bn and n boxes. Each ball is placed in box chosen independently and uniformly at random.
We say that (bi , bj ) is a colliding pair if i < j, and bi and bj are placed in the same box. WHat is the expected
number of colliding pairs?
E. ( )
A. n−1
B. 0 C. 1 D. n n
2 4
2
tifr2016 probability uniform-hashing
I think A.
7 votes -- Aghori (4.4k points)
The distance from your home to your office is 4 kilometers and your normal walking speed is 4 Km/hr. On the first
day, you walk at your normal walking speed and take time T1 to reach office.
On the second day, you walk at a speed of 3 Km/hr from 2 Kilometers, and at a speed of 5 Km/hr for the remaining 2
Kilometers and you take time T2 to reach office.
On the third day, you walk at a speed of 3 Km/hr for 30 minutes, and at 5 Km/hr for the remaining time and take time T3 to
reach office.
What can you say about the ordering of T1 , T2 and T3
A. T1 > T2 and T1 < T3 B. T1 = T2 = T3
C. T1 < T2 and T1 > T3 D. T1 = T2 and T1 < T3
E. T1 < T2 and T1 = T3
option E
T1 = 4km = 1hr
4km/hr
3
km 4− 32 km
T3 = 2
3km/hr
+ 5km/hr
= 1hr
T1 = T3 and T1 < T2
1 votes -- Manoja Rajalakshmi Aravindakshan (7.7k points)
Answer Keys
18.0.1 D 18.0.2 B 18.0.3 B 18.0.4 E 18.0.5 B
18.0.6 B 18.0.7 E 18.0.8 D 18.0.9 D 18.0.10 C
18.0.11 A 18.0.12 B 18.0.13 D 18.0.14 D 18.0.15 E
18.0.16 A 18.0.17 D 18.0.18 B 18.0.19 C 18.0.20 E
18.0.21 A 18.0.22 D 18.0.23 B 18.0.24 D 18.0.25 C
18.0.26 C 18.0.27 B 18.0.28 Q-Q 18.0.29 B 18.0.30 A
18.0.31 B 18.0.32 B 18.0.33 D 18.0.34 E 18.0.35 E
18.0.36 E 18.0.37 Q-Q 18.0.38 C 18.0.39 E 18.0.40 Q-Q
18.0.41 E 18.0.42 C 18.0.43 C 18.0.44 A 18.0.45 B
18.0.46 E 18.0.47 Q-Q 18.0.48 E 18.0.49 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 A 18.10.1 C 18.11.1 A
18.12.1 A 18.13.1 E
Arrays, Stacks, Queues, Linked lists, Trees, Binary search trees, Binary heaps, Graphs.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 4 2 2 0 2 3 1 1 1 0 1.7 4
2 Marks Count 1 0 3 2 0 0 1 3 3 0 1.2 3
Total Marks 6 2 4 4 2 3 3 7 7 2 4.2 7
Consider an array A[1...n]. It consists of a permutation of numbers 1....n. Now compute another array B[1...n] as
follows: B[A[i]] := i for all i. Which of the following is true?
Answers: Arrays
index 1 2 3 4 5 6 7 8
A 5 1 3 7 6 2 8 4
B 2 6 3 8 1 5 4 7
To see that option c is incorrect, let array C be the array attained from doing the same transformation twice, that is,
C[B[i]] = i, ∀i ∈ [1. . n]. We get,
index 1 2 3 4 5 6 7 8
A 5 1 3 7 6 2 8 4
B 2 6 3 8 1 5 4 7
C 5 1 3 7 6 2 8 4
Suppose there is a balanced binary search tree with n nodes, where at each node, in addition to the key, we store the
number of elements in the sub tree rooted at that node.
Now, given two elements a and b, such that a < b , we want to find the number of elements x in the tree that lie between a and
b, that is, a ≤ x ≤ b . This can be done with (choose the best solution).
tifr2010 binary-search-tree
1. Find a and b : This will take O(log n) comparisons as tree is balanced BST.
2. Follow path from a to b, and along the path, keep adding the required number of nodes to result by looking at number
stored at each node. Path length is O(log n), hence number of additions will also be O(log n).
15 votes -- Happy Mittal (8.2k points)
Consider a complete binary tree of height n, where each edge is one Ohm resistor. Suppose all the leaves of the tree are
tied together. Approximately how much is the effective resistance from the root to this bunch of leaves for very large
n?
A. Exponential in n. B. Cubic in n.
C. Linear in n. D. Logarithmic in n.
E. Of the order square root of n.
tifr2012 binary-tree
Given a binary tree of the following form and having n nodes, the height of the tree is
A. Θ (log n) B. Θ (n)
−
C. Θ (√n ) D. Θ (n/ log n)
E. None of the above.
tifr2013 binary-tree data-structures
Let T be a rooted binary tree whose vertices are labelled with symbols a, b, c, d, e, f, g, h, i, j, k . Suppose the in-order
(visit left subtree, visit root, visit right subtree) and post-order (visit left subtree, visit right subtree, visit root) traversals
of T produce the following sequences.
in-order:a, b, c, d, e, f, g, h, i, j, k
post-order:a, c, b, e, f, h, j, k, i, g, d
How many leaves does the tree have?
A. THREE. B. FOUR.
C. FIVE. D. SIX.
E. Cannot be determined uniquely from
On the right, the nine nodes of the tree have been assigned numbers from the set {1, 2, … , 9} so that for every node, the
numbers in its left subtree and right subtree lie in disjoint intervals (that is, all numbers in one subtree are less than all numbers
in the other subtree). How many such assignments are possible? Hint: Fix a value for the root and ask what values can then
appear in its left and right subtrees.
Consider the following implementation of a binary tree data strucrure. The operator + denotes list-concatenation.
That is, [a, b, c] + [d, e] = [a, b, c, d, e].
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:
inOrder(T) : [12, 10, 6, 9, 7, 2, 15, 5, 1, 13, 4, 3, 8, 14, 11]
preOrder(T) : [5, 2, 10, 12, 9, 6, 7, 15, 13, 1, 3, 4, 14, 8, 11]
What does postOrder(T) return ?
1 1 1
Sum of resistors when in parallel, = +
rparallel r1 r2
r1 ⋅ r2
⟹ rparallel =
r1 + r2
Every node siblings are in parallel and the sum of each level are in series and all node of the last level are tied so all are in
series.
So, total sum of resistor = root + total of level 2 + total of level 3 + … + total of level n − 1+ total of level n (in series)
Level Number of nodes
1 1(20 )
2 2(21 )
3 4(22 )
4 8(23 )
.
.
n−1 2n−2
n 2n−1
So, total sum of resistor = root + total of level 2 + total of level 3 + … . + total of level n − 1 + total of level n (series)
= 1 + r2 + r4 + r8 + 16 r + ⋯ + r + (r + r + r + r + ⋯ + r) (here r = 1)
n−2 2
2n−1 times
{ 12 } (decreasing GP) + (1 + 1 + 1 + … + 1)
=1+ + 1 + 1 +⋯+ 1
4 8 2n−2
2n−1 times
≈ (2n ) approx
n = 1 + 2 + 3 + ⋯ + (h + 1)
(h + 1)(h + 2)
=
2
2n = h2 + 3h + 2
0 = h2 + 3h + (2 − 2n)
−−−−−−−−−−−−−
−3 + √32 − 4 ⋅ (2 − 2n)
⟹ h= ∵h≥0
2
−−−−−
−3 + √8n + 1
=
2
⟹ h = Θ(√−
n)
Option is B.
for every node -all numbers in one subtree are less than all numbers in the other subtree .
Now,we hv 3 elements for left subtree & 5 for right(Consider subtrees of subtree).
Left Subtree :
whatever way we place , always one side is smaller than other { 6 is smaller than 8 in above example given in question}
so, total ways = 3! {three places put one by one} = 6 ways
Right Subtree :
Right subtree has two more sub-trees ,so that elements on one side should be smaller than other **
Steps :
OPTION (D)
Suppose the nodes of the tree are randomly assigned distinct labels from {1, 2, … , 13} , each permutation being equally likely.
What is the probability that the labels form a min-heap (i.e., every node receives the minimum label in its subtree)?
2 2 3
A. ( 6!1 ) ( 3!1 ) B. ( 3!1 ) ( 2!1 )
1 3 2
C. ( 13 ) ( 16 ) ( 13 ) D. 13
1
E. 213
tifr2014 heap
Answers: Heap
(C) is Correct -
Number of Favorable Outcomes(minheaps)
Probability = Total Trees(13!)
Now, total Min-Heaps :
Firstly we select minimum element i.e. 1 for root = 1 way
We have 3 subtrees of 3, 6, 3 sizes respectively
= 12! ∗ 2 ∗ 9! ∗ 2 ∗ 5 ∗ 4 ∗ 2
13! ∗ 3! ∗ 9! ∗ 3! ∗ 6!
3
= ( 13 ) ( 16 ) ( 13 )
1
We have an implementation that supports the following operations on a stack (in the instructions below, s is the name
of the stack).
is executed?
Answers: Stack
(D) is option.
First push (((( on stack. Now when ) comes pop all (((( and push ) on stack. Now push ((( and stack become )((( . Now
when ) come it pop all ((( from stack and new stack become )). Again ) comes and stack become ))) . Now push (((( on
stack and the stack becomes (((())). Now pop one by one and get option D as the answer.
20 votes -- Mehak Sharma (1.2k points)
Let T be a tree of n nodes. Consider the following algorithm, that constructs a sequence of leaves u1 , u2 . . . . Let u1 be
some leaf of tree. Let u2 be a leaf that is farthest from u1 . Let u3 be the leaf that is farthest from u2 , and, in general, let
ui+1 be a leaf of T that is farthest from ui (if there are many choices for ui+1 , pick one arbitrarily). The algorithm stops when
some ui is visited again. What can u say about the distance between ui and ui+1 , as i = 1, 2, . . . ?
Answers: Trees
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
Programming in C. Recursion.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 0 2 1 2 2 1 2 2 1 0 1.4 2
2 Marks Count 2 2 1 3 3 4 4 2 2 2 2.6 4
Total Marks 4 6 5 8 8 9 10 6 5 4 6.7 10
Note that ∥ denotes the parallel operator. In which of the following cases can the program possibly result in a final state with
r1 = 0; r2 = r3 = 1 .
A. Such a transformation is not possible in Java.
B. Such a program transformation is possible in Java.
C. Possible in Pascal when the compiler appropriately translates the ∥ operator to interleaved pascal statements.
D. Possible in all sequential programming languages when the compiler appropriately translates the ∥ operator to interleaved
statements in the sequential language.
E. None of the above.
Consider the following program for summing the entries of the array b: array [0. . N − 1] of integers, where N is a
positive integer. (The symbol '<>' denotes 'not equal to').
var
i, s: integer;
Program
i:= 0;
s:= 0;
[*] while i <> N do
s := s + b[i];
i := i + 1;
od
Which of the following gives the invariant that holds at the beginning of each loop, that is, each time the program arrives at
point [∗] ?
N
A. s = ∑ b[j] & 0 ≤ i ≤ N
j=0
i=1
B. s = ∑ b[j] & 0 ≤ i < N
j=0
i
C. s = ∑ b[j] & 0 < i ≤ N
j=0
N
D. s = ∑ b[j] & 0 ≤ i < N
j=1
i−1
E. s = ∑ b[j] & 0 ≤ i ≤ N
j=0
Invariant of the loop is a condition which is true before and after every iteration of the loop. In the above program the loop
invariant is given by
0 ≤ y and z + x ∗ y = a ∗ b
Which of the following is true of the program?
Consider the following psuedocode fragment, where y 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. (i == 10) or (i == y)
ii. If y > 10 , then i == 10
iii. If j = 6, then y == 4
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
Whenever we encounter the [∗], the variable s holds the sum of all elements b[0] to b[i − 1].
When we first enter the loop, i = 0 , and s doesn't have any elements summed up.
When we last enter the loop, i = (N − 1) and s contains the sum of elements b[0] through b[N − 2].
We leave the loop when i = N , and s gets the sum of elements b[0] to b[N − 1]
The only option that matches this behavior is option E.
i−1
s = ∑ b[j] & 0 ≤ i ≤ N
j=0
if x is odd then -
4th iteration must not occur because j will become 24. Hence during 3rd iteration break statement must have been executed
and hence, y must be equal to 4 (equal to i during the 3rd iteration).
A loop invariant is any condition which is true for the start of the loop, for every iteration of the loop and for
the exit of the loop.
Before 1st iterations values of (x, y) are (1, 0)
After 1st iteration values of x and y are (2, 1)
After 2nd iteration values of x and y are (4, 2)
After 3rd iteration values of x and y are (8, 3)
⋮
After nth iteration values of x and y are (2n , n)
This loop will not terminate and that means we need not worry about the condition when loop exits (p → q is TRUE if p is
false) So E is false
D is the right option
16 votes -- Mk Utkarsh (25.7k points)
Various parameter passing mechanisms have been in used in different programming languages. Which of the following
statements is true?
If both parameters to G are passed by reference, what are the values of a and b at the end of the above program fragment ?
Option B is correct as for the given inputs the program fragments does swapping of the values. Call-by-reference
implies that the swapped values are reflected in the calling function as well.
PS: Procedure G is not doing proper swapping for all input values as for negative values, there is a chance of underflow in
c − d.
10 votes -- Arjun Suresh (334k points)
{
printf("hello");
greet(n-1);
}
printf("world");
}
If you run greet(n) for some non-negative integer n, what would it print?
A. n times "hello", followed by n+1 times B. n times "hello", followed by n times
"world" "world"
C. n times "helloworld" D. n+1 times "helloworld"
E. n times "helloworld", followed by
"world"
tifr2018 programming-in-c
Given the following pseudocode for function printx() below, how many times is x printed if we execute printx(5)?
void printx(int n) {
if(n==0){
printf(“x”);
}
for(int i=0;i<=n-1;++i){
printx(n-1);
}
}
Answers: Programming In C
Take n = 2:
void greet(2)
{
if(2>0)
{
printf("hello");
//print number 1
greet(1);
}
printf("world");
//3rd time print
}
void greet(1)
{
if(1>0)
{
printf("hello");
//print number 2
greet(0);
}
printf("world");
//2nd time print
}
void greet(0)
{
if(0>0) fail {}
printf("world");
//1st time print
}
If we denote the number of times x being printed for input n by C(n) we can write
C(n) = n × C(n − 1) (Since the for loop runs n times and each iteration does a recursive call to printx(n − 1))
C(0) = 1
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 F(x, y) = w when the evaluation of F(x, y) does not terminate. Computing F(1, 0) using the parallel -
innermost and parallel - outermost rule yields
A. w and 0 respectively B. 0 and 0 respectively
C. w and w respectively D. w and 1 respectively
E. none of the above
Consider the class of recursive and iterative programs. Which of the following is false?
Answers: Recursion
Now we can observe some part will never terminate and some part will become 0 so overall we can say it would be
something like W ∗ 0 and which would result into 0. So i think Applying parallel-outermost rule will result into 0 .
Parallel-innermost rule:- Replace all the innermost occurrences of F . Here innermost occurrences mean those whose
arguments are free from F .
Like in F(1, 0) argument of F are 1, 0 which are free from F so replace it by recurrence relation and hence it would
become
F(2, F(1, 0)) ∗ F(0, F(1, 0)) Here i colored another innermost occurrences of F which we have to replace
again.uncolored F are not innermost occurrences as they contain such arguments which are not themselves function of F .
So overall it would become
F(2, [F(2, F(1, 0)) ∗ F(0, F(1, 0))]) ∗ F(0, [F(2, F(1, 0)) ∗ F(0, F(1, 0))])
Here we can observe this that everytime we have to expand only function F(1, 0) because that's the only function whose
arguments are free from any F So in that way , overall it would become W ∗ W type which would result into W .
So option A is the correct answer.
13 votes -- Rupendra Choudhary (11.4k points)
Answer is option E.
Computable function: those which can be incorporated in a program using for/while loops.
Total Function: Defined for all possible inputs
Well Defined: if its definition assigns it a unique value.
It was a belief in early 1900s that every Computable function was also Primitively Recursive. But the discovery of
Ackermann function provided a counter to it.
The class of primitive recursive functions is a small subclass of the class of recursive functions. This means that there are
some functions which are Well-Defined Total Functions and are Computable BUT Not primitively recursive; eg. Ackermann
function.
This makes all options from option A to option D as True.
But option E as FALSE. As iterative programs are equivalent to only Primitively Recursive class.
21 votes -- Amar Vashishth (25.2k points)
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
Regular expressions and finite automata, Context-free grammars and push-down automata, Regular and context-free
languages, Pumping lemma, Turing machines and undecidability.
Mark Distribution in Previous GATE
Year 2021-1 2021-2 2020 2019 2018 2017-1 2017-2 2016-1 2016-2 Minimum Average Maximum
1 Mark Count 2 3 3 2 2 2 3 3 3 2 2.5 3
2 Marks Count 3 4 3 3 3 5 3 3 3 3 3.3 5
Total Marks 8 11 9 8 8 12 9 9 9 8 9.2 12
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.
A. True. For a recursive language, we have a TM which says for any string "w", "yes" if it belongs to the language
and "no" if it does not. For the complement of a recursive language we just have to reverse 'yes' and 'no' conditions and
this is possible with a slight modification to the original TM. So, the new language is also recursive.
B. True. Non-determinism does not add any recognizing power to a Turing machine though it can affect the time complexity
in solving a problem.
C. True. Complement of CFL is recursive. and recursive language is recognized by Turing machine. So, complement of a
context free language can be recognized by TM
D. True. If a language is r.e., we have a TM which says "yes" whenever a given string belongs to L. Similarly, if its
complement is r.e., we have a TM which says "yes", whenever a string does not belong to the language. So, combining
both we can always say "yes" if a string belongs to the language and "no" if a string does not belong to L ⟹ L is
recursive.
E. False.
Non-recursive Language can be:- (a) r.e. or (b) Non r.e.
As seen in option D, if the language is RE but not recursive, its complement cannot be r.e. (recognized by a TM). But, if
the language is not r.e. its complement may be r.e. (which Can be recognized by TM). option E is false.
Example:-
L = {⟨M, w⟩ ∣ M is a TM and it does not halt on string w}. //Non RE (complement of halting problem)
Lc = {⟨M, w⟩ ∣ M is a TM and it halts on string w} //RE but not Recursive //recognized by TM (halting problem)
So, answer is (E).
Which of the following problems is decidable? (Here, CFG means context free grammar and CFL means context free
language.)
A. L ∈ NP
B. Every problem in NP is polynomial time reducible to L.
C. Every problem in NP is polynomial time reducible to ATM .
D. Since L is NP − complete, ATM is polynomial time reducible to L.
E. ATM ∉ NP .
Answers: Decidability
A. We don't have any standard algorithm to change CFG into CFL
from a given CFG deciding a language is finite is decidable but regular its undecidable (Ref:
http://gatecse.in/wiki/Grammar:_Decidable_and_Undecidable_Problems)
B. From a given given CFG we can determine the CFL and CFL emptiness is Decidable.
C. Intersection of two CFL is undecidable coz it is not closed under intersection.
ATM is the language of the Halting Problem. It is undecidable, but Recursively Enumerable.
L is NPC
a. True. Any language in NPC is also in NP by definition.
b. True. By definition, any problem in NP is polynomial time reducible to any NPC problem.
c. True. ATM is undecidable. Any language that is decidable is polynomial time reducible to ATM !
d. False. ATM is undecidable. No Turing Machine can guarantee an answer in a finite time, let alone a polynomial
time.
e. True. ATM is undecidable. It is certainly not in NP .
Let L consist of all binary strings beginning with a 1 such that its value when converted to decimal is divisible by 5.
Which of the following is true?
L e t ai denote a sequence a. a. . . a with i letters and let ℵ be the set of natural numbers 1, 2, . . . . Let
L1 = {ai b2i ∣ i ∈ ℵ} and L2 = {ai bi ∣ i ∈ ℵ} be two languages. Which of the following is correct?
2
L e t L be a given context-free language over the alphabet {a, b}. Construct L1 , L2 as follows. Let
L1 = L − {xyx ∣ x, y ∈ {a, b}∗ } , and L2 = L ⋅ L . Then,
Let ∑1 = {a} be a one letter alphabet and ∑2 = {a, b} be a two letter alphabet. A language over an alphabet is a set
of finite length words comprising letters of the alphabet. Let L1 and L2 be the set of languages over ∑1 and ∑2
respectively. Which of the following is true about L1 and L2 :
A. Both are finite. B. Both are countably infinite.
C. L1 is countable but L2 is not. D. L2 is countable but L1 is not.
E. Neither of them is countable.
tifr2015 identify-class-language
Consider the following grammar G with terminals {[, ]}, start symbol S , and non-terminals {A, B, C}:
S → AC ∣ SS ∣ AB
C → SB
A →[
B →]
A language L is called prefix-closed if for every x ∈ L , every prefix of x is also in L. Which of the following is FALSE?
Let L be the language over the alphabet {1, 2, 3, (, )} generated by the following grammar (with start symbol S , and
non-terminals {A, B, C}):
S → A B CA → (B → 1 B ∣ 2 B ∣ 3 BB → 1 ∣ 2 ∣ 3C →)
Then, which of the following is TRUE?
A. L is finite B. L is not recursively enumerable
C. L is regular D. L contains only strings of even length
E. L is context-free but not regular
tifr2017 theory-of-computation identify-class-language
L = {ap bq cr : p = q or q = r or r = p} .
Which of the following answer is TRUE about the complexity of this language?
Define the language INFINITEDFA ≡ {(A) ∣ A is a DFA and L(A) is an infinite language}, where (A)
denotes the description of the deterministic finite automata (DFA).Then which of the following about INFINITEDFA
is TRUE:
A. It is regular.
B. It is context-free but not regular.
C. It is Turing decidable (recursive).
D. It is Turing recognizable but not decidable.
E. Its complement is Turing recognizable but it is not decidable.
tifr2018 identify-class-language
L can be recognized by a dfa. we have a dfa to accept all such strings which when interpretated as decimal
number are divisible by n. Where n can be anything the dfa of such can be made by a trick.
Transition Table
0 1
q0 q0 q1
q1 q2 q3
q2 q4 q0
q3 q1 q2
q4 q3 q4
If you can see the symmetry in it. write states and make fill like q0 q1 q2 q3 q4 q0 . . .
Now, it is saying that it has to always start with 1 which the above dfa will not satisfy so make it a nfa by making a
transition from q0 on zero to a new dead state. now you have a nfa reduce it which will result in a deterministic DFA .
So, option is A.
19 votes -- Ravi Singh (11.8k points)
Answer is B.
14 votes -- Akash Kanase (36.1k points)
Option C is correct.
52 votes -- Praveen Saini (42k points)
Languages over alphabet set are uncountable so, answer should be ( E).
Correct Answer: C
20 votes -- Motamarri Anusha (8.6k points)
L1 = ap bq cr : p = q
L2 = ap bq cr : q = r
L3 = ap bq cr : r = p
L = L1 ∪ L2 ∪ L3
L1, L2, L3 are CFL
We can directly eliminate option A and B as we need to do some computation which is beyond (in this case) the
capacity of the FSM and the PDA.
Let's understand what does 'encoding' of a DFA means. It is nothing but a string of 1's and 0's which on reading, you will get
the complete idea about DFA, that is how many states it has, which is the start stare, which are final states, all transitions etc.
Basically, we are 'encoding' whatever we know about the given DFA in 0's and 1's. There is no fixed procedure for how this
encoding should be. You can do it in whichever way you like.
Now the question is on taking a string of 1's and 0's (The description of a DFA) as the input, can we write a C program which
will print "YES" when the FSM corresponding to that string accepts the infinite language and prints "NO" otherwise. The
answer is YES we can write such a program. We will be checking for the "loops" in the FSM corresponding to the given
string as the existence of a loop and a valid final state implies that the FSM accepts infinite language. (We can use the logic
of finding a cycle in the directed graphs which can be done in O(V+E) time for the graphs. ) So this is a decidable problem.
10 votes -- Utkarsh Joshi (5.3k points)
DFA: http://flolac.iis.sinica.edu.tw/flolac11/lib/exe/logic_computation_theory_hw2s.pdf
References
a. False. Turing recognizable language are recursive enumerable and recursive set is a proper subset of it.
b. False, Complement of r.e. need not be r.e.
c. True. Complement of recursive language is recursive and every recursive language is recursive enumerable.
d. False. Complement of CFL need not be CFL (but is guaranteed to be a CSL).
e. False. We cannot make a Turing machine to determine if a given Turing machine does not halt on empty string (for that
matter any string). But the complement of this is r.e. (of course not recursive)
Which of the following regular expressions correctly accepts the set of all 0/1 -strings with an even (possibly zero)
number of 1s?
A. (10∗ 10∗ )∗ B. (0∗ 10∗ 1)∗
C. 0∗ 1(10∗ 1)∗ 10∗ D. 0∗ 1(0∗ 10∗ 10∗ )∗ 10∗
E. (0∗ 10∗ 1)∗ 0∗
tifr2017 theory-of-computation regular-expressions
Consider the following non-deterministic automation, where s1 is the start state and s4 is the final (accepting) state.
The alphabet is {a, b}. 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. (a + b)∗ aba B. aba(a + b)∗ aba C. (a + b)aba(b + a)∗ D. aba(a + b)∗ E. (ab)∗ aba
Consider the following non-deterministic automaton,where s1 is the start state and s4 is the final (accepting) state. The
alphabet is {a, b}. 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. (r + s)∗ = r∗ s∗ LHS can generate ' sr' but RHS not
b. r(s + t) = rs + t LHS can generate ' rt' but RHS not
c. (r + s)∗ = r∗ + s∗ LHS can generate ' sr' but RHS not
d. (rs + r)∗ r = r(sr + r)∗ They are equivalent
e. (r∗ s)∗ = (rs)∗ LHS can generate ' rrrs' but RHS not
a. (a + b)∗ = { any strings of over {a, b}}
a∗ b∗ = { any number of a's followed by any number of b's }
False, as strings, ba, aba, bab, etc are not present in a∗ b∗
b. a(b + c) = {ab, ac}
ab + c = {ab, c}
False
c. (a + b)∗ = { any strings of over {a, b}}
a∗ + b∗ = { any numbers of a's or any numbers of b's }
False , as strings , ab, ba, aba, bab etc are not present in a∗ + b∗
d. (ab + a)∗ a = a(ba + a)∗ , True
p(qp)∗ = p{ϵ, qp, qpqp, qpqpqp, . . . } = {p, pqp, pqpqp, pqpqpqp, . . . } = {ϵ, pq, pqpq, pqpqpq, . . . }p = (pq)∗ p
(ab + a)∗ a = (a(b + ϵ))∗ a = a((b + ϵ)a)∗ = a(ba + a)∗
Correct Answer: D
36 votes -- Praveen Saini (42k points)
As, mentioned in the question, the regular expression must accept all strings of 0 and 1 but with even no of 1s
(including no 1s). Hence, 00 must be in the language. Option A, B, C, D do not accept 00. Hence, option E is
correct.
14 votes -- tarun_svbk (1.4k points)
On initial state S1, we have a loop labeled a,b which implies (a + b)∗
S1 on input b moves to S2. Then S2 on input a moves to S3 and S3 on ϵ reaches the final state S4.
But we have to account for the case when S4 on input a moves to S2.
Here we see, S4 on being given two successive a's forms a cycle/loop and comes back to the final state.
Hence, the regular expression corresponding to the language accepted by automaton would be (a + b)∗ ba(aa)∗
PS: We do have an ϵ move from S3 to S1, but this is not important as S1 state captures (a + b)∗ meaning instead of moving
to S3 and back to S1, there is an option to remain in S1 only. The given automata captures all binary strings ending with a
"ba" followed by zero or more "aa".
10 votes -- Sayan Bose (5k points)
Which of the following gives the correct true/false evaluation of the above?
A. true, false, true. B. false, false, true.
C. true, false, true. D. false, false, false.
E. true, true, true.
tifr2014 theory-of-computation regular-languages
Let B consist of all binary strings beginning with a 1 whose value when converted to decimal is divisible by 7.
C. B can be recognized by a deterministic push-down automaton but not by a non-deterministic finite state automaton.
D. B can be recognized by a non-deterministic push-down automaton but not by a deterministic push-down automaton.
E. B cannot be recognized by any push down automaton, deterministic or non-deterministic.
i. For every positive integer n, let #n be the product of all primes less than or equal to n.
Then, #p + 1 is a prime, for every prime p.
22
ii. π is a universal constant with value .
7
iii. No polynomial time algorithm exists that can find the greatest common divisor of two integers given as input in binary.
iv. Let L ≡ {x ∈ {0, 1}∗ ∣ x is the binary encoding of an integer that is divisible by 31}
Then, L is a regular language.
tifr2018 regular-languages
a. False because - L = a∗ b∗ , L′ = an bn Here L/L′ = a∗ . L/L′ is regular, but L′ is not.
b. True. If L is regular, L/L′ is prefix of language. Regular languages are closed under Qoutient/Prefix. So this is correct.
c. False L′ = Empty set. Then L/L′ is Empty set whatever L is. Here L can be say an bn . See defination of L/L′ to see
why L/L′ should be empty set.
d. False because L/L′ can accept prefixes of string of Language L, which may or may not be accepted by L itself. So
L/L′ is not subset. ( It is not Superset either , because L′ can be empty set )
e. False. Same explanation as C.
Answer is B.
17 votes -- Akash Kanase (36.1k points)
0126 : 018 018 018 018 018 018 018 {018 can be generated as09 09 }
0127 : 016 016 016 016 09 09 09 09 09 09 09
0128 : 016 016 016 016 016 016 016 016
Now, 0129 can be given as 0120 09 and so on.
Every Further powers can be generated by concatenating 09 .
23 votes -- Himanshu Agarwal (12.4k points)
i. False
Regular Languages are not closed under Infinite Union and Intersection
L1 ∪ L2 ∪ L3 ∪ L4 ∪ …
For example :
ab ∪ aabb ∪ aaabbb ∪ aaaabbbb ∪ …
= {an bn , n ≥ 1} which is not regular
So, Infinite Union is not closed
L1 ∩ L2 ∩ L3 ∩ L4 ∩ …
= (L′1 ∪ L′2 ∪ L′3 ∪ L′4 ∪ …)′
As Infinite Union is not closed, Infinite Intersection is also not closed
ii. False.
a∗ b∗ is regular
its subset an bn , n ≥ 1 is not regular
a∗ is regular
ap , p is prime, is not regular
iii. False
L = {} is regular
M be non-regular like {0n 1n ∣ n > 0} .
L. M = {} , is regular
Correct Answer: D
35 votes -- Praveen Saini (42k points)
L2 is finite, so regular.
L1 is non-regular.
(It seems CFL to me as I think it can be implement with the help of PDA , as stack can ensure (m = n ∨ n = p) and we can
also ensure (m + n + p ≥ 10) with minimum states changes along with transitions).
Correct Answer: D
23 votes -- Praveen Saini (42k points)
Intersection of two regular language is regular (Regular set being closed under intersection).
Correct Answer: A.
18 votes -- Ahwan Mishra (10.2k points)
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.5 A 21.6.6 D