- 216 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about 'Discrete Mathematics' - mannix-harris

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

It is assumed that you have studied basics of mathematics before.

- The slides in this section are for your review. They will not all be covered in class.
- If you need extra help in this area, a special help session will be scheduled.
- A small test based on multiple choice questions will help you to analyse yourself

Learning Objectives

- Introduction
- Sets
- Logic & Boolean Algebra
- Proof Techniques
- Counting Principles
- Relations and Functions
- Partial Ordered Sets
- Group Theory
- Graphs and Trees

Introduction

- What it isn’t: continuous
- Discrete: consisting of distinct or unconnected elements
- Countably Infinite
- DefinitionDiscrete Mathematics is a collection of mathematical topics that examine and use finite or countably infinite mathematical objects.

Sets

- Members or Elements: part of the collection
- Roster Method: Description of a set by listing the elements, enclosed with braces
- Examples:
- Vowels = {a,e,i,o,u}
- Primary colors = {red, blue, yellow}
- Membership examples
- “a belongs to the set of Vowels” is written as:

a Vowels

- “j does not belong to the set of Vowels:

j Vowels ver model involves requests and replies.

Sets

- Set-builder method
- A = { x | x S, P(x) } or A = { x S | P(x) }
- A is the set of all elements x of S, such that x satisfies the property P
- Example:
- If X = {2,4,6,8,10}, then in set-builder notation, X can be described as

X = {n Z | n is even and 2 n 10}

Sets

- Standard Symbols which denote sets of numbers
- N : The set of all natural numbers (i.e.,all positive integers)
- Z : The set of all integers
- Z+ : The set of all positive integers
- Z* : The set of all nonzero integers
- E : The set of all even integers
- Q : The set of all rational numbers
- Q+ : R : The set of all real numbers

Sets

- Subsets
- “X is a subset of Y” is written as X Y
- “X is not a subset of Y” is written as X Y
- Example:
- X = {a,e,i,o,u}, Y = {a, i, u} and Z={b,c,d,f,g}

Y X, since every element of Y is an element of X

- Y Z, since a Y, but a Z

Sets

- Superset
- X and Y are sets. If X Y, then “X is contained in Y” or “Y contains X” or Y is a superset of X, written Y X
- Proper Subset
- X and Y are sets. X is a proper subset of Y if X Y and there exists at least one element in Y that is not in X. This is written X Y.
- Example:
- X = {a,e,i,o,u}, Y = {a,e,i,o,u,y}
- X Y , since y Y, but y X

Sets

- Set Equality
- X and Y are sets. They are said to be equal if every element of X is an element of Y and every element of Y is an element of X, i.e. X Y and Y X
- Examples:
- {1,2,3} = {2,3,1}
- X = {red, blue, yellow} and Y = {c | c is a primary color} Therefore, X=Y
- Empty (Null) Set
- A Set is Empty (Null) if it contains no elements.
- The Empty Set is written as
- The Empty Set is a subset of every set

Sets

- Finite and Infinite Sets
- X is a set. If there exists a nonnegative integer n such that X has n elements, then X is called a finite setwith n elements.
- If a set is not finite, then it is an infinite set.
- Examples:
- Y = {1,2,3} is a finite set
- P = {red, blue, yellow} is a finite set
- E , the set of all even integers, is an infinite set
- , the Empty Set, is a finite set with 0 elements

Sets

- Cardinality of Sets
- Let S be a finite set with n distinct elements, where n ≥ 0. Then |S| = n , where the cardinality (number of elements) of S is n
- Example:
- If P = {red, blue, yellow}, then |P| = 3
- Singleton
- A set with only one element is a singleton
- Example:
- H = { 4 }, |H| = 1, H is a singleton

Sets

- Power Set
- For any set X ,the power set of X ,written P(X),is the set of all subsets of X
- Example:
- If X = {red, blue, yellow}, then P(X) = { , {red}, {blue}, {yellow}, {red,blue}, {red, yellow}, {blue, yellow}, {red, blue, yellow} }
- Universal Set
- An arbitrarily chosen, but fixed set

Sets

