이산 수학 Discrete Mathematics

Slides:



Advertisements
Similar presentations
Introduction to Proofs
Advertisements

February 26, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers Example: Add a = (1110) 2 and b = (1011) 2. a 0 + b.
Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
CS128 – Discrete Mathematics for Computer Science
CSE115/ENGR160 Discrete Mathematics 01/31/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/01/11
So far we have learned about:
TR1413: Discrete Mathematics For Computer Science Lecture 1: Mathematical System.
Fall 2002CMSC Discrete Structures1 Let’s proceed to… Mathematical Reasoning.
Methods of Proof & Proof Strategies
1.1 Sets and Logic Set – a collection of objects. Set brackets {} are used to enclose the elements of a set. Example: {1, 2, 5, 9} Elements – objects inside.
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Introduction to Proofs
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 03: PROOFS Section 1.5 Jarek Rossignac CS1050: Understanding.
MATH 224 – Discrete Mathematics
Review I Rosen , 3.1 Know your definitions!
CSci 2011 Discrete Mathematics Lecture 6
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
CS201: Data Structures and Discrete Mathematics I
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Professor: Munehiro Fukuda
Discrete Mathematics Set.
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Chapter 1, Part III: Proofs With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Chapter 1 Logic and proofs
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
Chapter 1 Logic and Proof.
Chapter 1 Logic and Proof.
The Foundations: Logic and Proofs
2. The Logic of Compound Statements Summary
CSE15 Discrete Mathematics 02/01/17
CSE15 Discrete Mathematics 01/30/17
Discrete Mathematics Logic.
Chapter 1 Logic and Proofs Homework 2 Given the statement “A valid password is necessary for you to log on to the campus server.” Express the statement.
Y. Davis Geometry Notes Chapter 2.
Proof Techniques.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
The Foundations: Logic and Proofs
CHAPTER 1: LOGICS AND PROOF
CS201: Data Structures and Discrete Mathematics I
Mathematical Reasoning
Methods of Proof. Methods of Proof Definitions A theorem is a valid logical assertion which can be proved using Axioms: statements which are given.
CSE 311: Foundations of Computing
Applied Discrete Mathematics Week 1: Logic
First Order Logic Rosen Lecture 3: Sept 11, 12.
Week #2 – 4/6 September 2002 Prof. Marie desJardins
Discrete Mathematics R. Johnsonbaugh
Computer Security: Art and Science, 2nd Edition
Discrete Mathematics Logic.
Foundations of Discrete Mathematics
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Foundations of Discrete Mathematics
Mathematical Reasoning
CS201: Data Structures and Discrete Mathematics I
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

이산 수학 Discrete Mathematics Hyogon Kim 정통관 303 hyogon@korea.ac.kr / 3204

과목 소개 교재 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  이산수학

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

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

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

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}

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]

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}

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)

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.

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

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

Properties of set operations Theorem 2.1.10: 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 = 

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

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

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 …

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 

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

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

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

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

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

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

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.

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

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)

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

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.

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.

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"

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

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))

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

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

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.

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.

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."

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.

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.

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

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

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.

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.

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 …

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?

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

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).

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

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.

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.