Sie sind auf Seite 1von 103

UNIT-I

Mathematical Logic

1
Logic Operators

 :: NOT ~p is true if p is false

 :: AND  :: OR


P Q P Q P Q P Q
T T T T T T
T F F T F T
F T F F T T
F F F F F F

2
Compound Statement

p = “it is hot” q = “it is sunny”

It is hot and sunny

It is not hot but sunny

It is neither hot nor sunny

3
Exclusive-Or

coffee “or” tea  exclusive-or


How to construct a compound statement for exclusive-or?

Idea 1: Look at the true rows


p q pq
T T F Want the formula to be true
exactly when the input belongs
T F T
to a “true” row.
F T T
F F F
The input is the second row exactly if this sub-formula is satisfied

And the formula is true exactly when the input is the second row or the third 4row.
Exclusive-Or

coffee “or” tea  exclusive-or


How to construct a compound statement for exclusive-or?

Idea 2: Look at the false rows


p q pq
T T F Want the formula to be true
exactly when the input does
T F T
not belong to a “false” row.
F T T
F F F
The input is the first row exactly if this sub-formula is satisfied

And the formula is true exactly when the input is not in the 1st row and the 4th5row.
Logical Equivalence

Idea 3: Guess and check

p q
T T F T F F
T F T T T T
F T T T T T
F F F F T F

Logical equivalence: Two statements have the same truth table

As you see, there are many different ways to write the same logical formula.
One can always use a truth table to check whether two statements are equivalent.
6
Writing Logical Formula for a Truth Table

Digital logic:

Given a digital circuit, we can construct the truth table.

Now, suppose we are given only the truth table (i.e. the specification),
how can we construct a circuit (i.e. formula) that has the same function?

7
Writing Logical Formula for a Truth Table

Use idea 1 or idea 2. Idea 1: Look at the true rows


and take the “or”.

p q r output
T T T F
T T F T
T F T T
T F F F
F T T T
F T F T
F F T T
F F F F

The formula is true exactly when the input is one of the true rows. 8
Writing Logical Formula for a Truth Table

Idea 2: Look at the false rows,


negate and take the “and”.

p q r output
T T T F
T T F T
T F T T
T F F F
F T T T
F T F T
F F T T
F F F F

The formula is true exactly when the input is not one of the false row. 9
DeMorgan’s Laws

Logical equivalence: Two statements have the same truth table

De Morgan’s Law

Statement: Tom is in the football team and the basketball team.


Negation: Tom is not in the football team or not in the basketball team.

De Morgan’s Law

Statement: The number 783477841 is divisible by 7 or 11.


Negation: The number 783477841 is not divisible by 7 and not divisible by 11.

10
DeMorgan’s Laws

Logical equivalence: Two statements have the same truth table

De Morgan’s Law

T T F F
T F T T
F T T T
F F T T

De Morgan’s Law
11
Simplifying Statement

DeMorgan

Distributive

12
Tautology, Contradiction
A tautology is a statement that is always true.

A contradiction is a statement that is always false. (negation of a tautology)

In general it is “difficult” to tell whether a statement is a contradiction.


It is one of the most important problems in CS – the satisfiability problem.
13
Evaluating Deductive Arguments

14
Quantification: ‘All’ and ‘Some’
• In predicate logic, there are two
quantifiers: ‘all’ and ‘some’.
• Here are some examples:
– x Mortal(x) ‘All things are mortal’
– x Mortal(x) ‘Some things are mortal’
– x (Human(x)  Mortal(x)) ‘Every human
is mortal’
– x (Human(x)  Mortal(x)) ‘Some human
is not mortal’
15
UNIT-II
Sets ,Relations &Functions

16
Foundations : Types of Relations

reflexive
∀a∈S.aRa

transitive
∀ a, b, c ∈ S. a R b /\ b R c  a R c

symmetric
∀ a, b ∈ S . a R b  b R a

anti-symmetric
∀ a, b ∈ S . a R b /\ b R a  a = b 17
Foundations : Anti-Symmetry

anti-symmetric
∀ a, b ∈ S . a R b /\ b R a  a =
b

Anti-symmetry is slightly weird.

Essentially:
“If you start at X and only follow R to new
elements, you will never get back to X.”
18
Foundations : Posets

partially ordered set (poset)


defined by set S and partial order ·

Example: (2{x, y, z}, ⊆)

19
Foundations : Posets

partially ordered set (poset)


defined by set S and partial order ·

Examples:
(2S, ⊆)
(Z, <)
(Z, divides)

