uiz Space

September 2024 term · Advanced Algorithms · BSCS4021

Advanced Algorithms Quiz 2: 1 December 2024 (September 2024 term)

The IIT Madras BS Advanced Algorithms (Advanced Algorithms) Quiz 2 paper sat on 1 Dec 2024, in the September 2024 term: 26 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
26
Marks
50
Duration
120 min
MCQ
18
MSQ
1
Numerical
7

Updated

Official paper: IIT M DEGREE AN EXAM QDB2 01 Dec 2024 · No negative marking.

Question 1

+3 marksOne correct option

Based on the above data answer the given subquestions.

  1. A
  2. B
Show answer

Correct answer

  • B

Question 2

+2 marksOne or more correct options

Based on the above data answer the given subquestions.

Consider the following reduction from 3-PARTITION to 2-PARTITION: let {a1,…,a3n}\{a_1, \ldots, a_{3n}\} be the instance of 3-PARTITION where ∑i=13nai=nT\sum_{i=1}^{3n} a_i = nT. Now consider the instance of 2-PARTITION made of the numbers:

{a1,T−a1,a2,T−a2,…,an,T−an},\{a_1, T - a_1, a_2, T - a_2, \ldots, a_n, T - a_n\},

i.e, the reduced instance consists of the first nn numbers of the original problem, and nn new numbers formed by taking the difference between each of the input numbers and the common sum TT. This reduction:

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • B
  • C

Question 3

+2 marksOne correct option

Based on the above data answer the given subquestions.

Consider the following reduction from 3-PARTITION to 2-PARTITION: let {a1,…,a3n}\{a_1, \ldots, a_{3n}\} be the instance of 3-PARTITION where ∑i−13nai=nT\sum_{i-1}^{3n} a_i = nT. Now consider the instance of 2-PARTITION made of the numbers:

{a1,a2,…,a2n},\{a_1, a_2, \ldots, a_{2n}\},

i.e, the reduced instance simply consists of the first 2n2n numbers of the 3-PARTITION instance. This reduction:

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 4

+3 marksOne correct option

Based on the above data answer the given subquestions.

  1. A
  2. B
Show answer

Correct answer

  • A

Question 5

+1 markOne correct option

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

  1. A
  2. B
Show answer

Correct answer

  • B

Question 6

+1 markOne correct option

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

  1. A
  2. B
Show answer

Correct answer

  • A

Question 7

+1 markOne correct option

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

  1. A
  2. B
Show answer

Correct answer

  • B

Question 8

+1 markOne correct option

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

  1. A
  2. B
  3. C
Show answer

Correct answer

  • A

Question 9

+1 markOne correct option

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

  1. A
  2. B
  3. C
Show answer

Correct answer

  • B

Question 10

+1 markOne correct option

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

  1. A
  2. B
  3. C
Show answer

Correct answer

  • C

Question 11

+1 markNumerical answer

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

Show answer

Correct answer: 4

Question 12

+1 markNumerical answer

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

Show answer

Correct answer: 2

Question 13

+1 markNumerical answer

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

Show answer

Correct answer: 1

Question 14

+1 markNumerical answer

We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.

Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)

Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.

The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.

In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, V1V_1 is Alice, V3V_3 is Science, V7V_7 is Bio 101 and V2V_2 is Bob.

(Note: this example may not be satisfiable.)

Based on the above data answer the given subquestions.

Show answer

Correct answer: 3

Question 15

+2 marksOne correct option

Based on the above data answer the given subquestions.

  1. A
  2. B
  3. C
Show answer

Correct answer

  • A

Question 16

+3 marksOne correct option

Based on the above data answer the given subquestions.

Observe that for a given π\pi, the length of the corresponding superstring s(π)s(\pi), which is obtained by writing the input strings in the order (sπ(1),…,sπ(n))\left(s_{\pi(1)}, \ldots, s_{\pi(n)}\right) and merging adjacent strings, is given by:

∣s(π)∣=∑i=1n∣si∣−∑i=1n−1∣ov⁡(sπ(i),sπ(i+1))∣.|s(\pi)| = \sum_{i=1}^{n} |s_i| - \sum_{i=1}^{n-1} \left|\operatorname{ov}\left(s_{\pi(i)}, s_{\pi(i+1)}\right)\right|.

The compression of π\pi is the sum of the overlaps of adjacent strings in the permutation π\pi. Finding a shortest superstring is equivalent to:

  1. A
  2. B
  3. C
Show answer

Correct answer

  • A

Question 17

+3 marksOne correct option

Based on the above data answer the given subquestions.

We define an overlap graph OG(S)OG(\mathcal{S}) associated with S\mathcal{S} as follows: OG(S)OG(\mathcal{S}) is a complete directed graph (V,E)(V, E) (that is, for every s,t∈Vs, t \in V there are edges (s,t)(s, t) and (t,s)(t, s)), where V=SV = \mathcal{S}, and the weight of an edge (s,t)(s, t) is ∣ov⁡(s,t)∣|\operatorname{ov}(s, t)|.

Let us say that an edge (u,v)(u, v) dominates another edge (u′,v′)(u', v'), if they share head or tail (that is, u=u′u = u' or v=v′v = v') and ∣ov⁡(u,v)∣⩾∣ov⁡(u′,v′)∣|\operatorname{ov}(u, v)| \geqslant |\operatorname{ov}(u', v')|.

In terms of the overlap graph, the greedy algorithm goes through a list of all edges in OG(S)OG(\mathcal{S}) in the nonincreasing order of their overlap and includes some of them in a solution. Specifically, the greedy algorithm does not include another edge if and only if

R1. it is dominated by an already chosen edge,

R2. it is not dominated but it would form a cycle.

What is the structure of the set of edges returned by the greedy algorithm?

  1. A
  2. B
  3. C
Show answer

Correct answer

  • B

Question 18

+2 marksOne correct option

Based on the above data answer the given subquestions.

  1. A
  2. B
Show answer

Correct answer

  • B

Question 19

+2 marksNumerical answer
Show answer

Correct answer: 13

Question 20

+3 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 21

+2 marksOne correct option
  1. A
  2. B
Show answer

Correct answer

  • B

Question 22

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 23

+3 marksNumerical answer
Show answer

Correct answer: 1

Question 24

+3 marksNumerical answer
Show answer

Correct answer: 1

Question 25

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 26

+3 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D