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

ASM1 DM NguyenTuTrinh BS00411

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views20 pages

ASM1 DM NguyenTuTrinh BS00411

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

ASSIGNMENT 1 FRONT SHEET

Qualification Pearson BTEC Level 5 Higher National Diploma in Computing

Unit number and title Unit 18: Discrete Maths

Submission date 06/07/2024 Date Received 1st submission 06/07/2024

Re-submission Date Date Received 2nd submission

Student Name Nguyen Tu Trinh Student ID BS00411

Class SE06201 Assessor name On Nhat Minh

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand
that making a false declaration is a form of malpractice.

Student’s signature Trinh

Grading grid

P1 P2 P3 P4 M1 M2 D1 D2
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:


Internal Verifier’s Comments:

Signature & Date:


Table of Contents
INTRODUCTION .......................................................................................................................................................................3
I. Perform algebraic set operations in a formulated mathematical problem (P1) ...............................4
II. Determine the cardinality of a given bag (multiset) (P2) ..................................................................6
III. Model contextualised problems using trees, both quantitatively and qualitatively
(P3) 8
IV. Use Dijkstra’s algorithm to find a shortest path spanning tree in graph (P4) ............................ 11
IV. Determine the inverse of a function using appropriate mathematical techniques (M1)
13
V. Assess whether a Eulerian and Hamiltonian circuit exists in an undirected graph (M2).
16
VI. Formulate corresponding proof principles to prove properties about defined sets
(D1). 17
VII. Construct a proof of the Five Color Theorem (D2) . ....................................................................... 18
CONCLUSION .......................................................................................................................................................................... 19
REFERENCES.......................................................................................................................................................................... 20

List of Figure:

Figure 1. Binary Trees ........................................................................................................................................................ 10


Figure 2. Complete Binary Tree ...................................................................................................................................... 11
Figure 3 : Dijkstra’s algorithm ......................................................................................................................................... 13
Figure 4 : Eulerian and Hamiltonian ............................................................................................................................ 16

List of table

Table 1 : Table 1 MEMBERSHIP TABLE ...................................................................................................................... 13


Table 2 : SHORTEST LENGTH .......................................................................................................................................... 18

INTRODUCTION
In mathematics and computer science, graph theory plays a crucial role in modeling and analyzing
real-world problems. From network routing algorithms to social network analysis, graphs are
powerful tools for abstracting and solving complex systems. In this assignment, we explore a variety
of graph-theoretic concepts and algorithms. We cover fundamental properties like cardinality,
prime factorization, and function invertibility, as well as advanced topics such as Hamiltonian paths,
Dijkstra's Algorithm, and the Five Color Theorem. This exploration aims to sharpen our problem-
solving skills, deepen our understanding of graph theory, and appreciate the elegant solutions that
underpin the intricate web of interconnected systems around us.

I. Perform algebraic set operations in a formulated mathematical problem (P1)


Activity 1

Part I. My Student ID is BS00411 so a = 1, b = 4.

1. Let 𝑨 and 𝑩 be two non-empty finite sets. Assume that cardinalities of the sets 𝑨, 𝑩 and
𝑨 ∩ 𝑩 are 𝟗𝒃, 𝟐𝒂 and 𝒂 + 𝒃, respectively. Determine the cardinality of the set 𝑨 ∪ 𝑩.

To find the cardinality of the set 𝐴∪𝐵, we can use the principle of inclusion-exclusion. The principle
states that for any two sets 𝐴 and 𝐵,

|𝐴 ∪ 𝐵| = |𝐴| + |𝐵| − |𝐴 ∩ 𝐵|

Given the problem:

̅̅̅
The cardinality of 𝛢 is 9𝑏

The cardinality of 𝐵 is ̅2𝑎


̅̅̅

The cardinality of 𝐴 ∪ 𝐵 is 𝑎+𝑏

Substitute the given values 𝑎 = 1 and 𝑏 = 4 into the expressions for the cardinalities of the sets:

Cardinality of 𝐴: 𝛢 =̅̅̅̅
9𝑏 = 9b

̅̅̅̅ = 2𝑎
Cardinality of 𝐵: 𝐵 = 2𝑎

Cardinality of 𝐴∩𝐵: 𝐴 ∩ 𝐵 = 𝑎 + 𝑏

First, calculate the values:

|𝐴| = 9𝑏 = 9.4 = 3𝑏

|𝐵| = ̅̅
2𝑎̅̅ = 2.1 = 2

|𝐴 ∩ 𝐵| = 𝑎 + 𝑏 = 1 + 4 = 5

Now, apply the inclusion-exclusion principle to find |𝐴 ∪ 𝐵|:

|𝐴 ∪ 𝐵| = |𝐴| + |𝐵| − |𝐴 ∩ 𝐵|
Substitute thecalculated values:

|𝐴 ∪ 𝐵| = 36 + 2 − 5 = 33

Thus, the cardinality of the set 𝐴∪𝐵 is 33.

2. Suppose |𝑨 − 𝑩| = 𝟑𝒂, |𝑨 ∪ 𝑩| = 𝟏𝟏𝒃 and |𝑨 ∩ 𝑩| = 𝟏𝒂. Determine |𝑩|.

To determine the cardinality of the set ∣𝐵∣, we are given the following information:

|𝐴 − 𝐵| = ̅̅
3𝑎̅̅

̅̅̅̅̅
|𝐴𝑈𝐵| = 11𝑏

̅̅̅̅
|𝐴 ∩ 𝐵| = 1𝑎

We need to find ∣𝐵∣.

Given Values

Let's use the values 𝑎 = 1 and 𝑏 = 4 to simplify:

|𝐴 − 𝐵| = 3𝑎 = 3 × 1 = 3

|𝐴 ∪ 𝐵| = 11𝑏 = 11 × 4 = 44

|𝐴 ∩ 𝐵| = 1𝑎 = 1 × 1 = 1

Relationships Between Sets

From the given information, we can use the following set relationships:

• Cardinality of 𝐴:

𝐴 − 𝐵 represents the elements in 𝐴 but not in 𝐵 ,i.e., |𝐴 − 𝐵| = |𝐴| − |𝐴 ∩ 𝐵|.

Given |𝐴 − 𝐵| = 3 and |𝐴 ∩ 𝐵| = 1:

|𝐴| = |𝐴 − 𝐵| + |𝐴 ∩ 𝐵| = 3 + 1 = 4

• Inclusion-Exclusion Principle:

We know |𝐴 ∪ 𝐵| = |𝐴| + |𝐵| − |𝐴 ∩ 𝐵|.

Rearranging to solve for ∣𝐵∣:

|𝐵| = |𝐴 ∪ 𝐵| − |𝐴| + |𝐴 ∩ 𝐵|

Substitute the given values:


|𝐵| = 44 − 4 + 1 = 41

The cardinality of the set |𝐵| is 44.

3. At a local market, there are 𝟑𝟓𝒃 customers. Suppose 𝟏𝟏𝒂 have purchased fruits, 𝟗𝒃 have
purchased vegetables, 𝟖𝒂 have purchased bakery items, 𝟒𝒃 have purchased both fruits
and vegetables, 𝟑𝒃 have purchased both vegetables and bakery items, 𝟐𝒂 have
purchased both fruits and bakery items, and 𝟏𝒂 have purchased all three categories.
How many customers have not purchased anything?

Let's break down the problem and calculate step by step:


