0% found this document useful (0 votes)
21 views16 pages

GS2025 QP CS Lids

Uploaded by

shafqathassan00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views16 pages

GS2025 QP CS Lids

Uploaded by

shafqathassan00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

GS 2025: Solutions for Computer Science (CS)

and Learning, Information and Data Sciences (LIDS)


Common Section

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

(e) None of the above

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.

Which of the following is true?

(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.)

(a) One sock. ✓


(b) Two socks.

(c) Three socks.

(d) Four socks.

(e) Six socks.

6. Consider the following matrix:

 
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

Which of the following is true about α?


(a) α ≤ 0.5
(b) 0.5 < α < 0.6
(c) 0.6 < α ≤ 0.7
(d) 0.7 < α ≤ 0.8
(e) 0.8 < α ≤ 1 ✓
8. Consider the collection C of all possible n × n matrices with entries in {1, . . . , n} that
obey the following property:

ˆ every row of M is a permutation of {1, 2, . . . , n} and every column of M is a


permutation of {1, 2, . . . , n}.
An example of such a matrix for n=3 is the following.
 
3 2 1
M = 1 3 2
2 1 3

Suppose we choose a matrix X from C uniformly at random. What is the expected


value of trace(X)? Recall that the trace of a matrix is the sum of its diagonal entries.

