cs4021_2026T1_Q2_NA.pdf
Advanced Algorithms · Quiz 2 · Jan 2026
← Course papers · Start practice / exam
Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.
Question 2 MCQ · 3.0 marks
Consider the statements about randomized quicksort and answer the given subquestions if they
are true or false.
The worst-case running time and expected running time are equal to within constant factors for
any randomized algorithm.
True
False
A published solution is not available for this question yet.
Question 3 MCQ · 3.0 marks
Consider the statements about randomized quicksort and answer the given subquestions if they
are true or false.
An adversary can provide randomized quicksort with an input array of length [[IMAGE:753fc3671e35dbfc_2_2]] that forces the
algorithm to run in [[IMAGE:753fc3671e35dbfc_2_3]] time on that input. (If you are not familiar with the [[IMAGE:753fc3671e35dbfc_2_4]] asymptotic
notation, it roughly translates as “at least”. For example, we can say that it is possible to come up
with an input that forces insertion sort to run for [[IMAGE:753fc3671e35dbfc_2_5]] steps.)




True
False
A published solution is not available for this question yet.
Question 4 MCQ · 3.0 marks
In RANDOMIZED-QUICKSORT, consider two distinct elements [[IMAGE:753fc3671e35dbfc_3_6]] and [[IMAGE:753fc3671e35dbfc_3_7]] with [[IMAGE:753fc3671e35dbfc_3_8]] . What is the
probability that these two elements are compared during execution?



[[IMAGE:753fc3671e35dbfc_3_9]]

[[IMAGE:753fc3671e35dbfc_3_10]]

[[IMAGE:753fc3671e35dbfc_3_11]]

[[IMAGE:753fc3671e35dbfc_3_12]]

A published solution is not available for this question yet.
Question 5 MCQ · 3.0 marks
**Generating UAR Sequences**
The goal of this exercise is to compute a uniformly random permutation of [[IMAGE:753fc3671e35dbfc_3_13]] .
Assume we have a generator that produces independent uniform real numbers in [[IMAGE:753fc3671e35dbfc_3_14]] . Consider
the following algorithm:
• Generate random numbers [[IMAGE:753fc3671e35dbfc_3_15]] independently from [[IMAGE:753fc3671e35dbfc_3_16]]
• Pair them as [[IMAGE:753fc3671e35dbfc_3_17]]
• Sort the pairs in **decreasing order** of [[IMAGE:753fc3671e35dbfc_3_18]]
• Output the permutation based on sorted indices
Does this procedure generate a uniformly random permutation of [[IMAGE:753fc3671e35dbfc_3_19]] ?







Yes
No
A published solution is not available for this question yet.
Question 6 MCQ · 3.0 marks
Consider the following approximation algorithm for the weighted vertex cover problem:
1. Solve the relaxed linear program corresponding to the given problem:
**Minimize**
[[IMAGE:753fc3671e35dbfc_4_20]]
**Subject to**
[[IMAGE:753fc3671e35dbfc_4_21]]
2. [[IMAGE:753fc3671e35dbfc_4_22]]
3. return [[IMAGE:753fc3671e35dbfc_4_23]]
Based on the above data, answer the given subquestions.
Suppose that instead of putting a vertex [[IMAGE:753fc3671e35dbfc_4_24]] into the cover when [[IMAGE:753fc3671e35dbfc_4_25]] , we put [[IMAGE:753fc3671e35dbfc_4_26]] into the cover
when [[IMAGE:753fc3671e35dbfc_4_27]] . What happens?








We still get a valid solution, and the algorithm remains a 2-approximation.
We still get a valid solution, and the algorithm becomes a 4-approximation.
We may no longer get a valid solution.
A published solution is not available for this question yet.
Question 7 MCQ · 3.0 marks
Consider the following approximation algorithm for the weighted vertex cover problem:
1. Solve the relaxed linear program corresponding to the given problem:
**Minimize**
[[IMAGE:753fc3671e35dbfc_4_20]]
**Subject to**
[[IMAGE:753fc3671e35dbfc_4_21]]
2. [[IMAGE:753fc3671e35dbfc_4_22]]
3. return [[IMAGE:753fc3671e35dbfc_4_23]]
Based on the above data, answer the given subquestions.
Suppose that instead of putting a vertex [[IMAGE:753fc3671e35dbfc_5_28]] into the cover when [[IMAGE:753fc3671e35dbfc_5_29]] , we put [[IMAGE:753fc3671e35dbfc_5_30]] into the cover
when [[IMAGE:753fc3671e35dbfc_5_31]] . What happens?








