Download as pdf or txt
Download as pdf or txt
You are on page 1of 89

Higher Nationals

Internal verification of assessment decisions – BTEC (RQF)

INTERNAL VERIFICATION – ASSESSMENT DECISIONS


Programme title HND in Computing - Software Engineering Pathway

Assessor Ms. Shyamali Karunadasa Internal Verifier

Unit(s) Unit 18: Discrete Mathematics

Assignment title Discrete mathematics in software engineering concepts

Student’s name N.G.G. Lahiru Viraj

List which assessment Pass Merit Distinction


criteria the Assessor
has awarded.
INTERNAL VERIFIER CHECKLIST
Do the assessment criteria
awarded match those shown in the Y/
assignment brief? N

Is the Pass/Merit/Distinction grade


awarded justified by the assessor’s
comments on the student work? Y/N

Has the work been assessed Y/


accurately? N
Is the feedback to the student:
Give details:
• Constructive?
Y/
• Linked to relevant assessment
criteria? N

• Identifying opportunities Y/
for improved performance?
N
• Agreeing actions?

Y/
N
Y/
N

Does the assessment decision need Y/


amending? N
Assessor signature Date

Internal Verifier signature Date

Programme Leader signature (if


Date
required)

Confirm action completed


Remedial action taken

Give details:

Assessor signature Date

Internal Verifier
Date
signature
Programme Leader
Date
signature (if required)
Higher Nationals – Summative Assignment Feedback Form
Student Name/ID N.G.G. Lahiru Viraj / ME24716
Unit Title Unit 18: Discrete Mathematics
Assignment Number 1 Assessor Ms. Shyamali Karunadasa
03/02/2021 Date Received 1st
Submission Date
submission
Date Received 2nd
Re-submission Date
submission
Assessor Feedback:

LO1 Examine set theory and functions applicable to software engineering.


Pass, Merit & Distinction P1 P2 M1 D1
Descripts
LO2 Analyse mathematical structures of objects using graph theory.

Pass, Merit & Distinction P3 P4 M2 D2


Descripts

LO3 Investigate solutions to problem situations using the application of Boolean algebra.
Pass, Merit & Distinction P5 P6 M3 D3
Descripts

LO4 Explore applicable concepts within abstract algebra.


Pass, Merit & Distinction P7 P8 M4 D4
Descripts

Grade: Assessor Signature: Date:

Resubmission Feedback:

Grade: Assessor Signature: Date:

Internal Verifier’s Comments:

Signature & Date:


* Please note that grade decisions are provisional. They are only confirmed once internal and external moderation has taken place and grades
decisions have been agreed at the assessment board.

P a g e 3 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Pearson
Higher Nationals in
Computing
Unit 18 : Discrete Mathematics

P a g e 4 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


General Guidelines
1. A Cover page or title page – You should always attach a title page to your assignment. Use previous
page as your cover sheet and be sure to fill the details correctly.
2. This entire brief should be attached in first before you start answering.
3. All the assignments should prepare using word processing software.
4. All the assignments should print in A4 sized paper, and make sure to only use one side printing.
5. Allow 1” margin on each side of the paper. But on the left side you will need to leave room for
binging.

Word Processing Rules


1. Use a font type that will make easy for your examiner to read. The font size should be 12 point,
and should be in the style of Time New Roman.
2. Use 1.5 line word-processing. Left justify all paragraphs.
3. Ensure that all headings are consistent in terms of size and font style.
4. Use footer function on the word processor to insert Your Name, Subject, Assignment No, and
Page Number on each page. This is useful if individual sheets become detached for any reason.
5. Use word processing application spell check and grammar check function to help edit your
assignment.

Important Points:
1. Check carefully the hand in date and the instructions given with the assignment. Late submissions
will not be accepted.
2. Ensure that you give yourself enough time to complete the assignment by the due date.
3. Don’t leave things such as printing to the last minute – excuses of this nature will not be accepted
for failure to hand in the work on time.
4. You must take responsibility for managing your own time effectively.
5. If you are unable to hand in your assignment on time and have valid reasons such as illness, you
may apply (in writing) for an extension.
6. Failure to achieve at least a PASS grade will result in a REFERRAL grade being given.
7. Non-submission of work without valid reasons will lead to an automatic REFERRAL. You will then
be asked to complete an alternative assignment.
8. Take great care that if you use other people’s work or ideas in your assignment, you properly
reference them, using the HARVARD referencing system, in you text and any bibliography,
otherwise you may be guilty of plagiarism.
9. If you are caught plagiarising you could have your grade reduced to A REFERRAL or at worst you
could be excluded from the course.

P a g e 5 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Student Declaration

I hereby, declare that I know what plagiarism entails, namely to use another’s work and to present it as
my own without attributing the sources in the correct way. I further understand what it means to copy
another’s work.

1. I know that plagiarism is a punishable offence because it constitutes theft.


2. I understand the plagiarism and copying policy of the Edexcel UK.
3. I know what the consequences will be if I plagiaries or copy another’s work in any of the
assignments for this program.
4. I declare therefore that all work presented by me for every aspects of my program, will be my
own, and where I have made use of another’s work, I will attribute the source in the correct way.
5. I acknowledge that the attachment of this document signed or not, constitutes a binding
agreement between myself and Edexcel UK.
6. I understand that my assignment will not be considered as submitted if this document is not
attached to the attached.

13349lahiru@gmail.com 03/02/2021

Student’s Signature: Date:


(Provide E-mail ID) (Provide Submission Date)

P a g e 6 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Assignment Brief
Student Name /ID Number N.G.G. Lahiru Viraj / ME24716

Unit Number and Title Unit 18 : Discrete Mathematics

Academic Year 2020/21

Unit Tutor Ms. Shyamali Karunadasa

Assignment Title Discrete mathematics in Computing

Issue Date 17/12/2020

Submission Date 03/02/2021

IV Name & Date

Submission Format:

This assignment should be submitted at the end of your lesson, on the week stated at the front of this
brief. The assignment can either be word-processed or completed in legible handwriting.

If the tasks are completed over multiple pages, ensure that your name and student number are present
on each sheet of paper.

Unit Learning Outcomes:

LO1 Examine set theory and functions applicable to software engineering.

LO2 Analyse mathematical structures of objects using graph theory.

LO3 Investigate solutions to problem situations using the application of Boolean algebra.

LO4 Explore applicable concepts within abstract algebra.

P a g e 7 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Assignment Brief and Guidance:

P a g e 8 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Activity 01

Part 1
1. Perform algebraic set operations in the following formulated mathematical problems.
i. Let A and B be two non-empty finite sets. If cardinalities of the sets A, B, and A B are 72, 28
and 13 respectively, find the cardinality of the set A B.

ii. If n( A − B )=45, n( A B )=110 and n( A B )=15, then find n(B).


iii.If n(A)=33, n(B)=36 and n(C)=28, find n( A B C ).

Part 2

1. Write the multisets (bags) of prime factors of given numbers.


i. 160
ii. 120
iii. 250
2. Write the multiplicities of each element of multisets (bags) in Part 2-1(i,ii,iii) separately.
3. Determine the cardinalities of each multiset (bag) in Part 2-1(i,ii,iii).

Part 3

1. Determine whether the following functions are invertible or not and if a function is invertible,
(
then find the rule of the inverse −1

)
f (x) using appropriate mathematical technique.

i. f: → + ii. f: + → +

f (x) = x2 f (x) = 1
x
iii. f: + → + iv. f:− , → −1,1
2 2
f (x) = x2 f (x) = sin x

v. f : 0 , → − 2, 2 f (x)
= 2 cos x

Part 4

1. Formulate corresponding proof principles to prove the following properties about defined sets.
i. A = B A B and B A.

ii. De Morgan’s Law by mathematical induction.

iii. Distributive Laws for three non-empty finite sets A, B, and C.

P a g e 10 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Activity 02
Part 1
1. Model two contextualized problems using binary trees both quantitatively and qualitatively.
Part 2

1. State the Dijkstra’s algorithm for a directed weighted graph with all non-negative edge
weights.

2. Use Dijkstra’s algorithm to find the shortest path spanning tree for the following weighted
directed graph with vertices A, B, C, D, and E given. Consider the starting vertex as E.

Part 3

1. Assess whether the following undirected graphs have an Eulerian and/or a Hamiltonian cycle.

i.
ii.

iii.

Part 4

1. Construct a proof of the five-color theorem for every planar graph.


Activity 03
Part 1

1. Diagram two real world binary problems in two different fields using applications of Boolean
Algebra.

Part 2

1. Produce truth tables and its corresponding Boolean equation for the following scenarios.

i. If the driver is present and the driver has not buckled up and the ignition switch is on,
then the warning light should turn on.
ii. If it rains and you don't open your umbrella, then you will get wet.
2. Produce truth tables for given Boolean expressions.
i. ̄+̄++̄

ii.
̄
( + + )( + + )( + + )
̄ ̄

Part 3

1. Simplify the following Boolean expressions using algebraic methods.


i. ( + )+ ( + )+ ( + )

ii. ( + ̄ )( + ) + ( + )( + ̄)

iii. ( + )( + )̄ + +

iv. ̄( + ) + ( + )( + ̄ )

Part 4

1. Consider the K-Maps given below. For each K- Map


i. Write the appropriate standard form (SOP/POS) of Boolean expression.
ii. Design the circuit using AND, NOT and OR gates.
iii. Design the circuit only by using
• NAND gates if the standard form obtained in part (i) is SOP.
• NOR gates if the standard form obtained in pat (i) is POS.

(a)

AB/C 0 1

00 0 0

01 0 1

11 0 1
10 1 0
(b)

AB/CD 00 01 11 10

00 1 0 0 1

01 0 1 0 1

11 1 1 1 0

10 1 1 1 1

(c)

AB/C 0 1

00 1 0

01 1 1

11 1 0

10 0 1
Activity 04

Part 1

1. Describe the distinguishing characteristics of different binary operations that are performed
on the same set.

Part 2

1. Determine the operation tables for group G with orders 1, 2, 3 and 4 using the elements a, b, c,
and e as the identity element in an appropriate way.

2.

i. State the relation between the order of a group and the number of binary operations that
can be defined on that set.
ii. How many binary operations can be defined on a set with 4 elements?
3.

i. State the Lagrange’s theorem of group theory.


ii. For a subgroup H of a group G, prove the Lagrange’s theorem.

iii. Discuss whether a group H with order 6 can be a subgroup of a group with order 13
or not. Clearly state the reasons.

Part 3
1. Validate whether the set S = −{−1} is a group under the binary operation ‘*’defined as
a *b = a + b + ab for any two elements a,b S .

Part 4

1. Prepare a presentation for ten minutes to explore an application of group theory relevant to
your course of study. (i.e. in Computer Sciences)

P a g e 15 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Acknowledgement

I would like to express my sincere gratitude to all those who have given me the opportunity to
finish this assignment.