- Venn Diagrams
- Abstract visualization of a Universal set, U as a rectangle, with all subsets of U shown as circles.
- Shaded portion represents the corresponding set
- Example:
- In Figure 1, Set X, shaded, is a subset of the Universal set, U

Union Of Sets

- Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then
- XUY = {1,2,3,4,5,6,7,8,9

Intersection Of Sets

- Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9},
- then X ∩ Y = {5}

Disjoint sets

- Example: If X = {1,2,3,4,} and Y = {6,7,8,9}, then X ∩ Y =

Difference of Sets

- Example: If X = {a,b,c,d} and Y = {c,d,e,f}, then X – Y = {a,b} and Y – X = {e,f}

Compliment

- Compliment of a Set
- The complement of a set X with respect to a universal set U, denoted by , is defined to be
- = {x |x U, but x X}

- Example: If U = {a,b,c,d,e,f} and X = {c,d,e,f}, then ~X = {a,b}

Sets

- Ordered Pair
- X and Y are sets. If x X and y Y, then an ordered pair is written (x,y)
- Order of elements is important. (x,y) is not necessarily equal to (y,x)
- Cartesian Product
- The Cartesian product of two sets X and Y ,written X × Y ,is the set
- X × Y ={(x,y)|x ∈ X , y ∈ Y}
- For any set X, X × = = × X
- Example:
- X = {a,b}, Y = {c,d}
- X × Y = {(a,c), (a,d), (b,c), (b,d)}
- Y × X = {(c,a), (d,a), (c,b), (d,b)}

Mathematical Logic

- Definition: Methods of reasoning, provides rules and techniques to determine whether an argument is valid
- Theorem: a statement that can be shown to be true (under certain conditions)
- Example: If x is an even integer, then x + 1 is an odd integer
- This statement is true under the condition that x is an integer is true

Mathematical Logic

- A statement, or a proposition, is a declarative sentence that is either true or false, but not both
- Uppercase letters denote propositions
- Examples:
- P: 2 is an even number (true)
- Q: 7 is an even number (false)
- R: A is a vowel (true)
- The following are not propositions:
- P: My cat is beautiful
- Q: My house is big

Mathematical Logic

- Negation
- The negation of p, written ∼p, is the statement obtained by negating statement p
- Truth values of p and ∼p are opposite
- Symbol ~ is called “not” ~p is read as as “not p”
- Example:
- p: A is a consonant
- ~p: it is the case that A is not a consonant

Mathematical Logic

- Conjunction
- Let p and q be statements.The conjunction of p and q, written p ^ q , is the statement formed by joining statements p and q using the word “and”
- The statement p∧q is true if both p and q are true; otherwise p ^ q is false

Mathematical Logic

- Disjunction
- Let p and q be statements. The disjunction of p and q, written p v q , is the statement formed by joining statements p and q using the word “or”
- The statement p v q is true if at least one of the statements p or q is true; otherwise p v q is false
- The symbol v is read “or”

Mathematical Logic

- Implication
- Let p and q be statements.The statement “if p then q” is called an implication or condition.
- The implication “if p then q” is written p q
- p q is read:
- “If p, then q”
- “p is sufficient for q”
- q if p
- q whenever p

Mathematical Logic

- Implication
- Truth Table for Implication:
- p is called the hypothesis, q is called the conclusion

Mathematical Logic

- Implication
- Let p: Today is Sunday and q: I will wash the car. The conjunction p q is the statement:
- p q : If today is Sunday, then I will wash the car
- The converse of this implication is written q p
- If I wash the car, then today is Sunday
- The inverse of this implication is ~p ~q
- If today is not Sunday, then I will not wash the car
- The contrapositive of this implication is ~q ~p
- If I do not wash the car, then today is not Sunday

Mathematical Logic

- Biimplication
- Let p and q be statements. The statement “p if and only if q” is called the biimplication or biconditional of p and q
- The biconditional “p if and only if q” is written p q
- p q is read:
- “p if and only if q”
- “p is necessary and sufficient for q”
- “q if and only if p”
- “q when and only when p”

Mathematical Logic

