+ All Categories
Home > Documents > D isc r e t e

D isc r e t e

Date post: 05-Jan-2016
Category:
Upload: cara
View: 32 times
Download: 0 times
Share this document with a friend
Description:
s tructu r e s. D isc r e t e. 2110200. 2007. The foundations C ounting theory N umber theory G raphs & trees. Evaluation. The foundations15 % Counting theory15 % Number theory15 % Graphs & trees15 % Final40 %. Motivation. How fast can we do the computation ?. Motivation. - PowerPoint PPT Presentation
Popular Tags:
72
2007 Discret e The foundations Counting theory Number theory Graphs & trees structures 2110200
Transcript
Page 1: D isc r e t e

2007Discrete

The foundationsCounting theory

Number theory

Graphs & trees

structures2110200

Page 2: D isc r e t e

Evaluation

The foundations 15 %

Counting theory 15 %

Number theory 15 % Graphs & trees 15 %

Final 40 %

Page 3: D isc r e t e

Motivation

3 4 6 7 8 5 3 22 7 8 5 1 4 8 4 +---

---

---

---

---

---

---

---

6 2 5 3 0 0 1 6How fast can we do the computation ?

Page 4: D isc r e t e

Motivation

?A

I J

B

C

G

E D

H

F

Page 5: D isc r e t e

Motivation

K = 0FOR I1 = 0 TO M {

FOR I2 = 0 TO I1 {FOR I3 = 0 TO I2 {

FOR In = 0 TO In-1 {K = K + 1

}…

}}

} Find the value of K

Page 6: D isc r e t e

sThe Foundation

Relational structures

T s

Page 7: D isc r e t e

The Foundations

Logic and reasoningSet, relation and function

Methods of proof

Page 8: D isc r e t e

Logic & Reasoning

Page 9: D isc r e t e

Historical

SYLLOGISTIC REASONINGSYLLOGISTIC REASONINGAristotle (384-322 B.C.)Aristotle (384-322 B.C.)

Euclid of Alexandria (325-265 Euclid of Alexandria (325-265 B.C.)B.C.)

DEDUCTIVE REASONINGDEDUCTIVE REASONING

Chrysippus of Soli (279-206 B.C.)Chrysippus of Soli (279-206 B.C.) MODAL LOGICMODAL LOGIC

George Boole (1815-1864 A.D.)George Boole (1815-1864 A.D.) PROPOSITIONAL LOGICPROPOSITIONAL LOGIC

Augustus De Morgan (1806-1871 A.D.)Augustus De Morgan (1806-1871 A.D.) DE MORGAN’s LAWsDE MORGAN’s LAWs

Page 10: D isc r e t e

Propositional logic

Definition

A proposition is a declarative statement that is either true or false but not both.

Page 11: D isc r e t e

Summary

Theorem : Logical Equivalences,

given any propositions p,q and r, a tautology T and a contradiction C, the following logical equivalences hold:

•Commutative laws: pq qp pq qp•Associative laws: (pq)r p(qr)

(pq)r p(qr)•Distributive laws: p(qr) (pq)(pr)

p(qr) (pq)(pr)•Identity laws: pT p pC p•Domination laws:(Universal bound laws) pT T pC C•Idempotent laws: pp p pp p•Negation laws: pp T pp C•Double negative laws: (p) p•De Morgan’s laws: (pq) pq

(pq) pq•Absorption laws: p(pq) p p(pq) p

Page 12: D isc r e t e

Example

Is the following assertion a proposition?

This statement is false.

No, since this statement is neither “true” nor “false”.

Page 13: D isc r e t e

Example

The nth statement in a list of 100 statements is

What conclusion can you draw from these statements?

Exactly n statements are false.

At most one statement can be true, then 99 statements are false.That is only the 99th statement is true.

Page 14: D isc r e t e

Exactly n statements are false.

Example

The nth statement in a list of 100 statements is

What conclusion can you draw from these statements?

At least n statements are false.

50 first statements are true.The others are false.

Page 15: D isc r e t e

Exactly n statements are false.

Example

The nth statement in a list of 100 statements is

What conclusion can you draw from these statements?

At least n statements are false.

99

CONTRADICTION

Page 16: D isc r e t e

