Presentation is loading. Please wait.

Presentation is loading. Please wait.

이산 수학 Discrete Mathematics

Similar presentations


Presentation on theme: "이산 수학 Discrete Mathematics"— Presentation transcript:

1 이산 수학 Discrete Mathematics
Hyogon Kim 정통관 303 / 3204

2 과목 소개 교재 Discrete Mathematics(7/e), R. Johnsonbaugh, Prentice Hall, 2008 성적 평가 2 Midterms: 30% (9월 말, 10월 말) 4 Quizzes: 25% (2~3주 마다, from Homework) 1 Final: 25% + alpha 6 HWs/PGs: 12~18% Plagiarism policy 강의 자료: widen.korea.ac.kr  Courses  이산수학

3 8/28 Ch 1 30 Hw 1 Ch 1, 2 9/4 Ch 2 6 11 Ch 3 13 Hw 2 Ch 3, 4 18 Ch 4 Quiz 1 20 25 Ch 5 27 Ch 5 Hw 3 Ch 5, 6 10/2 Ch 6 4 Quiz 2 Ch 3, 4 9 Ch 7 11 Hw 4 Ch 7, 8 16 Wed Exam 1 Ch 1~6 18 Ch 8 23 25 Ch 9

4 30 Ch 9 11/1 Hw 5 Ch 9, 10 6 Ch 10 Quiz 3 Ch 7, 8 8 13 Ch 11 15 Hw 6 Ch 11, 12 20 Wed Exam 2 Ch 7~10 22 Ch 12 27 29 12/4 - Quiz 4 Ch 11, 12 6 Final All chapters

5 Discrete Mathematics 7th edition, 2009
Chapter 1 Sets and logic Chapter 2 Proofs

6 1.1 Sets Set = a collection of distinct unordered objects
Members of a set are called elements How to determine a set Listing: Example: A = {1,3,5,7} Description Example: B = {x | x = 2k + 1, 0 < k < 3}

7 Finite and infinite sets
Examples: A = {1, 2, 3, 4} B = {x | x is an integer, 1 < x < 4} Infinite sets Z = {integers} = {…, -3, -2, -1, 0, 1, 2, 3,…} S={ x | x is a real number and 1 < x < 4} = [1, 4]

8 Some important sets The empty set  has no elements.
Also called null set or void set. Universal set: the set of all elements about which we make assertions. Examples: U = {all natural numbers} U = {all real numbers} U = {x| x is a natural number and 1< x<10}

9 Cardinality Cardinality of a set A (in symbols |A|) is the number of elements in A Examples: If A = {1, 2, 3} then |A| = 3 If B = {x | x is a natural number and 1< x< 9} then |B| = 9 Infinite cardinality Countable (e.g., natural numbers, integers) Uncountable (e.g., real numbers)

10 Subsets , Power set X is a subset of Y if every element of X is also contained in Y (in symbols X  Y) Equality: X = Y if X  Y and Y  X X is a proper subset of Y if X  Y but Y  X Observation:  is a subset of every set The power set of X is the set of all subsets of X, in symbols P(X), i.e. P(X)= {A | A  X} Example: if X = {1, 2, 3}, then P(X) = {, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}} Theorem 2.1.4: If |X| = n, then |P(X)| = 2n.

11 Set operations Given two sets X and Y
The union of X and Y is defined as the set X  Y = { x | x  X or x  Y} The intersection of X and Y is defined as the set X  Y = { x | x  X and x  Y} Two sets X and Y are disjoint if X  Y =  The difference of two sets X – Y = { x | x  X and x  Y} The difference is also called the relative complement of Y in X Symmetric difference X Δ Y = (X – Y)  (Y – X) The complement of a set A contained in a universal set U is the set Ac = U – A

12 Venn diagrams A Venn diagram provides a graphic view of sets
Set union, intersection, difference, symmetric difference and complements can be identified U A B

13 Properties of set operations
Theorem : Let U be a universal set, and A, B and C subsets of U. The following properties hold: a) Associativity: (A  B)  C = A  (B  C) (A  B)  C = A  (B C) b) Commutativity: A  B = B  A A  B = B  A c) Distributive laws: A(BC) = (AB)(AC) A(BC) = (AB)(AC) d) Identity laws: AU=A A = A e) Complement laws: AAc = U AAc = 