- Biconditional
- Truth Table for the Biconditional:

Boolean Algebra

- Boolean algebra provides the operations and the rules for working with the set {0, 1}.
- We are going to focus on three operations:
- Boolean complementation,
- Boolean sum, and
- Boolean product

Boolean Algebra

- The complementis denoted by a bar (on the slides, we will use a minus sign). It is defined by
- -0 = 1 and -1 = 0.
- The Boolean sum, denoted by + or by OR, has the following values:
- 1 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, 0 + 0 = 0
- The Boolean product, denoted by or by AND, has the following values:
- 1 1 = 1, 1 0 = 0, 0 1 = 0, 0 0 = 0

Boolean Algebra

- Definition: Let B = {0, 1}. The variable x is called a Boolean variable if it assumes values only from B.
- A function from Bn, the set {(x1, x2, …, xn) |xiB, 1 i n}, to B is called a Boolean function of degree n.
- Boolean functions can be represented using expressions made up from the variables and Boolean operations

Boolean Algebra

- The Boolean expressions in the variables x1, x2, …, xn are defined recursively as follows:
- 0, 1, x1, x2, …, xn are Boolean expressions.
- If E1 and E2 are Boolean expressions, then (-E1), (E1.E2), and (E1 + E2) are Boolean expressions.
- Each Boolean expression represents a Boolean function. The values of this function are obtained by substituting 0 and 1 for the variables in the expression.

Boolean Functions and Expressions

- For example, we can create Boolean expression in the variables x, y, and z using the “building blocks”0, 1, x, y, and z, and the construction rules:
- Since x and y are Boolean expressions, so is xy.
- Since z is a Boolean expression, so is (-z).
- Since xy and (-z) are expressions, so is xy + (-z).

Boolean Functions and Expressions

- Example: Give a Boolean expression for the Boolean function F(x, y) as defined by the following table:

Possible solution: F(x, y) = (-x)y

Basic Identities of Boolean Algebra

- x + 0 = x
- x · 0 = 0
- x + 1 = 1
- x · 1 = 1

(5) x + x = x

(6) x · x = x

(7) x + x’ = x

(8) x · x’ = 0

(9) x + y = y + x

(10) xy = yx

Duality

Duality Principle – every valid Boolean expression (equality) remains valid if the operators and identity elements are interchanged, as follows:

- + .
- 1 0

Example: Given the expression

- a + (b.c) = (a+b).(a+c)
- then its dual expression is
- a . (b+c) = (a.b) + (a.c)

Standard Forms

Certain types of Boolean expressions lead to gating networks which are desirable from implementation viewpoint.

Two Standard Forms:

Sum-of-Products and Product-of-Sums

Literals: a variable on its own or in its complemented form. Examples: x, x' , y, y'

Product Term: a single literal or a logical product (AND) of several literals.

- Examples: x, x.y.z', A'.B, A.B, e.g'.w.v

Standard Forms

Sum Term: a single literal or a logical sum (OR) of several literals.

- Examples: x, x+y+z', A'+B, A+B, c+d+h'+j

Sum-of-Products (SOP) Expression: a product term or a logical sum (OR) of several product terms.

- Examples: x, x+y.z', x.y'+x'.y.z, A.B+A'.B', A + B'.C + A.C' + C.D

Product-of-Sums (POS) Expression: a sum term or a logical product (AND) of several sum terms.