Conditional statement

ConverseThe converse of p q is q

p.

InverseThe inverse of p q is p

q.

Only if p only if q means If q then p.

p q

Page 17: D isc r e t e

Valid arguments

An argument is valid means that if all hypotheses are true, the conclusion is also true.

Definition

An argument is a sequence of statements. All statements excluded the final one are called “hypotheses”, the final statement is called “conclusion”. A argument is the form:p ; q ; r ; … f (read therefore)

Page 18: D isc r e t e

ExampleGiven an argument p (q r) ; r ; p qp q r qr p (q r) r p q

T T T T T F T

T T F T T T T

T F T T T F T

T F F F T T T

F T T T T F T

F T F T T T T

F F T T T F F

F F F F F T F

TRUE

VALIDValid arguments

( p1 p2 p3 … pn) q

Page 19: D isc r e t e

Rules of inference Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

P

P Q

Page 20: D isc r e t e

Rules of inference

P Q

P

Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

Page 21: D isc r e t e

Rules of inference

PQ

P Q

Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

Page 22: D isc r e t e

Rules of inference

P QP

Q

Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

Page 23: D isc r e t e

Rules of inference

P Q Q

P

Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

Page 24: D isc r e t e

Rules of inference

P QQ R

P R

Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

Page 25: D isc r e t e

Rules of inference

P Q P

Q

Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

Page 26: D isc r e t e

Rules of inference

P Q P R

Q R

Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

Page 27: D isc r e t e

Rules of inference

P QP RQ R

R

Disjunctive addition Conjunctive

simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma

Page 28: D isc r e t e

Example

Given two logical operators,p | q means ( p q )p q means ( p q )

Find a simple proposition for ( p q ) ( p q ).

( p q )

Page 29: D isc r e t e

Example

Given two logical operators,p | q means ( p q )p q means ( p q )

Find a simple proposition for ( p q ) ( p q ).Find a proposition equivalent to pq using only .

(( p p ) q ) (( p p ) q )

Page 30: D isc r e t e

Problem

Consider the following statements:

All students go to school.John is a student.Diana is a student.……

Of course we can conclude thatJohn goes to school.Diana goes to school.……

Page 31: D isc r e t e

Predicate logic

The statement “All students go to school” has two parts:Variable students (denoted by variable x)“go to school” (the predicate)

This statement can be denoted by P(x), where P denotes the predicate “go to school”.P(x) is said to be the value of the propositional function P at x.Once a value has been assigned to the variable x, the statement P(x) becomes a proposition and has a truth value.

Page 32: D isc r e t e

Quantifiers Universal quantification Existential quantification Unique existential quantification !

Consider a statement x P(x) Q(x).

ContrapositionIts contrapositive is x Q(x) P(x).

InverseIts inverse is x P(x) Q(x)..

ConverseIts converse is x Q(x) P(x).

Page 33: D isc r e t e

Consider a statement x P(x) Q(x).

For a particular e,

P(e) is true,

therefore Q(e) is true.

Universal Modus Ponens

Page 34: D isc r e t e

Consider a statement x P(x) Q(x).

For a particular e,

Q(e) is true,

therefore P(e) is true.

Universal Modus Tollens

Page 35: D isc r e t e

Universal instantiationxP(x) P(c) if c U.

Universal generalizationP(c) for an arbitrary c U xP(x)

Existential instantiationxP(x) P(c) for some element c U

Existential generalization P(c) for some element c U xP(x)

Rules of inferences

Page 36: D isc r e t e

The order of quantifiers

Given a predicate P(x,y): x + y = 0

x y P(x,y)y x P(x,y)

Page 37: D isc r e t e

Nested quantifiers

x P(x) y Q(y) x y ( P(x) Q(y) ) y x ( P(x) Q(y) )

x P(x) x Q(x) x y ( P(x) Q(y) )

Prenex normal form (PNF)

Page 38: D isc r e t e

Express the following theorem using the first order predicate logic.

Example

Mathematical induction

Page 39: D isc r e t e

Set

George Cantor (1845-1918)

Page 40: D isc r e t e

Set

Definition

A set is an unordered collection of objects.The objects are called the elements or

members of the set.The number of distinct elements in a set is

the cardinality of the set.