Especially I would like to offer my special gratitude to our lecturer, Ms. Shyamali Karunadasa
whose contribution to stimulating suggestions and encouragement. Furthermore, I would also
extend my gratitude our co-coordinator Ms. Ishani Jayasuriya for providing us with all the
necessities without any hindrance.

I would further thank my beloved parents for their valuable and immeasurable dedication, which
lead this assignment to success. In addition, I would like to thank my dearest friends for supporting
me throughout this journey and all the people who helped me to conclude this assignment
successfully.

N.G.G. Lahiru Viraj.

P a g e 16 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Assignment Feedback

Formative Feedback: Assessor to Student

• 18.01.2020 –
▪ The student has done the Assignment properly.
▪ Has to complete Activity 02 – Part 01 – Q1.
• 23.01.2021 –
▪ The student has done the Assignment properly.
▪ Has to do a change in Activity 04 – Part 04 – Q1.
• 26.01.2021 –
▪ The student has completed the Assignment properly.
Action Plan

• 18.01.2020 –
▪ Complete Activity 02 – Part 01 – Q1. – Has to provide the Examples.
• 23.01.2021 –
▪ Do the mentioned change in Activity 04 – Part 04 – Q1. – Include the Slide Numbers.
Summative feedback

Feedback: Student to Assessor

I would like to express my heartiest gratitude towards my DM Module lecturer Ms. Shyamali
Karunadasa for her support and guidance provided all through the assignment completion.

N.G.G. Lahiru Viraj

Assessor signature shyamalikarunadasa@gmail.com Date 26.01.2021

Student signature 13349lahiru@gmail.com Date 26.01.2021

P a g e 17 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Table of Contents

Acknowledgement .................................................................................................................. 16
Activity 01 ............................................................................................................................... 24
Part 1 ......................................................................................................................................... 24
I. Let A and B be two non-empty finite sets. If cardinalities of the sets A, B, and A B are
72, 28 and 13 respectively, find the cardinality of the set A B. ......................................... 24

II. If n (A − B) =45, n (A B) =110 and n (A B) =15, then find n(B). ....................... 24

III. If n(A)=33, n(B)=36 and n(C)=28, find n (ABC). ............................................... 25

Part 2 ......................................................................................................................................... 27
1. Write the multisets (bags) of prime factors of given numbers. .................................. 27

2. Write the multiplicities of each element of multisets (bags) in Part 2-1(i,ii,iii) separately.
............................................................................................................................................... 27

3. Determine the cardinalities of each multiset (bag) in Part 2-1(i, ii, iii). ........................... 28

Part 3 ......................................................................................................................................... 29
Determine whether the following functions are invertible or not and if a function is invertible,
then find the rule of the inverse (f (x)) −1 using appropriate mathematical technique. ....... 29

Part 4 ......................................................................................................................................... 35
1. Formulate corresponding proof principles ........................................................................ 35

2. De Morgan’s Law ............................................................................................................. 36

3. Distributive Laws for three non-empty finite sets ............................................................ 37

Activity 02 ............................................................................................................................... 41
Part 1 ......................................................................................................................................... 41
Binary Tree ........................................................................................................................... 41

Qualitative Binary trees ........................................................................................................ 41

Quantitative Binary tree ........................................................................................................ 43

P a g e 18 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 2 ......................................................................................................................................... 45
1. State the Dijkstra’s algorithm for a directed weighted graph with all non-negative edge
weights. ................................................................................................................................. 45

2. Use Dijkstra’s algorithm to find the shortest path spanning tree for the following
weighted directed graph with vertices A, B, C, D, and E given. Consider the starting vertex
as E. 46

Part 3 ......................................................................................................................................... 48
1.Assess whether the following undirected graphs have an Eulerian and/or a Hamiltonian
cycle. ..................................................................................................................................... 48

Part 4 ......................................................................................................................................... 50
1. Construct a proof of the five-color theorem for every planar graph. ......................... 50

Activity 03 ............................................................................................................................... 52
Part 1 ......................................................................................................................................... 52
1. Diagram two real world binary problems in two different fields using applications of
Boolean Algebra. .................................................................................................................. 52

Part 2 ......................................................................................................................................... 55
1. Produce truth tables and its corresponding Boolean equation for the following scenarios.
............................................................................................................................................... 55

1. Produce truth tables for given Boolean expressions. ........................................................ 57

Part 3 ......................................................................................................................................... 58
1.Simplify the following Boolean expressions using algebraic methods. ............................ 58

Part 4 ......................................................................................................................................... 61
1.Consider the K-Maps given below. For each K- Map ....................................................... 61

a. ............................................................................................................................................ 63

b............................................................................................................................................. 64

c. ............................................................................................................................................ 66

Activity 04 ............................................................................................................................... 69
Part 1 ......................................................................................................................................... 69
P a g e 19 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


1. Describe the distinguishing characteristics of different binary operations that are
performed on the same set. ................................................................................................... 69

Part 2 ......................................................................................................................................... 71
1. Determine the operation tables for group G with orders 1, 2, 3 and 4 using the elements
a, b, c, and e as the identity element in an appropriate way.................................................. 71

2............................................................................................................................................. 73

i. State the relation between the order of a group and the number of binary operations that can
be defined on that set. ........................................................................................................... 73

ii. How many binary operations can be defined on a set with 4 elements? .......................... 74

3............................................................................................................................................. 74

i. State the Lagrange’s theorem of group theory................................................................... 74

ii. For a subgroup H of a group G, prove the Lagrange’s theorem. ................................ 74

iii. Discuss whether a group H with order 6 can be a subgroup of a group with order 13 or
not. Clearly state the reasons. ............................................................................................... 75

Part 3 ......................................................................................................................................... 75
1. Validate whether the set S = −{−1} is a group under the binary operation ‘*’defined
as a *b = a + b + ab for any two elements a,b S ................................................................ 75

Part 4 ......................................................................................................................................... 78
1. Prepare a presentation for ten minutes to explore an application of group theory
relevant to your course of study. (i.e., in Computer Sciences) ............................................. 78

References ............................................................................................................................... 85
Gantt Chart ............................................................................................................................ 86

P a g e 20 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


List of Figures

Figure 1 DE Morgan's Law ........................................................................................................... 36


Figure 2 Binary tree for Qualitative ............................................................................................. 41
Figure 3 Binary tree example for Qualitative ............................................................................... 42
Figure 4 web, Quantitative Binary tree ........................................................................................ 43
Figure 5 example for Quantitative Binary tree ............................................................................. 44
Figure 6 Weighted Directed Graph ............................................................................................... 46
Figure 7 Weighted Directed Graph ............................................................................................... 47
Figure 8 Five Color Theorem ....................................................................................................... 51
Figure 9 Logic Gate Circuit 1 ....................................................................................................... 53
Figure 10 Logic Gate Circuit 2 ..................................................................................................... 54
Figure 11 Logic Gate Circuit ........................................................................................................ 56
Figure 12 Logic Gate Circuit ........................................................................................................ 56
Figure 13 Truth Table ................................................................................................................... 57
Figure 14 Truth Table ................................................................................................................... 57
Figure 15 SOP K map ................................................................................................................... 63
Figure 16 SOP Circuit ................................................................................................................... 63
Figure 17 SOP NAND Circuit ...................................................................................................... 64
Figure 18 POS K map ................................................................................................................... 64
Figure 19 POS Circuit ................................................................................................................... 65
Figure 20 POS NOR Circuit ......................................................................................................... 66
Figure 21 POS K map ................................................................................................................... 67
Figure 22 POS Circuit ................................................................................................................... 67
Figure 23 POS NOR Circuit ......................................................................................................... 68
Figure 24 Presentation Slide 1 ...................................................................................................... 78
Figure 25 Presentation Slide 2 ...................................................................................................... 79
Figure 26 Presentation Slide 3 ...................................................................................................... 79
Figure 27 Presentation Slide 4 ...................................................................................................... 80
Figure 28 Presentation Slide 5 ...................................................................................................... 80
P a g e 21 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 29 Presentation Slide 6 ...................................................................................................... 81
Figure 30 Presentation Slide 7 ...................................................................................................... 81
Figure 31 Presentation Slide 8 ...................................................................................................... 82
Figure 32 Presentation Slide 9 ...................................................................................................... 83
Figure 33 Presentation Slide 10 .................................................................................................... 83
Figure 34 Presentation Slide 11 .................................................................................................... 84
Figure 35 Presentation Slide 12 .................................................................................................... 84
Figure 36 Gantt Chart ................................................................................................................... 86

P a g e 22 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


List of Table

Table 1 Vertices of Weighted Directed Graph ............................................................................. 47


Table 2 Differences of Eulerian and Hamilton Circuits ............................................................... 48
Table 3 Truth Table 1 ................................................................................................................... 52
Table 4 Truth Table 2 ................................................................................................................... 54
Table 5 Truth Table ...................................................................................................................... 55
Table 6 Truth Table ...................................................................................................................... 56
Table 7 Basic Binary Operations .................................................................................................. 69
Table 8 Operation Table for Order 1 ............................................................................................ 71
Table 9 Operation Table for Order 2 ............................................................................................ 72
Table 10 Operation Table for Order 3 .......................................................................................... 72
Table 11 Operation Table for Order 4 .......................................................................................... 73

P a g e 23 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Activity 01
Part 1
1. Perform algebraic set operations in the following formulated mathematical
problems.

I. Let A and B be two non-empty finite sets. If cardinalities of the sets A, B, and A B
are 72, 28 and 13 respectively, find the cardinality of the set A B.
𝑛(𝐴) = 72 𝑛(𝐵) = 28
𝑛 (𝐴 ∩ 𝐵) = 13
𝑛(𝐴 ∪ 𝐵) = ?
𝑛(𝐴 ∪ 𝐵) = 𝑛(𝐴) + 𝑛(𝐵) − 𝑛(𝐴 ∩ 𝐵)
= 72 + 28 − 13
𝑛 (𝐴 ∪ 𝐵) = 87

II. If n (A − B) =45, n (A B) =110 and n (A B) =15, then find n(B).
𝑛(𝐴 − 𝐵) = 45
𝑛(𝐴 ∪ 𝐵 ) = 110
𝑛(𝐴 ∩ 𝐵 ) = 15
𝑛(𝐵) = ?
𝑛(𝐴 − 𝐵) = 𝑛(𝐴) − 𝑛(𝐵)
45 = 𝑛(𝐴) − 𝑛(𝐵) -------------------- (1)
𝑛(𝐴 ∪ 𝐵 ) = 𝑛(𝐴) + 𝑛(𝐵) − 𝑛(𝐴 ∩ 𝐵 )
110 = 𝑛(𝐴) + 𝑛(𝐵) − 15------------- (2)

By (1) + (2),
45 + 110 = 𝑛(𝐴) − 𝑛(𝐵) + 𝑛(𝐴) + 𝑛(𝐵) − 15
155 = 2𝑛(𝐴) − 15
155 + 15 = 2𝑛(𝐴)
2𝑛(𝐴) = 170