(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

the random variable Z ?


1
(a)
2
(b) 1
3

1
(c)
4
1
(d)
5
(e) 1

14. Let c1 , c2 , . . . , cn and z be complex numbers such that

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.,

(e) None of the above

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

1. What is the solution to the following recursion?


n n n
T (n) = T +T +T + O(n),
2 3 6
T (n) = 5 ∀n < 100.

(a) T (n) = Θ(n log n) ✓


(b) T (n) = Θ(n log2 n)
(c) T (n) = Θ(n2 )
(d) T (n) = Θ(n2 log n)
(e) T (n) = 2Θ(n)

2. Let φ be a propositional formula on n variables, with n ≥ 1. Consider the following


statements.

(i) φ is satisable

(ii) ¬φ is unsatisable

(iii) φ is a tautology

(iv) ¬φ is a contradiction

Which of the following is ALWAYS TRUE for all such formulas φ?


(a) (i) ̸⇔ (ii), and (ii) ⇔ (iii) ⇔ (iv) ✓
(b) (i) ̸⇔ (ii), and (ii) ̸⇔ (iii), and (iii) ⇔ (iv)

(c) (i) ̸⇔ (ii), and (iii) ̸⇔ (iv), and (ii) ⇔ (iii)

(d) (i) ̸⇔ (ii), and (ii) ̸⇔ (iii), and (iii) ̸⇔ (iv)

(e) (i) ⇔ (ii) ⇔ (iii) ⇔ (iv)

3. Consider the following sets.

(i) The set of all natural numbers N.


(ii) The set of all rational numbers Q.
(iii) The set of all functions from N to {1, 2, 3, 4, 5}.
(iv) The set of all functions from {1, 2, 3, 4, 5} to N.

Which of the above sets are countable?

(a) Only (i)

(b) Only (i) and (ii)

(c) Only (i) and (iv)

(d) Only (i), (ii) and (iii)

(e) Only (i), (ii) and (iv) ✓


4. Consider the following languages:

ˆ L1 is the set of languages recognised by a deterministic pushdown automaton.

ˆ L2 is the set of languages recognised by a nondeterministic pushdown automaton.


ˆ L3 is the set of languages recognised by a nondeterministic Turing machine.

ˆ L4 is the set of languages recognised by a nondeterministic Turing machine with


two tapes.

Choose the correct option below.

(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

Which of the following is TRUE?

(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.

(d) The decidability of the problem is open.

(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 .

Consider the following statements.

(i) The class NP is closed under union.

(ii) The class coNP is closed under union.

(iii) The class NP is closed under intersection.

(iv) The class coNP is closed under intersection.

Which of the above statements are TRUE?

(a) Only (i) and (iv)

(b) Only (ii) and (iii)

(c) Only (i) and (iii)

(d) Only (ii) and (iv)

(e) All of (i), (ii), (iii), and (iv) ✓


7. Consider the following non-deterministic automata for a unary language L ⊆ {a}∗
consisting of 11 states with the start state as the unique nal state. All transitions
shown are on the symbol a.

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.

Consider the following statements.

(i) Any minimum-weight spanning-tree of G is also a maximum-weight spanning-



tree of G .

(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)

(b) Only (i) and (iii) ✓


(c) Only (ii) and (iii)

(d) (i), (ii) and (iii)

(e) None of (i), (ii) or (iii) is always true.

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.)

(a) v may not exist.

(b) v always exists, but λ may not be real.

(c) v always exists, λ is real, and λ = ℓ. ✓


(d) v always exists, λ is real, λ ≤ ℓ, and λ ̸= ℓ is possible.

(e) v always exists, λ is real, λ ≥ ℓ, and λ ̸= ℓ is possible.

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.

Which of the following statements are TRUE (assuming access to randomness)?

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.

(d) Only 1 and 2. ✓


(e) All three statements are true.

14. Let G s, t in G, let MinCut(s, t) be


be an undirected graph. For any pair of vertices
the least number of edges that have to be deleted from G so that there is no s-t path
in the resulting graph. Let a, b, c be three vertices in G such that MinCut(a, b) ≥
MinCut(b, c) ≥ MinCut(a, c). Consider the following statements.

(i) MinCut(a, b) > MinCut(b, c) > MinCut(a, c).


(ii) MinCut(a, b) = MinCut(b, c) > MinCut(a, c).
(iii) MinCut(a, b) > MinCut(b, c) = MinCut(a, c).
(iv) MinCut(a, b) = MinCut(b, c) = MinCut(a, c).

Which of the above statements are possible?

(a) Only (i) and (ii)

(b) Only (ii) and (iii)

(c) Only (iii) and (iv) ✓


(d) Only (ii), (iii), (iv)
(e) All of (i), (ii), (iii), (iv)

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.

Which of the above statements are TRUE ?

(a) Only (i)

(b) Both (ii), (iv)

(c) Only (iii)

(d) Only (iv)

(e) Both (iii), (iv) ✓


Learning, Information and Data Sciences Section

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

Which of the above statements are always TRUE?

(a) (i) only

(b) (ii) only

(c) (iii) only ✓


(d) (i) and (ii) only

(e) None of the above

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

(e) None of the above


4. Suppose in a sequence of tosses of a coin, the rst toss is equally likely to show heads
or tails. For the next toss, the probability of seeing heads is 2/3 if the rst toss was
heads and the probability of seeing heads is 1/3 if the rst toss was tails. In general,
for the (k + 1)-th toss, the probability of heads is (1 + m)/(2 + k) where m is the
number of heads seen in the rst k tosses. What is the expected number of tosses
before the rst heads is seen?

(a) 2

(b) 2.5

(c) 5

(d) ∞ ✓
(e) None of the above

5. Recall the denitions of the ∞-norm of a vector x ∈ Rn and of a matrix A ∈ Rm×n :


n
∥x∥∞ = max |xi | and ∥A∥∞ = sup ∥Ax∥∞ .
i=1 x:∥x∥∞ =1

 
2 3
Find the ∞-norm of the following matrix:
−2 4
(a) 4

(b) 7

(c) 6 ✓
(d) 5

(e) 8

6. Suppose X is a 10 × 10 matrix with complex entries and that X 3 = X 4. Which of


the following is necessarily TRUE?

(a) X = X2
(b) X is the identity matrix

(c) X=0
(d) X is a real matrix

(e) None of the above ✓


7. 2
Let (X, Y ) be an R -valued random variable. Suppose E[X] = E[Y ] = 0 and E[XY ] =
1
. Which of the following is necessarily TRUE?
2
4
(a) E[X ] = 1

(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) E[X12 + X22 ] ≥ 1


(b) The rst and second eigenvalues of the matrix E[XX T ] are equal ✓
1
(c) P[X12 + X22 > 0.999999] > 10
1
(d) P[(X12 + X22 )2 > 0.999999] > 10
(e) None of the above

9. Let X, Y, Z be complex n×n matrices. Dene [X, Y ] = XY − Y X . Which of the


following is FALSE?

(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.

A = {(x1 , x2 ) : max |xi | ≤ 1},


i=1,2

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

Then which of the following statements is TRUE?

(a) (i) only

(b) (ii) only


(c) (iii) only ✓
(d) Both (i) and (ii)

(e) Both (ii) and (iii)

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

(c) A and B have at least one common eigenvector

(d) A and B have the same rank

(e) None of the above ✓


14. Consider a set Sn in n dimensions dened as

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

(b) exactly one real zero

(c) at least two real zeros ✓


(d) less than two real zeros

(e) none of the above

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy