Docsity

Discrete Mạth for do Asm1, Schemes and Mind Maps of Discrete Mathematics

Toggle sidebar
bg1
1
ASSIGNMENT 1 FRONT SHEET
Qualification
Pearson BTEC Level 5 Higher National Diploma in Computing
Unit number and title
Unit 18: Discrete Maths
Submission date
Date Received 1st submission
Re-submission Date
Date Received 2nd submission
Student Name
Student ID
Class
Assessor name
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
Grading grid
P1
P2
P3
P4
M1
M2
D1
D2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Discrete Mạth for do Asm1 and more Schemes and Mind Maps Discrete Mathematics in PDF only on Docsity!

ASSIGNMENT 1 FRONT SHEET

Qualification Pearson BTEC Level 5 Higher National Diploma in Computing

Unit number and title Unit 18: Discrete Maths

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Student ID

Class Assessor name

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

Grading grid

P1 P2 P3 P4 M1 M2 D1 D

❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:

Internal Verifier’s Comments:

Signature & Date:

A. INTRODUCTION

Discrete mathematics is an important branch of mathematics that studies the structure and

principles of discrete sets. It focuses on objects that are countable or discontinuous, such as

integers, sets, graphs, and strings, and its rules are widely used across a variety of domains.

Examples include computer engineering, cryptography, graph theory, optimization, and

information theory. Discrete mathematics introduces the principles and methods needed to solve

complex problems in these fields.

Discrete mathematics provides methods and tools for analyzing, modeling, and solving

discrete problems. It is essential for algorithm development, database design, network analysis and

many other applications in information technology.

In this essay, we will explore the importance of discrete mathematics in the modern IT

industry. We will consider its impact on privacy preservation, graph theory, natural language

processing, databases, and computer science. The article will delve into specific applications of

discrete mathematics in each field, highlighting its importance.

Learning about discrete mathematics shows that it is more than just an abstract subject; it

has a significant impact on daily life and the IT sector. Discrete mathematics provides the

theoretical foundation and methods for solving complex problems, optimizing algorithms, and

modeling data. The advancement of discrete mathematics has opened up countless new

opportunities and solutions, contributing greatly to the progress and development of modern

society.

B. BODY

Activity 1

1. Part 1 ( P1 )

a. Let A

and B

be two non-empty finite sets. Assume that cardinalities of the sets A B ,

and

AB are 9 , 2 b a and ab ,respectively. Determine the cardinality of the set AB.

Answer

We know the carnality:

Set A is 9b

Set B is 2a

=> Which we'll denote as |A| = 9b and |B| = 2a

We know the carinatily of the intersection of sets A and B is a + b

→ |A ∩ B| = a + b

Substituting the values a and b into the article we get:

|A| = 95, B| = 24 and |A ∩ B| = a + b = 9

We can use the principle of inconclusion and exclusion:

|A ∪ B| = A + B - |A ∩ B| = 9b + 2a - (a +b)

My ID=BH

  • Set a = 4, b = 9:

So |A U B| is 110.

b. Suppose | AB |  3 ,| a AB |  11 b and | AB | 1. a Determine| B |.

According to the formula for calculating the quantity of the union of two sets, we have:

|A – B| = 34

|A ∪ B| = 119

|A ∩ B| = 14

Determine |B|.

|A| = |A ∩ B| + |A - B|

2. Part 2 ( P 2)

My Student ID : BH00954 => a = 4 , b = 9

List the bag of prime factors for each of the provided numbers.

1 2 a => 14 2 = 2 x 71 => Bags A = {|2:1, 71:1|}

2 0 b => 290 = 2 x 29 x 5 => Bags B = {|2:1, 29:1, 5:1|}

Find the cardinalities of

a) each of the aforementioned bags.

b) the intersection of the aforementioned bags.

c) the union of the aforementioned bags.

d) the difference between the aforementioned bags.

Answer

a) Find the cardinalities of each bag mentioned above.