P a g e 24 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


∴ 𝑛(𝐴) = 85
By (1),
45 = 𝑛(𝐴) − 𝑛(𝐵)
45 = 85 − 𝑛(𝐵)
𝑛(𝐵) = 85 − 45
𝑛(𝐵) = 40

III. If n(A)=33, n(B)=36 and n(C)=28, find n (ABC).

𝑛(𝐴) = 33
𝑛(𝐵) = 36
𝑛(𝐶) = 28 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶 ) = 5
𝑛(𝐴 ∪ 𝐵 ∪ 𝐶) = ?
𝑛(𝐴 ∪ 𝐵 ∪ 𝐶) = 𝑛(𝐴) + 𝑛(𝐵)+ 𝑛(𝐶)− 𝑛(𝐴 ∩ 𝐵 ) − 𝑛(𝐴 ∩ 𝐶 ) − 𝑛(𝐵 ∩ 𝐶 )
+ 𝑛(𝐴 ∩ 𝐵 ∩ 𝐶 )
= 33+ 36 + 28 − 𝑛(𝐴 ∩ 𝐵 ) − 𝑛(𝐴 ∩ 𝐶 )− 𝑛(𝐵 ∩ 𝐶 )+ 5
= 102− 𝑛(𝐴 ∩ 𝐵 )− 𝑛(𝐴 ∩ 𝐶 ) − 𝑛(𝐵 ∩ 𝐶 )------------- (1)
A→𝑎 + 𝑏 + 5 + 10 = 33
𝑎+𝑏 = 33 − 15
𝑎+𝑏 = 18--------------------- (2)

B→𝑎 + 𝑐 + 5 + 15 = 36

P a g e 25 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝑎+𝑐 = 36 − 20
𝑎+𝑐 = 16------------------------ (3)
C→𝑏 + 𝑐 + 5 + 13 = 28
𝑏+𝑐 = 28 − 18
𝑏+𝑐 = 10------------------------ (4)
By (2) − (3),
𝑎 + 𝑏 − (𝑎 + 𝑐) = 18 − 16
𝑎+𝑏−𝑎−𝑐 =2
𝑏−𝑐 = 2------------------------ (5)
By (4)+(5),
𝑏+𝑐+𝑏−𝑐 = 10 + 2
2𝑏 = 12
𝑏 = 6----------------------- (6)
By (2),
𝑎+6 = 18
𝑎 = 18 − 6
𝑎 = 12---------------------- (7)
By (3),
12 + 𝑐 = 16
𝑐 = 16 − 12
𝑐 = 4------------------------ (8)
By (1), (6), (7), (8),
𝑛(𝐴 ∪ 𝐵 ∪ 𝐶) = 102 − (𝑎 + 5) − (𝑏 + 5) − (𝑐 + 5)
= 102 − (12+ 5) − (6 + 5) − (4 + 5)
= 102 − 17 − 11 − 9
𝑛(𝐴 ∪ 𝐵 ∪ 𝐶) = 65

P a g e 26 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 2
1. Write the multisets (bags) of prime factors of given numbers.
I. 160
II. 120
III. 250

A multi set in mathematics is a generalization of the concept of a set. It’s a collection of unordered
numbers, where every element x occurs a finite number of times.
I. 160

160 = 2*2*2*2*2*5

160 = [2, 2, 2, 2, 2, 5]

II. 120

120 = 2*2*2*3*5

120 = [2, 2, 2, 3, 5]

III. 250

250 = 2*5*5*5

250 = [2, 5, 5, 5]

2. Write the multiplicities of each element of multisets (bags) in Part 2-1(i,ii,iii) separately.
The number of times an element occurs in a multiset is called Multiplicity.
I. 160 = [2,2,2,2,2,5]
µ (2) = 5
µ (5) = 1

II. 120 = [2,2,2,3,5]


µ (2) = 3
µ (3) = 1
µ (5) = 1

P a g e 27 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


III. 250 = [2,5,5,5]
µ (2) = 1
µ (5) = 3

3. Determine the cardinalities of each multiset (bag) in Part 2-1(i, ii, iii).
Cardinality of multiset is the summation of all the multiplicities of its elements.

i. 𝑛 (160) = µ (2) + µ (5)


𝑛 (160) = 5 + 1
𝑛 (160) = 6

ii. 𝑛 (120) = µ (2) + µ (3) + µ (5)


𝑛 (120) = 3 + 1 + 1
𝑛 (120) = 5

iii. 𝑛 (250) = µ (2) + µ (5)


𝑛 (250) = 1 + 3
𝑛 (250) = 4

P a g e 28 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 3
Determine whether the following functions are invertible or not and if a function is invertible,
then find the rule of the inverse (f (x)) −1 using appropriate mathematical technique.

i. 𝑓: ℜ → ℜ+
𝑓(𝑥) = 𝑥2

𝑓 is invertible if and only if 𝑓 is One to One correspondent between ℜ → ℜ+ (𝑓 is One to


One and onto) ---------------(1)
Step 01→
Check whether 𝑓 is One to One:
Let 𝑥1, 𝑥2 ∈ ℜ (Domain)

And 𝑓(𝑥1), 𝑓(𝑥2) ∈ ℜ = 𝑦1, 𝑦2 ∈ ℜ (Codomain)

𝑓(𝑥1) = 𝑓(𝑥2)

(𝑥12) = (𝑥22)

(𝑥12−𝑥22) = 0

(𝑥1 − 𝑥2) (𝑥1 + 𝑥2) = 0

(𝑥1 − 𝑥2) = 0 𝑂𝑅 (𝑥1 + 𝑥2) = 0

∴ 𝑥1 = 𝑥2 𝑂𝑅 𝑥1 = (−𝑥2)
𝑥1, 𝑥2, (−𝑥2) ∈ ℜ and 𝑥2 ≠ (−𝑥2)
Therefore, 𝑓 is not One to One ------------------ (2)
∴ By (1) and (2),
𝑓 is not One to One correspondent between ℜ → ℜ+. Due to that, 𝑓 is not invertible.

P a g e 29 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


ii. 𝑓: ℜ+ → ℜ+
𝑓(𝑥) = 1/𝑥
Between ℜ+and ℜ+--------------------------- (1)
Step 01→
Check whether 𝑓 is One to One:
Let 𝑥1, 𝑥2 ∈ ℜ+ (Domain)
And 𝑓(𝑥1), 𝑓(𝑥2) ∈ ℜ+ = 𝑦1, 𝑦2 ∈ ℜ+ (Codomain)
𝑓(𝑥1) = 𝑓(𝑥2)
1 1
=
𝑥1 𝑥2

1 1
= =0
𝑥1 𝑥2

𝑥2 −𝑥1
= 0
𝑥1 𝑥2