The Cartesian product of A and B, denoted by AB, is described by

{ (a,b) | a A b B }.

Page 41: D isc r e t e

Defining sets L

1={ n| for n =1 2 3 … }

L2={ n | for n =1 3 5 7 … }

L3={ n | for n =1 4 9 16 … }

L4={ n | for n = 3 4 8 22 … }.

Membership problem

Page 42: D isc r e t e

Machine model

Minput

output{ yes, no }

{ space of input }

{ space of yes-input }MEMBERSHIP DECISION

Page 43: D isc r e t e

ExampleLet U be the universe described by

U = { x | 1000 x 9999}.Let Ai be the set of all numbers in U

such that the ith position is i.

Find the cardinality ofthe union of A1 A2 A3 and A4 ?

Page 44: D isc r e t e

ExampleLet S be the set of all x that x does not

contain x.

S = { x | x x }Note that x is also a set.

Does S contain S ?Russell’s paradox Bertrand Russell (1872-1970)

Page 45: D isc r e t e

Set

Operators

Union Mutually disjoint

Intersection PartitionDifferentDisjointComplementPower set

Page 46: D isc r e t e

Set

Theorem Given sets A,B and C.

•Commutative laws: AB = BA AB = BA

•Associative laws: (AB)C = A(BC)

•Distributive laws: A(BC) = (AB)(AC)

•Idempotent laws: AU = A AU = U

•De Morgan’s laws: (AB)c = Ac Bc (AB)c = Ac Bc

•Alternative representation for set differenceA-B = ABc

•Absorption laws: A(AB) = A (AB)A = A

Page 47: D isc r e t e

ExampleThe symmetric difference of A and B, ( A B ), is the set containing those elements in either A or B, but not in both A and B.

( A ( B C ) )= ( ( A B ) C )?YES

Page 48: D isc r e t e

ExampleThe symmetric difference of A and B, ( A B ), is the set containing those elements in either A or B, but not in both A and B.

( A ( B C ) )= ( ( A B ) C )?YES

Given A C = B C

Must it be the case that A = B ?

Page 49: D isc r e t e

Multisets

Definition

Multisets are unordered collections of elements where an element can occur as a member more than once.

{ m1.a1, m2.a2, m3.a3, …, mr.ar }

mi are called the multiplicities of the elements ai.OPERATORS: UNION, INTERSECTION, DIFFERENCE, SUM

Page 50: D isc r e t e

Multisets

Definition

Multisets are unordered collections of elements where an element can occur as a member more than once.

{ m1.a1, m2.a2, m3.a3, …, mr.ar }

mi are called the multiplicities of the elements ai.OPERATORS: UNION, INTERSECTION, DIFFERENCE, SUM

Fuzzy sets

0 mi 1

Degree of membership

Page 51: D isc r e t e

Relations & functions

Page 52: D isc r e t e

Binary relationDefinitionLet A,B be sets. A binary relation R from A to B

is a subset of the Cartesian product AB. Given (x,y), ordered pair, in A B,

x is related to y by R, written xRy, iff (x,y)R.

Example (the congruence modulo 2 relation)

The relation R from Z to Z is defined as follows;

for all (x,y) ZZ, xRy iff x-y is even.

Example, 6R2, 120R36 etc.

Page 53: D isc r e t e

Function

DefinitionA function F from A to B is a relation from A to B, F :

AB,that satisfies the following properties:

For every xA, there exists yB such that (x,y)F.For all xA, and y, zB, if (x,y)F and (x,z)F then

y=z.

For (x,y) F , we usually write y =F (x) = image of x under F, and x is called pre-image of y under F.

A is called domain of F.B is called co-domain of F.The set of all images of F is called range of F.

Page 54: D isc r e t e

Compositions of functions

DefinitionA function f, g from A to B is a function from A to

B.

(f + g)(x) = f(x) + g(x).(f g)(x) = f(x) g(x)

The composition of the functions f and g, denoted by f g, is defined as

(f g)(x) = f (g ( x ) )

Page 55: D isc r e t e

Function

Arrow diagramA function F from A to B.

1234

abcde

F(1) = bF(2) = aF(3) = bF(4) = e

A B

Page 56: D isc r e t e

Injective function