We still get a valid solution, and the algorithm remains a 2-approximation.
We still get a valid solution, and the algorithm becomes a [[IMAGE:753fc3671e35dbfc_5_32]] -approximation.

We may no longer get a valid solution.
A published solution is not available for this question yet.
Question 8 MCQ · 3.0 marks
Consider the following approximation algorithm for the weighted vertex cover problem:
1. Solve the relaxed linear program corresponding to the given problem:
**Minimize**
[[IMAGE:753fc3671e35dbfc_4_20]]
**Subject to**
[[IMAGE:753fc3671e35dbfc_4_21]]
2. [[IMAGE:753fc3671e35dbfc_4_22]]
3. return [[IMAGE:753fc3671e35dbfc_4_23]]
Based on the above data, answer the given subquestions.
Suppose that we modify the algorithm to include vertex [[IMAGE:753fc3671e35dbfc_5_33]] in the cover only when [[IMAGE:753fc3671e35dbfc_5_34]] . What
happens?






We still get a valid solution, and the algorithm remains a 2-approximation.
We may no longer get a valid solution.
We get an optimal solution always.
A published solution is not available for this question yet.
Question 9 MCQ · 3.0 marks
Consider the following approximation algorithm for the weighted vertex cover problem:
1. Solve the relaxed linear program corresponding to the given problem:
**Minimize**
[[IMAGE:753fc3671e35dbfc_4_20]]
**Subject to**
[[IMAGE:753fc3671e35dbfc_4_21]]
2. [[IMAGE:753fc3671e35dbfc_4_22]]
3. return [[IMAGE:753fc3671e35dbfc_4_23]]
Based on the above data, answer the given subquestions.
Suppose that we include vertex [[IMAGE:753fc3671e35dbfc_5_35]] in the cover when [[IMAGE:753fc3671e35dbfc_5_36]] . What happens?






We always get a valid solution, but the approximation factor may become
worse.
We always get an optimal solution.
We may not get a valid solution.
A published solution is not available for this question yet.
Question 10 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_6_37]]
Based on the above data, answer the given subquestions.
A graph G is a cluster graph if and only if it does not have an induced path on 3 vertices.

True
False
A published solution is not available for this question yet.
Question 11 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_6_37]]
Based on the above data, answer the given subquestions.
In the DISJOINT CLUSTER VERTEX DELETION problem, if the subgraph induced on S is not a cluster
graph, we can immediately return YES.

True
False
A published solution is not available for this question yet.
Question 12 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_6_37]]
Based on the above data, answer the given subquestions.
In the DISJOINT CLUSTER VERTEX DELETION problem, if the subgraph induced on the vertices of S
is not a cluster graph, we can immediately return NO.

True
False
A published solution is not available for this question yet.
Question 13 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_6_37]]
Based on the above data, answer the given subquestions.
If the subgraph induced on the vertices of S is a cluster graph and a vertex in V (G) \ S is adjacent to
at least two vertices in S which are in different cliques, then we can delete it and leave the
parameter unchanged.

True
False
A published solution is not available for this question yet.
Question 14 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_6_37]]
Based on the above data, answer the given subquestions.
If the subgraph induced on the vertices of S is a cluster graph and a vertex in V (G) \ S is adjacent to
at least two vertices in S which are in different cliques, then we can delete it and decrease the
parameter by 1.

True
False
A published solution is not available for this question yet.
Question 15 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_6_37]]
Based on the above data, answer the given subquestions.
If the subgraph induced on the vertices of S is a cluster graph and a vertex in V (G) \ S is adjacent to
some but not all vertices in a clique of G[S], then we can delete it and leave the parameter
unchanged.

True
False
A published solution is not available for this question yet.
Question 16 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_6_37]]
Based on the above data, answer the given subquestions.
If the subgraph induced on the vertices of S is a cluster graph and a vertex in V (G) \ S is adjacent to
some but not all vertices in a clique of G[S], then we can delete it and decrease the parameter by 1.

True
False
A published solution is not available for this question yet.
Question 17 MSQ · 2.0 marks
Consider a graph [[IMAGE:753fc3671e35dbfc_8_38]] and let [[IMAGE:753fc3671e35dbfc_8_39]] denote its chromatic number. Let [[IMAGE:753fc3671e35dbfc_8_40]] .
Select all true statements:



