0% found this document useful (0 votes)
4 views

pgcs2024

The document outlines the entrance examination format for the M.Sc. / Ph.D. Programme in Computer Science at Chennai Mathematical Institute for 2024, consisting of two parts: Part A with 10 multiple-choice questions and Part B with 7 algorithmic problems. Each question tests knowledge in various areas of computer science, including graph theory, algorithms, and automata. The total marks for the examination are 100, with specific instructions on answering and the nature of the questions provided.

Uploaded by

amitsamanta2823
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)
4 views

pgcs2024

The document outlines the entrance examination format for the M.Sc. / Ph.D. Programme in Computer Science at Chennai Mathematical Institute for 2024, consisting of two parts: Part A with 10 multiple-choice questions and Part B with 7 algorithmic problems. Each question tests knowledge in various areas of computer science, including graph theory, algorithms, and automata. The total marks for the examination are 100, with specific instructions on answering and the nature of the questions provided.

Uploaded by

amitsamanta2823
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/ 5

CHENNAI MATHEMATICAL INSTITUTE

M.Sc. / Ph.D. Programme in Computer Science


Entrance Examination, 2024

Part A has 10 questions of 3 marks each. Each question in Part A has four choices, of which
exactly one is correct. Part B has 7 questions of 10 marks each. The total marks are 100.
Answers to Part A must be filled in the answer sheet provided.
In all questions related to graphs, unless otherwise specified, we use the word “graph” to mean
an undirected graph with no self-loops, and at most one edge between any pair of vertices.

Part A
1. All inhabitants of the Old Forest are either Ents or Bents. Ents always tell the truth
and Bents always lie. During a visit to the Old Forest, you encounter four inhabitants
– A, B, C and D. They make the following assertions.

A: Exactly one of us is a Bent.


B: Exactly two of us are Bents.
C: Exactly three of us are Bents.
D: Exactly four of us are Bents.

How many of them are Bents?


(a) 1 (b) 2 (c) 3 (d) 4

2. Friends Akshay and Bipasha go to a fun fair, and decide to explore the stalls separately.
Each of them visits a stall every 10 minutes, starting at 8am. If a stall that Akshay
visits is one that he has not seen before, he texts new to Bipasha; otherwise he texts
old. If a stall that Bipasha visits is new to her she texts new to Akshay; otherwise
she texts old. A round refers to such a pair of messages, one sent by Akshay and the
other sent by Bipasha. If there are 50 stalls, what is the maximum number of rounds
they can go before both of them text old to each other in the same round?
(a) 99 (b) 100 (c) 2500 (d) 50

1
3. You live in ∆-City, which is a large equilateral triangle with each side of length 2km.
The corners are named A, B and C. The city is partitioned into triangular blocks
with sides of 500m each, and there are roads at the boundaries of the blocks.
You live in corner A and your office is at corner B.

B C

You have decided to walk from home to the office everyday, and you are willing to
change your route, as long as the total distance is at most 2.5kms. How many such
routes are possible from A to B?
(a) 5 (b) 11 (c) 21 (d) 45

4. Rohit and Ben participate in a new toss system introduced by the ICC. The umpire
repeatedly tosses a fair coin (which comes up heads with probability 21 and tails with
probability 12 ), until one of them wins. Rohit wins if the result of two consecutive
tosses is heads (i.e., the pattern HH is seen), while Ben wins if the pattern TH is seen.
What are the winning probabilities for Rohit and Ben?
1 3 1 1 1 1 1 2
(a) 4
and 4
(b) 4
and 4
(c) 2
and 2
(d) 3
and 3

5. Let Σ = {a, b, c}. What is the language generated by the following grammar?

S := ϵ | aS | Sb | cS

(a) (a + b + c)∗ b∗ (b) (a + b + c)∗ c∗


(c) (a + c)∗ b∗ (d) (a + b)∗ c∗
6. Let Σ = {a1 , a2 , . . . , an } for some n ≥ 1. Consider the two languages:

L1 = {w ∈ Σ∗ | ∃ai ∈ Σ such that ai occurs at least two times in w}


L2 = Σ∗ (a1 a1 + a2 a2 + · · · an an ) Σ∗

Which of the following statements are true?

(I) There is an NFA with O(n) states accepting L1 .


(II) There is a DFA with O(n) states accepting L1 .
(III) There is an NFA with O(n) states accepting L2 .
(IV) There is a DFA with O(n) states accepting L2 .

(a) All of the above (b) I, III, IV


(c) I and III (d) I, II and III

2
7. Consider the following two recurrence relations:

• T1 (n) = T1 ( n2 ) + T1 ( n3 ) + Θ(n), T1 (1) = 2


• T2 (n) = T2 ( 2n
3
) + T2 ( n3 ) + Θ(n), T2 (1) = 2

Which of the following statements is true?

(a) T1 (n) = Θ(n) and T2 (n) = Θ(n)


(b) T1 (n) = Θ(n log n) and T2 (n) = Θ(n log n)
(c) T1 (n) = Θ(n) and T2 (n) = Θ(n log n)
(d) T1 (n) = Θ(n log n) and T2 (n) = Θ(n)

8. Let G be an undirected connected graph with distinct edge weights. Let emax be the
edge with maximum weight and emin the edge with minimum weight. What can you
say about the following statements?