𝑥2 − 𝑥1 = 0
𝑥2 = 𝑥1
∴ 𝑥2 = 𝑥1
Therefore, f is One to One ---------------------- (2)
Step 02→
Check whether 𝑓 is onto:
For every 𝑦 ∈ ℜ+(Codomain)
1
𝑦 (𝑦)∈ R+(Domain)
1
Such that 𝑓 (𝑦) = 𝑦
1
So, y is the image of (1(𝑦)
1
∴ x = (𝑦)

Therefore, 𝑓 is Onto --------------------- (3)


By (1), (2) and (3),
P a g e 30 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝑓 is One to One and onto correspondent between ℜ+ → ℜ+. Due to that, 𝑓 is invertible.

Step 03→
Inverse function of 𝑓:
1
f (x) = (𝑥)

1
𝑦 = (𝑥)

1
𝑥 = (𝑥 )

1
∴ f −1(x) = (𝑥)

∴ Inverse of 𝑓:
∴ Inverse of f :

f −1 : R+ → R+

1
f −1(x) = (𝑥)//

iii. 𝑓: ℜ+ → ℜ+
𝑓(𝑥) = 𝑥2

Between ℜ+and ℜ+----------------------- (1)

Step 01
Check whether 𝑓 is One to One:
Let 𝑥1, 𝑥2 ∈ ℜ+ (Domain)
And 𝑓(𝑥1),𝑓(𝑥2) ∈ ℜ+ = 𝑦1, 𝑦2 ∈ ℜ+ (Codomain)
𝑥21 = 𝑥22

𝑥21 − 𝑥22 = 0
P a g e 31 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


(𝑥1 − 𝑥2 )(𝑥1 + 𝑥2 ) = 0

(𝑥1 − 𝑥2 ) = 0 𝑂𝑅 (𝑥1 + 𝑥2 ) = 0

(𝑥1 ) = (𝑥2 ) 𝑂𝑅 (𝑥1 ) = (−𝑥2 )

Since 𝑥2 ∈ R+, 𝑥2 ∉ R+
Therefore, (−𝑥2 ) ∈ Codomain
Therefore, f is one to one------------------------- (2)
Step 02→
Check whether f is onto:
For every y ∈ R+ (Codomain)
1
𝑦2 ∈ R+ (Domain)
1
Such that 𝑓 (𝑦 2 ) = 𝑦
1
So, 𝑦 is the image of (𝑦2 )
1
∴ 𝑥 = (𝑦 2 )

Therefore, 𝑓 is Onto------------------------------- (3)

By (1),(2) and (3),

𝑓 is One to One and Onto correspondent between R+ → R+. Due to that, f is invertible.

Step 03→

Inverse function of 𝑓:

𝑓(𝑥) = 𝑥 2

𝑦 = 𝑥2
1
𝑥 = 𝑦2
1
∴ 𝑓 −1 = 𝑦 2

P a g e 32 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


∴ Inverse of 𝑓:

𝑓 −1 : R+ → R+
1
𝑓 −1 (𝑥) = 𝑥 2

iv f: [-π/2, π/2] → [-1, 1]


f(x) = sin x

𝜋 𝜋
Between [− , 2 ] and [−1,1] ---------------------- (1)
2

Step 01→
Check whether f(x) is 1-1 then,
Let x1, x2 € [-π/2, π/2] (Domain)
Then f(x1), f(x2) € [-1, 1] (Range)

Let f(x1) = f(x2)


Sin x1= Sin x2
x1 = x2
Therefore, f(x1) = f(x2) → x1 = x2 → ------------------------------------- (1)
Therefore, f(x) is 1-1 → ----------------------------------------------- (2)

Step 02→
Check whether f(x) is Onto
y = Sin x
y = Sin (Sin -1 y)
For all y € [-1,1] , there should be at least one Sin (Sin -1 y) € [-π/2, π/2] such that f(Sin -1 y) = y
Therefore, f(x) is onto → --------------------------------------- (3)

By 1, 2, 3,
f(x) is invertible.

P a g e 33 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Step 03 →
Inverse function of f(x)
f(x) = Sin x
y = Sin x
Sin (Sin -1 y) = x
Sin (Sin -1 y) = f-1 (x)
f -1 : [-1,1] → [-π/2, π/2]
f(x) = Sin x
f: [-π/2, π/2] → [-1,1]

v. 𝑓: [𝑜, 𝜋] → [−2,2]
𝑓(𝑥) = 2 cos𝑥

Between [0,𝜋] and [−2,2]---------------------- (1)

Step 01
Check whether 𝑓 is One to One:
Let 𝑥1, 𝑥2 ∈ [0,𝜋] (Domain)
And 𝑓(𝑥1),𝑓(𝑥2) ∈ [−2,2] (Codomain)
𝑓(𝑥1) = 𝑓(𝑥2)
2𝑐𝑜𝑠𝑥1 = 2𝑐𝑜𝑠𝑥2
𝑐𝑜𝑠𝑥1 = 𝑐𝑜𝑠𝑥2
(𝑥1) = (𝑥2)
Therefore, 𝑓 is One to One------------------------- (2)

Step 02→
Check whether 𝑓 is onto:
For every 𝑦 ∈ [−2,2] (Codomain)
𝑦
𝑐𝑜𝑠 −1 ( 2) ∈ [0, 𝜋] (Domain)

P a g e 34 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝑦
Such that 𝑓 𝑐𝑜𝑠 −1 ( 2) = 𝑦

𝑦
So, y is the image of 𝑐𝑜𝑠 −1 (2)
𝑦
∴ x = 𝑐𝑜𝑠 −1 ( 2)

Therefore, 𝑓 is Onto------------------------------- (3)

By (1), (2) and (3),


𝑓 is One to One and onto correspondent between [0, 𝜋] and [−2,2]. Due to that, 𝑓 is invertible.

Step 03→
Inverse function of 𝑓:
𝑓 (𝑥) = 2𝑐𝑜𝑠𝑥
𝑦 = 2cosx
𝑦
𝑦
𝑐𝑜𝑠𝑥 =
2
𝑦
𝑥 = 𝑐𝑜𝑠 −1 ( 2)
𝑦
∴ 𝑓 −1 (𝑥) = 𝑐𝑜𝑠−1 ( )
2

∴ Inverse of 𝑓:
𝑓 −1 : [−2,2] → [0, 𝜋]
𝑥
𝑓 −1 (𝑥) = 𝑐𝑜𝑠 −1 (2)

Part 4
1. Formulate corresponding proof principles
A = B  A  B and B  A
In the above theory A and B are equal, if A is a subset of B and B is a subset of A.

P a g e 35 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


If A=B. Then suppose x ∈A. So x ∈B. Any moment an equality is found, it can be replaced any
instance of one side of the equality with the other side. It can be assumed that x ∈A implies x
∈B. As it is "if x ∈A, then x∈B", by default it can be obtained that A⊆B. It can be proved that
B⊆A, therefore A⊆B and B⊆A and also conclude that if A=B, then both A⊆B and B⊆A.
Also, if A⊆B and B⊆A. By definition of ⊆ and if A⊆B available, it is drawn that "if x ∈A, then
x ∈B" and also conclude that x ∈A if and only if x ∈B. As this is proven. The predecessor of the
axion of extensionality, it is settled the consequent that A is equal to B
Also, besides it can be finalized that if A⊆B and B⊆A, then A=B. As coming to the conclusion
of the second part it is proven that "if A=B, then A⊆B and B⊆A" and "if A⊆B and B⊆A, then
A=B" then it has a final answer that
A=B if A⊆B and B⊆A.

2. De Morgan’s Law

Figure 1 DE Morgan's Law

“De Morgan's Laws describe how mathematical statements and concepts are related through their
opposites. In set theory, De Morgan's Laws relate the intersection and union of sets
through complements. In propositional logic, De Morgan's Laws relate conjunctions and
disjunctions of propositions through negation. De Morgan's Laws are also applicable in computer
engineering for developing logic gates.
Interestingly, regardless of whether De Morgan's Laws apply to sets, propositions, or logic gates,
the structure is always the same.

P a g e 36 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


De Morgan's Laws
Not (A and B) is the same as Not A or Not B.
Not (A or B) is the same as Not A and Not B.
This same structure can be used to make observations in cardinality of sets, to calculate
certain probabilities, and to write equivalent” (Wu, 2018)

3. Distributive Laws for three non-empty finite sets

(𝑨 ∩ 𝑩)𝑪 = 𝑨𝑪 ∪ 𝑩𝑪

Prove by induction on 𝑛 the following statement:


𝑃(𝑛): For all sets 𝐴1, … , 𝐴𝑛 have,
(∗) (̅𝐴̅1̅∩̅…̅
̅ ̅∩̅̅ ̅𝐴̅𝑛̅) = ̅𝐴̅1 ∪ … ∪ 𝐴̅𝑛̅ ̅
The key to the argument is two set version of De Morgan’s Law:
(∗∗) (̅𝐴̅∩̅𝐵̅) = 𝐴̅ ∪ 𝐵̅,
Which holds for any sets 𝐴 and 𝐵.
Base case: For 𝑛 = 1, the left and right sides of (∗) are both equal to ̅𝐴̅1, so (∗) holds trivially in
this case. Hence 𝑃(1) is true.
Though not absolutely necessary, that can also easily verify the next case,
𝑛 = 2: In this case, the left and right sides of (∗) are (̅𝐴̅1̅∩̅̅𝐴̅̅2) and ̅𝐴̅1 ∪ 𝐴̅̅2̅, respectively,
so the identity is just the two set version of De Morgan’s Law, i.e., (∗∗) with 𝐴 = 𝐴1 and 𝐵 = 𝐴2.
Induction step: Let 𝑘 ≥ 1, and suppose 𝑃(𝑘) is true, i.e., suppose that (∗) holds for 𝑛 = 𝑘 and any
sets 𝐴1, … , 𝐴𝑘. To show that 𝑃(𝑘 + 1) is true, i.e., that for any sets 𝐴1, … , 𝐴𝑘+1, (∗) holds.
Let 𝐴1, …, 𝐴𝑘+1 be given sets. Then
̅ ̅𝐴̅̅𝑘̅+̅1̅) = (̅(̅𝐴̅1̅∩̅…̅∩̅̅𝐴̅̅𝑘̅)̅∩̅𝐴𝑘̅ ̅+̅1̅)
̅(̅𝐴1̅ ̅∩̅…̅∩̅
= ̅(̅𝐴̅1̅∩̅…̅̅∩̅̅𝐴̅𝑘̅) ∪ 𝐴̅̅𝑘̅+̅1̅(by (∗∗) with 𝐴 = (𝐴1 ∩ …∩ 𝐴𝑘) and 𝐵 = 𝐴𝑘+1)
= (̅𝐴̅1 ∪ … ∪ ̅𝐴𝑘̅ ̅) ∪ ̅𝐴̅𝑘̅+̅1 (by induction hypothesis applied to 𝐴1, …. , 𝐴𝑘 )
= ̅𝐴̅1 ∪ … ∪ ̅𝐴̅𝑘̅ ∪ 𝐴̅̅𝑘̅+̅1.
Thus, (∗)holds for 𝑛 = 𝑘 + 1, and since the 𝐴1, … , 𝐴𝑘+1 were arbitrary sets, that have obtained
statement 𝑃(𝑘 + 1). Hence, the proof of the induction, it follows that 𝑃(𝑛) is true for all 𝑛 ∈ ℤ+//

P a g e 37 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Proof:
(𝑨 ∩ 𝑩)𝑪 = 𝑨𝑪 ∪ 𝑩𝑪
Let M = (𝐴 ∩ 𝐵)𝐶and N = 𝐴𝐶 ∪ 𝐵𝐶
Let x be an arbitrary element of M then 𝑥 ∈ 𝑀 ⇒ 𝑥 ∈ (𝐴 ∩ 𝐵)𝐶
⇒ 𝑥 ∉ (𝐴 ∩ 𝐵)
⇒ 𝑥 ∉ 𝐴 𝑜𝑟 𝑥 ∉ 𝐵
⇒ 𝑥 ∈ 𝐴𝐶 𝑜𝑟 𝑥 ∈ 𝐵𝐶
⇒ 𝑥 ∈ 𝐴𝐶 ∪ 𝐵𝐶
⇒𝑥∈𝑁
Therefore, 𝑀 ⊂ 𝑁------------------------- (1)
Again, let y be an arbitrary element of N then 𝑦 ∈ 𝑁 ⇒ 𝑦 ∈ 𝐴𝐶 ∪ 𝐵𝐶
⇒ 𝑦 ∈ 𝐴𝑐 𝑂𝑅 𝑦 ∈ 𝐵𝐶
⇒ 𝑦 ∉ 𝐴 𝑜𝑟 𝑦 ∉ 𝐵
⇒ 𝑦 ∉ (𝐴 ∩ 𝐵)
⇒ 𝑦 ∈ (𝐴 ∩ 𝐵)𝐶
⇒𝑦∈𝑀
Therefore, 𝑁 ⊂ 𝑀------------------------ (2)
By (1) and (2), 𝑀 = 𝑁
∴ (𝐴 ∩ 𝐵)𝐶 = 𝐴𝐶 ∪ 𝐵𝐶 iii. Distributive Laws for three non-empty finite sets A, B, and C
𝑨 ∪ (𝑩∩ 𝑪) = (𝑨 ∪ 𝑩)∩ (𝑨 ∪ 𝑪)
This law states that taking the union of a set to the intersection of two other sets is the same as
taking the union of the original set and both the other two sets separately, and then taking the
intersection of the results.
Proof :-
𝐴 ∪ (𝐵 ∩ 𝐶) = (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶) Let 𝑥 ∈ 𝐴 ∪ (𝐵 ∩ 𝐶).
If x ∈ 𝐴 ∪ (𝐵 ∩ 𝐶) then x is either in A or in (B and C).
𝑥 ∈ 𝐴 𝑜𝑟 𝑥 ∈ (𝐵 𝑎𝑛𝑑 𝐶)
𝑥 ∈ 𝐴 𝑜𝑟 {𝑥 ∈ 𝐵 𝑎𝑛𝑑 𝑥 ∈ 𝐶)
{𝑥 ∈ 𝐴 𝑜𝑟 𝑥 ∈ 𝐵} 𝑎𝑛𝑑 {𝑥 ∈ 𝐴 𝑜𝑟 𝑥 ∈ 𝐶)
𝑥 ∈ (𝐴 𝑜𝑟 𝐵) 𝑎𝑛𝑑 𝑥 ∈ (𝐴 𝑜𝑟 𝐶)
P a g e 38 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝑥 ∈ (𝐴 ∪ 𝐵) ∩ 𝑥 ∈ (𝐴 ∪ 𝐶)
𝑥 ∈ (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶)
𝑥 ∈ 𝐴 ∪ (𝐵 ∩ 𝐶) ⇒ 𝑥 ∈ (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶)
Therefore,
𝐴 ∪ (𝐵 ∩ 𝐶) ⊂ (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶)------------------ (1) Let 𝑥 ∈ (𝐴 ∪ B) ∩ (𝐴 ∪ 𝐶).
If x ∈ (𝐴 ∪ B) ∩ (A ∪ C) then x is in (A or B) and x is in (A or C).
𝑥 ∈ (𝐴 𝑜𝑟 𝐵) 𝑎𝑛𝑑 𝑥 ∈ (𝐴 𝑜𝑟 𝐶)
{𝑥 ∈ 𝐴 𝑜𝑟 𝑥 ∈ 𝐵}𝑎𝑛𝑑 {𝑥 ∈ 𝐴 𝑜𝑟 𝑥 ∈ 𝐶}
𝑥 ∈ 𝐴 𝑜𝑟 {𝑥 ∈ 𝐵 𝑎𝑛𝑑 𝑥 ∈ 𝐶}
𝑥 ∈ 𝐴 𝑜𝑟 {𝑥 ∈ (𝐵 𝑎𝑛𝑑 𝐶)}
𝑥 ∈ 𝐴 ∪ {𝑥 ∈ (𝐵 ∩ 𝐶)}
𝑥 ∈ 𝐴 ∪ (𝐵 ∩ 𝐶)
𝑥 ∈ (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶) ⇒ 𝑥 ∈ 𝐴 ∪ (𝐵 ∩ 𝐶)
Therefore,
(𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶) ⊂ 𝐴 ∪ (𝐵 ∩ 𝐶)------------------- (2)
By (1) and (2),
𝐴 ∪ (𝐵 ∩ 𝐶) = (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶)
𝑨 ∩ (𝑩∪ 𝑪) = (𝑨 ∩ 𝑩)∪ (𝑨 ∩ 𝑪)
This law states that taking the intersection of a set to the union of two other sets is the same as
taking the intersection of the original set and both the other two sets separately, and then taking
the union of the results.
Proof :-
𝐴 ∩ (𝐵 ∪ 𝐶) = (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶) Let 𝑥 ∈ 𝐴 ∩ (𝐵 ∪ 𝐶).
If x ∈ 𝐴 ∩ (𝐵 ∪ 𝐶) then 𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ (𝐵 𝑜𝑟 𝐶).
𝑥 ∈ 𝐴 𝑎𝑛𝑑 {𝑥 ∈ 𝐵 𝑜𝑟 𝑥 ∈ 𝐶}
{𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ 𝐵} 𝑜𝑟 {𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ 𝐶)
𝑥 ∈ (𝐴 ∩ 𝐵) 𝑜𝑟 𝑥 ∈ (𝐴 ∩ 𝐶)
𝑥 ∈ (𝐴 ∩ 𝐵) ∪ (𝐴 ∪ 𝐶)
𝑥 ∈ 𝐴 ∩ (𝐵 ∪ 𝐶) ⇒ 𝑥 ∈ (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶)
Therefore,
P a g e 39 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝐴 ∩ (𝐵 ∪ 𝐶) ⊂ (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶)------------------ (1) Let 𝑥 ∈ (𝐴 ∩ B) ∪ (𝐴 ∩ 𝐶).
If x ∈ (𝐴 ∩ B) ∪ (A ∩ C) then 𝑥 ∈ (𝐴 ∩ 𝐵) 𝑜𝑟 𝑥 ∈ (𝐴 ∩ 𝐶).
𝑥 ∈ (𝐴 𝑎𝑛𝑑 𝐵) 𝑜𝑟 (𝐴 𝑎𝑛𝑑 𝐶)
{𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ 𝐵} 𝑜𝑟 {𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ 𝐶}
𝑥 ∈ 𝐴 𝑎𝑛𝑑 {𝑥 ∈ 𝐵 𝑜𝑟 𝑥 ∈ 𝐶}
𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ (𝐵 𝑜𝑟 𝐶}
𝑥 ∈ 𝐴 ∩ (𝐵 ∪ 𝐶)
𝑥 ∈ (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶) ⇒ 𝑥 ∈ 𝐴 ∩ (𝐵 ∪ 𝐶)
Therefore,
(𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶) ⊂ 𝐴 ∩ (𝐵 ∪ 𝐶)------------------- (2)
From (1) and (2),
𝐴 ∩ (𝐵 ∪ 𝐶) = (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶)

P a g e 40 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Activity 02
Part 1
Binary Tree
Each node can have at most two children. The maximum number of nodes possible at any level i
is 2i. Binary tree play a vital role in a software application. one of the most applications of binary
the tree is a searching algorithm.

The binary tree is a special data structure used for data storage purposes. The binary tree is used
to represent a nonlinear data structure (Roshanthi, 2020).

Qualitative Binary trees

Figure 2 Binary tree for Qualitative

“Consider the usual setting of classification learning, but in our case the hypothesis language
involves qualitative constraints. Let there be N learning examples. Each example is described by
n + 1 continuous variables X1... Xn+1. The variable Xn+1 is called the class, and the others are
called attributes. Given the learning examples, our problem is to learn a hypothesis that separates
the areas of attribute space which share a common qualitative behaviour of the class variable. We
learn such hypotheses in the form of qualitative trees. A qualitative tree is a binary tree with
internal nodes called splits and qualitatively constrained functions in the leaves. The splits define
a partition of the state space into areas with common qualitative behaviour of the class variable.
A split consists of a split attribute and a split value. Qualitatively constrained functions
(abbreviated QCFs) in leaves define qualitative constraints on the class variable. Fig. 1 shows an
P a g e 41 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


example of qualitative tree induced from a set of example points for the function z = x2 − y2”
(Bratko, 2001).

Example Qualitative binary tree


The following decision tree shows the main sectors of an online shopping site.
X1= Online Shopping Site
X2= Women’s Clothing
X3= Men’s Clothing
Y= {W1, W2,} = {Frocks, Blouses}
Z= {W3, W4} = {Shirts, Trousers}

Figure 3 Binary tree example for Qualitative

P a g e 42 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Quantitative Binary tree

Figure 4 web, Quantitative Binary tree

“A binary tree is a non-linear data structure in which each node has maximum of two child
nodes. The tree connections can be called as branches.
According to graph theory binary trees defined here are actually arborescence. A binary tree is
also known as old programming term bifurcating arborescence, before the modern computer
science terminology prevailed. Binary tree is also known as rooted binary tree because some
author uses this term to emphasize the fact that the tree is rooted, but as defined above, a binary
tree is always rooted. A binary tree is a special case of an ordered binary tree, where k is 2.
• Trees are used to represent data in hierarchical form.
• Binary tree is the one in which each node has maximum of two child- node.
• The order of binary tree is ‘2’.
• Binary tree does not allow duplicate values.
• While constructing a binary, if an element is less than the value of its parent node, it is
placed on the left side of it otherwise right side.
• A binary tree is shown for the element 40, 56, 35, 48, 22, 65, 28” (Shukla, 2017)

P a g e 43 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Example Quantitative binary tree
The following tree shows that the product A has a 30% probability of success, and product B
has a 60% probability of success. Therefore, there is a 18% chance of having 2 products
successful, 18% + 12% + 42% chance of having 1 more product succeed and 28% chances of
a total failure.

Figure 5 example for Quantitative Binary tree

P a g e 44 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 2
1. State the Dijkstra’s algorithm for a directed weighted graph with all non-negative edge
weights.
One algorithm for finding the shortest path from a starting node to a target node in a weighted
graph is Dijkstra’s algorithm. The algorithm creates a tree of shortest paths from the starting vertex,
the source, to all other points in the graph (brilliant.org, 2019).
Dijkstra’s algorithm does not work on graphs with negative weights or edges. This is called
“Greedy Algorithm” because it always relay on local optimum. This is commonly used in maps,
AI based applications and routing systems.

The Algorithm
Initially 𝑎 is the only vertex in 𝑉. At each step 𝑉 is added to another vertex for which the shortest
path from 𝑎 has been determined. The array 𝐿 is initialized by setting 𝐿[𝑖]to the ∞. To determine
which vertex is to be added to V at each step, a criteria is applied of choosing the vertex 𝑗 with the
smallest distance recorded in 𝐿, such that 𝑗 is not a visited one. When 𝑉 is added to 𝐽 (𝑉 is set of
visited vertices), the entries of L must be updated by checking, for every vertex 𝑘 not in ∪ (∪ is
set of unvisited vertices), whether a path through 𝑗 and directly to 𝑘 is shorter than the previously
recorded one. If the latter quantity is lesser,

𝐿(𝑘) must be replaced by [𝐿(𝑗)+ 𝑤(𝑗, 𝑘)]. Here 𝑤(𝑗, 𝑘) is weight of edge between 𝑗 and 𝑘, when
the shortest distance, 𝐿(𝑘), is updated, the shortest path 𝑃(𝑘) must be updated.
𝑃(𝑘) is updated by a path of 𝑗 followed by 𝑘. In brief, if 𝐿(𝑘) > (𝐿(𝑗)+ 𝑤(𝑗, 𝑘)) then 𝐿(𝑘) =
𝐿(𝑗)+ 𝑤(𝑗, , 𝑘) and 𝑃(𝑘) = 𝑃(𝑗) ∪ {𝑘}.
This procedure is repeated by successively adding vertices to V until z is added. Here z is
destination vertex.

Dijkstra’s Algorithm
𝐺 = (𝐴, 𝐵), A is set of vertices and B is set of edges. 𝑈 is set of unvisited vertices and 𝑉 is set of
visited vertices. 𝑤(𝑖, 𝑗) represent weight of edge (𝑖, 𝑗) where 𝑤(𝑖, 𝑗) = ∞ if (𝑖, 𝑗) ∉ 𝐵. Let |𝐴| = 𝑛.
P a g e 45 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝐿(𝑖) is shortest distance between source 𝑎 and vertex 𝑖. 𝑃(𝑖) is set of vertices representing shortest
path.
Step 1: for 𝑖 = 1 to 𝑛 do
𝐿(𝑖) = ∞, 𝐿(𝑎) = 0
𝑃(𝑖) = ∅
Step 2: 𝑉 = ∅ and 𝑈 = 𝐴
Step 3: Let 𝑎 be source vertex and 𝑧 be the destination vertex. Step 4: While 𝑧 ∈ 𝑉
begin,
𝑘 = 𝑎 vertex in 𝑈 with 𝐿(𝑥) minimal.
𝑉 = 𝑉 ∪ {𝑘} for every 𝑗 ∈ 𝑈 if (𝐿(𝑗) > (𝐿(𝑘)) + 𝑤(𝑘,𝑗)) then
begin,
𝐿(𝑗) = 𝐿(𝑘) + 𝑤(𝑘,𝑗)
𝑃(𝑗) = 𝑃(𝑘) ∪ {𝑗}
end
end
Step 5: Stop

2. Use Dijkstra’s algorithm to find the shortest path spanning tree for the following weighted
directed graph with vertices A, B, C, D, and E given. Consider the starting vertex as E.

Figure 6 Weighted Directed Graph

P a g e 46 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Vertices B C D E
A 5 3 ∞ ∞
{A, B} {A, C}
C 5 - 7 9
{A, B} {A, C, D} {A, C, E}
B - - 7 9
{A, C, D} {A, C, E}
D - - - 9
{A, C, E}
Table 1 Vertices of Weighted Directed Graph

Shortest path for vertices:

A → C Weight = 3

A → B Weight = 5

A → C → D Weight = 7

A → C → E Weight = 9

Figure 7 Weighted Directed Graph

P a g e 47 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 3
1.Assess whether the following undirected graphs have an Eulerian and/or a Hamiltonian
cycle.

Eulerian Path and Circuit


A Eulerian path is a path that uses all the edges of a graph without repeats. Being a path, it
does not have to return to the starting vertex.
A Eulerian circuit is a circuit that uses all the edges of a graph without repeats.
Being a circuit, it must start and end at the same vertex.

Eulerian Path and Circuit Theorems

A graph will contain a Euler path if it contains at most two odd-degree vertices.
A graph will contain a Euler circuit if all the vertices have even degree.

Hamilton Path and Circuit


A Hamiltonian path visits each vertex once without repeats, but does not have to start and end
at the same vertex.
A Hamiltonian circuit is a circuit that visits each vertex once without repeats. Being a circuit,
it must start and end at the same vertex.

Eulerian Hamilton

All edges All vertices


Same edge cannot take twice Same vertex cannot take twice
An edge can be taken more than once. A vertex can be taken more than once.

Table 2 Differences of Eulerian and Hamilton Circuits

P a g e 48 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


1.

𝑑(𝐷) = 3
𝑑(𝐸) = 1
This graph, has 2 odd degree vertices. This graph passes same vertex more than once.
Therefore, this is Eulerian. Not Hamilton.

2.

𝑑(𝐴) = 3
𝑑(𝐶) = 3
𝑑(𝐷) = 3
𝑑(𝐸) = 3
P a g e 49 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


This graph has 4 odd degree vertices. This graph passes every vertex exactly once without
repeats.
Therefore, this is Hamilton. Not Eulerian.
Ex:- {𝐴, 𝐵, 𝐶, 𝐷, 𝐸, 𝐴}, {𝐸, 𝐴, 𝐵,𝐶, 𝐷, 𝐸}

3.

𝑑(𝐵) = 3
𝑑(𝐸) = 3
This graph has 2 odd degree vertices. This graph passes same vertex more than once.
Therefore, this is Eulerian. Not Hamilton.

Part 4
1. Construct a proof of the five-color theorem for every planar graph.
Prove Theorem
The proof is by induction on the number 𝑝 of vertices of 𝐺. If 𝑝 ≤ 5, then the theorem obviously
holds. Suppose 𝑝 > 5, and the theorem holds for graphs with less than 𝑝 vertices. By the
preceding problem, 𝐺 has a vertex 𝑣 such that deg (𝑣) ≤ 5. By induction, the subgraph 𝐺 − 𝑣
is 5-colorable. Assume one such coloring. If the vertices adjacent to 𝑣 use less than the five
colors, then simply paint 𝑣 with one of the remaining colors and obtain a 5-coloring of 𝐺. But,
still left with the case that 𝑣 is adjacent to five vertices which are painted different colors. Say

P a g e 50 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


the vertices, moving counter clockwise about 𝑣 are 𝑣1, … , 𝑣5 and are painted respectively by
the colors 𝑐1,… , 𝑐5.

Figure 8 Five Color Theorem

Consider now the subgraph 𝐻 of 𝐺 generated by the vertices painted 𝑐1 and 𝑐3. Note 𝐻 includes
𝑣1 and 𝑣3. If 𝑣1 and 𝑣3 belong to different components of 𝐻, then the colors 𝑐1 and 𝑐3 can be
interchanged in the component containing 𝑣1 without destroying the coloring of 𝐺 − 𝑣. Then
𝑣1 and 𝑣3 are painted by 𝑐3, 𝑐1 can be chosen to paint 𝑣, and have a 5coloring of 𝐺. On the
other hand, suppose 𝑣1 and 𝑣3 are in the same component of 𝐻. Then there is a path 𝑃 from
𝑣1 to 𝑣3 whose vertices are painted either 𝑐1 or 𝑐3. The path 𝑃 together with the edges {𝑣, 𝑣1}
and {𝑣, 𝑣3} from a cycle 𝐶 which encloses either 𝑣2 or 𝑣4. Consider now the subgraph 𝐾
generated by the vertices painted 𝑐3 or 𝑐4. Since 𝐶 encloses 𝑣2 or 𝑣4, but not both, the vertices
𝑣2 and 𝑣4 belong to different components of 𝐾.
Thus, the colors 𝑐2 and 𝑐4 can be interchanged in the component containing 𝑣2 without
destroying the coloring of 𝐺 − 𝑣. Then 𝑣2 and 𝑣4 are painted by 𝑐4, and 𝑐2 can be chosen to
paint 𝑣 and obtain a 5-coloring of G. Thus, 𝐺 is 5-colorable and the theorem is proved.

P a g e 51 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Activity 03
Part 1
1. Diagram two real world binary problems in two different fields using applications of
Boolean Algebra.
Example: -
1) In order to access into security locker at a prominent organization the fingerprint access of
Managing Director and one of the Managers is needed. There are Operational Manager and
Production Manager at organization.
Input: -
𝐴 → Fingerprint of Managing Director
𝐵 → Fingerprint of Operational Manager
𝐶 → Fingerprint of Production Manager
Output: -
𝑋 → Accessing security locker

