0% found this document useful (0 votes)
3 views

Discreate Structure

The document outlines the syllabus for a Discrete Structures course for BS IT 3rd semester, covering topics such as planar graphs, graph coloring, Euler and Hamiltonian paths, rooted trees, number theory, sequences, series, counting principles, and the analysis of algorithms. It also discusses countable and uncountable sets, operations on functions, and various mathematical concepts and their applications in computer science. Key concepts include graph theory, algorithm efficiency, and combinatorial mathematics.

Uploaded by

xigipic733
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Discreate Structure

The document outlines the syllabus for a Discrete Structures course for BS IT 3rd semester, covering topics such as planar graphs, graph coloring, Euler and Hamiltonian paths, rooted trees, number theory, sequences, series, counting principles, and the analysis of algorithms. It also discusses countable and uncountable sets, operations on functions, and various mathematical concepts and their applications in computer science. Key concepts include graph theory, algorithm efficiency, and combinatorial mathematics.

Uploaded by

xigipic733
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Discrete 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:

The process of visiting all nodes in a graph or tree in a specific order.


Common types are
DFS (Depth-First Search) and BFS (Breadth-First Search). Used in
searching, pathfinding, and analyzing data structures.
Number Theory:
A branch of mathematics dealing with integers and their
properties.
Key concepts include prime numbers, divisibility, and
modular arithmetic. It’s fundamental in cryptography,
hashing, and data encryption.
Number theory focuses on the study of integers and their
relationships. Key concepts include:

Prime Numbers: Numbers greater than 1 with no divisors


other than 1 and itself (e.g., 2, 3, 5). Crucial for
cryptographic algorithms like RSA.
Modular Arithmetic: Remainder-based calculations (e.g.,
7mod 3=17 \mod 3 = 17mod3=1). Used in hashing
functions, error detection, and encryption.
Elements of Graph Theory

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:

A method used to calculate the size of the


union of multiple sets by considering the
size of individual sets and subtracting the
overlaps.
Formula for two sets:
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣
This principle is extended for more sets.
Mapping & Function
Mapping:
A mapping is a relationship between two sets where each
element of the first set is associated with an element of the
second set. It can be a function, but not always. A mapping
can be one-to-one, many-to-one, or onto (surjective).
Function:

A function is a specific type of mapping where each element of the


domain (input set) is related to exactly one element in the codomain
(output set). Functions can be classified as:
Injective (One-to-One): Every element of the domain maps to a
unique element in the codomain.
Surjective (Onto): Every element of the codomain is mapped by at
least one element of the domain.
Bijective: Both injective and surjective; each element of the domain
maps to exactly one unique element in the codomain, and vice versa.
Pigeonhole Principle:
The Pigeonhole Principle states that if more than n items are placed into n
containers, at least one container must contain more than one item. In simpler
terms, if you try to distribute more items than containers, some containers will
end up with more than one item.
Permutations and Combinations function composition:
Permutations and Combinations:
Permutations: The number of ways to arrange r objects out of n distinct
objects, where order matters. The formula is:
P(n,r)=​
Combinations: The number of ways to choose rrr objects out of nnn distinct
objects, where order does not matter. The formula is:

C(n,r)=​
Analysis of Algorithms

The analysis of algorithms involves evaluating the efficiency of algorithms in terms of


their time and space complexity. It helps determine how well an algorithm performs in
terms of its resource usage (like CPU time and memory) as the input size increases.
Time Complexity:
Describes how the runtime of an algorithm grows with respect to the input size.
Common notations include:
Big O (O): Worst-case time complexity.
Big Omega (Ω): Best-case time complexity.
Big Theta (Θ): Exact time complexity (both upper and lower bounds).

Common time complexities:


O(1)O(1)O(1) - Constant time.
O(n)O(n)O(n) - Linear time.
O(n2)O(n^2)O(n2) - Quadratic time.
O(log⁡n)O(\log n)O(logn) - Logarithmic time.

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:

A set is uncountable if it is not possible to list all its elements in a


sequence, or if there is no one-to-one correspondence between the set and
N. The set has more elements than can be counted using natural numbers.
Example:
The set of real numbers R is uncountable because you cannot list
all real numbers or establish a one-to-one correspondence with
natural numbers.
The set of all points on a line segment or in a 2D plane is
uncountable.
Key Difference:
Countable sets have elements that can be listed or paired with natural
numbers.
Uncountable sets have too many elements to be listed or paired with
natural numbers, and their size (cardinality) is larger than any countable
set.
Operations on Functions

Functions can be combined and manipulated using various operations. These


operations allow us to create new functions from existing ones, which is useful in
mathematics and computer science for optimizing algorithms and simplifying
expressions.
Key Operations on Functions:

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

You might also like