- Examples: x, x.(y+z'), (x+y').(x'+y+z), (A+B).(A'+B'), (A+B+C).D'.(B'+D+E')

Proof Techniques

- Learn various proof techniques
- Direct
- Indirect
- Contradiction
- Induction

Proof Techniques

- Theorem
- Statement that can be shown to be true (under certain conditions)
- Typically Stated in one of three ways
- As Facts
- As Implications
- As Biimplications

Proof Techniques

- Direct Proof or Proof by Direct Method
- Proof of those theorems that can be expressed in the form ∀x (P(x) → Q(x)), D is the domain of discourse
- Select a particular, but arbitrarily chosen, member a of the domain D
- Show that the statement P(a) → Q(a) is true. (Assume that P(a) is true
- Show that Q(a) is true
- By the rule of Choose Method (Universal Generalization),

∀x (P(x) → Q(x)) is true

Proof Techniques

- Indirect Proof
- The implication P → Q is equivalent to the implication ( Q → P)
- Therefore, in order to show that P → Q is true, one can also show that the implication ( Q → P) is true
- To show that ( Q → P) is true, assume that the negation of Q is true and prove that the negation of P is true

Proof Techniques

- Proof by Contradiction
- Assume that the conclusion is not true and then arrive at a contradiction
- Example: Prove that there are infinitely many prime numbers
- Proof:
- Assume there are not infinitely many prime numbers, therefore they are listable, i.e. p1,p2,…,pn
- Consider the number q = p1p2…pn+1. q is not divisible by any of the listed primes
- Therefore, q is a prime. However, it was not listed.
- Contradiction! Therefore, there are infinitely many primes.

Proof Techniques

- Proof of Biimplications
- To prove a theorem of the form ∀x (P(x) ↔ Q(x )), where D is the domain of the discourse, consider an arbitrary but fixed element a from D. For this a, prove that the biimplication P(a) ↔ Q(a) is true
- The biimplication P↔ Q is equivalent to (P→ Q) ∧ (Q → P)
- Prove that the implications P→ Q and Q → Pare true
- Assume that Pis true and show that Q is true
- Assume that Q is true and show that Pis true

Proof Techniques

- Proof of Equivalent Statements
- Consider the theorem that says that statements P,Q and r are equivalent
- Show that P → Q, Q → R and R → P
- Assume P and prove Q. Then assume Q and prove R Finally, assume R and prove P
- What other methods are possible?

Mathematical Induction

- Assume that when a domino is knocked over, the next domino is knocked over by it
- Show that if the first domino is knocked over, then all the dominoes will be knocked over

Mathematical Induction

- Let P(n) denote the statement that then nth domino is knocked over
- Base Step: Show that P(1) is true
- Inductive Hypothesis: Assume some P(i) is true, i.e. the ith domino is knocked over for some
- Inductive Step: Prove that P(i+1) is true, i.e.

Relation

Let A and B be sets. A binary relation or simply relation from A to B is a subset of A X B

Suppose R is a relation from A to B. Then R is a set of ordered pairs where each first element comes from A and each second element comes from B.That is ,for each pair a A and b B exactly one of the following is true

(a,b) R: a is R-related to b

(a,b) ∉ R : a is not R-related to b.

Domain And Range Of A Relation

Let R be a Relation from A to B

DOMAIN:- Set of all first co-ordinates of the members of the relation set R.

Domain R={x : (x , y) R}

RANGE:- Set of all second co-ordinates of the members of relation set R.

Range R={y : (x, y) R}

Total Number Of Relations

Let A and B be two non-empty sets consisting m and n elements respectively.

Then A X B has mn ordered pair.

Total no of subset of AX B is 2mn

Since each subset of A X B defines a relation so total no of relation from A to B is 2mn

Inverse Relation

Let R be any relation from set A to set B .The inverse of R, denoted by R-1, is the relation from B to A which consist of those ordered pairs which when reversed belong to R : that is

R-1= {(b,a): (a,b) R }

DOMAIN (R-1)= RANGE (R)

RANGE (R-1)= DOMAIN (R)

Is R is any relation then (R-1) –1 is equal to R

Composition Of Relation

Let A ,B and C be sets and Let R be a relation from A to B and S be a relation from B to C. That is R is a subset of AXB and S is a subset of BXC. Then R and S give rise to a relation from A to C denoted by RoS and defined by

RoS = {(a,c): there exists b B for which (a,b) R and (b,c) S}

This relation is called composition of R and S. Sometime denoted by RS also.

Suppose R is a relation from a set A to itself then R • R the composition of R with itself is defined by R2 .

In layman terms

A function is nothing but a relationship between two sets.It maps element of one set to another set on the basis of some logical relation.

But in terms of mathematics

A binary relation R from A to B is said to be a function, if for every element a in A, there is a unique element b in B so that (a, b) is in R.

We use the notation R(a)=b, where b is called the image of a.

Diagrammatic Representation Of Function

A={2,3,4,5} and B={4,9,16,25}

f : A--->B

f(x) = x^2

2

3

4

5

4

16

9

25

- There may be some element of set B which are not associated to any element of Set A but each element of set A must be associated to only one element of set B . For each a A, (a,b) f, for some b B
- 2) Two or more element of set A may be associated to same element of set B but association of one element of A to more then one element in B is not possible
- if (a,b) f and (a,b’) f then b=b’

Domain Co-domain And Range

Suppose f be a function from A to B

Domain:- A is called the domain of the function f.

CO-Domain:- B is called the co-domain of function.

Range:- it consist of all those elements in B which appear as image of at least one element in A.

Type Of Functions

One-to-one function (injection):- if different elements of A have different images in B. For f:-AB f(a) # f(b) for all a,b A

Many-to-one function:- if two or more elements of Set A has same images in B.For f:-AB there exists x,y A such that x # y but f(x)=f(y).

Onto function (Surjection):-if every element of B is the image of some element of A. In this case range of f is co-domain of f.

Into function:-if there exists an element in B which is not the image of any element of A.

Bijection (one-to-one onto function):-if function is one-to-one as well as onto then it is bijection.

Inverse Image Of An Element

Let f : XY then inverse image of an element b Y under f is denoted by ƒ–1 (b) to be read as f-image b and

ƒ–1 (b)={x:x X and f(x)=b}

INVERSE IMAGE OF A SUBSET

Let f : XY and B be a subset of Y means B Y then the inverse of B under f is given by

ƒ–1 (b)= { x:x X and f(x) b}

Poset

- Suppose R is a relation on set S which satisfy the following properties

(Reflexive) for any a S we have aRa

(Antisymmetric) if aRb and bRa then a=b

(Transitive) if aRb and bRc then aRc.

Then this relation R is called partial order relation and the set S is called partially ordered set or POSET. A partial order relation is usually denoted by the symbol ≤

- Means (S , ≤ ) is a partially ordered set.

Comparable elements

- Two elements x, y in a partially ordered set (A, ≤ ) are said to be comparable if either x ≤ y or y ≤ x
- Uncomparable elements
- Two elements x, y in a partially ordered set (A, ≤ ) are said to be uncomparable if x ≤ y or y ≤ x both do not hold
- Ex in the poset (z+ , /) are the integers 3 and 9 comparable? Are 5 and 7 comparable
- Yes 3 and 9 are comparable but 5 and 7 and 7 and 5 are not

- If (S , ≤ ) is a poset and every two element of a set are comparable then S Is called totally ordered set or linearly ordered set.Totally ordered set is also known as chain.
- Ex the poset (Z , ≤) is a totally ordered set

Sum Rule principle

- Sum Rule Principle: Suppose an event E can occur in n1 ways and a second event F can occur in n2 ways and if both event can not occur simultaneously . Then E or F can occur in n1+n2 ways.
- General Format: suppose an event E1 can occur in n1 ways , a second event E2 can occur in n2 ways , a third event E3 can occur in n3 ways ….. And suppose no two of the event can occur at the same time. Then one of the event can occur in n1+n2+n3…. Ways.
- Ex:- suppose there are 8 male professor and 5 female professor teaching a calculus class. A student can choose a calculus professor in 8+5 =13 ways.
- Ex:- Suppose E is the event of choosing a prime no les then 10, and suppose F is the event of choosing an even number less then 10 . By how many ways E or F can occur.

Product Rule Principle

- If an event E can occur in m ways and, independent of this event there is a second event F which can occur in n ways . Then combination of E and F can occur in m. n ways. (the product rule applies when a procedure is made up of separate task).
- General Format
- Suppose an Event E1 can occur in n1 ways and following E1 event E2 can occur in n2 ways and following E2 a third event E3 can occur in n3 ways and so on. Then all the event can occur in n1.n2.n3….ways
- OR
- Suppose that a procedure can be broken in to a sequence of two tasks . If there are n1 ways to do the first task and n2 ways to do the second task after the first task has been done then there are n1n2 ways to do the procedure.
- Ex Suppose a license plate contain two letters followed by three digit with the first digit not zero . How many diff license plates can be printed.

- Suppose there are 5 different optional papers to select in third semester and 4 different optional papers to select in 4th semester by the MCA students.
- By product rule:- there will be 5*4 choices for students who want to select one paper in third semester and one in 4th semester.
- By sum rule:- student will have 5+4 choices to select only one paper

Algebraic System

If there exists a system such that it consist of a non-empty set and one or more operations on that set, then that system is called an algebraic system. It is generally denoted by (A, o1,o2,……..on) Where A is a non-empty set and o1,o2,……..on are operations on A.

An algebraic system is also called an algebraic structure because the operations on the set A define a structure on the elements of A.

Ex. (N,+), (Q,-), (R.+) etc..

all are the example of algebraic system or structure

Operations On Set

Operations are functions which are use to assign a unique element to any given pair of elements.

EX. A+B=C A∩B=C A * B=C

Binary OperationLet S be a nonempty set .An operation on S is a function from S X S into S and it will be written by a*b or sometimes ab

In this case the algebraic system is denoted by (S,*)

Unary Operation A function from S into S is called unary operation. For example, the absolute value |n| of an integer n is a unary operation on Z.

Ternary Operation A function from S X S X S into S is called ternary operation

N-ary OperationA function from S X S X S…..X S (up to n factors) in to S is called n-ary operation.

Closed Operation

Suppose we have a non-empty set A.

A function from A X A in to A is said to be a binary operation that is closed if a and b belongs to A then a * b must also belongs to A.

Ex. Let A and B denote, respectively the set of even and odd positive integers. Then A is closed under addition and multiplication since the sum and product of any even numbers are even. But, B is closed under multiplication only not for addition because sum of two odd numbers can be even also 3+5=8

Closed Operation

Example. Addition(+) and multiplication (*) are closed operation on N. However subtraction(-) and division(/) are not operations on N. 2-9 and 7/3 are not positive integers.

Example: Let S = {0, 1, -1}. Then addition + is not an operation on S since the sum 1+1 is not an element of S. On the other hand, multiplication is an operation on S.

Properties Of Operation

Suppose I is a set of integers. consider the algebraic system (I,+,*) where + and * are the operation of addition and multiplication on I.

1) Associative