14 Properties of set operations
f) Idempotent laws: AA = A AA = A g) Bound laws: AU = U A =  h) Absorption laws: A(AB) = A A(AB) = A i) Involution law: (Ac)c = A j) 0/1 laws: c = U Uc =  k) De Morgan’s laws for sets: (AB)c = AcBc (AB)c = AcBc

15 1.2 Propositions Logic = the study of correct reasoning Use of logic
Statements as a single datum having (binary) truth value Representing “facts” digitally Q: what about statements that have degree of truth value? How can we manipulate them to derive new things? Use of logic In mathematics: to prove theorems In computer science: to prove that programs do what they are supposed to do AI / DB: Theorem prover Software engineering: Program correctness

16 Propositions A proposition is a statement or sentence that can be determined to be either true or false. Examples: “John is a programmer" is a proposition “I wish I were wise” is not a proposition (?) Well, you can still assign some value … Computers don’t really care …

17 Connectives If p and q are propositions, new compound propositions can be formed by using connectives Most common connectives: Conjunction AND. Symbol ^ Inclusive disjunction OR Symbol v Exclusive disjunction OR Symbol v Negation Symbol ~ Implication Symbol  Double implication Symbol 

18 Truth table Truth table of conjunction Truth table of Negation
^, and, 논리곱 Truth table of Negation ~, not, 부정 p q p ^ q T F p ~p T F Truth table of exclusive disjunction “Either p or q” (but not both), , exclusive or Truth table of (inclusive) disjunction v, or, 논리합 p q p v q T F p q p v q T F

19 More compound statements
Let p, q, r be simple statements We can form other compound statements, such as (pq)^r p(q^r) (~p)(~q) (pq)^(~r) and many others… Example truth table of (pq)^r p q r (p  q) ^ r T F

20 1.3 Conditional propositions (조건명제) and logical equivalence (동치)
A conditional proposition “If p then q” , "p only if q" In symbols: p  q Truth table p: antecedent or hypothesis (가정) sufficient condition (충분 조건) for q q : consequent or conclusion (결론) necessary condition (필요조건) for p p q p  q T F

21 Logical equivalence logically equivalent converse contrapositive 동치
two truth tables are identical. converse converse of p  q is q  p contrapositive 대우 contrapositive of the p  q is ~q  ~p. logically equivalent p q ~p  q p  q T F p q p  q ~q  ~p T F p q p  q q  p T F

22 Logical equivalence double implication tautology contradiction 동치?
p if and only if q p  q logically equivalent to (p  q)^(q  p) tautology 항진 명제 truth table contains only true values for every case contradiction 모순 명제 truth table contains only false values for every case p q p  p v q T F p q p  q (p  q) ^ (q  p) T F p p ^ (~p) T F

23 De Morgan’s laws for logic
The following pairs of propositions are logically equivalent: ~ (p  q) and (~p)^(~q) ~ (p ^ q) and (~p)  (~q)

24 1.4 Arguments and rules of inference
Deductive reasoning: the process of reaching a conclusion q from a sequence of propositions p1, p2, …, pn. The propositions p1, p2, …, pn are called premises (전제) or hypothesis (가정). The proposition q that is logically obtained through the process is called the conclusion.

25 Rules of inference 1. Law of detachment or modus ponens
(mode that affirms) p  q p Therefore, q 2. Modus tollens (mode that denies) ~q Therefore, ~p 3. Rule of Addition Therefore, p  q 4. Rule of simplification p ^ q Therefore, p 5. Rule of conjunction p q Therefore, p ^ q 6. Rule of hypothetical syllogism p  q q  r Therefore, p  r 7. Rule of disjunctive syllogism p  q ~p Therefore, q

26 Rules of inference for quantified statements
1. Universal instantiation xD, P(x) d  D Therefore P(d) 2. Universal generalization P(d) for any d  D Therefore x, P(x) 3. Existential instantiation  x  D, P(x) Therefore P(d) for some d D 4. Existential generalization P(d) for some d D Therefore  x, P(x)

27 1.5 Quantifiers (한정기호) A propositional function P(x) is a statement involving a variable x For example: P(x): 2x is an even integer Domain of a propositional function if x is an element of a set D, D is called the domain of P(x) For example, x is an element of the set of integers the domain D of P(x) must be defined (cf.) P(x) : x is an even integer if D is a set of even integers if D is a set of odd integers

