Download presentation
Presentation is loading. Please wait.
Published byElisabeth Warren Modified over 9 years ago
1
2007 D iscrete The foundations C ounting theory N umber theory G raphs & trees structure s 2110200
2
Evaluation The foundations15 % Counting theory15 % Number theory15 % Graphs & trees15 % Final40 %
3
Motivation 34678532 27851484+ --- 62530016 How fast can we do the computation ?
4
Motivation ? A IJ B C G ED H F
5
K = 0 FOR I 1 = 0 TO M { FOR I 2 = 0 TO I 1 { FOR I 3 = 0 TO I 2 { … FOR I n = 0 TO I n-1 { K = K + 1 } … } Find the value of K
6
s T he Foundation Relational structures T s
7
The Foundations Logic and reasoning Set, relation and function Methods of proof
8
Logic & Reasoning
9
Historical SYLLOGISTIC REASONING Aristotle (384-322 B.C.) Euclid of Alexandria (325-265 B.C.) DEDUCTIVE REASONING Chrysippus of Soli (279-206 B.C.) MODAL LOGIC George Boole (1815-1864 A.D.) PROPOSITIONAL LOGIC Augustus De Morgan (1806-1871 A.D.) DE MORGAN’s LAWs
10
Propositional logic Definition A proposition is a declarative statement that is either true or false but not both.
11
S ummary T heorem : Logical Equivalences, given any propositions p,q and r, a tautology T and a contradiction C, the following logical equivalences hold: Commutative laws: p q q p p q q p Associative laws:( p q ) r p ( q r ) ( p q ) r p ( q r ) Distributive laws: p ( q r ) ( p q ) ( p r ) p ( q r ) ( p q ) ( p r ) Identity laws: p T pp C p Domination laws:( Universal bound laws ) p T Tp C C Idempotent laws: p p pp p p Negation laws: p p Tp p C Double negative laws: ( p ) p De Morgan’s laws: ( p q ) p q ( p q ) p q Absorption laws: p ( p q ) p p ( p q ) p
12
Example Is the following assertion a proposition? This statement is false. No, since this statement is neither “true” nor “false”.
13
Example The n th 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 99 th statement is true.
14
Exactly n statements are false. Example The n th 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.
15
Exactly n statements are false. Example The n th statement in a list of 100 statements is What conclusion can you draw from these statements? At least n statements are false. 99 CONTRADICTION
16
Conditional statement Converse The converse of p q is q p. Inverse The inverse of p q is p q. Only if p only if q means If q then p. p qp q
17
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)
18
Example Given an argument p (q r) ; r ; p q pqrqrqrp (q r) rrp q TTTTTFT TTFTTTT TFTTTFT TFFFTTT FTTTTFT FTFTTTT FFTTTFF FFFFFTF TRUE VALID Valid arguments ( p 1 p 2 p 3 … p n ) q
19
Rules of inference Disjunctive addition Conjunctive simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma P P Q
20
Rules of inference P Q P Disjunctive addition Conjunctive simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma
21
Rules of inference P Q P Q Disjunctive addition Conjunctive simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma
22
Rules of inference P Q P Q Disjunctive addition Conjunctive simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma
23
Rules of inference P Q Q P Disjunctive addition Conjunctive simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma
24
Rules of inference P Q Q R P R Disjunctive addition Conjunctive simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma
25
Rules of inference P Q P Q Disjunctive addition Conjunctive simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma
26
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
27
Rules of inference P Q P R Q R R Disjunctive addition Conjunctive simplification Conjunction addition Modus ponens Modus tollens Hypothetical syllogism Disjunctive syllogism Resolution Dilemma
28
Example Given two logical operators, p | qmeans ( p q ) p qmeans ( p q ) Find a simple proposition for ( p q ) ( p q ). ( p q )
29
Example Given two logical operators, p | qmeans ( p q ) p qmeans ( p q ) Find a simple proposition for ( p q ) ( p q ). Find a proposition equivalent to p q using only . (( p p ) q ) (( p p ) q )
30
Problem C onsider the following statements: All students go to school. John is a student. Diana is a student. …… O f course we can conclude that John goes to school. Diana goes to school. ……
31
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.
32
Quantifiers Universal quantification Existential quantification Unique existential quantification ! Consider a statement x P(x) Q(x). Contraposition Its contrapositive is x Q(x) P(x). Inverse Its inverse is x P(x) Q(x).. Converse Its converse is x Q(x) P(x).
33
Consider a statement x P(x) Q(x). For a particular e, P(e) is true, therefore Q(e) is true. Universal Modus Ponens
34
Consider a statement x P(x) Q(x). For a particular e, Q(e) is true, therefore P(e) is true. Universal Modus Tollens
35
Universal instantiation xP(x) P(c) if c U. Universal generalization P(c) for an arbitrary c U xP(x) Existential instantiation xP(x) P(c) for some element c U Existential generalization P(c) for some element c U xP(x) Rules of inferences
36
The order of quantifiers Given a predicate P(x,y): x + y = 0 x y P(x,y) y x P(x,y)
37
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)
38
Express the following theorem using the first order predicate logic. Example Mathematical induction
39
Set George Cantor (1845-1918)
40
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 A B, is described by { (a,b) | a A b B }.
41
Defining sets L 1 ={ n| for n = 1 2 3 … } L 2 ={ n | for n = 1 3 5 7 … } L 3 ={ n | for n = 1 4 9 16 … } L 4 ={ n | for n = 3 4 8 22 … }. Membership problem
42
Machine model M input output { yes, no } { space of input } { space of yes-input } MEMBERSHIP DECISION
43
Example Let U be the universe described by U = { x | 1000 x 9999}. Let A i be the set of all numbers in U such that the i th position is i. Find the cardinality of the union of A 1 A 2 A 3 and A 4 ?
44
Example Let 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)
45
Set Operators UnionMutually disjoint IntersectionPartition Different Disjoint Complement Power set
46
Set Theorem Given sets A,B and C. Commutative laws: A B = B AA B = B A Associative laws: (A B) C = A (B C) Distributive laws: A (B C) = (A B) (A C) Idempotent laws: A U = AA U = U De Morgan’s laws: (A B) c = A c B c (A B) c = A c B c Alternative representation for set difference A-B = A B c Absorption laws: A (A B) = A(A B) A = A
47
Example The 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
48
Example The 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 ?
49
Multisets Definition Multisets are unordered collections of elements where an element can occur as a member more than once. { m 1.a 1, m 2.a 2, m 3.a 3, …, m r.a r } m i are called the multiplicities of the elements a i. OPERATORS: UNION, INTERSECTION, DIFFERENCE, SUM
50
Multisets Definition Multisets are unordered collections of elements where an element can occur as a member more than once. { m 1.a 1, m 2.a 2, m 3.a 3, …, m r.a r } m i are called the multiplicities of the elements a i. OPERATORS: UNION, INTERSECTION, DIFFERENCE, SUM Fuzzy sets 0 m i 1 Degree of membership
51
Relations & functions
52
Binary relation Definition Let A,B be sets. A binary relation R from A to B is a subset of the Cartesian product A B. 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) Z Z, xRy iff x-y is even. Example, 6R2, 120R36 etc.
53
Function Definition A function F from A to B is a relation from A to B, F : A B, that satisfies the following properties: For every x A, there exists y B such that (x,y) F. For all x A, and y, z B, 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.
54
Compositions of functions Definition A 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 ) )
55
Function Arrow diagram A function F from A to B. 12341234 abcdeabcde F(1) = b F(2) = a F(3) = b F(4) = e A B
56
Injective function Definition A 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]. 12341234 abcdeabcde A B This function is not One-to-one.
57
Injective function Definition A 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. 12341234 abcdeabcde A B
58
Definition A 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 A such that y = F (x]. 12341234 ab eab e A B This function is Onto. Surjective function
59
Definition A one-to-one correspondence (or bijection) F from A to B is a function that is both one-to-one and onto. 12341234 abcdeabcde A B This function is not a bijection. Bijective function
60
Definition A one-to-one correspondence (or bijection) F from A to B is a function that is both one-to-one and onto. 12341234 abcdeabcde A B Bijective function This function is not a bijection.
61
Definition A one-to-one correspondence (or bijection) F from A to B is a function that is both one-to-one and onto. 12341234 abcdabcd A B Bijective function This function is a bijection.
62
Properties Definition Let R be a binary relation on A. R is reflexive iff for all x A, x R x. R is symmetric iff for all x,y A, if x R y then y R x. R is transitive iff for all x,y,z A, if x R y and y R z then x R z.
63
Equivalence relation Definition R is a equivalence relation on A iff R is a binary relation on A. R is reflexive. R is symmetric. R is transitive.
64
Transitive closure Definition Let R be a binary relation on A. The transitive closure of R is the binary relation R t on A That satisfies the following three properties: R t is transitive. R R t. S is any other transitive that contains R then R t S.
65
Mutually disjoint Definition Sets A 1,A 2, A 3, …,A n are Mutually disjoint (pairwise or nonoverlapping) Iff, any two sets A i,A j with distinct subscripts have not any elements in common, precisely A i A j = empty set .
66
Set partition Definition A collection of nonempty sets {A1,A2, A3, …,An} is a Partition of a set A Iff, A = A1 A2 A3 … An and A1,A2, A3, …,An are mutually disjoint.
67
Definition Given a partition of A={A 1,A 2, A 3, …,A n }. 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 A j of the partition such that both x and y are in A j. Set partition
68
Theorem Let A be a set with a partition and Let R be the relation induced by the partition. Then R is reflexive, symmetric and transitive. Set partition How to prove this theorem?
69
Equivalence class Definition Suppose 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 that x is related to a by R. [ a ] = { x A | x R a }.
70
Theorem Lemma 1 Let R be an equivalence relation on A, a b A. If a R b then [ a ] = [ b ]. Lemma 2 Let R be an equivalence relation on A, a b A, then either [ a ] [ b ] = or [ a ] = [ b ]. Theorem If 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.
71
Antisymmetric Definition A 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.
72
Example Let R be a relation on the set A R = { (a,b) | a < b } Findthe inverse relation R -1 and the complementary relation R.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.