20
Foundations : Least Upper Bounds

Assume poset (S, ⊑)

least upper bound (lub) of a and b is c where


a⊑c
Upper
b⊑c
∀ d . (a ⊑ d /\ b ⊑ d)  c ⊑ d Least

21
Foundations : Greatest Lower Bounds

Assume poset (S, ⊑)

greatest lower bound (glb) of a and b is c


where
c⊑a Lower
c⊑b
Greatest
∀ d . (d ⊑ a /\ d ⊑ b)  d ⊑ c

22
Foundations : Bounds

Assume poset (S, ⊑)

Essentially:
lub(a, b) = smallest thing bigger than a and
b
glb(a, b) = biggest thing smaller than a and
b

Question: Do lub and glb always exist? 23


Foundations : Bounds

Assume poset (S, ⊑)

Essentially:
lub(a, b) = smallest thing bigger than a and
b
glb(a, b) = biggest thing smaller than a and
b

Question: Do lub and glb always exist?


24
Answer: No!
Foundations : Bounds

Question: Do lub and glb always exist?


Answer: No!

glb( , ) = ???
25
Foundations : Lattices

A lattice is (S, ⊑, ⊥, ⊤, ⊔, ⊓) where:


(S, ⊑) is a poset
⊥ is the smallest thing in S
⊤ is the biggest thing in S
lub(a, b) and glb(a, b) always exist
a ⊔ b = lub(a, b)
a ⊓ b = glb(a, b)
26
Foundations : Lattices (Formally)

A lattice is (S, ⊑, ⊥, ⊤, ⊔, ⊓) where:


(S, ⊑) is a poset
∀a∈S.⊥⊑a
∀a∈S.a⊑⊤

∀ a, b ∈ S . ∃ c . c = lub(a, b) /\ a ⊔ b = c

∀ a, b ∈ S . ∃ c . c = glb(a, b) /\ a ⊓ b = c

27
Foundations : Fancy Lattice Names

⊥ is “botom”

⊤ is “top”

⊔ is “join”

⊓ is “meet”
28
Examples of lattices
• Powerset lattice

29
Examples of lattices
• Powerset lattice

30
Sets
A set is an unordered collection of objects.
Order and repetition
Examples: don’t matter

= {6, 7, 1, 2, 9}
{ 1, 6, 7, 2, 9 }
= {a, a, d, d, e, e, 1, 2, 3}
{ a, d, e, 1, 2, 3}
The empty set, or the set containing no
elements.
 = {} Note:   {}

Singleton is a set S that contains exactly one element


31
Cartesian Product
The Cartesian Product of two sets A and B is:
A x B = { (a, b) | a  A  b  B}

Example:
A= {a, b}, B= {1, 2}
A  B = {(a,1), (a,2), (b,1), (b,2)}
B  A = {(1,a), (1,b), (2,a), (2,b)}
Not commutative!
In general,
A1 x A2 x … x An = {(a1, a2,…, an) | a1  A1, a2  A2, …, an
 An}
32
|A1 x A2 x … x An| = |A1| x |A2| x … x |An|
Tree diagrams for the Cartesian product

33
Set Theory :
Inclusion/Exclusion
• What is the cardinality of A  B ?
twice

A AB B

Once

|AB| = |A| + |B| - |A  B|


34
Set Identities
• Absorption:
– A  (A  B) = A
– A  (A  B) = A

• Complement:
– A  A¯ = U
– A  A¯ = 

• Distributive:
– A  (B  C) = (A  B)  (A  C)
– A  (B  C) = (A  B)  (A  C)

35
Boolean Identities
Double complement: Associative laws:
x=x x + (y + z) = (x + y) + z
Idempotent laws: x · (y · z) = (x · y) · z
x + x = x, x·x=x Distributive laws:
Identity laws: x + y ·z = (x + y)·(x + z)
x + 0 = x, x·1=x x · (y + z) = x ·y + x ·z
Domination laws: De Morgan’s laws:
x + 1 = 1, x·0=0 (x · y) = x + y, (x + y) = x · y
Commutative laws: Absorption laws:
x + y = y + x, x · y = y · x x + x ·y = x, x · (x + y) = x

the Unit Property: x + x = 1 and Zero Property: x ·x = 0


36
UNIT-III
Permutations & combinations

37
Permutation
• Set of objects in an ordered arrangement
• ordered arrangement of r members of a
set is r-permutation
• number of r-permutations of a set with n
elements is denoted P(n,r)