Substitute values for 𝑎 and 𝑎:
𝑎 = 1, 𝑏 = 4
Therefore, the numbers are:
35𝑏 = 35.4 = 140 (Total customers)
11𝑎 = 11.1 = 11 (Customers who purchased fruits)
̅̅̅
9𝑏 = 9.4 = 36(Customers who purchased vegetables)
8𝑎 = 8.1 = 8 (Customers who purchased bakery items)
3𝑏 = 3.4 = 12 (Customers who purchased both vegetables and bakery items)
2𝑎 = 2.1 = 2 (Customers who purchased both fruits and bakery items)
1𝑎 = 1.1 = 1 (Customers who purchased all three categories)
Apply the principle of inclusion-exclusion:
̅̅̅̅̅ + ̅̅̅
Total who purchased at least one item = 11𝑎 ̅̅̅̅ − ̅̅̅
9𝑏 + 8𝑎 4𝑏 − ̅̅̅ ̅̅̅̅ + 1𝑎
3𝑏 − 2𝑎 ̅̅̅̅
Substituting the values:
= 11 + 36 + 8 – 16 − 12 – 2 + 1
= 55 – 30 + 1
= 26
Calculate the number of customers who have not purchased anything:
̅̅̅̅̅ −Total who purchased at least one item
Customers who have not purchased anything = 35𝑏
= 140−26
= 114
Therefore, the number of customers who have not purchased anything is 114.
II. Determine the cardinality of a given bag (multiset) (P2)
Activity 1
Part II.
1. List the bag of prime factors for each of the provided numbers.
a) 𝟏𝒂𝟐
To list the bag of prime factors for each number, we'll first calculate each number by substituting the
given values for 𝑎 and 𝑏:
𝑎=1
𝑏=4
Let's compute and then factorize each number:
̅̅̅̅̅̅:
Calculate the number 𝟏𝒂𝟐
Substituting 𝑎 = 1:
̅̅̅̅̅ = 1 × 100 + 1 + 10 + 2 = 112
1𝑎2
Prime factorization of 112:
112 = 24 × 7
So, the bag of prime factors for 112 is:
{2,2,2,2,7}
b) 2𝑏0
Calculate the number ̅̅̅̅̅̅
𝟐𝒃𝟎
Substituting 𝑏 = 4:
̅̅̅̅̅ = 2 × 100 + 4 × 10 × 10 + 0 = 240
2𝑏0
Prime factorization of 240:
240 = 24 × 3 × 5
So, the bag of prime factors for 240 is:
{2,2,2,2,3,5}
Therefore, the bags of prime factors for the provided numbers are:
̅̅̅̅̅ = 112: {2,2,2,2,7}
1𝑎2
̅̅̅̅̅
2𝑏0 = 240: {2,2,2,2,3,5}
2. Find the cardinalities of
a. Each of the aforementioned bags.
Bag of prime factors for ̅̅̅̅̅̅
𝟏𝒂𝟐 = 𝟏𝟏𝟐:
The bag of prime factors is: {2,2,2,2,7}
Cardinality: Count the total number of elements.
5 (four 2’s and one 7)
Bag of prime factors for ̅̅̅̅̅̅
𝟐𝒃𝟎 = 𝟐𝟒𝟎:
The bag of prime factors is:
{2,2,2,2,3,5}
Cardinality: Count the total number of elements.
6 (four 2’s, one 3, and one 5)
b. The intersection of the aforementioned bags.
To find the intersection, list the common prime factors considering their multiplicities in both bags:

