GS2025 QP CS Lids
GS2025 QP CS Lids
1. What is the smallest positive integer that when multiplied with 23 32 43 57 65 results in
a perfect square?
(a) 6
(b) 10
(c) 15 ✓
(d) 60
(e) 210
2. Assume that in a room there are k persons. We know that k = 3 with probability
1 1 1
, k = 5 with probability , and k = 10 with probability . What is the probability
4 4 2
that at least two persons in the room have their birthday on the same day of the
week? Assume that all days of the week are equally likely.
1 15×61
(a)
2
(1 + 492
)
1 30
(b) 1− ( + 360
2 49 492
)
(c) 1 − 15
98
(1 + 12
49
) ✓
15×61
(d) 1− 492
4
(e)
7
3. How many distinct factors does 22 33 44 55 have? For example, 12 has 6 distinct factors:
1, 2, 3, 4, 6, and 12.
(a) 240
(b) 264 ✓
(c) 324
(d) 360
4. There are two bags, one with 10 red balls and 90 blue balls, and another with 90 red
balls and 10 blue balls. You pick one of the two bags uniformly at random and draw
a random ball from it, and it turns out to be red. You throw that ball away, and
draw another from the same bag. Let p be the probability that this ball is also red.
(a) 0 ≤ p ≤ 0.33
(b) 0.33 ≤ p < 0.50
(c) p = 0.5
(d) 0.50 < p < 0.66
(e) 0.66 ≤ p ≤ 1 ✓
5. There are three boxes. One box contains ten red socks, another contains ten blue
socks, and the third contains a mix ve red and ve blue socks. The three boxes are
labelled R (for red), B (for blue), or M (for mixed), but the labels are permuted so
that for EACH drawer the label attached to it does NOT match its contents.
How many total socks do you have to look at from the drawers, in order to correctly
identify each drawer? (You are not allowed to look inside the drawers. You can only
pick socks one at a time and observe its colour.)
3 0 1
A= 0 2 0 .
x 0 1
If all eigenvalues of the matrix are the same, what is the value of x?
(a) 2
(b) −2
(c) 1
(d) −1 ✓
(e) 0
7. Suppose we had a conical container with some liquid lled in that reaches until half
its height when placed with the circular face downwards. If we were to turn the cone
upside-down, suppose that the liquid reaches until α·h height when measured from
the bottom (the pointy end). (Diagram below not drawn to scale.)
h/2 α·h
(a) n
(b) n2 /2
(c) n(n + 1)/2 ✓
(d) (n + 1)2 /2
(e) n2
9. What is the largest number of knights that can be placed on a 60 × 60 chessboard
such that no two knights attack each other (two knights attack each other if they are
two steps away vertically and one step away horizontally, or vice versa).
The gure above shows a part of a chessboard showing all those squares that a knight
placed in the central white square attacks.
(a) 1200
(b) 1500
(c) 1800 ✓
(d) 2100
(e) 2400
10. A clock shows 3:00. After 101024 minutes, what minute does the minute hand point
to?
(a) 0
(b) 20
(c) 40 ✓
(d) 50
(e) 10
11. How many distinct ways are there to paint the 6 faces of a cube using six colors (1,
2, 3, 4, 5, 6), with each face painted a dierent color, such that no two painted cubes
are identical (i.e., cannot be transformed into each other by any rotation)?
(a) 30. ✓
(b) 60.
(c) 120.
(d) 360.
(e) 720.
12. Consider a coin which has probability p of coming up heads when tossed. Assume
that 0 < p < 1. A trial is performed by repeatedly tossing the coin until the rst
time it shows a head: the number of tosses made is then called the value of the
trial. (Thus, if a trial results in tosses tails, tails, heads, then its value is 3.) An
experiment is a sequence of n independent trials.
Akhil and Bela each perform an experiment, as dened above, with the coin. Akhil
denes the value A of his experiment to be the maximum of the values of the n trials
in his experiment, while Bela denes the value B of her experiment to be the average
of the value of the n trials in her experiment. Which of the following is correct?
(Here, for any random variable X , E[X] denotes the expectation of X .)
(a) E[A] is a strictly increasing function of n while E[B] does not depend
upon n. ✓
(b) E[A] is a non-constant function of n, but it is not strictly increasing, while E[B]
does not depend upon n.
(c) E[A] and E[B] are both strictly increasing functions of n.
(d) E[A] is a non-decreasing function of n while E[B] is a strictly decreasing function
ofn.
(e) Neither E[A] nor E[B] depends upon n.
13. Let (X, Y, Z) ∈ R3 be a point chosen uniformly at random from the unit sphere
S := {(a, b, c) ∈ R3 |a2 + b2 + c2 = 1} in three dimensions. What is the variance of
2
1 1 1
+ + ... + = 0.
z − c1 z − c2 z − cn
Assume that the numbers c1 , c2 , . . . , cn are represented in the complex plane by the
vertices of a convex n-gon C. Then
(a) the number z always lies strictly outside C.
(b) the number z always lies inside or on C. ✓
(c) the number z may lie inside or outside C depending on c1 , c2 , . . . , cn .
z = n1 nk=1 ck .
P
(d) if z lies inside C then z must be the centroid, i.e.,
15. How many subsets of {1, 2, . . . , 2n} do not contain two numbers with sum 2n + 1?
2n
(a) 3n + 2
(b) 3n ✓
2n
(c) 4n − 2
(d) 2n
(e) None of the above
Computer Science Section
(i) φ is satisable
(ii) ¬φ is unsatisable
(iii) φ is a tautology
(iv) ¬φ is a contradiction
(a) L1 ⊊ L2 ⊊ L3 ⊊ L4
(b) L1 ⊊ L2 ⊊ L3 = L4 ✓ .
(c) L1 ⊊ L2 = L3 = L4
(d) L1 = L2 ⊊ L3 = L4
(e) L1 ⊆ L2 = L3 ⊊ L4
5. Given a directed graph G and an initial vertex s, we would like to explore the graph
from s, that is, starting from s see all vertices along a path.
For example, the graph on the left side below cannot be explored from s since there
does not exist a path along which we can visit all vertices starting froms while the
graph on the right side can be explored from s by following the path s → u → s → t.
t t
s s
u u
(a) There exists a polynomial time algorithm to explore the graph from s.
✓
(b) There exists an exponential time algorithm to explore the graph from s but there
does not exist any polynomial time algorithm.
(c) There exists an algorithm to explore the graph from s but it is not known if it
runs in exponential time.
(e) The halting problem of Turing machine can be reduced to checking if a graph
can be explored from s.
6. The complexity class NP corresponds to the class of languages which can be accepted
by some nondeterministic Turing machine in polynomial time.
The complexity class coNP consists of all languages whose complement language is
in the class NP.
A complexity class C is said to be closed under union if for any two languages L1 and
L2 in C , we also have that L1 ∪ L2 ∈ C . Similarly, we also say that a complexity class
C is closed under intersection if for any two languages L1 and L2 in C , we also have
that L1 ∩ L2 ∈ C .
a
a a a a
a
a a a a a
ℓ be the length of the longest string that is NOT accepted by the above automata.
Let
Which of the following is TRUE about ℓ?
(a) ℓ = 18
(b) ℓ = 22
(c) ℓ = 23 ✓
(d) ℓ = 26
(e) ℓ is not well-dened as there are arbitrary long strings that the automata does
not accept.
8. Let G = (V, E) be a weighted, undirected and connected graph, with weight 1 ≤
wtG (e) ≤ 99 for edge e ∈ E . Suppose G′ is the graph with the same set of vertices
and edges, but with edge weights wtG′ (e) = 100 − wtG (e). Assume that |V | is an
even number.
(ii) For any pair of vertices s, t ∈ V , any shortest path from s to t in G is also a
longest path from s to t in G′ .
(iii) Any minimum-weight perfect matching of G is also a maximum-weight perfect
′
matching of G .
Which of the above statements ALWAYS TRUE for any such graphs G, G′ ?
(a) Only (i) and (ii)
9. Consider the following pseudocode. The program should take as input n, and when
it ends, the element A[i] of the vector A should contain the binomial coecient ni
(with the index of A starting from 0). In order to do so, what should replace the
in the pseudocode?
1: procedure BinomialCoefficient
2: input n
3: for i ← 0 to n do
4: A[i] ← 0
5: end for
6: A[0] ← 1
7: for i ← 1 to n do
8: B←A
9: for j ← 1 to n do
10: A[j] ←
11: end for
12: end for
13: end procedure
(a) B(j − 1) + B(j) ✓
(b) A(j − 1) + B(j − 1)
B(j) + B(n − j)
(c)
2
B(j − 1) × B(j)
(d)
2
A(j − 1) + B(j − 1)
(e)
2
10. Suppose 3 elements are hashed independently and uniformly at random one by one
to slots in a hash table of size 6 (assume that in case of a collision, the element is
hashed to the rst free slot). What is the expected number of elements that DO
NOT collide with an existing element in the table?
(a) 25/18
(b) 3/2
(c) 59/36
(d) 2
(e) 5/2 ✓
11. Recall the insertion sort algorithm:
1: procedure InsertionSort(A)
2: for i ← 1 to A.length − 1 do
3: key ← A[i]
4: j ←i−1
5: while j ≥ 0 and A[j] > key do
6: A[j + 1] ← A[j]
7: j ←j−1
8: end while
9: A[j + 1] ← key
10: end for
11: end procedure
Suppose for some parameter k (possibly a function of the length of the array n), we
are guaranteed that the array has k inversions, i.e., there are exactly k pairs(i, j)
such that A[i] > A[j] and i < j. Then, the running time of insertion sort for A is:
(a) Θ(n + k) ✓
(b) Θ(n log n + k)
(c) Θ(n2 + k)
(d) Θ(k log n)
(e) Θ(n log k)
12. Let m, n be positive integers such that 10 ≤ m ≤ n. Let A be an m×n matrix with
n
real entries. Letv be a unit vector in R with the maximum possible value of ∥Av∥2 .
2 T
Dene ℓ := ∥Av∥2 and let λ be an eigenvalue of A A with the largest absolute value.
Which of the following is TRUE? (Here, for a vector u, ∥u∥2 represents its Euclidean
length.)
13. There are n people in a house and n pairs of shoes such that the i-th shoe ts the
i-th person's feet (and no one else's). A burglar comes and throws the shoes around
in some indescribable manner. The people want to determine whose feet t which
shoe and they can only use the following oracles:
Fit : Takes as input a person and a shoe and outputs < if the person's feet are
too small for the shoe, = if they t, and > if they are too large.
Compare : Takes as input two people or two shoes and outputs < if the rst is
smaller than the second, = if they are the same size, and > if the rst is larger
than the second.
1. If they only have the Fit oracle, the determination can be made in O(n log n)
calls to the oracle in expectation.
2. If they only have the Compare oracle, the determination can be made in O(n log n)
calls to the oracle in expectation.
√
3. If they have both oracles, the determination can be made in O( n) calls to the
oracles in expectation.
(a) Only 1.
(b) Only 2.
(c) Only 3.
15. Letm be a positive integer and a be an integer such that a ∈ {0, 1, . . . , m − 1}.
LetSa = {b : b ∈ {0, 1, . . . , m − 1}, b2 ≡ a mod m} be the set of square roots of a
modulo m. Consider the following statements.
(i) For all natural numbers m and for all a ∈ {0, 1, . . . , m − 1}, |Sa | ≤ 2.
(ii) For all natural numbers m, there exists an a ∈ {0, 1, . . . , m − 1}, |Sa | > 2.
(iii) If m is a prime number, then for all a ∈ {0, 1, . . . , m − 1}, |Sa | ≤ 2.
(iv) For composite m, |Sa | is not necessarily bounded above by 2.
1.
Consider the vector ⃗v which is closest (in Euclidean distance) to a b c that can
be written in the form
⃗v = α 1 2 1 + β 1 1 1
where a, b, c and α, β
are real numbers. Recall that the squared (Euclidean) distance
P3 2
between two vectors x1 x2 x3 and y1 y2 y3 is given by i=1 (xi − yi ) . Con-
sider the following statements about the coecients α and β of the closest vector
⃗v :
(i) α = (a + 2b + c)/6
(ii) β = (a + b + c)/3
(iii) 2α + β = b
2. A 10cm long string is cut at two independently and uniformly chosen locations.
What is the probability that the resulting three pieces of string can form the sides of
a triangle?
(a) 2/3
(b) 1/2
(c) 1/3
(d) 1/4 ✓
(e) None of the above
3. From a survey conducted by a radio station, it was determined that a randomly chosen
listener likes Hindustani classical music with probability 0.85, Carnatic music with
probability 0.8, lm music with probability 0.75, and Western classical music with
probability 0.7. What is the least possible value for the probability that a randomly
chosen listener likes all four forms of music?
(a) 0
(b) 0.1 ✓
(c) 0.225
(d) 0.5
(a) 2
(b) 2.5
(c) 5
(d) ∞ ✓
(e) None of the above
2 3
Find the ∞-norm of the following matrix:
−2 4
(a) 4
(b) 7
(c) 6 ✓
(d) 5
(e) 8
(a) X = X2
(b) X is the identity matrix
(c) X=0
(d) X is a real matrix
(b) E[X 2 ] = EY 2
(c) E[X 2 ] < e7
(d) E[X 2 ] > e−7
(e) None of the above ✓
8. Let X = (X1 , X2 ) be a point chosen uniformly at random from the interior of an
origin centered regular hexagon of side length 1. Which of the following is TRUE?
(a) [X, X] = 0
(b) [[X, Y ], Z] + [[Y, Z], X] + [[Z, X], Y ] = 0
(c) [X, Y ] = −[Y, X]
(d) [[X, X], Y ] = 0
(e) None of the above ✓
10. Let A, B ⊆ R2 be two-dimensional sets dened as follows.
and
2
X
B = {(x1 , x2 ) : |xi | ≤ a},
i=1
for some 0 < a < 2. Then what is the maximum number of corners A∩B can have
(a) 32
(b) 16
(c) 8 ✓
(d) 4
(e) None of the above
11. Consider a six-faced dice that has equal probability of showing any of the six numbers
from {1, 2, . . . , 6} on each roll. Let X be the number seen on the rst roll and let
Y = 6 − X . Let Z = max{X, Y }. Consider the following statements
(i) E[Z] = 4
(ii) Z is uniformly distributed over {3, 4, 5, 6}
9
(iii) E[Z] = 2
12. Consider a right-angled triangle ABC, with angle ABC as 90◦ . Let the height AB
be constant, and let the base BC be of length x and hypotenuse AC be of length y.
Let x be changing with dx/dt = 1, and angle BCA is θ(t). What is dy/dt?
(a) sin(θ(t))
(b) 1/ cos(θ(t))
(c) cos(θ(t)) ✓
(d) 1/ sin(θ(t))
(e) None of the above
13. For two n×n matrices A and B , suppose that there exist two non-zero n-dimensional
vectors x, y such that Ax + By = 0. Which of the following is always TRUE?
(a) A and Bare similar (two matrices A and B are similar if there exists a matrix
−1
C such that A = C BC )
(b) A and B have at least one common non-zero eigenvalue
n
X
Sn = {x = (x1 , x2 , . . . , xn ) : xi ≥ 0 ∀ i = 1, . . . , n, xi = 1}.
i=1
Let diameter(Sn ) = maxx,y∈Sn ||x − y||, where ||x − y|| is the Euclidean distance
2
between x, y. What is diameter(Sn ) ? [Hint: It might be easier to bound ||x − y|| .]
√
(a) 2 ✓
(b) 2
√
(c) n
√
(d) 3
(e) None of the above
15. Let f :R→R be a dierentiable function such that f has at least three distinct
real zeros. Dene the function g : R → R as g(x) = f ′ (x) + xf (x). Then g has
(a) no real zeros