28 Universal quantifier universal quantifier for every …
x P(x) : P(x) for every x in a domain D True if P(x) is true for every x  D False if P(x) is not true for some x  D Example: Let P(n) be the propositional function n2 + 2n is an odd integer n  D = {all integers} P(n) is true only when n is an odd integer, false if n is an even integer.

29 Existential quantifier, Counter example
for some … x P(x) : P(x) for some x in a domain D true if there exists an element x in the domain D for which P(x) is true. counter example x P(x) is false if xD such that P(x) is false. The value x that makes P(x) false is called a counter example to the statement x P(x). Example P(x) = "every x is a prime number", for every integer x. But if x = 4 (an integer) this x is not a primer number. Then 4 is a counter example to P(x) being true.

30 Generalized De Morgan’s laws for Logic
If P(x) is a propositional function, then each pair of propositions in a) and b) below have the same truth values: a) ~(x P(x)) and x: ~P(x) "It is not true that for every x, P(x) holds" is equivalent to "There exists an x for which P(x) is not true“ b) ~(x P(x)) and x: ~P(x) "It is not true that there exists an x for which P(x) is true" is equivalent to "For all x, P(x) is not true"

31 1.6 Nested Quantifiers Nested quantifier : multiple quantifier Example
xy P(x,y) For every x in D, there is y in D such that P(x,y) is true xy (x<y) For every x, there exist y such that x<y. D: integer xy L(x,y) L(x,y) : x loves y Everybody(x) loves somebody(y) E.g. False : there is someone who loves nobody xy P(x,y) For every x in D and for every y in D, P(x,y) is true. xy ((x>0) ^ (y>0))(x+y > 0)), D: real number If there is at least one x and at least y such that P(x,y) is false Like in xy ((x>0) ^ (y<0))(x+y  0)), D: real number Counter example : x=1, y=-1

32 Nested Quantifier Example xy P(x,y) xy P(x,y)
There is at least on x such that P(x,y) is true for every y in D xy (xy), D: positive integer x = 1 xy (xy), D: positive integer False : for every x, there is at least one positive integer y (ex. y=x+1) xy P(x,y) There is at least one x in D and at least one y in D such that P(x,y) is true. xy ((x>1) ^ (y>1) ^ (xy=6)) xy ((x>1) ^ (y>1) ^ (xy=7))