38
Number of r-permutations in a
set
• P(n,r) can be found using the product rule:
P(n,r) = n(n-1)(n-2)* … *(n-r+1)
• This is true because the first element of a
permutation can be chosen any one of n
ways; for the second element, there are n-
1 ways to choose; for the third, n-2, etc.
until there are exactly (n-r+1) ways to
choose the rth element

39
Example
• There are 8 runners in a race. The winner
gets a gold medal, the second place
finisher gets a silver, and third place
finisher a bronze. How many different
ways are there to award medals, if all
possible outcomes of the race are equally
likely?

40
Example 1
• There are 3 medals to be awarded, and 8
contenders for a medal
• So the number of ways to award a medal
is the number of 3-permutations on a set
of 8 elements
• P(8,3) = 8*7*6 = 336 ways to award
medals

41
Combinations
• An r-combination of elements of a set is an
unordered selection of r elements from the
set - so an r-combination is a subset with r
elements
• The number of r-combinations in a set of n
distinct elements is denoted by C(n,r) or
(nr)
• C(n,r) = n!/(r!(n-r)!)
• if r<=n, C(n,r) = C(n,n-r)
42
Permutations: Examples
• Example: A news program n!
has time to present 2 of four n Pr 
available news stories. How (n  r )!
many ways can the evening
4!
n P2 
news be set up?
(4  2)!
4 * 3 * 2 *1
4 P2 
Checking the process:
If we let A, B, C, D represent the four
shows, then the possible show
2 *1
orders would be:
AB BA CA DA 24
4 P2   12
AC BC CB DB
AD BD CD DC
2
Twelve (12) possible presentations
43
where order matters.
Combinations: Examples
• Example: A news program has time to
n!
n Cr 
present 2 of four available news stories.
How many different sets of stories (n  r )! r!
can be presented on the evening news?
Checking the process:
If we let A, B, C, D represent the four
shows, then the possible show orders
would be:
AB BA CA DA
AC BC CB DB
4 * 3 * 2 *1
n C2 
AD BD CD DC
However, AB and BA represent the
presentation of the same two stories.
If order does not matter, one of these
2 *1* 2 *1
two may be deleted. Repeating the
process results in: AB, AC, AD, BC,
BD, CD,

Six (6) different presentations where order


does not matter.

44
Example
• Suppose there are 12 students in a
discrete math class, of whom 4 are taking
CS2. How many possible combinations of
4 students are there?
• C(12,4) = 12!/(8!4!) = 495

45
Example
• In how many ways can a set of 5 letters be
chosen from the English alphabet?
• C(26,5) = 26!/(21!5!) = 65780

46
Binomial Coefficients
• A number of the form (nr) is called a
binomial coefficient because the numbers
occur as coefficients in the expansion of
powers of binomial expressions (e.g.
(a+b)n)
• Properties of binomial coefficients include
Pascal’s Identity: Let n & k be positive
integers with n  k. Then C(n+1,k) =
C(n,k+1) + C(n,k)
47
Pascal’s Triangle
• Can arrange binomial coefficients in a
triangle based on Pascal’s identity
• The nth row of the triangle consists of
coefficients (nk), k=0, 1, … , n
• When 2 adjacent binomial coefficients are
added, the value in the next row between
them is produced

48
Pascal’s Triangle

(00)
(10)(11) Consider (21) + (22) = (32)
(20)(21)(22) derived from n=2, k=2
C(3,2) = C(2,1) + C(2,2)
(30)(31)(32)(33)

49
Binomial Theorem
• Binomial expression: an expression with 2
terms, e.g. x and y
• The binomial theorem gives the
coefficients of the expansion of powers of
binomial expressions, e.g. (x+y)n

50
Binomial Theorem
• For example, the expansion of (x+y)4 can
be found using combinatorial reasoning
instead of multiplying out the terms
(x+y)4 = (x+y) (x+y) (x+y) (x+y)
• All products of a term in each of the sums
are added; terms of the form x4, x3y, x2y2,
xy3 and y4 arise

51
Binomial Theorem

• To get x4, you must choose x from each sum; there


is one way to do this, so the coefficient is 1
• To get x3y, you must choose x from 3 sums and y
from one; the number of these is the number of 3-
combinations in 4 objects, or C(4,3)
• By similar reasoning, the number of x2y2 terms is
C(4,2), number of xy3 terms is C(4,3) and the
number of y4 terms is 1
• So (x+y)4 = x4+4x3y+6x2y2+4xy3+y4