For any a, b, c I

(a + b ) + c = a + (b + c)

(a * b ) * c = a * (b * c)

2) Commutative

For any a, b I

a + b = b + a

a * b = b * a

3) Identity Element

For 0, a I, a + 0 = 0 + a =a (0 is the identity element for + )

For 1, a I , a * 1=1 * a =a (1 is the identity element for s * )

For each a I there exists an element in I denoted by –a and called inverse of a

a + (-a)=0

5) Distributive

For any a, b, c I

a * (b + c)=(a * b) + (a * C)

6) Cancellation Property

For any a, b, c I and a # 0

a * b=a * c b=c

Inverse Element

Suppose (A,*) be an algebraic system with an identity e and a be an element in A. An element b is said to be a left inverse of a if

b * a = e

An element b is said to be a right inverse of a if

a * b = e

An element b which is both a left and right inverse of a is called an inverse of a and is said to be invertible or regular.

Properties Of Inverse Element

1)The inverse of the identity element e is e

e * e = e, e-1= e

2) The inverse of the inverse of any element is the element itself.

(a-1)-1 = a

Groups

- For a nonempty set G, a Group (G,*) is an algebraic system in which the binary operation * on G satisfies the below four conditions—
- Operation * must be closed.
- For all x, y, z G
- X * (Y * Z) = (X * Y) * Z (ASSOCIATIVITY)
- There exists an element e G such that for any x g
- X * e = e * X = X (IDENTITY)
- 4) For every x G there exists an element denoted by x-1 G such that
- X-1 * X = X * X-1 = e (INVERSE)
- Ex. For algebraic system (I, +) where I is the set of all integers and + is the ordinary addition operation of integers, (I,+) is a group with 0 being the identity and the inverse of n being –n.