Cardinality of Bag 142: {|2:1, 71:1|} = 2

Cardinality of Bag 290: {|2:1, 29:1, 5:1|} =

The cardinality of each bag is calculated by the number of unique prime divisors in that bag.

Proof: The number of prime divisors in the bag of 142 is 2, in the bag of 290 is 3.

b) Find the cardinalities of the intersection of the aforementioned bags.

Intersection: {|2:1, 71:1|} n {2:1, 29:1, 5:1|} = 1 (because only the prime number 2 is common between

The intersection of the bags only contains common prime divisors between both numbers. Here there are only 2

that are prime to both numbers 142 and 290.

c) Find the cardinalities of the union of the aforementioned bags.

Union: {2:1, 71:1|}∩ {| 2:1, 29:1, 5:11} = {2:1,71:1,29:1,5:1}

Cardinality: 4

The union of bags contains all prime divisors of both numbers. The union of bags has 4 prime divisors which is

2,3,5,71.

Find the cardinalities of the difference of the aforementioned bags.

Summary

One. Prime factorization: 142 = 2.71 or {|2:1, 71:11}

1.b. Prime factorization: 270=2,33,5 or {2:1, 3:3, 5:

2 a. Quantity of Bag 142: {|2:1, 71:1|} = 2

Quantity of Bag 270: {|2:1, 3:3, 5:1|} =

2.b. Intersection: {|2:1, 71:1|3^ <2:1, 3:3, 5:103 = 1

2 C. Coalition: {2:1, 71:1130 12:1, 3:3, 5:1|} =

Activity 2

3. Part I (P 3)

What is a binary tree?

Figure 1 : Binary tree

A binary tree is a hierarchical data structure in which each node has at most two children,

called left and right children. The root of a binary tree is the node at the top. Each node in the

binary tree has a value, ordered or arranged in a certain way as determined by the application or

problem being worked on. Binary trees are widely used in computer science, as the basis for

many algorithms and data structures.

How are some key charateristics of binary tress:

 Root: The topmost node in the tree is called the root node. It serves as the starting point

for traversing the tree.

 Nodes: Each node in a binary tree contains a value or data and can have up to two

children. The children's nodes are referred to as the left child and the right child.

 Parent and Child Nodes: Each node, except the root, has a parent node. The node that is

connected to another node (its child) is considered the parent of that child node.

 Leaf Nodes: Leaf nodes are the nodes that do not have any children. In a binary tree, leaf

nodes are the nodes with no left or right child.

 Subtrees: A binary tree can be divided into smaller binary trees called subtrees. Each

subtree has its own root node and its children.

b) Some types of binary trees

Definition: The Binary Search Tree (BST) is a data structure used for efficient searching,

insertion, and deletion operations. A BST is a binary tree with keys at each node. Keys in the left

subtree are smaller than those in the node, while keys in the right subtree are larger.

Figure 3 : Example of AVL Trees

Definition:

The AVL (Adelson-Velskii and Landis) tree is a self-balancing binary search tree. It assures that any

node's left and right subtrees deviate by no more than one unit of height. This balancing property

contributes to the tree's efficiency during searching, insertion, and deletion operations.

Quantitative Analysis:

 Searching, insertion, and deletion: The time complexity for these operations in an AVL tree is

O(log n), where n is the number of nodes in the tree. This is because the tree's balancing property

ensures that the maximum height of the tree is always logarithmic with respect to the number of

nodes.

 Balancing: Balancing an AVL tree requires performing rotations, which have a time complexity of

O(1). However, after an insertion or deletion, the tree may need to be rebalanced by performing a

series of rotations, resulting in a time complexity of O(log n).

Qualitative Analysis:

 Self-balancing AVL trees ensure efficient operations for dynamic datasets, making them a key

benefit. The balancing keeps the tree roughly balanced, resulting in consistent O(log n) time

complexity for finding, inserting, operations.

 The fundamental disadvantage of the AVL tree is the additional overhead required to maintain

balance during insertion and deletion. Multiple rotations may be required during the balancing

process, affecting total performance. This makes AVL trees more difficult to implement than

standard binary search trees.

4. Part II (P4)

a. State Dijkstra's Algorithm in an undirected graph.

Definition:

In 1959, Dutch computer scientist Edger Dijkstra proposed an algorithm for weighted graphs. Graphs

can be directed or undirected, as long as each edge has a non-negative value. He named the algorithm

"Dijkstra's Algorithm" after himself. (Source: Pandey, M. (2021). Scaler Topics.

  • Simply described, a graph is a descriptive structural data used to represent the relationships between

a number of pieces, which are known as nodes (or vertices) and are typically items, persons, or actions.

Real-time connections between nodes are known as edges. Additionally, nodes are only connected if they

share an edge.

  • "A diagram is essentially a relationship between nodes/vertices connected by edges."

Dijkstra's algorithm in undirected graphs works as follows.

  • Initialization: Assign a tentative distance value to every node. Initialize the source node with a

distance of 0 and all other nodes with a distance of infinity.

  • Consider the source node: Consider the source node's neighbors one by one, update the expected

distance to the neighbors if it is less than the current distance.

  • Update Neighbors: Determine the approximate distance between the current node and each of its

unexplored neighbors. Update the neighbor's distance if this distance is less than the known distance

Slart aer Node: Select the envisted node withe smallet sentative ais nee. Set it as the new

current node and go back to step 3.

  • Repeat: Until all nodes have been visited or the destination node has been reached, keep

choosingthe unvisited nodes with the smallest tentative distance, updating distances, and marking visited.

b. Apply Dijkstra's algorithm to determine the shortest path length between vertices

and in the provided weighted graph.

Set a = 4, b= 9.

Let U be the starting point and V be the points adjacent to U.

Applying Dijsktra' Algorithm with formula: deg(V) = Min (Deg(U) + Length of U & V), we have the

following table:

C. CONCLUSIONS

In conclusion, the significance of discrete mathematics in the contemporary IT profession

cannot be overstated. This branch of mathematics, dedicated to the study of countable and

discontinuous structures, serves as a foundational pillar for various applications in information

technology. From algorithm development and database design to network analysis and

cryptography, discrete mathematics provides essential tools and methodologies for addressing

complex problems.

The impact of discrete mathematics is particularly evident in the realms of privacy

protection, graph theory, natural language processing, and computer science. Its theoretical

underpinnings and problem-solving approaches play a crucial role in shaping advancements in

these areas, including the development of algorithms, optimization techniques, and data modeling

strategies.

By delving into the intricacies of discrete mathematics, individuals gain more than a

theoretical understanding of abstract mathematical concepts. They acquire practical skills with far-

reaching implications in everyday life and professional fields. The continuous evolution of discrete

mathematics has paved the way for innovative solutions and opportunities, significantly

contributing to the progress and development of modern society.

As technology continues to advance, the relevance of discrete mathematics will only grow,

emphasizing its pivotal role in shaping the landscape of information technology and its

multifaceted applications. In essence, the study of discrete mathematics transcends mere

abstraction, proving itself as a dynamic and indispensable tool for tackling the challenges of our

interconnected and data-driven world.

D. REFERENCE

GeeksforGeeks. (2015). Binary Search Tree - GeeksforGeeks. [online]

 Available at: https://www.geeksforgeeks.org/binary-search-tree-data-structure/

GeeksforGeeks. (n.d.). Binary Tree Data Structure. [online]

 Available at: https://www.geeksforgeeks.org/binary=%20tree-data-structure/

Yadav, P. (2021). AVL Tree in Javascript. [online] LearnersBucket.

Available at: https://learnersbucket.com/tutorials/data-structures/avl-tree-in-javascript/

Pandey, M. (2021). Scaler Topics. [online] www.scaler.com.

Available at: https://www.scaler.com/topics/data-structures/dijkstra-algorithm/.