52
Binomial Theorem
• Stated generally, the binomial theorem
holds:
(x+y)n = C(n,j)xn-jyj
= (n0)xn+(n1)xn-1y+(n2)xn-2y2+…+(nn-1) xyn-1+(nn)yn

53
Proof of Binomial Theorem
• The terms in the expanded product are of
the form xn-jyj for j = 0,1,2, … ,n
• To count the number of terms of this form,
it is necessary to choose n-j x’s from the n
sums (the other j terms are y’s)
• So the coefficient of xn-jyj = C(n,n-j) =
C(n,j) as the theorem states

54
Example

• What is the expansion of (x+y)7?


(x+y)7 = C(7,0)x7 + C(7,1)x6y + C(7,2)x5y2 +
C(7,3)x4y3 + C(7,4)x3y4 + C(7,5)x2y5 +
C(7,6)xy6 + C(7,7)y7 =
x7+7x6y+21x5y2+35x4y3+35x3y4+21x2y5+7xy6+
y7

55
Examples
• What is the coefficient of x7y6 in (x+y)13?
• C(13,7) = 13!/(7!6!) =
6,227,020,800/5040*720 = 1716
• What is the coefficient of x5y8 in (x+y)13?
• C(13,5) = 13!/(5!8!) = 1287

56
Example
• What is the coefficient of x10y9 in (2x-
3y)19?
• (2x-3y)19 = C(19,j)(2x)19-j(-3y)j
• So coefficient of x10y9 = C(19,10)(2)10(-3)9
= -(19!/(10!9!))21039

57
UNIT-IV
Recurrence Relations

58
Recurrence Relations
A recurrence relation for the sequence {an} is an
equation that expresses an is terms of one or more
of the previous terms of the sequence, namely, a0,
a1, …, an-1, for all integers n with
n  n0, where n0 is a nonnegative integer.

A sequence is called a solution of a recurrence


relation if it terms satisfy the recurrence relation.

59
Recurrence Relations

In other words, a recurrence relation is like a


recursively defined sequence, but without
specifying any initial values (initial conditions).

Therefore, the same recurrence relation can have


(and usually has) multiple solutions.

If both the initial conditions and the recurrence


relation are specified, then the sequence is uniquely
determined.

60
Recurrence Relations
Example:
Consider the recurrence relation
an = 2an-1 – an-2 for n = 2, 3, 4, …

Is the sequence {an} with an=3n a solution of this


recurrence relation?
For n  2 we see that
2an-1 – an-2 = 2(3(n – 1)) – 3(n – 2) = 3n = an.
Therefore, {an} with an=3n is a solution of the
recurrence relation.

61
Modeling with Recurrence Relations
Example:
Someone deposits $10,000 in a savings account at
a bank yielding 5% per year with interest
compounded annually. How much money will be in
the account after 30 years?
Solution:
Let Pn denote the amount in the account after n
years.
How can we determine Pn on the basis of Pn-1?

62
Modeling with Recurrence Relations
We can derive the following recurrence relation:
Pn = Pn-1 + 0.05Pn-1 = 1.05Pn-1.
The initial condition is P0 = 10,000.
Then we have:
P1 = 1.05P0
P2 = 1.05P1 = (1.05)2P0
P3 = 1.05P2 = (1.05)3P0

Pn = 1.05Pn-1 = (1.05)nP0

We now have a formula to calculate Pn for any


natural number n and can avoid the iteration.
63
Modeling with Recurrence Relations

Let us use this formula to find P30 under the


initial condition P0 = 10,000:

P30 = (1.05)3010,000 = 43,219.42

After 30 years, the account contains $43,219.42.

64
Modeling with Recurrence Relations
Another example:
Let an denote the number of bit strings of length n
that do not have two consecutive 0s (“valid strings”).
Find a recurrence relation and give initial conditions
for the sequence {an}.

Solution:
Idea: The number of valid strings equals the number
of valid strings ending with a 0 plus the number of
valid strings ending with a 1.

65
Modeling with Recurrence Relations

So there are an-2 valid strings of length n that end


with a 0 (all valid strings of length (n – 2) with 10
appended to them).

number of valid strings is the number of valid strings


ending with a 0 plus the number of valid strings
ending with a 1.

That gives us the following recurrence relation:


an = an-1 + an-2

66
Modeling with Recurrence Relations
What are the initial conditions?
a1 = 2 (0 and 1)
a2 = 3 (01, 10, and 11)
a3 = a 2 + a 1 = 3 + 2 = 5
a4 = a 3 + a 2 = 5 + 3 = 8
a5 = a4 + a3 = 8 + 5 = 13