If [[IMAGE:753fc3671e35dbfc_8_41]] is an **independent set**, then
[[IMAGE:753fc3671e35dbfc_8_42]]


There exists an optimal coloring of [[IMAGE:753fc3671e35dbfc_8_43]] such that **every color class is a**
**maximal independent set**.

If [[IMAGE:753fc3671e35dbfc_8_44]] is a **maximum independent set**, then
[[IMAGE:753fc3671e35dbfc_8_45]]


A DP over subsets that tries all independent sets leads to an algorithm running
in [[IMAGE:753fc3671e35dbfc_8_46]] time.

A published solution is not available for this question yet.
Question 18 MSQ · 2.0 marks
Let [[IMAGE:753fc3671e35dbfc_8_47]] be a maximal independent set in graph [[IMAGE:753fc3671e35dbfc_8_48]] .
Select all true statements:


For every vertex [[IMAGE:753fc3671e35dbfc_8_49]] , **all neighbours** of [[IMAGE:753fc3671e35dbfc_8_50]] must be in [[IMAGE:753fc3671e35dbfc_8_51]]



In branching algorithms, we can branch on a vertex [[IMAGE:753fc3671e35dbfc_8_52]] by either:
• include [[IMAGE:753fc3671e35dbfc_8_53]] , or
• exclude [[IMAGE:753fc3671e35dbfc_8_54]] and include all neighbours of [[IMAGE:753fc3671e35dbfc_8_55]]




If a vertex has degree 0, it must be included in every maximum independent
set
If [[IMAGE:753fc3671e35dbfc_9_56]] , then removing [[IMAGE:753fc3671e35dbfc_9_57]] does not reduce the size of maximum
independent set


A published solution is not available for this question yet.
Question 19 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_9_58]]
In the above figure, we have a graph G and a **Feedback Vertex Set (FVS)** of size 3, which is given
by the boxed vertices:
S := {a, c, e}
We need to find a **DISJOINT FVS** of size 2.
For each of the given statements, determine whether it is **True** or **False**.
Based on the above data, answer the given subquestions.
According to the reduction rules for **DFVS**, the following figure shows a valid intermediate instance
in the reduction with [[IMAGE:753fc3671e35dbfc_9_59]] .
[[IMAGE:753fc3671e35dbfc_10_60]]



True
False
A published solution is not available for this question yet.
Question 20 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_9_58]]
In the above figure, we have a graph G and a **Feedback Vertex Set (FVS)** of size 3, which is given
by the boxed vertices:
S := {a, c, e}
We need to find a **DISJOINT FVS** of size 2.
For each of the given statements, determine whether it is **True** or **False**.
Based on the above data, answer the given subquestions.
According to the reduction rules for **DFVS**, the following figure shows a valid intermediate instance
in the reduction with [[IMAGE:753fc3671e35dbfc_10_61]] .
[[IMAGE:753fc3671e35dbfc_10_62]]



True
False
A published solution is not available for this question yet.
Question 21 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_9_58]]
In the above figure, we have a graph G and a **Feedback Vertex Set (FVS)** of size 3, which is given
by the boxed vertices:
S := {a, c, e}
We need to find a **DISJOINT FVS** of size 2.
For each of the given statements, determine whether it is **True** or **False**.
Based on the above data, answer the given subquestions.
According to the reduction rules for **DFVS**, the following figure shows a valid intermediate instance
in the reduction with [[IMAGE:753fc3671e35dbfc_10_63]] .
[[IMAGE:753fc3671e35dbfc_10_64]]



True
False
A published solution is not available for this question yet.
Question 22 MCQ · 2.0 marks
[[IMAGE:753fc3671e35dbfc_9_58]]
In the above figure, we have a graph G and a **Feedback Vertex Set (FVS)** of size 3, which is given
by the boxed vertices:
S := {a, c, e}
We need to find a **DISJOINT FVS** of size 2.
For each of the given statements, determine whether it is **True** or **False**.
Based on the above data, answer the given subquestions.
According to the reduction rules for **DFVS**, the following figure shows a valid intermediate instance
in the reduction with [[IMAGE:753fc3671e35dbfc_11_65]] .
[[IMAGE:753fc3671e35dbfc_11_66]]



True
False
A published solution is not available for this question yet.