Abelian Group

A group (A,*) is called commutative or abelian group if * is a commutative operation.

means a * b= b * a for all a, b G

Ex. Group (I,+) is a example of abelian group.

Finite And Infinite Group

- If a group contains a finite number of distinct elements then it is called finite group
- If a group contains an infinite no of elements then it is called infinite group.
- The no of elements in a finite group is called order of group
- An infinite group is said to be of infinite order.

What is a Graph?

- Informally a graph is a set of nodes joined by a set of lines or arrows.
- A graph, written as G= {V,E} consists of two components.

1

2

3

1

3

2

4

4

5

6

5

6

The finite set of vertices V , also called points or nodes

The finite set of (directed/undirected) edges E also called lines or arcs connecting pair of vertices.

GraphAn undirected graph G = ( V, E ) , but unlike a digraph the edge set E consist of unordered pairs. We use the notation (a,b ) to refer to a directed edge, and { a, b } for an undirected edge.

V = { A, B, C, D, E, F } |V | = 6

A

B

C

E = { {A, B}, {A,E}, {B,E}, {C,F} }

|E | = 4

D

F

E

Some texts use (a, b) also for undirected edges. So ( a, b ) and ( b, a ) refers to the same edge.

DiagraphA directed graph (or digraph) G = (V,E ) consists of a non-empty set V of vertices (or nodes) and a set E of edges with E V V. The edge (a,b) is also denoted by a b and a is called the sourceof the edge while b is called the target of the edge.