DefinitionA function F from A to B is injective (or

one-to-one)

iff for all elements x and y in A,

if F(x] =F(y] then x = y.Or, equivalently,

if x y then F(x] F(y].

1234

abcde

A B

This function is not One-to-one.

Page 57: D isc r e t e

Injective function

DefinitionA function F from A to B is injective (or

one-to-one)

iff for all elements x and y in A,

if F(x] =F(y] then x = y.Or, equivalently,

if x y then F(x] F(y].This function is an One-to-one.

1234

abcde

A B

Page 58: D isc r e t e

DefinitionA function F from A to B is surjective (or

onto)

iff for any element y in B,it is possible to find an element x in Asuch that

y = F(x] .

1234

ab e

A B

This function is Onto.

Surjective function

Page 59: D isc r e t e

DefinitionA one-to-one correspondence (or bijection)

F from A to B is a function that is both one-

to-one and onto.1234

abcde

A BThis function is not a

bijection.

Bijective function

Page 60: D isc r e t e

DefinitionA one-to-one correspondence (or bijection)

F from A to B is a function that is both one-

to-one and onto.1234

abcde

A B

Bijective function

This function is not a bijection.

Page 61: D isc r e t e

DefinitionA one-to-one correspondence (or bijection)

F from A to B is a function that is both one-

to-one and onto.1234

abcd

A B

Bijective function

This function is a bijection.

Page 62: D isc r e t e

Properties

DefinitionLet R be a binary relation on A.R is reflexive iff for all xA, x R x .R is symmetric iff for all x,yA,

if x R y then y R x.R is transitive iff for all x,y,zA,

if x R y and y R z then x R z.

Page 63: D isc r e t e

Equivalence relation

DefinitionR is a equivalence relation on A iff

R is a binary relation on A. R is reflexive.R is symmetric.R is transitive.

Page 64: D isc r e t e

Transitive closure

DefinitionLet R be a binary relation on A.The transitive closure of R is the binary

relation Rt on AThat satisfies the following three

properties:Rt is transitive.R Rt.S is any other transitive that

contains R then Rt S.

Page 65: D isc r e t e

Mutually disjoint

DefinitionSets A1,A2, A3, …,An are Mutually

disjoint(pairwise or nonoverlapping)

Iff, any two sets Ai,Aj with distinct subscripts have not any elements in common, precisely AiAj= empty set .

Page 66: D isc r e t e

Set partition

DefinitionA collection of nonempty sets

{A1,A2, A3, …,An}

is a Partition of a set A Iff, A = A1A2 A3 … An andA1,A2, A3, …,An are mutually

disjoint.

Page 67: D isc r e t e

DefinitionGiven a partition of A={A1,A2, A3, …,An}.

The binary relation induced by the partition, R,

is defined on A as follows:for all x,y A, x R y Iff,

there is a subset Aj of the partition such that both x and y are in Aj.

Set partition

Page 68: D isc r e t e

TheoremLet A be a set with a partition andLet R be the relation induced by

the partition.Then R is reflexive, symmetric

and transitive.

Set partition

How to prove this

theorem?

Page 69: D isc r e t e

Equivalence class

DefinitionSuppose A is a set and R is a equivalence relation on A.For each a A, the equivalence class of a, denoted [ a ],is the set of all elements x in A such thatx is related to a by R.

[ a ] = { x A | x R a }.

Page 70: D isc r e t e

TheoremLemma 1Let R be an equivalence relation on A, a b

A.

If a R b then [ a ] = [ b ].Lemma 2Let R be an equivalence relation on A, a b

A, then

either [ a ] [ b ] = or

[ a ] = [ b ].

TheoremIf A is a nonempty set and R is an equivalence

relation on A,

then the distinct equivalence classes of R form a partition of A; that is, the union of the equivalence classes is all of A and the intersection of any two distinct classes is empty.

Page 71: D isc r e t e

Antisymmetric

DefinitionA relation R on a set A such that

(a,b) and (b,a) are in R only if a=b, for all a,b in A, is called antisymmetric.

Page 72: D isc r e t e

Example

Let R be a relation on the set AR = { (a,b) | a < b }

Find the inverse relation R-1 andthe complementary relation R.


Recommended