GS2022_QP_CSS
GS2022_QP_CSS
1. A snail crawls up a vertical pole 75 feet high, starting from the ground. Each day it
crawls up 5 feet, and each night it slides down 4 feet. When will it first reach the top
of the pole?
(a) 75th day
(b) 74th day
(c) 73rd day
(d) 72nd day
(e) 71st day ✓
2. We would like to invite a minimum number n of people (their birthdays are indepen-
dent of each other) to a party such that the expected number of pairs of people that
share the same birthday is at least 1. What should n be?
(Ignore leap years, so there are only 365 possible birthdays. Assume that birthdays
fall with equal probability on each of the 365 days of the year.)
(a) 23
(b) 28 ✓
(c) 92
(d) 183
(e) 366
3. A binary string is a sequence of 0’s and 1’s. A binary string is finite if the sequence
is finite, otherwise it is infinite. Examples of finite binary strings include 00010100,
and 1111101010. Which of the following is TRUE about the set of all finite binary
strings and the set of all infinite binary strings?
(a) The set of all finite binary strings is countable while the set of all
infinite binary strings is uncountable ✓
(b) The set of all finite binary strings is uncountable while the set of all infinite binary
strings is countable
(c) The set of all finite binary strings and the set of all infinite binary strings are
both countable
(d) The set of all finite binary strings and the set of all infinite binary strings are
both uncountable
(e) The set of all finite binary strings is countable while whether the set of all infinite
binary strings is countable or not is not known
GS 2022 Common part Page 2 of 16
5. Let F be the set of all functions mapping {1, . . . , n} to {1, . . . , m}. Let f be a
function that is chosen uniformly at random from F. Let x, y be distinct elements
from the set {1, . . . , n}. Let p denote the probability that f (x) = f (y). Then,
(a) p = 0
1
(b) p = nm
1
(c) 0 < p ≤ mn
1
(d) p = m
✓
1
(e) p = n
9. You are given the following properties of sets A, B, X, and Y . For notation, |A|
denotes the cardinality of set A (i.e., the number of elements in A), and A \ B
denotes the set of elements that are in A but not in B.
1. A ∪ B = X ∪ Y
2. A ∩ B = X ∩ Y = ∅
3. |Y \ A| = 2
4. |A \ X| = 4
10. Consider a bag containing colored marbles. There are n marbles in the bag such that
there is exactly one pair of marbles of color i for each i ∈ {1, . . . , m} and the rest of
the marbles are of distinct colors (different from colors {1, . . . , m}). You draw two
marbles uniformly at random (without replacement). What is the probability that
both marbles are of same color?
m
(a) n
2m
(b) n
GS 2022 Common part Page 4 of 16
2m
(c) n(n−1)
✓
2m
(d) n2
m
(e) n(n−1)
11. Let X be a finite set. A family F of subsets of X is said to be upward closed if the
following holds for all sets A, B ⊆ X:
A ∈ F and A ⊆ B ⇒ B ∈ F.
For families F and G of subsets of X, let
F ⊔ G = {A ∪ B : A ∈ F and B ∈ G}.
Suppose F and G are upward closed families. Then which of the following is true?
(a) F ⊔G =F ∩G ✓
(b) F ⊔G =F ∪G
(c) F ⊔G =F \G
(d) F ⊔G =G\F
(e) None of the above
12. Alice plays the following game on a math show. There are 7 boxes and identical
prizes are hidden inside 3 of the boxes. Alice is asked to choose a box where a prize
might be. She chooses a box uniformly at random. From the unchosen boxes which
do not have a prize, the host opens an arbitrary box and shows Alice that there is
no prize in it. The host then allows Alice to change her choice if she so wishes. Alice
chooses a box uniformly at random from the other 5 boxes (other than the one she
chose first and the one opened by the host). Her probability of winning the prize is
(a) 3/7
(b) 1/2
(c) 17/30
(d) 18/35 ✓
(e) 9/19
13. Consider the transition system shown in the figure below with the initial state s1 . A
token is initially placed at s1 , and it moves to s2 with probability 32 , and to s3 with
probability 31 . From s2 and s3 , the token always moves to s1 and s2 respectively. A
run of the system consists of an infinite sequence of states constructed by moving
the token from one state to another following the transitions forever. Assuming such
a run is chosen randomly, what is the fraction of times that the state s2 is expected
to appear in the run?
2/3
start s1 s2
1
1/3 1
s3
GS 2022 Common part Page 5 of 16
1
(a) 7
2
(b) 7
3
(c) 7
✓
5
(d) 7
(e) None of the above
14. Suppose w(t) = 4eit , x(t) = 3ei(t+π/3) , y(t) = 3ei(t−π/3) and z(t) = 3ei(t+π) are points
that move in the complex plane as the time t varies in (−∞, ∞). Let c(t) be the point
in the complex plane such that |w(t)−c(t)|2 +|x(t)−c(t)|2 +|y(t)−c(t)|2 +|z(t)−c(t)|2
is minimum. For each value of t, the point c(t) is unique, but c(t) moves at constant
d
speed as t varies. At what speed? That is, what is dt c(t) ?
1
(a) 2π
(b) 2π
√
(c) 3π
(d) √1
3π
(e) 1 ✓
15. Fix n ≥ 4. Suppose there is a particle that moves randomly on the number line, but
never leaves the set {1, 2, . . . , n}. The initial probability distribution of the particle
is π i.e., the probability that particle is in location i is given by π(i). 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 distribution 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
1. Which data structure is commonly used to implement breadth first search in a graph?
(a) A queue ✓
(b) A stack
(c) A heap
(d) A hash table
(e) A splay tree
2. Let G = (V, E) be an undirected simple graph. A subset M ⊆ E is a matching in
G if distinct edges in M do not share a vertex. A matching is maximal if no strict
superset of M is a matching. How many maximal matchings does the following graph
have?
(a) 1
(b) 2
(c) 3
(d) 4✓
(e) 5
3. Consider the problem of sorting n single digit integers (base 10). This problem can
be solved in time
(a) O(n log n) but not O(n log log n)
(b) O(n log log n) but not O(n)
(c) O(n) but not O(n/ log log n) ✓
(d) O(n/ log log n)
(e) None of the above.
4. Consider the following algorithm for computing the factorial of a positive integer n,
specified in binary:
prod ← 1
for i from 1 to n
prod ← prod × i
output prod
Assume that the number of bit operations required to multiply a k-bit positive integer
with an ℓ-bit positive integer is at least Ω(k +l) and at most O(kl). Then, the number
of bit operations required by this algorithm is
GS 2022 CS part Page 7 of 16
(a) O(n)
(b) O(n log n) but ω(n)
(c) O(n2 ) but ω(n log n)
(d) O(n3 ) but ω(n2 ) ✓
(e) None of the above
5. There is an unsorted list of n integers. You are given 3 distinct integers and you have
to check if all 3 integers are present in the list or not. The only operation that you
are allowed to perform is a comparison. Let A be an algorithm for this task that
performs the least number of comparisons. Let c be the number of comparisons done
by A. Then,
(a) c = 3n
(b) c = 2n + 5
(c) c ≥ 3n − 1
(d) c ≤ n
(e) c ≤ 2n + 3 ✓
6. We are given a graph G along with a matching M and a vertex cover C in it such
that |M | = |C|. Consider the following statements:
P ::= QR
Q ::= c
Q ::= RcR
R ::= ddQ
8. Let r1 and r2 be two regular expressions. They symbol ≡ stands for equivalence of
two regular expressions in the sense that if r1 ≡ r2 , then both regular expressions
describe the same language. Which of the following is/are FALSE?
(A1) Given a directed graph G with positive weights on the edges, two special vertices
s and t, and an integer k - it is NP-complete to determine if G has an s-t path
of length at most k.
(A2) P = NP.
11. Consider the following function count, that takes as input a, an array of integers,
and N, the size of the array.
GS 2022 CS part Page 9 of 16
Further, let count_IS be the number of comparisons made by the insertion sort
algorithm on the array a.
Which of the following statements is TRUE for some constant c?
(a) For all N ≥ c, there exists an array of size N for which count_IS ≥ N 2 /c,
while count_FN ≤ cN ✓
(b) For all N ≥ c, there exists an array of size N for which count_FN ≥ N 2 /c, while
count_IS ≤ cN
(c) For all N ≥ c, for all arrays of size N, count_FN ≤ count_IS ≤ c × count_FN
(d) For all N ≥ c, for all arrays of size N, count_FN ≥ N 2 /c
(e) None of the above
12. Given an undirected graph G, an ordering σ of its vertices is called a perfect ordering
if for every vertex v, the neighbours of v which precede v in σ form a clique in G.
Recall that given an undirected graph G, a clique in G is a subset of vertices every
two of which are connected by an edge, while a perfect colouring of G with k colours
is an assignment of labels from the set {1, 2, . . . , k} to the vertices of G such that no
two vertices which are adjacent in G receive the same label.
Consider the following problems.
Problem Special-Clique
INPUT: An undirected graph G, a positive integer k, and a perfect ordering σ of
the vertices of G.
OUTPUT: Yes, if G has a clique of size at least k, No otherwise.
Problem Special-Colouring
INPUT: An undirected graph G, a positive integer k, and a perfect ordering σ of
the vertices of G.
OUTPUT: Yes, if G has a proper colouring with at most k colours, No otherwise.
Assume that P ̸= N P . Which of the following statements is true?
(a) Both Special-Clique and Special-Colouring are undecidable
(b) Only Special-Clique is in P
GS 2022 CS part Page 10 of 16
13. Consider a directed graph G = (V, E), where each edge e ∈ E has a positive edge
weight ce . Determine the appropriate choices for the blanks below so that the value
of the following linear program is the length of the shortest directed path in G from
s to t. (Assume that the graph has at least one path from s to t.)
(blank 1)imize Xt
s.t. Xs = 0
Xw − Xv (blank 2) ce (for each edge e = (v, w) ∈ E).
14. Let G be a directed graph (with no self-loops or parallel edges) with n ≥ 2 vertices
and m edges. Consider the n × m incidence matrix M of G, whose rows are indexed
by the vertices of G and the columns by the edges of G. The entry mv,e is defined as
follows.
−1 if e = (v, w) for some vertex w,
mv,e = +1 if e = (u, v) for some vertex u,
0 otherwise.
Suppose every vertex of G is reachable from a special source vertex of G. Then, what
is the rank of M ?
(a) m − 1
(b) m − n + 1
(c) ⌈m/2⌉
(d) n − 1 ✓
(e) ⌈n/2⌉
15. Let R denote the set of real numbers. Let d ≥ 4 and α ∈ R. Let
( d d
)
X X
S = (a0 , a1 , . . . , ad ) ∈ Rd+1 : ai αi = 0 and iai αi−1 = 0 .
i=0 i=0
Then,
(a) S is finite or infinite depending on the value of α
GS 2022 CS part Page 11 of 16
—End of CS Section—
(SS section begins in the following page)
GS 2022 SS part Page 12 of 16
1. Suppose that a random variable X can take 5 values {1, 2, 3, 4, 5} with probabilities
that depend upon n ≥ 0 and are given by
ekn
P (X = k) =
en + e2n + e3n + e4n + e5n
for k = 1, 2, 3, 4, 5. What can one say about the expectation E[X] as n → ∞?
(a) It increases to infinity as n → ∞
(b) It equals 3 for all values of n ≥ 0
(c) It converges to 1 as n → ∞
(d) It converges to 5 as n → ∞ ✓
(e) It converges to 0 as n → ∞
2. Consider a coin flip game between Amar, Akbar and Anthony. A fair coin (so that
heads and tails each have probability 0.5) is independently flipped five times. Amar
wins if at least three consecutive draws of heads are observed in the five coin tosses.
Akbar wins if at least three consecutive draws of tails are observed in the five coin
tosses. Anthony wins if the other two do not win. What is the probability of Anthony
winning?
(a) 9/16
(b) 1/3
(c) 1/2 ✓
(d) 5/8
(e) 7/12
3. Consider two linear time invariant (LTI) systems T1 and T2 with impulse responses
h1 (n) and h2 (n), respectively. Let there be two cascades C1 and C2 , where in C1 , T2
follows after T1 , and in C2 , T1 follows after T2 .
T1 T2 T2 T1
C1 C2
5. Let Q be a unit square in the plane with corners at (0, 0), (0, 1), (1, 0) and (1, 1). Let
B be a ball of radius 1 in the plane centered at the origin (0, 0). Let Q + B denote
the set of all vectors in the plane of the form v + w, where v ∈ Q and w ∈ B. The
area of Q + B is:
(a) 5 + π ✓
(b) 4 + π
(c) 3 + π
(d) 2 + π
(e) 1 + π
7. Two players A and B of equal skill are playing a match. The first one to win 4 rounds
wins the match. Both players are equally likely to win each round independent of
the outcomes of the other rounds. After 3 rounds, A has won 2 rounds and B has
won 1 round. Conditioned on this, what is the conditional probability that A wins
the match?
(a) 5/8
(b) 2/3
(c) 11/16 ✓
(d) 5/7
(e) None of the above
8. Let a, b, c be real numbers such that the following system of equations has a solution
x + 2y + 3z = a (1)
8x + 10y + 12z = b (2)
7x + 8y + 9z = c − 1 (3)
9. Suppose you throw a dart and it lands uniformly at random on a target which is a
disk of unit radius. What is the probability density function f (x) of the distance of
the dart from the center of the disk?
(
1, if 0 ≤ x ≤ 1
(a) f (x) =
0, otherwise
(
2x, if 0 ≤ x ≤ 1
(b) f (x) = ✓
0, otherwise
(
3x2 , if 0 ≤ x ≤ 1
(c) f (x) =
0, otherwise
(
4x3 , if 0 ≤ x ≤ 1
(d) f (x) =
0, otherwise
GS 2022 SS part Page 15 of 16
(a) 31 1 1 1 ✓
(b) 21 0 1 −1
(c) 31 1 1 1 + 12 0 1 −1
(d) − 13 1 1 1 + 21 0 1 −1
11. A drunken man walks on a straight lane. At every integer time (in seconds) he
moves a distance of 1 unit randomly, either forwards or backwards. What is the
expectation of the square of the distance after 100 seconds from the initial position?
Hint: The position at time 100 is a sum of independent and identically distributed
random variables.
(a) 100 ✓
√
300
(b) 4
(c) 40
(d) 200
(e) 20π
√1 π
(a) 2
1− 8
(b) 0
π
(c) 1 − √
2 2
(d) − √12 1 + 9π
2
√
(e) − 2π ✓
14. Let a bag contain ten balls numbered 1, 2, . . . , 10. Let three balls be drawn at random
in sequence without replacement, and the number on the ball drawn on the ith choice
be ni ∈ {1, 2, . . . , 10}. What is the probability that n1 < n2 < n3 ?
1
(a) 3
1
(b) 12
1
(c) 4
1
(d) 6
✓
(e) None of the above
— End of paper —