Truth Table
𝑨 𝑩 𝑪 𝑿
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
Table 3 Truth Table 1

P a g e 52 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝑋 = 𝐴𝐵̅𝐶 + 𝐴𝐵𝐶̅ + 𝐴𝐵𝐶

Figure 9 Logic Gate Circuit 1

Example: -
2) In a Nescafe machine at a local restaurant in order to make either tea, sugar and water button
should be pressed.
Input: -
𝐴 → Tea button
𝐵 → Sugar button
𝐶 → Water button
Output: -
𝑋 → Receive tea/coffee

P a g e 53 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Truth Table
𝑨 𝑩 𝑪 𝑿
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
Table 4 Truth Table 2

𝑋 = 𝐴𝐵𝐶

Figure 10 Logic Gate Circuit 2

P a g e 54 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 2
1. Produce truth tables and its corresponding Boolean equation for the following scenarios.
i. If the driver is present and the driver has not buckled up and the ignition
switch is on, then the warning light should turn on.
ii. If it rains and you don't open your umbrella, then you will get wet.

𝐴 − The driver is present


𝐵 − The driver has buckled up
𝐶 − The ignition switches on
𝑋 − The warning light is turn on

Boolean Equation:
𝐴 and 𝐵̅ and 𝐶 = 𝑋
𝐴. 𝐵̅. 𝐶 = 𝑋
𝐴𝐵̅𝐶 = 𝑋
Truth Table
𝑨 𝑩 𝑪 𝑩̅ 𝑨𝑩̅𝑪(𝑿)
0 0 0 1 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 0
1 0 0 1 0
1 0 1 1 1
1 1 0 0 0
1 1 1 0 0
Table 5 Truth Table

