LE5456, Batch 51, DM
LE5456, Batch 51, DM
LE5456, Batch 51, DM
• Constructive?
Y/N
• Linked to relevant assessment
criteria? Y/N
1
Dewmi Sandunika Heenatigala LE05456
Confirm action completed
Remedial action taken
Give details:
Internal Verifier
Date
signature
Programme Leader
Date
signature (if required)
2
Dewmi Sandunika Heenatigala LE05456
Higher Nationals - Summative Assignment Feedback Form
Student Name/ID Dewmi Sandunika Heeantigala/LE05456
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.
Resubmission Feedback:
3
Dewmi Sandunika Heenatigala LE05456
Pearson
Higher Nationals in
Computing
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.
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.
4
Dewmi Sandunika Heenatigala LE05456
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.
5
Dewmi Sandunika Heenatigala LE05456
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.
6
Dewmi Sandunika Heenatigala LE05456
Assignment Brief
Student Name /ID Number
Academic Year
Unit Tutor
Issue Date
Submission 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.
LO3 Investigate solutions to problem situations using the application of Boolean algebra
7
Dewmi Sandunika Heenatigala LE05456
Activity 01
Part 1
1. 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 .
2. If n( A−B )=45, n( A∪B )=110 and n( A∩B )=15, then find n(B).
Part 2
1. Write the multisets of prime factors of given numbers.
I. 160
II. 120
III. 250
2. Write the multiplicities of each element of multisets in part 2(1-I,ii,iii) separately.
3. Find the cardinalities of each multiset in part 2-1.
Part 3
1. Determine whether the following functions are invertible or not. If it is invertible, then find the rule of
the inverse ( f ( x ))
−1
i. f : ℜ→ℜ+ ii . f : ℜ+ → ℜ+
1
f ( x )=x 2 f ( x )=
x
iii . f : ℜ+ → ℜ+ iv . f : [ −π π
,
2 2 ]
→ [ −1 ,1 ]
f ( x )=x 2 f ( x )=sin x
v . f : [ 0 , π ] → [ −2 , 2 ]
f ( x )=2 cos x
5
f (x )= (x−32)
2. Function 9 converts Fahrenheit temperatures into Celsius. What is the function for
opposite conversion?
8
Dewmi Sandunika Heenatigala LE05456
Part 4
1. Formulate corresponding proof principles to prove the following properties about defined sets.
A=B ⇔ A ⊆ B and B⊆ A
i.
ii. De Morgan’s Law by mathematical induction
iii. Distributive Laws for three non-empty finite sets A, B, and C
Activity 02
Part 1
1. Discuss using two examples on 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. Find the shortest path spanning tree for the weighted directed graph with vertices A, B, C, D, and E
given using Dijkstra’s algorithm.
Part 3
1. Check whether the following graphs have an Eulerian and/or Hamiltonian circuit.
I.
9
Dewmi Sandunika Heenatigala LE05456
II.
III.
Part 4
1. Construct a proof for the five color theorem for every planar graph.
2. Discuss how efficiently Graph Theory can be used in a route planning project for a vacation trip from
Colombo to Trincomalee by considering most of the practical situations (such as millage of the vehicle,
etc.) as much as you can. Essentially consider the two fold,
- Routes with shortest distance(Quick route travelling by own vehicle)
- Route with the lowest cost
3. Determine the minimum number of separate racks needed to store the chemicals given in the table (1 st
column) by considering their incompatibility using graph coloring technique. Clearly state you steps and
10
Dewmi Sandunika Heenatigala LE05456
graphs used.
Activity 03
Part 1
1. Discuss two real world binary problems in two different fields using applications of Boolean Algebra.
Part 2
1. Develop 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. Ā B̄ C +A B̄ C̄+ ABC + Ā B C̄
ii. ( A + B̄+C )( A +B +C )( Ā +B+ C̄ )
Part 3
2. Find the simplest form of given Boolean expressions using algebraic methods.
i. A ( A+B)+B( B+C)+C(C+A )
ii. ( A + B̄)( B+C )+( A+B )(C + Ā )
iii. ( A +B)( AC+ A C̄ )+AB+B
iv. Ā ( A+B )+(B+ A )( A+ B̄ )
11
Dewmi Sandunika Heenatigala LE05456
Part 4
1. Consider the K-Maps given. For each K- Map
i. Write the appropriate standard form (SOP/POS) of Boolean expression.
ii. Draw the circuit using AND, NOT and OR gates.
iii. Draw the circuit only by using
i. NAND gates if the standard form obtained in part (i) is SOP.
ii. 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/ 00 01 11 10
CD
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
12
Dewmi Sandunika Heenatigala LE05456
13
Dewmi Sandunika Heenatigala LE05456
Activity 04
Part 1
1. Describe the characteristics of different binary operations that are performed on the same set.
2. Justify whether the given operations on relevant sets are binary operations or not.
i. Multiplication and Division on se of Natural numbers
ii. Subtraction and Addition on Set of Natural numbers
y
iii. Exponential operation: ( x , y )→ x on Set of Natural numbers and set of Integers
Part 2
1. Build up 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 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. Check 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 .
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. Discuss the group theory concept behind the Rubik’s cube.
Part 4
1. Prepare a presentation for ten minutes that explains an application of group theory in computer
sciences.
14
Dewmi Sandunika Heenatigala LE05456
Acknowledgement
15
Dewmi Sandunika Heenatigala LE05456
Assignment Feedback
Action Plan
Summative feedback
[email protected]
Assessor k Date
signature
Student Date
signature
16
Dewmi Sandunika Heenatigala LE05456
Contents
Activity 01...........................................................................................................................................18
Part 01.............................................................................................................................................18
1. 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 ................................................18
Part 02.............................................................................................................................................19
2. Write the multiplicities of each element of multisets in part 2(1-I, ii, iii) separately............20
Part 03.............................................................................................................................................21
1. Determine whether the following functions are invertible or not. If it is invertible, then find
5
f (x )= (x−32)
2. Function 9 converts Fahrenheit temperatures into Celsius. What is the
function for opposite conversion?................................................................................................27
Activity 02...........................................................................................................................................27
Part 01.............................................................................................................................................27
1. Discuss using two examples on binary trees both quantitatively and qualitatively..............27
Part 02.............................................................................................................................................29
1. State the Dijkstra’s algorithm for a directed weighted graph with all non-negative edge
weights.........................................................................................................................................29
2. Find the shortest path spanning tree for the weighted directed graph with vertices A, B, C,
D, and E given using Dijkstra’s algorithm...................................................................................30
Part 03.............................................................................................................................................31
Activity 03...........................................................................................................................................33
Part 01.............................................................................................................................................33
17
Dewmi Sandunika Heenatigala LE05456
1. Discuss two real world binary problems in two different fields using applications of
Boolean Algebra..........................................................................................................................33
Part 02.............................................................................................................................................34
1. Develop truth tables and its corresponding Boolean equation for the following scenarios ''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.''....................................................................................................34
Part 03.............................................................................................................................................36
1. Find the simplest form of given Boolean expressions using algebraic methods...................37
Part 04.............................................................................................................................................38
Activity 04...........................................................................................................................................42
Part 01.............................................................................................................................................42
1. Describe the characteristics of different binary operations that are performed on the same set
42
2. Justify whether the given operations on relevant sets are binary operations or not..............43
Part 02.............................................................................................................................................45
1. Build up 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.................................................................45
2...................................................................................................................................................47
Part 03.............................................................................................................................................48
1. Check 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 ...................................................................48
2...................................................................................................................................................49
References...........................................................................................................................................54
List of Figures
Figure 1 Venn Diagram.......................................................................................................................20
Figure 2 f(x) = sin (x)..........................................................................................................................26
18
Dewmi Sandunika Heenatigala LE05456
Figure 3 f (x) = 2cosx..........................................................................................................................28
Figure 4 Quantitative Binary Tree.......................................................................................................30
Figure 5 Qualitative Binary tree...........................................................................................................31
Figure 6 Dijkstra Algorithm.................................................................................................................32
Figure 7 Shortest Path..........................................................................................................................32
Figure 8 Shortest Path..........................................................................................................................33
Figure 9 Part 03 Question....................................................................................................................33
Figure 10 Question 02..........................................................................................................................34
Figure 11 Question 03..........................................................................................................................34
Figure 12 Laws of Boolean Algebra....................................................................................................39
Figure 13 Using AND, NOT & OR Gates...........................................................................................41
Figure 14 Using NAND.......................................................................................................................41
Figure 15 using AND, NOT and OR gates..........................................................................................42
Figure 16 Using NAND.......................................................................................................................42
Figure 17 Using AND, NOT and OR gates..........................................................................................43
Figure 18 Using NAND.......................................................................................................................44
Figure 19 Nested Group Gi..................................................................................................................53
List of Tables
19
Dewmi Sandunika Heenatigala LE05456
Table 19 Final Stage............................................................................................................................56
20
Dewmi Sandunika Heenatigala LE05456
Activity 01
Part 01
1. 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 .
(1)
(2) – (1)
125 - 45 = 𝑛 (𝐴) + 𝑛 (𝐵) – ( (𝐴) – n(A ∩ B) )
80 = (𝐵) + 15
65 = 𝑛 (𝐵)
21
Dewmi Sandunika Heenatigala LE05456
10 + 5 + a + b = 33→ A
a+b = 18→ 1
15 + 5 + a + c = 36→ B
a+c = 16→ 2
13 + 5 + b + c = 28→ C
b+c = 10→ 3
2–3
a + c - ( b + c ) = 16 – 10
a–b =6→4
1+4
a + b + ( a – b ) = 18 + 6
a = 12
By 1
12 + b = 18
b=6
By 2
12 + c = 16
C = 16 – 12
C=4
n(A⋃B⋃C) = 10 + 12 + 5 + 6 + 15 + 4 + 13
= 65
Part 02
160 =2×2×2×2×2×5
= [ 2, 2, 2, 2, 2, 5 ]
120 =2×2×2×3×5
22
Dewmi Sandunika Heenatigala LE05456
= [ 2, 2, 2, 3, 5 ]
250 =2×5×5×5
= [ 2, 5, 5, 5]
2. Write the multiplicities of each element of multisets in part 2(1-I, ii, iii) separately.
160 = [2,2,2,2,2,5]
µ (2) = 5
µ (5) = 1
120 = [2,2,2,3,5]
µ (2) = 3
µ (3) = 1
µ (5) = 1
250 = [2,5,5,5]
µ (2) = 1
µ (5) = 3
Part 03
23
Dewmi Sandunika Heenatigala LE05456
1. Determine whether the following functions are invertible or not. If it is invertible, then find the rule of
the inverse ( f ( x ))
−1
01. 𝑓: ℜ → ℜ+
𝑓(𝑥) = 𝑥2
Step 01
+¿ ¿
𝑥1, 𝑥2 Є | R
+¿ ¿
𝑓 ( x 1) , 𝑓 ( x 2) Є | R
𝑓 ( x 1) = 𝑓 ( x 2)
2 2
𝑓 ( x 1) = 𝑓 ( x 2)
2 2
𝑓 ( x 1) − 𝑓 ( x 2) = 0
( x 1 - x 2)( x 1 - x 2) = 0
( x 1 - x 2) = 0 or ( x 1 - x 2) = 0
x 1 = x 2 or x 1 =(− x 2)
Therefore,
f is not 1-1 and f is not invertible
02. 𝑓 ∶ ℜ+ ℜ+
𝑓(x) = 1⁄𝑥
Step 01
Check weather f is 1-1
+¿ ¿
𝑥1, 𝑥2 Є | R
𝑓 ( x 1) , 𝑓 ( x 2) Є |𝑅+
𝑓 ( x 1) = 𝑓 ( x 2)
1/ x 1 = 1/ x 2
x2 = x1
x2 - x1 = 0
24
Dewmi Sandunika Heenatigala LE05456
So, x 2 = x 1
𝑓 ( x 1) = 𝑓 ( x 2) →𝑥2 = 𝑥1
If 𝑓 ( x 1) = 𝑓 ( x 2) , then x 2 = x 1
So, f(x) is a 1-1 A
Step 02
Check weather f is onto
F(x) = 1⁄𝑥
Y = 1⁄𝑥
1
Y= 1
y
∀ y ∈ ℜ+ (Range), ∃ y1 ∈ ℜ+ (Domain)
Such that f (1/y) = y
f is onto
f is invertible
Step 03
F(x) = 1⁄𝑥
Y = 1⁄𝑥
1⁄𝑦 = 1⁄𝑥 * 1
x = 1⁄𝑦
𝑓−1 (𝑥) = 1⁄𝑥 ∶ 𝑓−1 (𝑥) ∶ ℜ+ → ℜ+
03. 𝑓 ∶ ℜ+ ℜ+
𝑓 (𝑥) = 𝑥2
Step 01
Check weather f is 1-1
𝑥1, 𝑥2 Є |𝑅+
𝑓 ( x 1) , 𝑓 ( x 2) Є |𝑅+
𝑓 ( x 1) = 𝑓 ( x 2)
2 2
x 1) = x 2)
x 21) - x 22) = 0
( x 1) - x 2)) ( x 1) + x 2)) = 0
25
Dewmi Sandunika Heenatigala LE05456
( x 1) - x 2)) = 0 or ( x 1) + x 2)) = 0
x 1) = x 2) Or x 1) = (- x 2))
Since x 2) ∈ ℜ+, (- x 2 )ℜ+
Therefore, (- x 2 ) ∈ codomain
Therefore, 𝑓 is 1- 1
Step 02
Check weather f is onto
f (x) x 2
y x2
∀ y ∈ ℜ+ (Range), ∃ y 1 /2∈ ℜ+ (Domain) such that f ( y 1 /2) y
f is onto
So,
f is invertible
Step 03
(𝑥) = x 2
𝑦 = x2
1 /2 2 1 /2
y = (x )
𝑥 = y 1 /2
𝑓-1 (𝑥) = x 1/ 2∶ 𝑓-1 (𝑥) ∶ ℜ+ → ℜ+
04. 𝑓 ∶ ℜ+ ℜ+
𝑓 (𝑥) = 𝑥2
Step 01
Check weather f is 1-1
𝑥1, 𝑥2 Є |𝑅+
𝑓 ( x 1) , 𝑓 ( x 2) Є |𝑅+
𝑓 ( x 1) = 𝑓 ( x 2)
2 2
x 1) = x 2)
2 2
x 1) - x 2) = 0
( x 1) - x 2)) ( x 1) + x 2)) = 0
26
Dewmi Sandunika Heenatigala LE05456
( x 1) - x 2)) = 0 or ( x 1) + x 2)) = 0
x 1) = x 2) Or x 1) = (- x 2))
Since x 2) ∈ ℜ+, (- x 2 )ℜ+
Therefore, (- x 2 ) ∈ codomain
Therefore, 𝑓 is 1- 1
Step 02
Check weather f is onto
f (x) x 2
y x2
∀ y ∈ ℜ+ (Range), ∃ y 1 /2∈ ℜ+ (Domain) such that f ( y 1 /2) y
f is onto
So,
f is invertible
Step 03
(𝑥) = x 2
𝑦 = x2
1 /2 2 1 /2
y = (x )
𝑥 = y 1 /2
𝑓-1 (𝑥) = x 1/ 2∶ 𝑓-1 (𝑥) ∶ ℜ+ → ℜ+
04.
π π
f:[- , : ]
2 2
f (x) = sin x
27
Dewmi Sandunika Heenatigala LE05456
Figure 2 f(x) = sin (x)
Source: (Author Created)
Step 01
sin x 1 = sin x 2
x1 = x2
𝑖𝑒. f ( x 1) = f ( x 2) → x 1 = x 2
So, 𝑓 𝑖𝑠 1 – 1
Step 02
Step 03
28
Dewmi Sandunika Heenatigala LE05456
(𝑥) = sin 𝑥
𝑦 = sin 𝑥
−1 −1 −1
sin y = x → f (𝑥) = sin x
π π
f
−1
(𝑥) = [-1, 1] → [- , ]
2 2
05.
𝑓: [0, 𝜋] →[-2, 2]
𝑓 (𝑥) = 2 cos 𝑥
Step 01
𝑓 ( x 1) = 𝑓 ( x 2)
2𝑐𝑜𝑠 x 1 = 2 cos x 2
x1 = x2
f ( x 1) = f ( x 2 ) → x 1 = x 2
29
Dewmi Sandunika Heenatigala LE05456
So, f is 1 – 1
Step 02
Step 03
f (x) = 2cos x
y = 2cos x
y
= 𝑐𝑜𝑠 x
2
−1 y
cos ( ) = x
2
−1 x
f
−1
(𝑥) = cos ( )
2
f −1 (𝑥) = [-2, 2] [0, 𝜋]
5
f (x )= (x−32)
2. Function 9 converts Fahrenheit temperatures into Celsius. What is the function for
opposite conversion?
𝐹 (𝑥) = 5 ⁄ 9 (𝑥 − 32)
𝑌 = 5 ⁄ 9 (𝑥 − 32)
9y ⁄ 5 = 𝑥 − 32
30
Dewmi Sandunika Heenatigala LE05456
𝑥 =9 y ⁄ 5 + 32
Inverse function of f
−¿¿
f (𝑦) = (9 y ⁄ 5 ) + 32
Activity 02
Part 01
1. Discuss using two examples on binary trees both quantitatively and qualitatively
A binary tree is a method of placing and locating files (called records or keys) in a database, especially when all the
data is known to be in random access memory (RAM). The algorithm finds data by repeatedly dividing the number of
ultimately accessible records in half until only one remains.
In a tree, records are stored in locations called leaves. This name derives from the fact that records always exist at end
points; there is nothing beyond them. Branch points are called nodes. The order of a tree is the number of branches
(called children) per node. In a binary tree, there are always two children per node, so the order is 2. The number of
leaves in a binary tree is always a power of 2. The number of access operations required to reach the desired record is
called the depth of the tree. (Margaret, 2019)
Quantitative
31
Dewmi Sandunika Heenatigala LE05456
Figure 4 Quantitative Binary Tree
Source: (Author Created)
And this Quantitative Binary Tree is mainly base on the Bank And this mainly divided in to two categories, it means
Male staff and Female staff.. And there are two age categories represent in this employees, and the age categories are
equal or above 30 and less than 30 and also this tree Considering height and weight.
Qualitative
32
Dewmi Sandunika Heenatigala LE05456
Figure 5 Qualitative Binary tree
Source: (Author Created)
The goal of the above qualitative binary tree is to identify the HND and Degree. This sector divided into After A/L
and After O/L. And it’s separated by Pass and Fail.
Part 02
1. State the Dijkstra’s algorithm for a directed weighted graph with all non-negative edge weights.
Dijkstra's algorithm solves the shortest-path problem for any weighted, directed graph with non-negative weights. It
can handle graphs consisting of cycles, but negative weights will cause this algorithm to produce incorrect results.
Consequently, we assume that w(e) ≥ 0 for all e ∈ E here.
The pseudocode in Algorithm 4.12 shows Dijkstra's algorithm. The algorithm maintains a priority queue minQ that is
used to store the unprocessed vertices with their shortest-path estimates est(v) as key values. (sciencedirect.com,
2018)
33
Dewmi Sandunika Heenatigala LE05456
Figure 6 Dijkstra Algorithm
Source: (https://d2vlcm61l7u1fs.cloudfront.net/media%2F769%2F7690acb6-5bf6-447f-9e7c-
dd36733df974%2FphpmoKJr3.png, 2019)
2. Find the shortest path spanning tree for the weighted directed graph with vertices A, B, C, D, and E
given using Dijkstra’s algorithm.
A B C D
E 5 (E,A) α α 3 (E,D)
D 5 (E,A) 7 (E,D,B) 9 (E,D,C) -
A - 7 (E,D,B) 9 (E,D,C) -
34
Dewmi Sandunika Heenatigala LE05456
B - - 9 (E,D,C) -
Table 1 Path Diagram
Source: (Author Created)
Part 03
35
Dewmi Sandunika Heenatigala LE05456
Figure 10 Question 02
Source: (Assignment)
Figure 11 Question 03
Source: (Assignment)
36
Dewmi Sandunika Heenatigala LE05456
Activity 03
Part 01
1. Discuss two real world binary problems in two different fields using applications of Boolean Algebra
Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses only the binary numbers i.e. 0 and
1. It is also called as Binary Algebra or logical Algebra. Boolean algebra was invented by George Boole in 1854.
Consider a tin drink vending machine to dispense Coca cola and Pepsi. each choice and so that a customer can have at
most one of the 2 choices
Solution
Step 01
Specify the input and output variables and the two states of each.
Input C = Coca cola button (1 = pressed, 0 = not pressed)
P = Pepsi button (1 = pressed, 0 = not pressed)
Output D = choice verifier (1 = acceptable input – deliver the choice selected; 0 = unacceptable
input– Displays a message “Select Coca cola or Pepsi”)
Step 02
Construct the truth table
C P D
1 1 0
1 0 1
0 1 1
0 0 0
Table 2 Truth Table
Source: (Author Created)
37
Dewmi Sandunika Heenatigala LE05456
Considering a Television in home. The remote controller of TV has button user can choose one of them. (On and Off)
Step 01
Specify the input and output variables and the two states of each.
Input O = Switch ON button (1 = pushed, 0 = not pushed)
Input S = Switch OFF button (1 = pushed, 0 = not pushed)
Output R = choice verifier (1 = acceptable input– Either ON/OFF; 0 = unacceptable input–
Blink Sensor light)
Step 02
Construct the truth table
O S R
1 1 0
1 0 1
0 1 1
0 0 0
Table 3 Truth Table
Source: (Author Created)
The output is OS’ + O’S
Part 02
1. Develop truth tables and its corresponding Boolean equation for the following scenarios ''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.''
38
Dewmi Sandunika Heenatigala LE05456
A B C B ABC = X
1 1 1 0 0
1 1 0 0 0
1 0 1 1 1
1 0 0 1 0
0 1 1 0 0
0 1 0 0 0
0 0 1 1 0
0 0 0 1 0
Table 4 Boolean Truth Table
Source: (Author Created)
''If it rains and you don't open your umbrella then you will get wet''
A: If it Rains
B: Open your Umbrella
X: You get wet
AB =X
A B B A B= X
1 1 0 0
1 0 1 1
0 1 1 0
0 0 0 0
Table 5 Boolean Truth Table
Source: (Author Created)
Ā B̄ C +A B̄ C̄+ ABC+ Ā B C̄
39
Dewmi Sandunika Heenatigala LE05456
A B C A B C AB A ABC AB A BC + A B C + ABC + A B
C BC C C
0 0 0 1 1 1 0 0 0 0 0
0 0 1 1 1 0 1 0 0 0 1
0 1 0 1 0 1 0 0 0 1 1
0 1 1 1 0 0 0 0 0 0 0
1 0 0 0 1 1 0 1 1 0 1
1 0 1 0 1 0 0 0 0 0 0
1 1 0 0 0 1 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0 1
Table 6 truth table for given Boolean expressions
Source: (Author Created)
( A + B̄+C )( A +B +C )( Ā +B+ C̄ )
Part 03
40
Dewmi Sandunika Heenatigala LE05456
Figure 12 Laws of Boolean Algebra
Source: (http://4.bp.blogspot.com/-uKI0W87tFDA/Up20mDeQjSI/AAAAAAAAABw/TXf5hEE9-fg/s1600/
boolean+law.gif,2019)
1. Find the simplest form of given Boolean expressions using algebraic methods.
A ( A+B)+B( B+C)+C(C+A )
= AA + AB + BB + BC + CC + CA (Rule 03)
= (A+AB) + (B+BC) + (C+CA) (Rule 11)
= A + B + C (Rule 14)
= AB + AC + BB + BC + AC + A A + BC + B A (Rule 03)
= AB + AC + 0 + BC + AC + 0 + BC + B A (Rule 12)
= (AB + B A ) + (AC + AC) + ( BC + BC) (Rule 1,5)
= B (A + A ) + AC + (B + B) (Rule 03)
= B + (AC + C) (Rule 08)
= B + C (Rule 14)
= (𝐴 + 𝐵) (𝐴 (𝐶 + C )) + 𝐵 (Rule 09)
= (𝐴 + 𝐵) 𝐴 + 𝐵 (Rule 03)
= 𝐴𝐴 + 𝐵𝐴 + 𝐵 (Rule 11)
41
Dewmi Sandunika Heenatigala LE05456
= 𝐴 + 𝐵 (Rule 15)
Ā ( A+B )+(B+ A )( A+ B̄ )
Part 04
a)
AB/C 0 1
00 0 0
01 0 1
11 0 1
10 1 0
42
Dewmi Sandunika Heenatigala LE05456
Draw the circuit using AND, NOT and OR gates.
b)
AB/ 00 01 11 10
CD
00 1 0 0 1
43
Dewmi Sandunika Heenatigala LE05456
01 0 1 0 1
11 1 1 1 0
10 1 1 1 1
X= (A + B + C + D) (A + B + D ) (A + C + D ) ( A + B + C + D)
44
Dewmi Sandunika Heenatigala LE05456
Figure 16 Using NAND
Source: (Author Created)
c)
AB/C 0 1
00 1 0
01 1 1
11 1 0
10 0 1
45
Dewmi Sandunika Heenatigala LE05456
Figure 17 Using AND, NOT and OR gates
Source: (Author Created)
Activity 04
46
Dewmi Sandunika Heenatigala LE05456
Part 01
1. Describe the characteristics of different binary operations that are performed on the same set
Bi =2
Operands : a , b
Operations: + , - , × , ÷
Association Properties
Consider a non-empty set A and a binary operation * on A. Then the operation * on A is associative, if for every a, b,
c, ∈ A, we have (a * b) * c = a* (b*c)
(a + b) + c = a + (b + c)
(a - b) – c ≠ a - (b - c)
(a × b) × c = a × (b × c)
(a ÷ b) ÷ c ≠ a ÷ (b ÷ c)
Commutative Properties
Consider a non-empty set A and a binary operation * on A. Then the operation * on A is associative, if for every a, b,
∈ A, we have a * b = b * a.
a + 0 = 0 + a = a → 0 –Additive identity
a × 1 = 1 × a = a → 1 – Multiplicative identity
47
Dewmi Sandunika Heenatigala LE05456
Consider a non-empty set A, and a binary operation * on A. Then the operation is the inverse property, if for each a
∈A, there exists an element b in A such that a * b (right inverse) = b * a (left inverse) = e, where b is called an inverse
of a.
Distributive Property
Consider a non-empty set A, and a binary operation * on A. Then the operation * distributes over ∘, if for every a, b, c
∈A, we have
a * (b + c) = (a * b) + (a * c) [left distributive]
(b + c) * a = (b * a) + (c * a) [right distributive]
2. Justify whether the given operations on relevant sets are binary operations or not.
Multiplication
Closure :
𝑝×𝑞∈ℕ
Associative :
(𝑝 × 𝑞) × 𝑟 = 𝑝 × (𝑞 × 𝑟)
Identity :
𝑝×𝑠=𝑠×𝑝=𝑠=1
Inverse :
𝑝 × p−1 ≠ ℕ
Division
48
Dewmi Sandunika Heenatigala LE05456
1÷2= ½ ∈ 𝑙𝑁
Conclusion: Division is not a binary operation on Natural Numbers
Subtraction
Closure :
𝑝 − 𝑞 ≠ ℕ, let 𝑝 = 2 𝑎𝑛𝑑 𝑞 = 3
Addition
Closure :
𝑝+𝑞∈ℕ
Associative :
(𝑝 + 𝑞) + 𝑟 = 𝑝 + (𝑞 + 𝑟) ∈ ℕ
Identity :
𝑝+𝑠=𝑠+𝑝=𝑝
𝑠 = 0; 𝑝 + 0 = 0 + 𝑝 = 𝑝
0∉ℕ
y
Exponential operation: ( x , y )→ x on Set of Natural numbers and set of Integers
Natural Numbers
Closure :
y
x ∈𝑁
Associative :
xy ≠ yx
49
Dewmi Sandunika Heenatigala LE05456
e.g.
5 2
2 ≠5
Set of integers
Closure
xy ∉ ℤ
e.g. :
−1
6 is not an element of integers
Part 02
1. Build up 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.
Order 1 – e
* e
e e
Table 8 Order 1 – e
Source: (Author created)
Order 2 – a,e
* a e
50
Dewmi Sandunika Heenatigala LE05456
a a e
e e a
Order 3 – a,b,e
* a b e
a a b e
b b e a
c e a b
Order 4 – a,b,c,e
* a b c e
a a b c e
b b e a c
c c a e b
e e c b a
2.
Let ‘S’ be a sub group of a finite group ‘G’, then the order ‘S’ divides the order of ‘G’
51
Dewmi Sandunika Heenatigala LE05456
Lagrange's Theorem simply states that the number of elements in any subgroup of a finite group must divide evenly
into the number of elements in the group. Note that the {A, B} subgroup of the Atayun-HOOT! group has 2 elements
while the Atayun-HOOT! group has 4 members. Also we can recall that the subgroups of S3, the permutation group
on 3 objects, that we found cosets of in the previous chapter had either 2 or 3 elements -- 2 and 3 divide evenly into 6.
(Arfur, 1999)
Proof - Suppose H has r elements and there are S right cosets as H a , H a ,, H a , ….. H a ,
1 2 3 s
Theorem- Let H be a sub-group of a finite group G, then the right cosets Ha form a partition of G.
Statement- Any coset H a have the same number of elements From the above theorem and statement each coset that
partition G has r elements. So, G has r s elements so, the order of H divides the order of G.
Right coset- Consider a countable subgroup H with elements H a and an element x not in H, then H ax for a=1, 2, 3…
Constitute the eight coset of the subgroup H with respect to x.
Discuss whether a group H with order 6 can be a subgroup of a group with order 13 or not. Clearly state
the reasons.
Lagrange’s theorem is the group possibly will be able to divide by a subgroup, but 13 cannot be divided by 6.
Therefore, according to the Lagrange’s Theorem of group theory, a H group with order 6 cannot be a subgroup of a
group with order 13.
Part 03
1. Check 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 .
𝑆 = ℝ\{−1}
𝑎 ∗ 𝑏 = 𝑎 + 𝑏 + 𝑎𝑏 ; 𝑎, 𝑏 ∈ 𝑆
Closure
Let a, b ∈ G.
52
Dewmi Sandunika Heenatigala LE05456
a ∗ b = b · a, and b · a ∈ G because (G, ·) is a group and therefore satisfies closure.
Associative
Let a, b and c ∈ G. Then,
(a ∗ b) ∗ c = a ∗ (b * c), let (a ∗ b) = x
=(a * b) + c + (a * b)c
= a + b + ab + c + (a + b + ab)c
= a + b + ab + c + ac + bc + abc
a ∗ (b ∗ c) = a + y + ay ; let (b ∗ c) = y
= a + (b * c) + a + (b * c)
= a + (b + c + bc) + a (b + c + bc)
= a + b + c +bc + ab + ac + abc
LHS = RHS
Identity
Let e be the identity for (S, ·). Then for a ∈ S, a ∗ e = e · a = a
When e=0;
a * 0 = a + 0 +a * 0
=a
e is also an identity for (S, ∗).
Inverse
a * a−1= e → a−1* a = e
−1
a = -a/(1+a)
a * a−1= 0
a + a−1+ a.a-1 = 0
a + a−1 (1 + a) = 0
−1
a (1 + a) = -a
−1
a = -a/(1+a)
Considering,
−1
a (1+a) = -a
53
Dewmi Sandunika Heenatigala LE05456
2.
State the relation between the order of a group and the number of binary operations that can be defined
on that set.
𝑛 ∧ (𝑛 ∧ 2) ⟶ Total number of operation on a set consulting ‘n’ elements (order is n), is given by
2
𝑛 ∧ (𝑛 ∧ 2). n(n ) (n raised to the n square).
2 2
n
(n )
= 3(3 ) = 3(9) = (No. of binary operation)
n ; order = 4
Binary operations = 4 4 ²= 4 16
Thistlethwaite's algorithm was invented in 1981 by Morwen Thistletwaite, a British professor of mathematics. This
algorithm is based on a mathematical theory, called group theory and on extensive computer searches, which studies
the algebraic structures known as groups. The concept of a group is central to algebra theory and is a powerful formal
method for analyzing abstract and physical systems, and has a high importance in solving the Rubik's cube related to
mathematics problems. (Heit, 2015)
Thistlethwaite's algorithms divides the problem Divides to four sub problems by using the following four nested
groups Gi:
54
Dewmi Sandunika Heenatigala LE05456
The functional principle of this algorithm is to start with a cube in Gi, and then move some target cubies to their
expected positions by using only moves from nested groups Gi. And repeat this until the Rubik's cube is entirely
solved, meaning that it arrives in G4.
G0 = <L, R, B, U, D>
G1 = < L, R, F, B, U2, D2>
G2 = < L, R, F2, B2, U2, D2>
G3 = < L2, R2, F2, B2, U2, D2, G4= <l>
Thislewaits algorithm is based on a table that shows a transition sequence for each element in the current coset space
Gi+1 Gi to the next one I = I+1.
Dentition "Given a Group G and a subgroup H < G , a coset of H is the set of Hg = hg : h ∈ H ; thus, H < G partitions
G into cosets. The set of all cosets is written h>G. (Nail El-Sourani, 2015)
In general, the Thistlethwaite's algorithms divides the problem into four independent sub problems by using the
following four nested groups Gi: The functional principle of this algorithm is to start with a cube in Gi, and then move
some target cubies to their expected positions by using only moves from nested groups Gi. And repeat this until the
Rubik's cube is entirely solved, meaning that it arrives in G4. In general, every stage of the
Thislewaits algorithm is based on a table that shows a transition sequence for each element in the current coset space
Gi+1 Gi to the next one I = I+1.
Dentition "Given a Group G and a subgroup H < G , a coset of H is the set of Hg = hg : h ∈ H ; thus, H < G partitions
G into cosets. The set of all cosets is written h>G.
The coset spaces describe the reduced form of the cube, which exact results in the following; the total number of
reachable states is reduced by using moves from some subgroups. In other words, this means that the number of
permitted moves decreases each time the program moves to a new group/stage. Further explanation is described down
55
Dewmi Sandunika Heenatigala LE05456
below where exact orders for each group are calculated. (Nail El-Sourani, Sascha Hauke, and Markus Borschbach,
2015)
Group Positions
G0 4:33 * 1019
In the first stage, all the edge-orientations are fixed. By above Definition, an edge is correctly oriented if the piece can
be brought back to its original position without making use of U and D turns. The edges in the Up or Down-face will
flip the edge orientation on every Up and Down turns.
This results that quarter turns of both F and B are now prohibited. The process of transferring the cube from G1 to G2
can be divided in two parts. The rst part is to put the middle edges in the middle layer. Second, the corners are
correctly oriented.
56
Dewmi Sandunika Heenatigala LE05456
In the second coset space G2∠G1, all the edges arc fixed. The 90 degrees turns of UP and Down faces are prohibited
in this stage. The second stage has a factor that corresponds to the fact that all the corners are correctly oriented and
puts the middle edges in the middle layer.
In the nal stage, the cube can be solved by using only double moves. This makes sure that the edges and the corners
stays in their slices. In this stage, the remaining edges and corners will be restored to the correct position, until the
cube is entirely solved.
Final Stage
The final stage G4 represents the solved state. This means that there are possible states in group G3 that needs to be
xed, until it can transfer to the solved state. In other words, this means that the permutations of each edge slice and
edge corner are solved in this stage.
57
Dewmi Sandunika Heenatigala LE05456
Group Positions
G4 1
Finally, the Thitslewaites algorithm is relatively easy to implement. This algorithm has been used worldwide,
especially in Tomas Rokicki's cube programming contest. The main task of this contest is to write a short program that
solves the Rubik's cube. By using the Thitslewaites algorithm combined
with computer searches, the program can quickly give very short solutions. However, these solutions might not be
optimal and may require more moves than other efficient algorithms, such as the kociemba's algorithm. (Joren Heit,
2011)
References
Arfur, D., 1999. dogschool.tripod. [Online]
Available at: http://dogschool.tripod.com/lagrange.html
[Accessed 15 August 2020].
58
Dewmi Sandunika Heenatigala LE05456
Heit, J., 2015. mike.verdone. [Online]
Available at: https://mike.verdone.ca/media/rubiks.pdf
[Accessed 22 August 2020].
Joren Heit, 2011. Building and Solving Rubik's cube in Mathworks. [Online]
Available at: http://joren.ralphdesign.nl/
[Accessed 25 August 2020].
Margaret, R., 2019. techtarget. [Online]
Available at: https://searchsqlserver.techtarget.com/definition/binary-tree#:~:text=A%20binary%20tree%20is
%20a,random%20access%20memory%20(RAM).&text=This%20name%20derives%20from%20the,Branch
%20points%20are%20called%20nodes.
[Accessed 01 August 2020].
Morwen B. Thistlethwaite,, 2015. Thistlethwaite's 52-move algorithm.. [Online]
Available at: http://www.jaapsch.net/puzzles/thistle.htm
[Accessed 25 August 2020].
Nail El-Sourani, Sascha Hauke, and Markus Borschbach, 2015. genetic-programming. [Online]
Available at: http://www.genetic-programming.org/hc2010/7
[Accessed 23 August 2020].
Nail El-Sourani, S. H. a. M. B., 2015. genetic-programming. [Online]
Available at: http://www.genetic-programming.org/hc2010/7
[Accessed 20 August 2020].
sciencedirect.com, 2018. sciencedirect.com. [Online]
Available at: https://www.sciencedirect.com/topics/computer-science/dijkstra-algorithms
[Accessed 02 August 2020].
59
Dewmi Sandunika Heenatigala LE05456
Activity Parts Time Frame
July August September
W W W W W W W W W W W W
1 2 3 4 1 2 3 4 1 2 3 4
1 01
02
03
2 01
02
03
3 01
02
03
04
4 01
02
03
60
Dewmi Sandunika Heenatigala LE05456
Grading Rubric
Grading Criteria Achieved Feedback
61
Dewmi Sandunika Heenatigala LE05456
P5 Diagram a binary problem in the application of Boolean Algebra.
62
Dewmi Sandunika Heenatigala LE05456