0% found this document useful (0 votes)
16 views15 pages

Math Week 10 Solns

The document contains solutions for a graded assignment in Mathematics for Data Science at IIT Madras, focusing on graph theory concepts such as adjacency matrices, vertex degrees, and graph coloring. It includes multiple choice questions, multiple select questions, and numerical answer types related to graph properties and data structures. The answers provided are derived from theoretical principles and practical examples in graph theory.

Uploaded by

sreeram.datasci
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)
16 views15 pages

Math Week 10 Solns

The document contains solutions for a graded assignment in Mathematics for Data Science at IIT Madras, focusing on graph theory concepts such as adjacency matrices, vertex degrees, and graph coloring. It includes multiple choice questions, multiple select questions, and numerical answer types related to graph properties and data structures. The answers provided are derived from theoretical principles and practical examples in graph theory.

Uploaded by

sreeram.datasci
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/ 15

lOMoARcPSD|53447010

Maths 1 Week 10 GA Solution

Programming and data science (Indian Institute of Technology Madras)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Sreeram ([email protected])
lOMoARcPSD|53447010

Mathematics for Data Science - 1


Graded Assignment
Week 10

1 MULTIPLE CHOICE QUESTIONS:


1. The maximum number of non-zero entries in an adjacency matrix of a simple graph
having n vertices can be [option: d]

(a) n2
n(n−1)
(b) 2
n(n−1)
(c) 4
(d) n(n − 1)

Solution:
Number of non zero entry means number of ones in the adjacency matrix which is
equal to the sum of the degrees of all vertices. In a graph a vertex can have maximum
n − 1 degree. In at most case if each vertex has the degree n − 1, then the sum of
degrees of all vertex will be (n − 1) + (n − 1) + .....n times which means n × (n − 1).

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

2. We have a graph G with 6 vertices. We write down the degrees of all vertices in G in
descending order. Which of the following is a possible listing of the degrees? [option:
c]

(a) 6,5,4,3,2,1
(b) 5,5,2,2,1,1
(c) 5,3,3,2,2,1
(d) 2,1,1,1,1,1

Solution:
Step 1:
Any vertex in a graph can have maximum degree (n-1).
Here n-1 = 6-1 = 5, therefore we do not need to check option 1.
Step 2:
Sum of degree of all vertices always be even therefore option 4 can not be correct
option.
Step 3:
If two vertices in a graph have (n-1) degree it means there will be no vertex with degree
1 (shown in figure ). Vertices A and F have degree 5.

B C

A D

F E

Step 4:
Option 3 satisfies all the possible conditions therefore the correct option is option 3.

Page 2

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

B C

A D

F E

Page 3

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

3. We are trying to find the correct path in a maze. We start at the entrance. At some
points, we have to choose a direction to explore. If we reach a dead end, we come
back to the most recent intersection where we still have an unexplored direction to
investigate. What is a good data structure to keep track of the intersections we have
visited? [option: b]

(a) List
(b) Stack
(c) Queue
(d) Array

Solution:
This is a recursive exploration of the maze, so intermediate stages should be stored on
a stack.

Page 4

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

4. Below table shows the adjacency list w.r.t outgoing edges of a directed graph G.

1 {2,4}
2 {3,5,6}
3 {7}
4 {3,5,6}
5 {6,7}
6 {1}
7 {1,2,6}

Table 1: adjacency list w.r.t forward edges

Which of the following tables shows the adjacency list w.r.t incoming edges of the
graph G? [option: c]

1 {6,7}
2 {1,6}
3 {2,4}
4 {1}
5 {2,7}
6 {2,4,5,7}
7 {3,5}

(a)

1 {6,7}
2 {1,7}
3 {2,4}
4 {1,5}
5 {2,4}
6 {2,4,7}
7 {3,5}

(b)

Page 5

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

1 {6,7}
2 {1,7}
3 {2,4}
4 {1}
5 {2,4}
6 {2,4,5,7}
7 {3,5}

(c)

1 {6,7}
2 {1,4}
3 {2,7}
4 {1,5}
5 {2,4}
6 {2,4,7}
7 {3,5}

(d)

Page 6

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

5. Suppose we obtain the following BFS tree rooted at node 1 for an undirected graph
with vertices (1,2,3,4,5,.....14).

5 4 10

6 11 3 12

7 2 9 13

8 14

Which of the following cannot be an edge in the original graph? [option: A]

(a) (8,11)
(b) (3,10)
(c) (4,5)
(d) (6,9)

Page 7

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

2 MUTIPLE SELECT QUESTIONS:


6. Which of the following graphs satisfies the below properties:
1. |V C(G)| = 3, where V C(G) is the minimum vertex cover of a graph G.
2. |P M (G)| = 3, where P M (G) is the perfect matching of a graph G.
3. The graph is a 3-colouring. [option: c,d]

(a)

(b)

(c)

(d)

Page 8

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

3 NUMERICAL ANSWER TYPE:


 
0 1 0 1 0 0 0
1 0 1 1 0 1 0
 
0 1 0 0 0 0 0
 
8. If A = 1 1 0 0 1 1 1 represents adjacency matrix of a graph G, then the
0 0 0 1 0 0 0
 
0 1 0 1 0 0 0
0 0 0 1 0 0 0
cardinality of the maximum independent set of the graph G is [Answer: 5]

Page 11

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

9. A company manufactures 10 chemicals x1 , x2 , x3 , ....x10 . Certain pairs of these chem-


icals are incompatible and would cause explosions if brought into contact with each
other. Below graph shows the incompatibility of the chemicals, each vertex represents
the chemical and each edge between a pair of chemicals represents that those two
chemicals are incompatible. As a precautionary measure the company wishes to par-
tition its warehouse into compartments, and store incompatible chemicals in different
compartments. What is the least number of compartments into which the warehouse
should be partitioned?
[Answer: 3]

x6

x10 x2 x7

x1 x4

x3 x5

x9 x8

Page 12

Downloaded by Sreeram ([email protected])


lOMoARcPSD|53447010

10. An incomplete undirected graph is given below and the numbering on each vertex
denotes the colouring of the graph(‘1’ denotes color 1, ‘2’ denotes color 2, and ‘3’
denotes color 3). Find the number of maximum edges that can be added to the given
graph such that the colouring is retained and the graph is planar.
NOTE: Planar graph is a graph that can be drawn on the plane in such a way that its
edges intersect only at their endpoints. [Answer: 6]

1 2 3

3
1
2
1

Page 13

Downloaded by Sreeram ([email protected])

You might also like