This sequence satisfies the same recurrence relation
as the Fibonacci sequence.
Since a1 = f3 and a2 = f4, we have an = fn+2.
67
Solving Recurrence Relations
Linear homogeneous recurrence relation of degree k
with constant coefficients is a recurrence relation of
the form:
an = c1an-1 + c2an-2 + … + ckan-k,
Where c1, c2, …, ck are real numbers, and ck  0.

A sequence satisfying such a recurrence relation is


uniquely determined by the recurrence relation and
the k initial conditions
a0 = C0, a1 = C1, a2 = C2, …, ak-1 = Ck-1.

68
Solving Recurrence Relations
Examples:
The recurrence relation Pn = (1.05)Pn-1
is a linear homogeneous recurrence relation of
degree one.
The recurrence relation fn = fn-1 + fn-2
is a linear homogeneous recurrence relation of
degree two.
The recurrence relation an = an-5
is a linear homogeneous recurrence relation of
degree five.

69
Solving Recurrence Relations
To find solutions of the form an = rn, where r is a
constant.
an = rn is a solution of the recurrence relation
an = c1an-1 + c2an-2 + … + ckan-k if and only if
rn = c1rn-1 + c2rn-2 + … + ckrn-k.
Divide this equation by rn-k and subtract the right-
hand side from the left:
rk - c1rk-1 - c2rk-2 - … - ck-1r - ck = 0
This is called the characteristic equation of the
recurrence relation.

70
Solving Recurrence Relations
solutions of this equation are called the characteristic
roots of the recurrence relation.
linear homogeneous recurrence relations of degree
two.

71
Solving Recurrence Relations

Example: What is the solution of the recurrence


relation an = an-1 + 2an-2 with a0 = 2 and a1 = 7 ?

Solution: The characteristic equation of the


recurrence relation is r2 – r – 2 = 0.
Its roots are r = 2 and r = -1.
Hence, the sequence {an} is a solution to the
recurrence relation if and only if:
an = 12n + 2(-1)n for some constants 1 and 2.

72
Solving Recurrence Relations
Given the equation an = 12n + 2(-1)n and the initial
conditions a0 = 2 and a1 = 7, it follows that
a0 = 2 = 1 + 2
a1 = 7 = 12 + 2 (-1)

Solving these two equations gives us


1 = 3 and 2 = -1.

Therefore, the solution to the recurrence relation and


initial conditions is the sequence {an} with
an = 32n – (-1)n.
73
Solving Recurrence Relations
an = rn is a solution of the linear homogeneous
recurrence relation
an = c1an-1 + c2an-2 + … + ckan-k
if and only if
rn = c1rn-1 + c2rn-2 + … + ckrn-k.
Divide this equation by rn-k and subtract the right-
hand side from the left:
rk - c1rk-1 - c2rk-2 - … - ck-1r - ck = 0
This is called the characteristic equation of the
recurrence relation.

74
Solving Recurrence Relations
Example What is the solution of the recurrence
relation an = 6an-1 – 9an-2 with a0 = 1 and a1 = 6?
Solution
The only root of r2 – 6r + 9 = 0 is r0 = 3.
Hence, the solution to the recurrence relation is
an = 13n + 2n3n for some constants 1 and 2.
To match the initial condition, we need
a0 = 1 = 1
a1 = 6 = 13 + 23
Solving these equations yields 1 = 1 and 2 = 1.
Consequently, the overall solution is given by
an = 3n + n3n.
75
Recurrence Relations
• recurrence relation along with initial
conditions specify a single sequence. Any
such sequence is a solution to the relation.

Consider the recurrence relation an = 2an-1 - an-


2.
Is an = 3n a solution for n ≥ 1? Try it out!
an = 2an-1 - an-2 = 23(n-1) – 3(n-2)
= 6n – 6 -3n + 6
= 3n
= an
76
UNIT-V
Graphs & Graphs theory

77
Graphs consist of Example 1: The following
picture
 points called is a graph. List its vertices and
vertices edges.
 lines called edges D

1. Edges connect two C


vertices.
2. Edges only
intersect at
vertices. E
3. Edges joining a
B
vertex to itself are
called loops. 78
Example

1) Find the degree of each A


vertex. D

2) Is A adjacent to B?
Is D adjacent to A? C
Is E adjacent to itself?
Is C adjacent to itself?
3) Is AB adjacent to BC?
Is CE adjacent to BD? E