33 Nested Quantifier X={a,b,c}, Y={1,2,3,4} xy P(x,y) xy P(x,y)
P(`,y) X Y a b c 1 2 3 4 P(x,y) X Y a b c 1 2 3 4 P(x,y) X Y

34 2.1 Mathematical systems, direct proofs and counterexamples
A mathematical system consists of Undefined terms Definitions Axioms

35 Undefined terms, Definitions
Undefined terms are the basic building blocks of a mathematical system. These are words that are accepted as starting concepts of a mathematical system. Example: in Euclidean geometry we have undefined terms such as Point Line A definition (정의) is a proposition constructed from undefined terms and previously accepted concepts in order to create a new concept. Example : In Euclidean geometry the following are definitions: Two triangles are congruent if their vertices can be paired so that the corresponding sides are equal and so are the corresponding angles. Two angles are supplementary if the sum of their measures is 180 degrees.

36 Axioms, Theorems An axiom (공리) is a proposition accepted as true without proof within the mathematical system. There are many examples of axioms in mathematics: Example: In Euclidean geometry the following are axioms Given two distinct points, there is exactly one line that contains them. Given a line and a point not on the line, there is exactly one line through the point which is parallel to the line. A theorem (정리) is a proposition of the form p  q which must be shown to be true by a sequence of logical steps that assume that p is true, and use definitions, axioms and previously proven theorems.

37 Lemmas and corollaries
A lemma (보조정리) is a small theorem which is used to prove a bigger theorem. A corollary (따름정리) is a theorem that can be proven to be a logical consequence of another theorem. Example from Euclidean geometry: "If the three sides of a triangle have equal length, then its angles also have equal measure."

38 Types of proof A proof is a logical argument that consists of a series of steps using propositions in such a way that the truth of the theorem is established. Direct proof: p  q A direct method of attack that assumes the truth of proposition p, axioms and proven theorems so that the truth of proposition q is obtained.

39 Direct proof: example If n is even, then n2 is even.
Suppose n is even.  Then by definition of “even” there is an integer m for which n = 2m.  If we square both sides, we get n2 = 4m2 = 2*2m2. 2m2 is an integer because m is an integer, so by definition of “even”, n is even.

40 2.2 More methods of proof Proof by contradiction
Proof by contrapositive Proof by cases Proofs of equivalence Existence proofs

41 Indirect proof The method of proof by contradiction (a.k.a. indirect proof) of a theorem p  q consists of the following steps: Assume p is true but q is false ~ (p  q)  p ~ q 2. Using p, ~q, axioms, previously derived theorems and rules of inference, derive r ^ (~r), a contradiction In particular, r could be p 3. Conclude q cannot be false, hence p  q The only difference is the negated conclusion in our assumptions Use when direct proof is difficult

42 Special case: proof by contrapositive
If r=p in the proof by contradiction, it is called the proof by contrapositive Since in effect we have shown (~q)  (~p), which is logically equivalent to p  q Example: Show for every n  Z, if n2 is even, then n is even. Suppose n2 is even, but n is odd. Then there exists an integer k s.t. n = 2k+1. If we square both sides we obtain n2 = 4k2 + 4k +1 = 2(2k2 + 2k)+1. But the equation tells us n2 is odd, a contradiction. We have proved that for every n  Z, if n2 is even, then n is even.

43 Proof by contradiction: example
Prove 2 is irrational. Suppose 2 is rational. Then there exist integers p and q such that 2 = p/q. Assume the fraction p/q is in lowest terms so that p and q are not both even. Squaring both sides gives 2 = p2/q2 Multiplying by q2 gives 2q2 = p2. It means p2 is even, then p is even (!). Therefore, there exists an integer k s.t. p = 2k. Substituting into 2q2 = p2 gives q2 = 2k2. Therefore, q is even. Thus both p and q are both even, contradicting our assumption. Therefore, 2 is irrational.

44 Others Proof by cases Prove (p1  p2  p3  …  pn)  q
Instead prove (p1  q)  …  (pn  q) Also called exhaustive proof Use when the number of cases to prove is small Proof of equivalence Prove p  q Prove p  q and q  p Existence proof Prove x P(x) Just find one x that satisfies above and that is it … Sometimes it is not so easy to find that x …

45 2.3 Resolution proofs Due to J. A. Robinson (1965)
A clause is a compound statement with terms separated by “or”, and each term is a single variable or the negation of a single variable Example: p  q  (~r) is a clause (p  q)  r  (~s) is not a clause Hypotheses and conclusion are written as clauses If a hypothesis is not a clause, it must be replaced by an equivalent expression that is either a clause or the and of clauses Only one rule: If (p  q) and (~p  r) are both true then (q  r) is true Can be checked by truth table but think If (~p  q)  (p  r), wouldn’t (q  r) follow?

46 Resolution: example Prove a  b, ~a  c, ~c  d  b  d
Resolution procedure a  b, ~a  c  b  c c  b, ~c  d  b  d Special cases If p  q and ~p  q is true If p and ~p  r are true, r is true

47 Resolution: example -- Prolog
%% (just click on likes.p and make queries %% Sam's likes and dislikes in food %% %% Considering the following will give some practice %% in thinking about backtracking. %% ?- likes(sam,dahl). %% ?- likes(sam,chop_suey). %% ?- likes(sam,pizza). %% ?- likes(sam,chips). %% ?- likes(sam,curry). likes(sam,Food) :- indian(Food), mild(Food). likes(sam,Food) :- chinese(Food). likes(sam,Food) :- italian(Food). likes(sam,chips). indian(curry). indian(dahl). indian(tandoori). indian(kurma). mild(dahl). mild(tandoori). mild(kurma). chinese(chow_mein). chinese(chop_suey). chinese(sweet_and_sour). italian(pizza). italian(spaghetti).

48 2.4 Mathematical induction
Useful for proving statements of the form nA S(n) N is the set of positive integers or natural numbers, A is an infinite subset of N S(n) is a propositional function

49 Mathematical Induction
Suppose we want to show that for each positive integer n the statement S(n) is either true or false. 1. Verify that S(1) is true. 2. Let n be an arbitrary positive integer. Let i be a positive integer such that i < n. 3. Show that S(i) true implies that S(i+1) is true, i.e. show S(i)  S(i+1). 4. Then conclude that S(n) is true for all positive integers n.

50 Mathematical induction: terminology
Basis step Verify that S(1) is true. Inductive step Assume S(i) is true. Prove S(i)  S(i+1). Conclusion Therefore S(n) is true for all positive integers n.

51


Download ppt "이산 수학 Discrete Mathematics"

Similar presentations


Ads by Google