Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CS1231S Discrete Structures Exam solutions

Rating
-
Sold
-
Pages
10
Grade
A
Uploaded on
02-11-2022
Written in
2020/2021

The modules introduce mathematical tools required in the study of computer science. Topics include: 1.Logic and proof techniques 2.Number theory 3.Sequences and Mathematical Induction 4.Set theory, Functions and Relations 5.Counting and Probability 6.Graphs and Trees It is the backbone of CS. Concepts and notations from DM are useful in studying the describing objects and problems in all branches of CS, such as algorithms, programming languages, theorem proving and software development. Modeling with DM is an extremely important problem solving skill.

Show more Read less
Institution
Course

Content preview

National University of Singapore
Department of Computer Science
2019/20 (Sem. 2) CS1231/CS1231S Discrete Structures Tutorial 10

1 Let G3 be the set of all undirected graphs whose vertices are a, b, c. Suppose G = ({a, b, c}, E) ∈ G3 .
Determine the number of possible G’s such that:
(i) G has a loop; (ii) G has a cycle;
(iii) G is cyclic; (iv) G is connected;
(v) G is a tree; (vi) G has exactly two connected components.
Solution:

Consider (labelled) undirected graphs with 3 nodes.
Each node may or may not have a loop (23 possibilities),
and each node pair may or may not have an edge (2(2) possibilities).
3


Total = 23 (23 ) = 26 = 64.

(i) #graphs with no loops = 13 2(2) = 8
3


⇒ #graphs with loops = 64 − 8 = 56.

(ii) #graphs with a cycle (choice only in loops) = 23 = 8.

(iii) #(∼loop∧ ∼cycle)= 2(2) − 1 = 7.
3


#cyclic = #(loop∨cycle) = 64 − 7 = 57.

(iv) #connected⇔ ∧, <, > or △ and any choice of loops: 4(23 ) = 32 possibilites

(v) tree ⇔ ∧, <, or > and no loops: 3 possibilities

(vi) G has exactly 2 components ⇔ 1 edge only and any choice of loops:
3 3
1
2 = 24 possibilities.




1

, x
2 The diagram here illustrates an undirected graph K, called a 3-sided wheel:
(i) Let K = (VK , EK ). List the elements of EK . u
(ii) How many different 3-sided wheels are there with VK = {u, x, y, z}?
y z
(iii) Determine the number of different 3-sided wheels with VK ⊆ {1, 2, 3, 4, 5, 6}
3-sided wheel K
(e.g. u = 4, x = 6, y = 2, z = 3)?
with vertices u, x, y, z
w x u x
The diagram here shows two
u w
4-sided wheels H and H ′ :
y z y z
(iv) Explain why H 6= H ′ .
4-sided wheel H 4-sided wheel H’
(v) Determine the number of different 4-sided wheels H with vertex set VH = {1, 2, 3, 4, 5}.
(vi) Determine the number of different 4-sided wheels H with vertex set VH ⊆ {1, 2, 3, 4, 5, 6, 7}.
Solution:

(i) EK = {{u, x}, {u, y}, {u, z}, {x, y}, {y, z}, {x, z}}

(ii) Just 1, since EK already has all possible edges

(iii) There are 64 = 15 choices for VK ; each choice gives one 3-sided wheel.


Therefore, there are 15 possibilites.

(iv) H 6= H ′ since u in H has 4 edges, but u in H ′ has 3 edges.

(v) With u at the center, there are just 3 possible wheels,
determined by who is not connected to x by one edge.
There are 5 possible choices for the center,
so there are 5 × 3 = 15 possible 4-sided wheels (Multiplication Rule)

(vi) There are 75 = 21 choices for VH ; each choice gives 15 4-sided wheels.


Therefore there are 21 × 15 = 315 possible 4-sided wheels for VH ⊆ {1, 2, 3, 4, 5, 6, 7}.




2

Written for

Course

Document information

Uploaded on
November 2, 2022
Number of pages
10
Written in
2020/2021
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.31
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
chrisbarn

Get to know the seller

Seller avatar
chrisbarn universitas sumatera utara
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions