Discreate Structure
Discreate Structure
BS IT 3rd
Semester
Final Term
Syllabus
Planar Graph:
A graph that can be drawn on a plane without edges crossing each other.
Used in network design, circuit layouts, and geographic mapping for clear a
efficient designs.
Euler’s formula helps analyze its structure: V−E+F=2V - E + F = 2V−E+F=
Graph Colouring:
Assigning colors to vertices of a graph so that no two
connected vertices share
the same color. It’s used in scheduling, register allocation, and
solving optimization problems in IT.
Euler Graph:
A graph where there exists a path (Eulerian path) or a
circuit (Eulerian circuit) that visits every edge exactly
once. It’s applied in network routing, circuit design,
and solving traversal problems.
Hamiltonion path:
A path in a graph that visits each vertex exactly once. It’s used in
optimization problems like the traveling salesman problem, logistic
and route planning.
Rooted Trees:
A tree with a designated root node where each edge
directs away from the root. Used in hierarchical data
structures, databases, and file systems for efficient
organization and traversal.
Traversals:
raph theory studies graphs, which consist of nodes (vertices) and edges .
ey elements include:
ertices (Nodes): Points or locations in a graph.
dges (Links): Connections between pairs of vertices, can be directed (arcs) or u
egree: The number of edges connected to a vertex.
ath: A sequence of vertices connected by edges.
ycle: A path that starts and ends at the same vertex without revisiting any verte
onnected Graph: A graph where there's a path between every pair of vertices.
ubgraph: A portion of a graph formed by a subset of its vertices and edges.
Sequences:
A sequence is an ordered list of numbers or terms, typically
following a specific rule or pattern. Key types include:
Arithmetic Sequence: Each term is obtained by adding a
constant difference to the previous term (e.g., 2, 5, 8, 11).
Geometric Sequence: Each term is obtained by multiplying
the previous term by a constant ratio (e.g., 2, 4, 8, 16).
Fibonacci Sequence: A sequence where each term is the
sum of the two preceding terms (e.g., 0, 1, 1, 2, 3, 5, 8).
Series
A series is the sum of the terms of a sequence.
Key types include:
Arithmetic Series: The sum of an arithmetic sequence, where each
term has a constant difference (e.g., 2 + 5 + 8 + 11...).
Geometric Series: The sum of a geometric sequence, where each
term is multiplied by a constant ratio (e.g., 2 + 4 + 8 + 16...).
Infinite Series: A series with an infinite number of terms, like the
sum of a geometric series that converges to a limit (e.g., 1 + 1/2 +
1/4 + 1/8...).
Counting:
Counting (Combinatorics): The branch of mathematics that
deals with counting, arrangement, and selection of objects. Key
concepts include:
Permutations: Arrangements of objects in a specific order
(e.g., arranging 3 books from a set of 5).
Combinations: Selecting objects without regard to order (e.g.,
choosing 3 students from a group of 5).
Inclusion-Exclusion Principle:
C(n,r)=
Analysis of Algorithms
Space Complexity:
Describes the amount of memory an algorithm uses as a function of the input size.
For example, algorithms that use large amounts of memory for storing data
structures will have higher space complexity.
Comparing Growth Rates of Functions
When analyzing algorithms, it's essential to compare how different functions grow as the input size
increases. This helps to determine which algorithms are more efficient. The most common way to
express the growth rates is through asymptotic notation.
Growth Rate Comparison
Constant Time (O(1)):
The execution time or space does not depend on the input size. Example: Accessing an element in an
array by index.
Logarithmic Time (O(log n)):
The execution time grows logarithmically with the input size. Common in algorithms that divide the
input in half at each step, such as binary search.
Linear Time (O(n)):
The execution time grows linearly with the input size. Example: Traversing an array or linked list.
Linearithmic Time (O(n log n)):
A combination of linear and logarithmic growth. Example: Efficient sorting algorithms like Merge Sort
or Quick Sort.
Quadratic Time (O(n²)):
The execution time grows with the square of the input size. Common in algorithms that involve
nested loops, like bubble sort.
Cubic Time (O(n³)):
The execution time grows with the cube of the input size. Occurs in algorithms with triple nested
loops.
Exponential Time (O(2^n)):
The execution time grows exponentially with the input size. Example: Solving the Travelling Salesman
Problem using brute force.
Countable and Uncountable Sets
Countable Sets:
A set is called countable if its elements can be listed in a sequence or if there
exists a one-to-one correspondence between the elements of the set and the
set of natural numbers N\mathbb{N}N. Countable sets can be either finite or
infinite. For infinite sets, they are referred to as countably infinite.
Example:
The set of natural numbers {1,2,3,4,… } is countably infinite.
The set of integers {0,1,−1,2,−2,3,−3,… } is countably infinite.
The set of all students in a class is countable (finite).
Uncountable Sets:
Function Composition:
The composition of two functions f(x)f(x)f(x) and g(x)g(x)g(x) is written as (f∘g)(x)=f(g(x)).
This means applying g(x)g(x)g(x) first, and then applying f(x)f(x)f(x) to the result of
g(x)g(x)g(x).
Addition of Functions:
The sum of two functions f(x)f(x)f(x) and g(x)g(x)g(x) is
a new function defined as (f+g)(x)=f(x)+g(x)
Subtraction of Functions:
The difference between two functions f(x)f(x)f(x) and
g(x)g(x)g(x) is defined as (f−g)(x)=f(x)−g(x)(f - g)
Multiplication of Functions:
The product of two functions f(x)f(x)f(x) and g(x)g(x)g(x) is defined as (f⋅g)
(x)=f(x)⋅g(x)
Division of Functions:
The division of two functions f(x)f(x)f(x) and g(x)g(x)g(x) is
defined as (f/g)(x)=f(x)g(x)(f / g)(x) = =g(x)f(x), where
g(x)≠0g(x)
Thanks