P a g e 55 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 11 Logic Gate Circuit

If it rains and you don't open your umbrella, then you will get wet.
𝐴 − It is raining
𝐵 − You open your umbrella
𝑋 − You get wet
𝐴 and 𝐵̅ = 𝑋
𝐴. 𝐵̅ = 𝑋
𝐴𝐵̅ = 𝑋

Truth Table

𝑨 𝑩 𝑩̅ 𝑨𝑩̅(𝑿)
0 0 1 0
0 1 0 0
1 0 1 1
1 1 0 0
Table 6 Truth Table

Figure 12 Logic Gate Circuit

P a g e 56 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


1. Produce truth tables for given Boolean expressions.
𝐴̅𝐵̅𝐶 + 𝐴𝐵̅𝐶̅ + 𝐴𝐵𝐶 + 𝐴̅𝐵𝐶 ̅

Figure 13 Truth Table

(𝐴 + 𝐵̅ + 𝐶)(𝐴 + 𝐵 + 𝐶)(𝐴̅ + 𝐵 + 𝐶̅)

Figure 14 Truth Table

P a g e 57 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 3
1.Simplify the following Boolean expressions using algebraic methods.
Laws of Boolean Algebra

Commutative Law
𝐴+𝐵=𝐵+𝐴
𝐴𝐵 = 𝐵𝐴
Associative Law
𝐴 + (𝐵 + 𝐶) = (𝐴 + 𝐵) + 𝐶
𝐴(𝐵𝐶) = (𝐴𝐵)𝐶
Distributive Law
𝐴(𝐵 + 𝐶) = 𝐴𝐵 + 𝐴𝐶 Annulment Law
𝐴. 0 = 0
𝐴+1=1
Identity Law 𝐴 + 0 = 𝐴
𝐴. 1 = 𝐴
Idempotent Law
𝐴+𝐴=𝐴
𝐴. 𝐴 = 𝐴
Complement Law
𝐴. 𝐴̅ = 0
𝐴 + 𝐴̅ = 1
P a g e 58 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Double Negation Law
𝐴=𝐴
de Morgan´s Theorem
̅𝐴̅+̅
̅ ̅𝐵̅ = 𝐴̅. ̅𝐵
𝐴̅̅.̅𝐵̅ = 𝐴̅ + ̅𝐵
Absorptive Law
𝐴 + (𝐴. B) = 𝐴
𝐴(𝐴 + 𝐵) = 𝐴
Redundancy Law
𝐴 + Ā𝐵 = 𝐴 + 𝐵
𝐴. (Ā + 𝐵) = 𝐴𝐵

Consensus Law
(𝐴 + 𝐵). (𝐴̅ + 𝐶).(𝐵 + 𝐶) = (𝐴 + 𝐵).(𝐴̅ + 𝐶)
𝐴𝐵 + 𝐴̅𝐶 + 𝐵𝐶 = 𝐴𝐵 + 𝐴̅𝐶

1. 𝐴(𝐴+ 𝐵) + 𝐵(𝐵 + 𝐶) + 𝐶(𝐶 + 𝐴)


