Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

BTEC Discrete Maths assignment 1, Papers of Discrete Mathematics

BTEC Discrete Maths assignment 1

Typology: Papers

2023/2024

Uploaded on 03/07/2024

pugboss
pugboss ๐Ÿ‡ป๐Ÿ‡ณ

3 documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PROGRAM TITLE: BTEC in Computing
UNIT TITLE: Discrete Maths
ASSIGNMENT NUMBER: 1
ASSIGNMENT NAME: Set theory and functions- Graph theory
SUBMISSION DATE: 05/03/2024
DATE RECEIVED: 08/02/2024
TUTORIAL LECTURER: Mrs. Luu Thi Huong Giang
WORD COUNT: 5099
STUDENT NAME: Nguyen Dac Trung Phuong
STUDENT ID: BKC13093
MOBILE NUMBER: 0934516636
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download BTEC Discrete Maths assignment 1 and more Papers Discrete Mathematics in PDF only on Docsity!

PROGRAM TITLE: BTEC in Computing

UNIT TITLE: Discrete Maths

ASSIGNMENT NUMBER: 1

ASSIGNMENT NAME: Set theory and functions- Graph theory

SUBMISSION DATE: 05/03/

DATE RECEIVED: 08/02/

TUTORIAL LECTURER: Mrs. Luu Thi Huong Giang

WORD COUNT: 5099

STUDENT NAME: Nguyen Dac Trung Phuong

STUDENT ID: BKC

MOBILE NUMBER: 0934516636

Summative Feedback:

I. Examine set theory and functions applicables to software engineering

1.1 Set theory

1.1.1 Set definition and basic concepts

Definition:

A set is a collection of distinct objects, called elements, where each element can be identified, and

there is no specific order.

Representation:

Sets are often represented using curly braces "{}". For example, the set of natural numbers less than

5 can be represented as {0,1,2,3,4}.

Elements:

The objects in a set are called the elements of the set.

Relationships between Sets:

Two sets can have relationships, such as being a subset (a set where all elements are also elements

of another set) or a union (a set containing all elements from other sets).

Empty Set:

A set with no elements is called an empty set, usually denoted as โˆ…โˆ… or {}.

Set Operations:

Various set operations, such as union, intersection, and complement, are used to perform logical

operations on sets.

1.1.2 Set operations

Union

Representation: AโˆชB

Meaning: Creates a new set containing all elements belonging to set A or set B, or both.

Intersection

Representation: AโˆฉB

1.1.5 Multiset

A multiset is a concept in set theory where each element can appear multiple times within the set.

Unlike a regular set, in a multiset, elements can be repeated.

Basic Characteristics of a Multiset:

Elements can appear multiple times

In a multiset, an element can appear multiple times, without any limitation on the number of

occurrences.

Used to model situations with repetitions

Multisets are often used to model real-world situations where the repeated occurrence of an object

is significant. For example, in a list of courses a student has registered for, the name of a course

may appear multiple times if the student enrols in the same course multiple times.

Representation

Multisets are commonly represented using square brackets or other symbols to indicate the number

of occurrences of each element.

Notation of Multiset and Cardinality

Multiset Notation:

A multiset is often represented using square brackets [ ] or curly braces { } to distinguish it from a

regular set. For example: [a,b,a,c,b] or {a,b,a,c,b} both serve as notations for a multiset.

Cardinality of Multiset:

The cardinality of a multiset is the count of occurrences for each element in the multiset. Typically,

it is denoted by indicating the frequency of each element, often in subscript form or another

context-appropriate manner. For instance, the cardinality of [a,b,a,c,b] can be expressed

as{a:2,b:2,c:1}.

Total Number of Elements:

At times, one might be interested in the total number of elements in the multiset. In the given

example, the total number of elements is 5.

1.2. Functions

1.2.1 Definition

A function is a mathematical relation between a set of inputs, known as the domain, and a set of

possible outputs, known as the codomain. The key characteristic of a function is that each input

value is uniquely associated with exactly one output value. In other words, a function assigns to

each element in the domain a specific element in the codomain.

Bijective : A function f: Aโ†’B is called bijective if it is both one-to-one and onto. This means that

each element in the set A is mapped to one and only one element in the set B, and every element in

the set B has at least one element in the set A mapped to it.

1.2.3 Inverse functions

In mathematics, an inverse function is a special function constructed to interchange the roles of the

range and domain of a given function. If f: Aโ†’B is a function, then the inverse function of f,

denoted as f

โˆ’

, is defined as follows:

Domain and Range: The inverse function f

โˆ’

: Bโ†’A has a domain that corresponds to the range of f,

and vice versa.

Mapping with the Original Function: For every x in B, f

โˆ’

(x) is the unique value in A such that

when mapped through f, we obtain f (f

โˆ’

(x)) = x.

Mapping with the Inverse Function: For every y in A, f (f

โˆ’

(y)) = y.

One-to-One and Onto: If f is injective (one-to-one), then f

โˆ’

is surjective (onto), and vice versa.

II. Graph theory

2.1 Definition

In mathematics, a graph is understood as a pair of two finite sets: the set of vertices and the set of

edges connecting these vertices to each other.

2.2 Types of graphs, how to classify and represent graphs on computers

2.2.1 Type of graphs

There are many of graphs:

Directed and Undirected graphs

An undirected graph is a graph where the edges do not have a specific direction and it is

bidirectional in nature it does not have a parent-child relation concept as there is no particular

direction.

Pseudograph : A graph that can have both multiple edges and loops.

Singleton Graph : A graph with only one vertex and no edges.

Empty Graph : A graph with no vertices and edges.

2.2.2 Classification methods

The classification of graphs in mathematics can be based on various criteria, depending on the

purpose of use and the characteristics of the data. Here are some primary ways to classify graphs:

Classification based on vertex and edge sets

Finite Graph : When both V (vertex set) and E (edge set) are finite sets.

Infinite Graph : When either V or E is an infinite set.

Classification based on edge properties

Undirected Graph : A graph where all edges are undirected.

Directed Graph : A graph in which all edges have a direction.

Mixed Graph : A graph that contains both undirected and directed edges.

2.2.3 Represent Graphs on a Computer

Adjency matrix

For the graph G = (V, E) with n vertices, the adjacency matrix of G is denoted as A = [a ij ]n x n,

where a ij

represents the number of edges connecting vertex i to vertex j.

For example:

A B C D E F

A 0 4 2 0 3 0

B 4 0 0 5 0 0

C 2 0 0 1 6 4

D 0 5 1 0 0 6

E 3 0 6 0 0 2

F 0 0 4 6 2 0

2.3 Definition and Characteristics of Binary Trees

A binary tree is a data structure in computer science and mathematics. It consists of a set of nodes,

where each node can have at most two child nodes, called the left child and the right child. Each

node in the binary tree contains a value and is organized such that the value of the parent node is

greater than the value of the left child and less than the value of the right child.

Characteristics of Binary Trees:

Root Node:

The topmost node in the tree structure is called the root node. The root node has no parent.

Child Node:

Each node in the tree can have at most two child nodes, referred to as the left child and the right

child.

Leaf Node:

Nodes that do not have any child nodes are called leaf nodes. Leaf nodes are located at the last level

of the tree.

Depth:

The depth of a node is the number of nodes on the path from the root node to that node. The depth

of the root node is 0.

Full Binary Tree:

A full binary tree is a binary tree in which each node has exactly 0 or 2 child nodes.

Perfect Binary Tree:

A perfect binary tree is a full binary tree with all leaf nodes at the same level.

2.4 Definition of Spanning tree

A spanning tree is a subset of an undirected connected graph that includes all vertices with the

minimum possible number of edges. If any vertex is omitted, it is not considered a spanning tree. It

is a tree structure without cycles and ensures connectivity. A spanning tree comprises (n-1) edges,

where 'n' is the number of vertices. The edges may or may not have assigned weights. All possible

spanning trees derived from a graph G have the same number of vertices, but the number of edges is

equal to the number of vertices minus 1.

For a complete undirected graph with 'n' vertices, it can have (n^(n-2)) spanning trees. For example,

if n = 5, the maximum possible spanning trees would be 5 ^ (5-2) = 125.

Applications of spanning trees include cluster analysis, civil network planning, and computer

network routing protocols. In essence, spanning trees are employed to find the minimum path

connecting all nodes in a graph.

Characteristics of a Spanning Tree:

Connects All Vertices:

A spanning tree connects all the vertices of the original graph without forming cycles.

Objective: Find the shortest path from a source vertex to all other vertices in a graph with positive

edge weights.

Execution:

  • Create a set dist[] to store the shortest distances from the source vertex to all other vertices.

  • Initialize dist[] with infinity and set dist[source] to 0.

  • Iterate over all vertices:

  • Choose the vertex with the shortest distance from the source (not yet processed).

  • Update dist[] for all neighboring vertices if a shorter path is found.

  • Repeat the process until all vertices are processed.

Prim's Algorithm - Minimum Spanning Tree:

Objective: Find the minimum spanning tree of a weighted graph.

Execution:

  • Choose any vertex as the starting vertex of the minimum spanning tree.

  • Repeat the following steps until all vertices are included in the spanning tree:

  • Choose the edge with the minimum weight that connects a vertex in the spanning tree and a

vertex outside the spanning tree.

  • Add the selected vertex and edge to the spanning tree.

  • Repeat until the spanning tree contains all vertices.

III. Exercises

Part 1

1. Let A and B be two non-empty finite sets. If cardinalities of the sets A, B and A ๏ƒ‡ B are 86,

43 and 11 respectively, find the cardinality of the set A ๏ƒˆ B?

n(A ๏ƒˆ B) = n(A) + n(B) โ€“ n(A ๏ƒ‡ B) = 86 + 43 - 11 = 118

=> n(A ๏ƒˆ B ) = 118

2. Let A = {n ๏ƒŽ N: 30 ๏‚ฃ n < 50} and B = {n ๏ƒŽ N: 10 < n โ‰ค 42} and C = {n ๏ƒŽ N: 5 < n ๏‚ฃ 35}

Suppose D is a set such that D ๏ƒ A and D ๏ƒ B and D ๏ƒ C. What is the largest possible

cardinality of D?

Since A = {n โˆˆ N: 30 ๏‚ฃ n < 50} and D ๏ƒ A, D = {n ๏ƒŽ N: 30 ๏‚ฃ n < 50} (1)

Since B = {n ๏ƒŽ N: 10 < n โ‰ค 42} and D ๏ƒ B, D = {n ๏ƒŽ N: 10 < n ๏‚ฃ 42} (2)

Since C = {n ๏ƒŽ N: 5 < n ๏‚ฃ 35} and D ๏ƒ C, D = {n ๏ƒŽ N: 5 < n ๏‚ฃ 35} (3)

Combine statements (1), (2) and (3), we can conclude:

D = {n ๏ƒŽ N: 30 ๏‚ฃ n ๏‚ฃ 35}

This is because 35 is the smallest upper limit and 30 is the largest lower limit among the three sets.

Therefore, the largest possible cardinality of D is 6

3. Let A = {1, 2, ..., 10}. Define B 2 = {B ๏ƒ A: |B| = 2}. Find | B 2

|A| = 10, |B| = 2, so every element of B 2

is a pair of Aโ€™s values.

=> | B

2

| = C

10

2