(I) Every minimum spanning tree of G must contain emin


(II) Every minimum spanning tree must exclude emax

(a) I is True, but II is False (b) I is False, but II is True


(c) Both I and II are False (d) Both I and II are True
9. Let G be a directed graph with distinct and nonnegative edge weights. Let s be a
starting vertex and t a destination vertex. Assume that G has at least one s-t path.
What can you say about the following statements?

(I) Every shortest s-t path (minimum weight) must include the minimum-weight
edge of G.
(II) Every shortest s-t path must exclude the maximum-weight edge of G.

(a) I is True, but II is False (b) I is False, but II is True


(c) Both I and II are False (d) Both I and II are True
10. In the following code, A is an array indexed from 0, and for two integers a, b the
expression a//b returns ⌊ ab ⌋, the largest integer which is not larger than a/b.

foo(A, first, last)


1 if first ≥ last
2 then return A[first]
3 else
4 mid ← (first + last)//2
5 l ← foo(A, first, mid )
6 r ← foo(A, mid +1, last)
7 return l + r

If A = [1, 2, 3, 4, 5, 6], what will foo(A, 0, 5) return?


(a) 3 (b) 7 (c) 15 (d) 21

3
Part B
1. A binary search tree is a binary tree whose proper subtrees are binary search trees,
and whose root is strictly greater than all elements in the left subtree, and strictly
less than all elements in the right subtree. A preorder listing of a tree is obtained by
listing the root first, then recursively listing all elements of the left subtree in preorder,
followed by all elements of the right subtree in preorder.
Provide algorithms for the following two problems, and calculate their worst-case run-
ning times.

(a) Input is an array of integers A[1..n]. Output is “Yes” if A is the preorder listing
of a binary search tree, and “No” otherwise.
(b) Input is an array of integers A[1..n] which is guaranteed to be the preorder listing
of a binary search tree. Output is a binary tree t such that A is the preorder
listing of t.

2. Let M1 = (Q1 , {q1 }, ∆1 , F1 ), where ∆1 ⊆ Q1 × (Σ ∪ {ϵ}) × Q1 , be a non deterministic


finite automaton (NFA) accepting a language L1 ⊆ {0, 1}∗ . Let ϵ denote the null string.
We construct a new NFA M2 = (Q, {q2 }, ∆2 , F2 ), where ∆2 ⊆ Q2 × (Σ ∪ {ϵ}) × Q2 , as
follows.

• Q2 = Q1 .
• q2 = q1 .
• F2 = F1 ∪ {q1 }.
• (p, a, p′ ) ∈ ∆2 iff either (p, a, p′ ) ∈ ∆1 or (p ∈ F1 and a = ϵ and p′ = q1 )

Prove or disprove: The language L2 accepted by M2 is L∗1 .

3. You are using a fair coin to walk along the number line, starting at position 0. You
toss the coin. If you get heads you move two steps to your right, to position 2. On
the other hand if you get tails you move one step to your right, to position 1. You
continue tossing the coin. Every time you get heads you move two steps to the right
of the position you are in currently, and if you get tails you move one step to the right
of the position you are in currently.
Show that the probability of landing in position n is
1 1
[2 + (− )n ]
3 2
.

4. Suppose all points on the 2D plane with integer coordinates are coloured either blue
or green. Show that there is an isosceles right angled triangle all of whose vertices are
the same colour.

5. Let Σ be a finite alphabet. The reverse of a word is defined inductively as follows:


rev(ϵ) = ϵ and rev(wa) = a·rev(w) for w ∈ Σ∗ and a ∈ Σ. For example, rev(aab) = baa.
For a language L, we define rev(L) := {rev(w) | w ∈ L}.

(a) Is rev(L1 ∩ L2 ) equal to rev(L1 ) ∩ rev(L2 )?

4
(b) Prove or disprove the following statement: w ∈ L ∩ rev(L) iff w = rev(w).
(c) Show that if L is regular, rev(L) is also regular.

6. A tournament is a directed graph that has exactly one directed edge between each
pair of vertices. A king in a tournament is a vertex v such that every other vertex is
reachable from v via a directed path of length at most 2.

(a) Prove that in any tournament there is at least one king.


(b) Can there be more than one king in a tournament? Justify your answer.

7. A subsequence of an array A is any sub-array of A, obtained by deleting zero or more


elements of A without changing the order of the remaining elements. The input to the
Subsequence Sum problem consists of (i) an array A[1 . . . n] of n positive integers,
and (ii) a target integer T ≥ 0. The problem is to decide if there exists a subsequence
B of A such that the sum of all the elements of B is exactly T . We define the sum of the
empty subsequence (one with no elements) to be zero, and the sum of a subsequence
with one element, to be that element.
Describe an algorithm that solves this problem in O(nc T d ) time for some constants
c, d. The algorithm should take an array A[1 . . . n] and an integer T as described
above. It should output True if there is a subsequence B of A such that the sum of
all the elements of B is exactly T , and False otherwise. It is not required that the
algorithm find a subsequence whose sum is T .
Clearly explain why your algorithm correctly solves the problem, and why it runs in
time O(nc T d ). What are the constants c, d that you get?

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