= 𝐴𝐴 + 𝐴𝐵 + 𝐵𝐵 + 𝐵𝐶 + 𝐶𝐶 + 𝐶𝐴 Distributive Law
= (𝐴 + 𝐴𝐵) + (𝐵 + 𝐵𝐶) + (𝐶 + 𝐶𝐴) Rule 7
= 𝐴 + 𝐵 + 𝐶 Rule 10
2. (𝐴 + 𝐵̅)(𝐵 + 𝐶) + (𝐴 + 𝐵)(𝐶 + 𝐴̅)
̅B+B
=AB+AC+B ̅C+AC+AA
̅ +BC+BA
̅
̅ C+AC+0+BC+BA
=AB+AC+0+B ̅ Rule 8
̅) + (AC+AC) + ( B
= (AB+BA ̅C + BC)
̅) + AC+C (B+B
=B (A+A ̅) Rule 5, Distributive Law
=B (1) + AC+C (1) Rule 6
=B+ (AC+C)
=B+C Rule 10

P a g e 59 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


3. (𝐴 + 𝐵)(𝐴𝐶 + 𝐴𝐶̅)+ 𝐴𝐵 +𝐵
= (𝐴 + 𝐵) 𝐴(𝐶 + 𝐶̅) + (𝐴𝐵 + 𝐵) Distributive Law
= (𝐴 + 𝐵) 𝐴 + 𝐵 Rule 6, Rule 10
= 𝐴𝐴 + 𝐵𝐴 + 𝐵 Distributive Law
= 𝐴 + (𝐴𝐵 + 𝐵) Rule 7
= 𝐴 + 𝐵 Rule 10

4. 𝐴̅(𝐴 + 𝐵) + (𝐵 + 𝐴)(𝐴 + 𝐵̅)


= 𝐴𝐴̅ + 𝐴̅𝐵 + 𝐵𝐴 + 𝐵𝐵̅ + 𝐴𝐴 + 𝐴𝐵̅ Distributive Law, Rule 12
= 0 + 𝐴̅𝐵 + 𝐵𝐴 + 0 + 𝐴 + 𝐴𝐵̅ Rule 8, Rule 7
̅B+BA) + (A+AB
= (A ̅) Distributive Law, Rule 10
̅) +A
=B (A+A Rule 6
= B+A Rule 6

P a g e 60 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 4
1.Consider the K-Maps given below. For each K- Map

i. Write the appropriate standard form (SOP/POS) of Boolean expression.


ii. Design the circuit using AND, NOT and OR gates.
iii. Design the circuit only by using
• NAND gates if the standard form obtained in part (i) is SOP.
• NOR gates if the standard form obtained in pat (i) is POS.

“A Boolean expression is an expression which consists of variables, constants (0-false and 1-


true) and logical operators which results in true or false.
A Boolean function is an algebraic form of Boolean expression. A Boolean function of n-
variables is represented by f(x1, x2, and x3….). By using Boolean laws and theorems, we can
simplify the Boolean functions of digital circuits. A brief note of different ways of representing a
Boolean function is shown below.
• Sum-of-Products (SOP) Form
• Product-of-sums (POS) form
• Canonical forms
There are two types of canonical forms:
Sum-of-min terms or Canonical SOP
Product-of- max terms or Canonical POS
Boolean functions can be represented by using NAND gates and also by using K-map (Karnaugh
map) method. We can standardize the Boolean expressions by using by two standard forms.

Sum-of-products (SOP)
The sum-of-products (SOP) form is a method (or form) of simplifying the Boolean expressions
of logic gates. In this SOP form of Boolean function representation, the variables are operated by
AND (product) to form a product term and all these product terms are ORed (summed or added)
together to get the final function.

P a g e 61 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


A sum-of-products form can be formed by adding (or summing) two or more product terms
using a Boolean addition operation. Here the product terms are defined by using the AND
operation and the sum term is defined by using OR operation.
The sum-of-products form is also called as Disjunctive Normal Form as the product terms are
ORed together and Disjunction operation is logical OR. Sum-of-products form is also called as
Standard SOP.
SOP form representation is most suitable to use them in FPGA (Field Programmable Gate
Arrays).

Product of Sums (POS) Form


The product of sums form is a method (or form) of simplifying the Boolean expressions of logic
gates. In this POS form, all the variables are ORed, i.e. written as sums to form sum terms.
All these sum terms are ANDed (multiplied) together to get the product-of-sum form. This form
is exactly opposite to the SOP form. So this can also be said as “Dual of SOP form”.
Here the sum terms are defined by using the OR operation and the product term is defined by
using AND operation. When two or more sum terms are multiplied by a Boolean OR operation,
the resultant output expression will be in the form of product-of-sums form or POS form.
The product-of-sums form is also called as Conjunctive Normal Form as the sum terms are
ANDed together and Conjunction operation is logical AND. Product-of-sums form is also called
as Standard POS” (mathi, 2018).

P a g e 62 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


a.

Figure 15 SOP K map

I. This Boolean expression belongs to SOP form

SOP = 𝐵𝐶 + 𝐴𝐵̅ 𝐶̅

II.

Figure 16 SOP Circuit


P a g e 63 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


III. Below logic circuit has designed with NAND gates, since the standard form of above
Boolean expression belongs to SOP form.

Figure 17 SOP NAND Circuit

b.

Figure 18 POS K map

P a g e 64 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


I. This Boolean expression belongs to POS form

POS = (𝐴 + 𝐵̅ + 𝐶 + 𝐷)(𝐴̅ + 𝐵̅ + 𝐶̅ + 𝐷)(𝐴 + 𝐶̅ + 𝐷


̅ )(𝐴 + 𝐵 + 𝐷
̅)

II.

Figure 19 POS Circuit

III. Below logic circuit has designed with NOR gates, since the standard form of above Boolean
expression belongs to POS form.

P a g e 65 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 20 POS NOR Circuit

c.

P a g e 66 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 21 POS K map

I. This Boolean expression belongs to POS form

POS = (𝐴 + 𝐵 + 𝐶̅ )(𝐴̅ + 𝐵̅ + 𝐶̅ )(𝐴̅ + 𝐵 + 𝐶)

II.

Figure 22 POS Circuit

P a g e 67 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


III. Below logic circuit has designed with NOR gates, since the standard form of above Boolean
expression belongs to POS form.

Figure 23 POS NOR Circuit

P a g e 68 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Activity 04
Part 1
1. Describe the distinguishing characteristics of different binary operations that are
performed on the same set.

A binary operation is a calculation that combines two elements to create a new element. A binary
operation on a set describes a calculation that involves two elements of the set to create a new
element of the set.

Basic Binary Operations

Operation Symbol Representation


Addition + 𝑎+𝑏
Subtraction − 𝑎−𝑏
Multiplication × 𝑎×𝑏
Division ÷ 𝑎÷𝑏
Table 7 Basic Binary Operations

Let 𝑆 be a non-empty set. A binary operation in the set 𝑆 is a function ∗ from 𝑆 × 𝑆 into 𝑆
∗∶𝑆×𝑆 → 𝑆
(Domain) (Codomain)
Let 𝑎, 𝑏 ∈ 𝑆,
Then a binary operation, ∗ between 𝑎 and 𝑏 can be written as 𝑎 ∗ 𝑏 such that 𝑎 ∗ 𝑏 ∈ 𝑆.

P a g e 69 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Characteristics of binary operations that are performed on the same set

• Associative Property
A binary operation ∗ on a set 𝑆 is said to be “Associative” or satisfy the “Associative
Property” if, for any elements 𝑎, 𝑏, 𝑐 in (𝑎, 𝑏, 𝑐, ∈ 𝑆),
(𝑎 ∗ 𝑏) ∗ 𝑐 = 𝑎 ∗ (𝑏 ∗ 𝑐)

• Commutative Property
A binary operation ∗ on a set is said to be “Commutative” or satisfy the “Commutative
Property “if, for any elements 𝑎, 𝑏 in (𝑎, 𝑏 ∈ 𝑆),
𝑎∗𝑏=𝑏∗𝑎
𝑎 + 𝑏 = 𝑏 + 𝑎 ← Commutative
𝑎 − 𝑏 ≠ 𝑏 − 𝑎 → Not Commutative

• Identity Element Property


Consider a binary operation ∗ on a set S An element ′𝑒′ in 𝑆 (𝑒 ∈ 𝑆) is called an“Identity
Element” of an element ′𝑎′ in 𝑆 (𝑎 ∈ 𝑆), for ∗ if,
𝑎∗𝑒=𝑒∗𝑎=𝑎
𝑎 × 1 = 1 × 𝑎 = 𝑎 → 1 Multiplication Identity
𝑎 + 0 = 0 + 𝑎 = 𝑎 → 0 Additive Identity

• Inverse Element Property


Suppose a binary operation ∗ on a set 𝑆 has an Identity Element ′𝑒′. The inverse of an
element ′𝑎′ in 𝑆 (𝑎 ∈ 𝑆) is an element ′𝑏′ in 𝑆 (𝑏 ∈ 𝑆) such that,
𝑎∗𝑏=𝑏∗𝑎=𝑒
′𝑏′ can be denoted as "𝑎−1" (Inverse of ′𝑎′)
1 1
𝑎 × 𝑎 = 𝑎 × 𝑎 = 1 → Multiplicative Inverse
𝑎 𝑎

𝑎 + (−𝑎) = (−𝑎) + 𝑎 = 0 → Additive Inverse

P a g e 70 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 2
1. Determine the operation tables for group G with orders 1, 2, 3 and 4 using the elements a,
b, c, and e as the identity element in an appropriate way.
A Group is a set (𝐺, ∗), where 𝐺 is a set and ∗ is a binary operation on 𝐺 such that the following
properties satisfy.
• Closure Property
For all 𝑎, 𝑏 ∈ 𝐺, 𝑎 ∗ 𝑏 ∈ 𝐺
• Associative Property
For all 𝑎, 𝑏, 𝑐 ∈ 𝐺, 𝑎 ∗ (𝑏 ∗ 𝑐) = (𝑎 ∗ 𝑏) ∗ 𝑐
• Identity Property
There exists an element 𝑒 ∈ 𝐺 such that for all 𝑎 ∈ 𝐺, 𝑎 ∗ 𝑒 = 𝑒 ∗ 𝑎 = 𝑎
• Inverse Property
For every 𝑎 ∈ 𝐺, there exists an element 𝑏 ∈ 𝐺, such that 𝑎 ∗ 𝑏 = 𝑏 ∗ 𝑎 = 𝑒
[𝑏 = 𝑎−1(Inverse of′𝑎′)]

Order of a Group is, No. of elements in that Group.

Operation Table for Order 1


𝐺 = {𝑒}

∗ 𝑒

𝑒 𝑒
Table 8 Operation Table for Order 1

P a g e 71 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Operation Table for Order 2

𝐺 = {𝑒, 𝑎}

∗ 𝑒 𝑎

𝑒 𝑒 𝑎

𝑎 𝑎 𝑒

Table 9 Operation Table for Order 2

Operation Table for Order 3

𝐺 = {𝑒, 𝑎, 𝑏}

∗ 𝑒 𝑎 𝑏

𝑒 𝑒 𝑎 𝑏

𝑎 𝑎 𝑏 𝑒

𝑏 𝑏 𝑒 𝑎

Table 10 Operation Table for Order 3

P a g e 72 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Operation Table for Order 4

𝐺 = {𝑒, 𝑎, 𝑏, 𝑐}

∗ 𝑒 𝑎 𝑏 𝑐

𝑒 𝑒 𝑎 𝑏 𝑐

𝑎 𝑎 𝑒 𝑐 𝑏

𝑏 𝑏 𝑐 𝑒 𝑎

𝑐 𝑐 𝑏 𝑎 𝑒

Table 11 Operation Table for Order 4

2.
i. State the relation between the order of a group and the number of binary operations
that can be defined on that set.
Total number of operations on a set consisting ′𝑛′ elements (order is 𝑛), is given by 𝑛^(𝑛^2).
(𝑛 Is raised to 𝑛 square)

Ex:- Order = 4
2
= 44 = 416

P a g e 73 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


ii. How many binary operations can be defined on a set with 4 elements?
Order = 4
2
Binary operations = 44

= 416

= 4,294,967,296

3.
i. State the Lagrange’s theorem of group theory.
“Lemma: Let H be a subgroup of G. Let r, s ∈ G. Then Hr = Hs if and only if rs−1 ∈ H.
Otherwise Hr, Hs have no element in common. Similarly, rH = sH if and only if s−1r ∈ H,
otherwise rH, sH have no element in common.
Proof: If rs−1 = h ∈ H, then H = Hh = (Hr)s−1. Multiplying both sides on the right
by ss gives Hr = Hs. Conversely, if Hr = Hs, then since r ∈ Hr (because 1 ∈ H ) we
have r=h′s for some h′ ∈ H. Multiplying on the right by s−1 shows that rs−1 ∈ H.
Now suppose Hr, Hs have some element in common, that is h1r=h2s for some h1, h2 ∈ H.
This implies rs−1 = h1-1h2 ∈ H, thus Hr = Hs by above.
Lagrange’s Theorem: If H is a subgroup of G, then |G|=n|H| for some positive integer n.
This is called the index of H in G. Furthermore, there exist g1,..., gn such that G =
Hr1∪...∪Hrn and similarly with the left-hand cosets relative to H” (Lynn, n.d.).

ii. For a subgroup H of a group G, prove the Lagrange’s theorem.


“Proof: Take any r1 ∈ G. Note |Hr1| = |H|. If Hr1 ≠ G then take any r2 ∈ G∖Hr1. By the
lemma, Hr1, Hr2 are disjoint so we have |Hr1∪Hr2|=2|H|. By continuing in this fashion,
after nn steps for some positive integer n, we will eventually have accounted for all of the
elements of G. We will have |G|=n|H| and G=Hr1∪...∪Hrn.
Corollary: Let G be a group and g ∈ G. Then the order of gg divides |G|.
Corollary: Let G be a group of prime order. Then G has no subgroups and hence is cyclic”
(Lynn, n.d.).

P a g e 74 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


iii. Discuss whether a group H with order 6 can be a subgroup of a group with order 13 or
not. Clearly state the reasons.
Let 𝐻 be a subgroup of 𝐺. Then, by the Lagrange’s Theorem of group theory, order of the
group 𝐻 divides the order of 𝐺. The order of group H is 6 and the order of given group is 13.
But, 13 is not divisible by 6.
Therefore, according to the Lagrange’s Theorem of Group Theory, a group 𝐻 with order 6
cannot be a subgroup of a group with order 13.

Part 3
1. Validate whether the set S = −{−1} is a group under the binary operation ‘*’defined as
a *b = a + b + ab for any two elements a,b S .

𝑆 can be a Group under the binary operation “∗” defined as 𝑎 ∗ 𝑏 = 𝑎 + 𝑏 + 𝑎𝑏 for any two
elements 𝑎, 𝑏 ∈ 𝑆, if the following properties are satisfied.

𝑆1: Associative Property


For any 𝑎, 𝑏, 𝑐 ∈ 𝑆,
(𝑎 ∗ 𝑏) ∗ 𝑐 = 𝑎 ∗ (𝑏 ∗ 𝑐) -------------------------------- (1)

𝑆2: Identity Element Property


There exists an element “𝑒” in 𝑆 such that, for every 𝑎 ∈ 𝑆,
𝑎 ∗ 𝑒 = 𝑒 ∗ 𝑎 = 𝑎---------------------------------- (2)
𝑆3: Inverse Element Property
For each 𝑎 in 𝑆, there exists an element 𝑏 (inverse of 𝑎) in 𝑆 such that,
𝑎 ∗ 𝑏 = 𝑏 ∗ 𝑎 = 𝑒 (𝑏 = 𝑎−1)-------------------- (3)

P a g e 75 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝑺𝟏: Associative Property
𝐿. 𝐻. 𝑆 = (𝑎 ∗ 𝑏) ∗ 𝑐
= (𝑎 + 𝑏 + 𝑎𝑏) ∗ 𝑐
= (𝑎 + 𝑏 + 𝑎𝑏) + 𝑐 + (𝑎 + 𝑏 + 𝑎𝑏)𝑐
= 𝑎 + 𝑏 + 𝑎𝑏 + 𝑐 + 𝑎𝑐 + 𝑏𝑐 + 𝑎𝑏𝑐
= 𝑎 + 𝑏 + 𝑐 + 𝑎𝑏 + 𝑎𝑐 + 𝑏𝑐 + 𝑎𝑏𝑐---------------------- (a)
𝑅. 𝐻. 𝑆 = 𝑎 ∗ (𝑏 ∗ 𝑐)
= 𝑎 ∗ (𝑏 + 𝑐 + 𝑏𝑐)
= 𝑎 + (𝑏 + 𝑐 + 𝑏𝑐) + 𝑎(𝑏 + 𝑐 + 𝑏𝑐)
= 𝑎 + 𝑏 + 𝑐 + 𝑏𝑐 + 𝑎𝑏 + 𝑎𝑐 + 𝑎𝑏𝑐----------------------- (b)
(a) = (b);
Therefore, By (1),
Associative Property is satisfied.

𝑺𝟐: Identity Element Property


Let 𝑒 = 0 ;
𝑎∗𝑒=𝑎∗0
=𝑎+0+𝑎×0
=𝑎+0
= 𝑎---------------------------------- (a)
𝑒∗𝑎=0∗𝑎
=0+𝑎+0×𝑎
=𝑎+0
= 𝑎---------------------------------- (b)
Therefore, By (a), (b)
𝑎∗0=0∗𝑎=𝑎
Therefore, By (2),
Identity Element Property is satisfied.

P a g e 76 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


𝑺𝟑: Inverse Element Property
Since 𝑒 = 0 ;
Let inverse of 𝑎 = (−𝑎)
𝑎 ∗ (−𝑎) = 𝑎 + (−𝑎) + 𝑎 × (−𝑎)
= 𝑎 − 𝑎 − 𝑎2
= −𝑎2 ≠ 0------------------- (a)
Therefore, By (a),
𝑎 ∗ (−𝑎) ≠ 0
Therefore, By (3),
Identity Element Property is not satisfied
Therefore, the set 𝑆 is not a group under the given binary operation//.

P a g e 77 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Part 4
1. Prepare a presentation for ten minutes to explore an application of group theory relevant
to your course of study. (i.e., in Computer Sciences)

Figure 24 Presentation Slide 1

I’m Lahiru Viraj. The presentation is based on Application of Group Theory for my HND
Computing Discrete Mathematics module.

P a g e 78 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 25 Presentation Slide 2

This is the content of the presentation

Figure 26 Presentation Slide 3

The basic introduction for group theory.


P a g e 79 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 27 Presentation Slide 4

Here the history of group theory is presented.

Figure 28 Presentation Slide 5

General application of group theory.


P a g e 80 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 29 Presentation Slide 6

Cryptography is a method of protecting information and communications

Figure 30 Presentation Slide 7

P a g e 81 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Modern cryptography concerns with Confidentiality, Integrity, Non-repudiation and
Authentication.

Figure 31 Presentation Slide 8

Three types of cryptographic techniques used in general.

P a g e 82 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 32 Presentation Slide 9

By using Group theory we can construct variants of the Diffie–Hellman key agreement protocol.

Figure 33 Presentation Slide 10

Here’s the summary of the applications of group theory in computer science

P a g e 83 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Figure 34 Presentation Slide 11

Here’s the sources I used to create the presentation.

Figure 35 Presentation Slide 12

P a g e 84 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


References

Bratko, I., 2001. springer.com. [Online]


Available at: https://link.springer.com/content/pdf/10.1007/3-540-44795-4_38.pdf
[Accessed 23 12 2020].

brilliant.org, 2019. Dijkstra's Shortest Path Algorithm. [Online]


Available at: https://brilliant.org/wiki/dijkstras-short-path-finder/
[Accessed 22 January 2021].

Lynn, B., n.d. crypto.stanford.edu. [Online]


Available at: https://crypto.stanford.edu/pbc/notes/group/lagrange.html
[Accessed 20 01 2021].

mathi, 2018. electronicshub.org. [Online]


Available at: https://www.electronicshub.org/boolean-logic-sop-form-pos-form/

Roshanthi, 2020. Discrete Mathematics for Roshanthi. [Online]


Available at: https://www.assignmentexpert.com/homework-answers/mathematics/discrete-
mathematics/question-
120782#:~:text=Binary%20tree%20are%20used%20to,nodes%20as%20left%20as%20possible.
[Accessed 23 12 2020].

Shukla, A., 2017. includehelp.com. [Online]


Available at: https://www.includehelp.com/data-structure-tutorial/binary-tree-definition-and-its-
properties.aspx
[Accessed 23 12 2020].

Wu, A. H. a. V., 2018. brilliant.org. [Online]


Available at: https://brilliant.org/wiki/de-morgans-laws/
[Accessed 23 12 2020].

P a g e 85 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Gantt Chart

Figure 36 Gantt Chart

P a g e 86 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


Grading Rubric

Grading Criteria Achieved Feedback

LO1 : Examine set theory and functions applicable to software


engineering.

P1 Perform algebraic set operations in a formulated


mathematical problem.
P2 Determine the cardinality of a given bag (multiset).

M1 Determine the inverse of a function using appropriate


mathematical technique.
D1 Formulate corresponding proof principles to prove properties
about defined sets..
LO2 : Analyse mathematical structures of objects using graph
theory.

P3 Model contextualized problems using trees, both quantitatively


and qualitatively.
P4 Use Dijkstra’s algorithm to find a shortest path spanning tree in
a graph.
M2 Assess whether an Eulerian and Hamiltonian circuit exists in an
undirected graph.

P a g e 87 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


D2 Construct a proof of the Five colour theorem.

LO3 : Investigate solutions to problem situations using the


application of Boolean algebra.

P5 Diagram a binary problem in the application of Boolean Algebra.

P6 Produce a truth table and its corresponding Boolean equation


from an applicable scenario.
M3 Simplify a Boolean equation using algebraic methods.

D3 Design a complex system using logic gates.

LO4 : Explore applicable concepts within abstract algebra.

P7 Describe the distinguishing characteristics of different binary


operations that are performed on the same set.
P8 Determine the order of a group and the order of a subgroup in
given examples.
M4 Validate whether a given set with a binary operation is indeed a
group.

P a g e 88 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS


D4 Prepare a presentation that explains an application of group
theory relevant to your course of study.

P a g e 89 | 89

N.G.G. Lahiru Viraj / ME24716 Unit 18: DISCRETE MATHEMATICS

You might also like