Common prime factors are {2,2,2,2} (i.e., four 2's).


The intersection bag:
{2,2,2,2}
Cardinality of the intersection:
4 (four 2’s)
c. The union of the aforementioned bags.
To find the union, combine all prime factors, taking the maximum multiplicity of each prime factor
from both bags:
Prime factors in ̅̅̅̅̅
1𝑎2: {2,2,2,2,7}
Prime factors in ̅̅̅̅̅
2𝑏0: {2,2,2,2,3,5}
Union bag:
{2,2,2,2,3,5,7}
Cardinality of the union:

7(four 2’s, one 3, one 5, and one 7)


d. The difference of the aforementioned bags.
1𝑎2 minus ̅̅̅̅̅
The difference of the bags ̅̅̅̅̅ 2𝑏0 includes prime factors in the first bag that are not in the
second bag.
Prime factors unique to ̅̅̅̅̅
1𝑎2: {7}
Prime factors unique to ̅̅̅̅̅
2𝑏0: {3, 5}
̅̅̅̅̅ − ̅̅̅̅̅
Difference bag (1𝑎2 2𝑏0): {7}
Cardinality of the difference: 1 (one 7)
̅̅̅̅̅ − 1𝑎2
Difference bag bag (2𝑏0 ̅̅̅̅̅): {3,5}
Cardinality of the difference: 2 (one 3 and one 5)
III. Model contextualised problems using trees, both quantitatively and qualitatively
(P3)
Activity 2
1. Discuss two notable instances of binary trees, providing both quantitative and qualitative
analyses.
a. What is a Binary Tree?
A binary tree is a data structure in which each node has at most two children, referred to as the left
and right child. It is a special kind of tree in computer science and is used for various applications
such as sorting, searching, and hierarchical data representation. The hierarchical structure of binary
trees allows for efficient data management and retrieval [1].
Basic Properties
+ Root: The topmost node of the tree.
+ Leaves: Nodes with no children.
+ Internal Nodes: Nodes with at least one child.
+ Height: The length of the longest path from the root to a leaf.
+ Depth: The length of the path from the root to the node.
+ Level: All nodes at the same depth.
Operations
Common operations on binary trees include insertion, deletion, traversal (in-order, pre-order, post-
order), and searching.
Common Types of Binary Trees
+ Full Binary Tree: Every node has either 0 or 2 children. No node has only one child.
+ Complete Binary Tree: All levels are fully filled except possibly the last one, which is filled
from left to right.
+ Perfect Binary Tree: All internal nodes have two children and all leaves are at the same
level.
+ Balanced Binary Tree: The height difference between the left and right subtrees for any
node is at most 1.
+ Degenerate (or Pathological) Tree: Each parent node has only one child. It behaves like a
linked list.
+ Binary Search Tree (BST): For each node, all elements in the left subtree are less than the
node, and all elements in the right subtree are greater.
b. Provides some common types of binary trees such as complete binary trees, complete
binary trees, balanced binary trees,…
Two Notable Instances of Binary Trees
Binary Search Tree (BST)
− Quantitative Analysis [2]
Time Complexity:
+ Insertion: O(log n) in average case, O(n) in worst case (unbalanced tree).
+ Deletion: O(log n) in average case, O(n) in worst case.
+ Search: O(log n) in average case, O(n) in worst case.
+ Space Complexity: O(n) for storing n nodes.
− Qualitative Analysis
Binary Search Trees are widely used due to their efficiency in search operations, making them
suitable for applications like database indexing and memory retrieval systems. The average time
complexity for operations is logarithmic, making BSTs efficient for dynamic data sets that require
frequent insertions and deletions. However, if the tree becomes unbalanced, the performance
degrades to linear time, which can be mitigated by using self-balancing variants like AVL trees or Red-
Black trees.

Figure 1. Binary Trees


Complete Binary Tree
− Quantitative Analysis [3]
Time Complexity:
+ Insertion: O(log n)
+ Deletion: O(log n)
+ Search: O(log n)
+ Space Complexity: O(n) for storing n nodes.
− Qualitative Analysis
Complete Binary Trees are optimized for scenarios where data needs to be stored in a compact
structure with minimal height. This is particularly useful in heap-based algorithms, such as priority
queues, where both the complete and balanced properties ensure efficient element access and
manipulation. Because of their structure, complete binary trees are often implemented using arrays,
which simplifies node access and traversal.

Figure 2. Complete Binary Tree

IV. Use Dijkstra’s algorithm to find a shortest path spanning tree in graph (P4)
Part II.

1. State Dijkstra’s Algorithm in an undirected graph.

Dijkstra's algorithm is a well-known algorithm for finding the shortest path between nodes in a graph,
which can represent, for example, road networks. It was conceived by computer scientist Edsger W.
Dijkstra in 1956 and published in 1959.

Here’s how Dijkstra’s Algorithm works for an undirected graph:

Dijkstra's Algorithm for an Undirected Graph

Initialization:

+ Start with a graph 𝐺 = (𝑉, 𝐸), where 𝑉 is a set of vertices (or nodes) and 𝐸 is a set of edges,
each with an associated non-negative weight.
+ Choose a source vertex 𝑠 from which to calculate the shortest paths to all other vertices.
+ Set the distance to the source 𝑠 as 0: 𝑑(𝑠) = 0.
+ Set the distance to all other vertices as infinity: 𝑑 (𝑣) = ∞ for all 𝑣≠𝑠.
+ Initialize an empty set 𝑆 to keep track of vertices with known shortest paths.
+ Create a priority queue (min-heap) and insert the source vertex with a distance of 0.

Algorithm Execution:
While the priority queue is not empty, do the following:

Extract the vertex 𝑢 from the priority queue with the minimum distance:

+ This ensures that we are processing the vertex with the current known shortest distance.

Add 𝑢 to the set 𝑆:

+ This marks vertex 𝑢 as processed.

For each neighbor 𝑣 of 𝑢:

+ Consider the edge (𝑢, 𝑣) with weight 𝑤 (𝑢, 𝑣).


+ If 𝑣 is not in 𝑆 and the distance to 𝑣 through 𝑢 is shorter than the previously known distance
to 𝑣, update 𝑑 (𝑣):
+ 𝑑(𝑣)= 𝑑 (𝑢)+𝑤 (𝑢, 𝑣).
+ Update the priority queue to reflect this new distance for 𝑣.

Termination:

+ The algorithm terminates once the priority queue is empty. At this point, 𝑑 (𝑣) contains the
shortest distance from the source vertex 𝑠 to every other vertex 𝑣 in the graph.

Important Considerations:

+ Non-Negative Weights: Dijkstra's algorithm only works correctly with graphs that have
non-negative edge weights. If the graph has negative weights, algorithms like the Bellman-
Ford algorithm are required.
+ Graph Representation: The graph can be represented using adjacency lists or adjacency
matrices. The choice of representation can impact the efficiency of the algorithm.

2. Apply Dijkstra’s algorithm to determine the shortest path length between vertices 𝑨 and
𝒁 in the provided weighted graph.
As, we can see we have the shortest path from:

- Node 0 to Node 1,
- From Node 0 to Node 2,
- From Node 0 to Node 3,
- From Node 0 to Node 4,
- From Node 0 to Node 6.

Apply Dijkstra’s algorithm to determine the shortest path length between vertices A and Z in the
provided weighted graph.
Figure 3 : Dijkstra’s algorithm
We have a = 1 , b = 4

Round A B C D E F G Z
1 (0, - ) ∞, - ∞, - ∞, - ∞, - ∞, - ∞, - ∞, -
2 - (1,A) (4,A) ∞, - ∞, - ∞, - ∞, - ∞, -
3 - - (4,A) (7,B) ∞, - ∞, - ∞, - ∞, -
4 - - - (7,B) (11,C) ∞, - ∞, - ∞, -
5 - - - - (8,D) (13,D) ∞, - ∞, -
6 - - - - - (12,E) (14,E) ∞, -
7 - - - - - - (14,E) (20,G)
8 - - - - - - - (19,G)
Table 1 : Table 1 MEMBERSHIP TABLE

The shortest path length between vertices A and Z is 19.

IV. Determine the inverse of a function using appropriate mathematical techniques


(M1)

Activity 1

Part III. In the context of the ID BS00411, a = 1, b = 4.

1. Ascertain whether the given functions are invertible. If they are, identify the rule for the
inverse function 𝒇−𝟏 .
a. 𝒇: ℝ → ℝ with 𝒇(𝒙) = 𝒃𝒙 + 𝒂.
Given: 𝑓(𝑥) = 4𝑥 + 1.
Injectivity (One-to-One):
To check injectivity, assume 𝑓(𝑥1 ) = 𝑓(𝑥2 ) and verify if 𝑥1 = 𝑥2 .
𝑓(𝑥1 ) = 4𝑥1 + 1
𝑓(𝑥2 ) = 4𝑥2 + 1
If 𝑓(𝑥1 ) = 𝑓(𝑥2 ):
4𝑥1 + 1 = 4𝑥2 + 1
4𝑥1 = 4𝑥2
𝑥1 = 𝑥2
Since 𝑥1 = 𝑥2 whenever 𝑓(𝑥1 ) = 𝑓(𝑥2 ), the function 𝑓(𝑥) = 4𝑥 + 1 is injective.
Surjectivity (Onto):
To check surjectivity, we need to determine if every real number 𝑦 can be expressed as 𝑓(𝑥)for some
𝑥.
Given 𝑓(𝑥) = 4𝑥 + 1
𝑦 = 4𝑥 + 1
4𝑥 = 𝑦 − 1
𝑦−1
𝑥=
4
Since 𝑥 can take any real number and 𝑦 is any real number, 𝑓(𝑥) = 4𝑥 + 1 covers all real numbers 𝑦.
Therefore, 𝑓(𝑥) = 4𝑥 + 1 is surjective.
Conclusion
Since 𝑓(𝑥) = 4𝑥 + 1 is both injective and surjective, it is invertible.
Inverse Function 𝒇−𝟏 (𝒙)
To find the inverse function 𝑓 −1 (𝑥):
𝑦 = 4𝑥 + 1
𝑦 − 1 = 4𝑥
𝑦−1
𝑥=
4
So, the inverse function 𝑓 −1 (𝑥):
𝑥−1
𝑓 −1 (𝑥) =
4
𝑥−1
Therefore, the inverse function of 𝑓(𝑥) = 4𝑥 + 1 is 𝑓 −1 (𝑥) = .
4

b. 𝒇: [−𝒃, +∞) → [𝟎, +∞) with 𝒇(𝒙) = √𝒙 + 𝒃.


- With 𝑎 = 1 and 𝑏 = 4, the function becomes 𝑓(𝑥) = √𝑥 + 4 .

One-to-one (Injective):
- The function f(x) = √𝑥 + 4 is one-to-one if for every x1 , x2 in ít domain [ -4, +∞), if f(x1) = f(x2)
, then x1 = x2
- To check this :
- Assume f(x1) = f(x2) .
- This implies √𝑥1 + 4 = √𝑥2 + 4
- Squaring both sides gives x1 + 4 = x2 + 4
- Hence, x1 = x2
- Therefore, f(x) = √𝑥 + 4 is one-to-one on its domain [−4, +∞) because it does not map
different x1 and x2 to the same f(x).
Onto (Surjective):
- The function f(x) = √𝑥 + 4 is onto if for every y in its codomain [0,+∞), there exists at least
one xxx in its domain [−4,+∞) such that f(x) = √𝑥 + 4 = y
- To check this:
- For every y ≥ 0 in [0,+∞), we need to find x ≥ −4x such that √𝑥 + 4 = y .
- Squaring both sides, we get x + 4 = y2 .
- Therefore, x = y2 – 4
- The condition x ≥ -4 is valid for y ≥ 0
- Thus , f(x) = √𝑥 + 4 is onto on its domain [−4, +∞).
Therefore, with a = 1 and b = 4, the function , f(x) = √𝑥 + 4 is invertible on its domain [−4,+∞) . It is
both one-to-one and onto, allowing us to construct its inverse function f-1(y) = y2 – 4 on its codomain
[0,+∞).
𝟐𝒙 + 𝒂, 𝒙 < 𝟎
2. Let 𝒇, 𝒈: ℝ → ℝ be defined as 𝒇(𝒙) = { and 𝒈(𝒙) = 𝒃𝒙 − 𝒂. Find 𝒈 ∘ 𝒇.
𝒙𝟑 + 𝒃, 𝒙 ≥ 𝟎
For 𝑔 ° 𝑓 :

2𝑥 + 𝑎, 𝑥 < 0
- Let 𝑓(𝑥) = { 3 and 𝑔(𝑥) = 𝑏𝑥 − 𝑎.
𝑥 + 𝑏, 𝑥 ≥ 0
2𝑥 + 3, 𝑥 < 0
- With a = 1 and b = 4, 𝑓(𝑥) = { 3 and 𝑔(𝑥) = 4𝑥 − 1.
𝑥 + 4, 𝑥 ≥ 0
- (𝑔 ° 𝑓)(𝑥) = 𝑔(𝑓(𝑥))
- (𝑔 ° 𝑓)(𝑥) = g(2x + 1) = b(2x + 1) − 1 = 2bx + b − 1 for 𝑥 < 0
- (𝑔 ° 𝑓)(𝑥) = 𝑔(𝑥 3 + 4) for 𝑥 ≥ 0
= g( x3 + 4 ) = b( x3 + 4 ) – 1 = bx3 + 4b − 1
- (𝑔 ° 𝑓)(𝑥) = 2𝑏𝑥 + 𝑏 − 1 for 𝑥 < 0
- (𝑔 ° 𝑓)(𝑥) = bx 3 + 4b − 1 for 𝑥 ≥ 0
- (𝑔 ° 𝑓)(𝑥) = 2(4)𝑥 + (4)(1) − 1 for 𝑥 < 0
- (𝑔 ° 𝑓)(𝑥) = 4𝑥 3 + (4)2 - 1 for 𝑥 ≥ 0
- (𝑔 ° 𝑓)(𝑥) = 8𝑥 + 3 for 𝑥 < 0
- (𝑔 ° 𝑓)(𝑥) = 4𝑥 3 + 15 for 𝑥 ≥ 0
8𝑥 + 3, 𝑥 < 0
- So, (𝑔 ° 𝑓)(𝑥) = {
4𝑥 3 + 15,
V. Assess whether a Eulerian and Hamiltonian circuit exists in an undirected graph
(M2).

ACTIVITY 2

Part 3 :

Does the following graph have a Hamilton path? If so, find such a path. If it does not, give an
argument to show why no such path exists.

Figure 4 : Eulerian and Hamiltonian

The graph in the figure does not have a Hamiltonian path.

- A Hamilton path is a path that visits every node in the graph exactly once. For a graph to have
a Hamiltonian path, each node must have an even degree (the number of edges connected to
that node).
- In the graph in the figure, node d has degree 1 and node b has degree 3. Therefore, the graph
cannot have a Hamiltonian path.

Explain:

- Node Degree: The number of edges connecting to a particular node.


- Path: A sequence of nodes connected by edges.
- Hamiltonian path: A path that visits every node in the graph exactly once.

Reasons why the graph does not have a Hamiltonian path:

- Node d has only one edge connected to it, so it cannot be the start or end of a Hamiltonian
path.
- Node b has three edges connected to it. To have a Hamiltonian path, one of these three edges
must be used twice, but this would violate the rule of visiting each node only once.
Conclude:

- Because the graph does not meet the necessary conditions to have a Hamiltonian path, we
can confirm that the graph does not have a Hamiltonian path.

VI. Formulate corresponding proof principles to prove properties about defined sets
(D1).

ACTIVITY 1

Part 4:

Show that if A, B and C are sets, then ̅̅̅̅̅̅̅̅̅̅̅̅̅̅


𝐴 ∪ 𝐵 ∪ 𝐶 = 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅

1. Demonstrate that each side is a subset of the other side.

We need to show that ̅̅̅̅̅̅̅̅̅̅̅̅̅̅


𝐴 ∪ 𝐵 ∪ 𝐶 = 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ This involves proving two inclusions:

a. ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴 ∪ 𝐵 ∪ 𝐶 ⊆ 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅
b. 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ ⊆ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴∪𝐵∪𝐶.
Proof of ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴 ∪ 𝐵 ∪ 𝐶 ⊆ 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅
- Let x ∈ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴∪𝐵∪𝐶
- This means x ∉ A ∪ B ∪ C
- Therefore, x ∉ A , x ∉ B, and x ∉ C.
- ̅ x ∈ ∩ 𝐵,
Hence, x ∈ 𝐴, ̅ x ∈ ∩ 𝐶̅
- Thus, x ∈ 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅

Proof of 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ ⊆ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴∪𝐵∪𝐶

- Let x ∈ 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ .
- This means x ∈ 𝐴, ̅ x ∈ ∩ 𝐵,
̅ x ∈ ∩ 𝐶̅
- Therefore, x ∉ A, x ∉ B, x ∉ C
- Hence x ∉ A ∪ B ∪ C
- Thus, x ∈ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴∪𝐵∪𝐶
- Therefore, 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ ⊆ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴∪𝐵∪𝐶

Since both inclusions are true, we have ̅̅̅̅̅̅̅̅̅̅̅̅̅̅


𝐴 ∪ 𝐵 ∪ 𝐶 ⊆ 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅

2. Verification using a membership table:

Let's create a membership table for sets A, B, and C and check the expressions for ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴 ∪ 𝐵 ∪ 𝐶 ⊆ 𝐴̅ ∩
𝐵̅ ∩ 𝐶̅
A B C AUBUC 𝐴 ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
∪ 𝐵 ∪ 𝐶 𝐴̅ 𝐵̅ 𝐶̅ 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅
0 0 0 0 1 1 1 1 1
0 0 1 1 0 1 1 0 0
0 1 0 1 0 1 0 1 0
0 1 1 1 0 1 0 0 0
1 0 0 1 0 0 1 1 0
1 0 1 1 0 0 1 0 0
1 1 0 1 0 0 0 1 0
1 1 1 1 0 0 0 0 0
Table 2 : SHORTEST LENGTH

From the membership table, we see that the columns for ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴 ∪ 𝐵 ∪ 𝐶 and 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ are identical,
verifying the equality.

Thus, ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐴 ∪ 𝐵 ∪ 𝐶 = 𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ is proven both by subset inclusion and by the membership table.

VII. Construct a proof of the Five Color Theorem (D2) .

ACTIVITY 2

Part 4:

Construct a proof of the Five Color Theorem.


- is a classic result in graph theory, which states that any planar graph can be colored with at
most five colors such that no two adjacent vertices (with directly connected edges) have the
same color. Below is a detailed presentation of the proof of this theorem

Key Concepts and Definitions

- Planar Graph: A graph that can be drawn on a plane without any edges crossing.
- Vertex: A point or node in the graph.
- Edge: A line connecting two vertices.
- Face: A region of the plane bounded by edges of the graph.
- Chromatic Number: The smallest number of colors needed to color the vertices of a graph such
that no two adjacent vertices share the same color.

Proof Outline

1. Induction on the Number of Vertices

The proof proceeds by induction on the number of vertices nnn in the planar graph.

Base Case (n = 0, 1, 2, 3, 4):


- For n = 0 (no vertices), no colors are needed, trivially true.
- For n = 1, 2, 3, 4 each vertex can be colored with a different color since there are fewer than 5
vertices.
2. Inductive Step (Assume True for nnn Vertices)
- Assume that any planar graph with nnn vertices can be colored with at most 5 colors.
3. Consider a Planar Graph with n + 1 Vertices
- Let G be a planar graph with n + 1 vertices. We need to show that G can be colored with at most
5 colors.

Case 1: G is 5-colorable:

- If G already requires 5 colors, we are done.

Case 2: G is 4-colorable:

- Assume G is 4-colorable. Remove a vertex v and its incident edges, reducing G to a graph G′
with n vertices.
- By the inductive hypothesis, G′ can be colored with at most 5 colors.
- Re-insert vertex v back into G′. Since v is adjacent to at most 4 vertices in G′, one of the 5
available colors (from the 5-coloring of G′) can be used for v without conflicting with
adjacent vertices' colors.

Case 3: G is not 4-colorable:

- If G cannot be 4-colored, it must have a vertex of degree 5 or more.


- Use the concept of reducibility and planarity to show that such a graph can always be
reduced or manipulated to fit within the constraints of a 5-coloring.

By induction, every planar graph G can be colored with at most 5 colors. This completes the proof of
the Five Color Theorem.

This theorem is fundamental in graph theory and has various applications, particularly in map
coloring problems and in understanding the structure of planar graphs.

CONCLUSION
As we wrap up this assignment journey, we look back on the wealth of knowledge gained and the
obstacles overcome in the realm of graph theory. From delving into the intricacies of set sizes to
navigating the complexities of graph traversal algorithms, each task has shed light on new dimensions
of mathematical elegance and computational efficiency. Through rigorous analysis and creative
problem-solving, we've uncovered the mysteries of Hamiltonian paths, mapped out optimal routes
using Dijkstra's Algorithm, and appreciated the elegant yet profound implications of the Five Color
Theorem. Armed with these tools and insights, we move forward with renewed confidence, prepared
to confront real-world challenges with the grace and precision that graph theory offers.

REFERENCES

[1] What is a Binary Tree? (no date) Educative. Available at:


https://www.educative.io/answers/what-is-a-binary-tree (Accessed: 6 July 2024).
[2] Binary Search Tree, AVL Tree (no date) VisuAlgo. Available at:
https://visualgo.net/en/bst?slide=1 (Accessed: 6 July 2024).
[3] Complete Binary Tree (no date) Programiz. Available at:
https://www.programiz.com/dsa/complete-binary-tree (Accessed: 6 July 2024).

You might also like