79
Example : The graph on the left has no
Euler paths, but the one on the right has
several.

R R

A D A D

L L

80
Example 6: Unicursal Tracings
Recall the routing problems presented on Tuesday:
•“Do these drawings have unicursal tracings? If so, are they open or closed?”

How might we answer these queries? Well, if we add vertices to the corners of the
tracings we can reduce the questions to asking whether the following graphs have Euler
paths (open tracing) and/or Euler circuits (closed tracing).

(a) (b)
81
(c)
Number of odd vertices Conclusion

0 Graph has Euler


circuit(s)
2 Graph has Euler
path(s) but no Euler
circuit
4, 6, 8, . . . Graph has no Euler
path and no Euler
circuit
1, 3, 5, . . . Impossible!
82
The Golden Ratio in Art

Approx. = 0.618 x H 83
The Golden Ratio in Art

Approx. = 0.618 x H 84
The Golden Ratio in Art

85
The Golden Ratio in Art
.618 x Ht.

86
0.618 x Width
The Golden Ratio in Art
.618 x Ht.

87
0.618 x Width
Definitions
• Planar – graph that can be drawn without
edges that intersect within a plane
• Non-Planar – graph that cannot be drawn
without edges that intersect within a plane

88
Do Edges Intersect?
• Planar graphs can sometimes be drawn as
non-planar graphs. It is still a planar graph,
because they are isomorphic.

89
Three Houses / Three Utilities
• Q. Suppose we have three houses and
three utilities. Is it possible to connect
each utility to each of three houses without
any lines crossing?

• Planar or Non-Planar ?
• This is also known as K(3,3) bipartite
graph
90
Examples of Counting Regions
Region –area bounded by a subset of the vertices and
edges of a graph

91
Commonly Used Variables
• Variables used in following mathematical proofs

• G = an arbitrary graph
• P = number of vertices
• Q = number of edges
• R = number of regions
• n = number of edges that bound a region
• N = sum of n for all regions of G

92
First Theorem
• Let G be a connected planar graph
• p = vertices, q = edges, r = regions
• Then p – q + r = 2

• Theorem is by Euler
• Proof can be made by induction

93
Second Theorem
• Let G be a connected planar graph
• p = (vertices >= 3), q = edges
• Then q <= 3p - 6

• Proof is a little more interesting, uses first


theorem to help solve…

94
Proof: q <= 3p – 6
• For each region in graph, n = number of
edges to form boundary of its region. Sum
of all these n’s in graph = N
• N >= 3r must be true, since all regions
need at least 3 edges to form them.
• N <= 2q must be true, since no edge can
be used more than twice in forming a
region

95
(con’t) Proof: q <= 3p – 6
• 3r <= N <= 2q
• Solve p – q + r = 2 for r, then substitute
• 3(-p +q + 2) <= 2q

• q <= 3p – 6 is simplified answer

96
Proof: K(3,3) is Non-Planar
• Proof by contradiction of theorems
• Since graph is bipartite, no edge connects
two edges within same subset of vertices
• N >= 4r must be true, since graph contains
no simple triangle regions of 3 edges.
• N <= 2q must be true, since no edge can
be used more than twice in forming a
region
97
(con’t) Proof of K(3,3)
• For K(3,3) p=6, q= 9, r= ??
• 4r <= N <= 2q
• 4r <= (2q = 2 * 9 = 18)
• r <= 4.5

• Using first theorem of planar graphs, p – q + r = 2


• 6–9+r=2
• r=5

• Proof by contradiction:
• r cannot be both equal to 5 and less than 4.5
• Therefore, K(3,3) is a non-planar graph

98
Complete Graphs
• Denoted by Kp
• All vertices are connected to all vertices
• q = p * (p - 1) / 2

99
Proof: K5 is non-planar
• p=5
• q= p * (p – 1) / 2 = 10
• Using second theorem of planar graphs:
• q <= 3p – 6
• 10 <= 3(5) – 6
• 10 <= 9 ???
• By contradiction, K5 must be non-planar

100
Subdivisions of graph G
• Subdivision – a graph obtained from a graph
G, by inserting vertices of degree two into any
edge
• (H is a valid subdivision of G, while F is not)

101
Peterson Graph

102
Chromatic Number Rules
• Four Color Theorem:
• If G is a planar graph, then X(G) <= 4

• Theorem for any graph:


• Where D(G) = max degree of its vertices,
X(G) <= 1 + D(G)

103

Das könnte Ihnen auch gefallen