3

V = { 3, 6 }| V | = 2

E = { (6,3) }| E | = 1

6

Degree of a Vertex

- Degree of a Vertex in an undirected graph is the number of edges incident on it.
- Degree is denoted by deg(v).
- In a directed graph , the out degree of a vertex is the number of edges leaving it and the in degree is the number of edges entering it.
- A vertex of degree zero is called isolated vertex
- A vertex with degree one only is called pendant vertex.

Degree of a Vertex

The degree of B is 2.

A

B

C

Self-loop

D

F

E

The in degree of 2 is 2 andthe out degree of 2 is 3.

1

2

4

5

Type Of Graphs

Simple Graph :- A simple graph G=(V,E) consists of V, a nonempty set of vertices and E, a set of unordered pair of distinct elements of V called edges. it has no self loop and parallel edges.

Multi Graph :-If in a directed or undirected graph there exists a certain pair of nodes that are joined by more then one edges such edges are called multiple edges or parallel edges and such graphs are called multigraph.

Graph Terminology

Adjacent vertex:- Two vertices are said to be adjacent if they are join by an edge.

If e={u,v} the edge e is called incident with the vertices u and v . The vertices u and v are called endpoints of the edge {u,v}

Loop:- An edge that is incident from and in to the same vertex is called loop.

Path And Circuit

- A path is a walk through sequence ,V0,V1,V2….Vn of vertice ,each adjacent to the next ,without any repetition of vertices.if there exists a pth V0 to Vn in an undirected graph, then there always exists a path from Vn to V0 too. But in directed graph it is not necessary.number of edges in a path is called length of the path.
- A circuit is a closed walk in which the terminal vertex coincides with the initial vertex and it contains no repeated edges.
- Simple circuit:- A circuit is said to be simple if it does not include the same edge twice.
- Elementary Circuit:- if it does not meet the same vertex twice.

Trees

- A tree is a collection of nodes
- The collection can be empty
- (recursive definition) If not empty, a tree consists of a distinguished node r (the root), and zero or more nonempty subtrees T1, T2, ...., Tk, each of whose roots are connected by a directed edge from r

Path And Circuit

- Child and parent
- Every node except the root has one parent
- A node can have an arbitrary number of children
- Leaves
- Nodes with no children
- Sibling
- nodes with same parent

Trees

- Length
- number of edges on the path
- Depth of a node
- length of the unique path from the root to that node
- The depth of a tree is equal to the depth of the deepest leaf
- Height of a node
- length of the longest path from that node to a leaf
- all leaves are at height 0
- The height of a tree is equal to the height of the root

Download Presentation

Connecting to Server..