1 / 58

Discrete Mathematical Structures

Discrete Mathematical Structures. 离散数学结构. Bernard Kolman Robert C. Busby Sharon Cutler Ross. 《 离散数学 》 教学组. Chapter 2 Logic. 2.1 Propositions and Logical Operations 2.2 Conditional Statements 2.3 Methods of Proof 2.4 Mathematical Induction. 推理的符号化(形式化) 推理规则举例: 假言推理( modus ponens )

emery-burt
Télécharger la présentation

Discrete Mathematical Structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Discrete MathematicalStructures 离散数学结构 Bernard Kolman Robert C. Busby Sharon Cutler Ross 《离散数学》教学组

  2. 中山大学软件学院 Chapter 2 Logic 2.1 Propositions and Logical Operations 2.2 Conditional Statements 2.3 Methods of Proof 2.4 Mathematical Induction

  3. 推理的符号化(形式化) 推理规则举例: 假言推理(modus ponens) 如果张三是软院2011级学生,那么离散数学是张三的必修课 张三是软院2011级学生 所以,离散数学是张三的必修课 符号化: p =>q p ------------ q 若 p 则 q p ------------ q

  4. 推理规则举例: 三段论(Syllogism) 所有软院2011级学生必修离散数学 张三是软院2011级学生 所以,张三必修离散数学 符号化: x(A(x) -> B(x)) A(a) ------------ B(a)

  5. Gottfried Wilhelm Leibniz’s (July 1, 1646 – November 14, 1716) Symbolic thought: The only way to rectify our reasonings is to make them as tangible as those of the Mathematicians, so that we can find our error at a glance, and when there are disputes among persons, we can simply say: Let us calculate [calculemus], without further ado, to see who is right. It is obvious that if we could find characters or signs suited for expressing all our thoughts as clearly and as exactly as arithmetic expresses numbers or geometry expresses lines, we could do in all matters insofar as they are subject to reasoning all that we can do in arithmetic and geometry. For all investigations which depend on reasoning would be carried out by transposing these characters and by a species of calculus. Formal Logic George Boole (2 November 1815 -8 December 1864 ) invented Boolean Logic. Reasoning in Mathematics

  6. 中山大学软件学院 2.1 Propositions and Logical Operations 1) Statement or Proposition A statement or proposition (命题) is a declarative sentence that is either true or false, but not both. Ex. Which of the following are statements? (a) The earth is round. (b) 2 + 3 = 5. (c) Do you speak English? (d) 3 – x = 5 (e) Take two aspirins. (f) The temperature on the surface of the planet Venus (金星) is 800F. (g) The sun will come out tomorrow. Yes Yes No, it is a question. No, it is a declaration sentence, not a statement. No, it is a command. Yes, it is a statement. Yes, it is a statement.

  7. Proposition examples (compound propositions): 2 is an even number and 3 is an odd number. 2 is an even number and 3 is an even number. 2 is an odd number and 3 is an odd number. 2 is an odd number and 3 is an even number. 2 is an odd number and I am a student. Pattern of the proposition: with connective “and” Symbol: /\ (conjunction) Truth of the pattern, or the truth table of “/\”

  8. Compound proposition examples: 2 is an even number or 3 is an odd number. 2 is an even number or 3 is an even number. 2 is an odd number or 3 is an odd number. 2 is an odd number or 3 is an even number. 2 is an odd number or 2 is an even number. Pattern of the proposition: with connective “or” Symbol: \/ (disjunction) Truth of the pattern, or the truth table of “\/”

  9. Compound proposition examples: If I am hungry, then I’ll eat. If it is raining, then 2+3 = 5. If it is raining, then 2+3 = 4. If 2 is an even number, then 3+3 = 4. If 2 is an odd number, then 3 +3 = 4. If 2 is an odd number, then the sun rise on the west. Pattern of the proposition: with connective “if … then …” Symbol: => (implication, antecedent, consequent) Truth of the pattern, or the truth table of “=>”

  10. Compound proposition examples 2 is not an odd number. 2 is not an even number. Pattern of the proposition: with connective “not” Symbol: ~ Truth of the pattern, or the truth table of “~”

  11. Equivalence of propositions p => q and ~p \/ q Bidirectional p < = > q Tautologies Absurdity Videos:Inventing on Principle http://worrydream.com/ABriefRantOnTheFutureOfInteractionDesign/

  12. 中山大学软件学院 2.1 Propositions and Logical Operations 2) Proposition variable and Compound statements In Logic, the letters p, q, r, … denote propositionvariable (命题变量), they are replaced by statements. p: The sun is shining today. q: It is cold. Statement or proposition variables can be combined by logical connectives (逻辑联结词) to obtain compound statements(复合命题). Ex. and p and q: The sun is shining today and it is cold.

  13. 中山大学软件学院 2.1 Propositions and Logical Operations 3) Negation of statement – 否定命题 If p is a statement, the negation (非) of p is the statement not p, denote by ~p. ~p is the statement “it is not the case that p”. If p is true, ~p is false. If p is false, ~p is true. The truth table(真值表) is a table that shows the truth valuesof a compound statement in terms of its component parts. The truth table p ~p T F F T

  14. 中山大学软件学院 2.1 Propositions and Logical Operations 3) Negation of statement not is not a connective, it does not join two statements. notp is not compound statement. not is a unary operation for collection of statements. ~p is statement if p is. Ex. Give the negation of the following statements: (1) p: 2 + 3 > 1. (2) q: it is cold. Solution: (1) ~p: 2 + 3  1. (2) ~q: it is not cold.

  15. 中山大学软件学院 2.1 Propositions and Logical Operations 4) Conjunction of statements –合取式 If p and q are statements, the conjunction of p and q is “p and q”, denote by pq.  stands for connective and. The compound pq is true if both p and q are true, otherwise, it is false. The truth table of pq pq pq T T T F F T F F T F F F

  16. 中山大学软件学院 2.1 Propositions and Logical Operations 4) Conjunction of statements Ex. From the conjunction of p and q for each of the following. (a) p: It is snowing, q: I am cold. (b) p: 2 < 3, q: -5 > -8. (c) p: It is snowing, q: 3 < 5. Solution: (a) pq: it is snowing and I am cold. (b) pq: 2 < 3 and -5 > -8. (c) pq: It is snowing and 3 < 5.

  17. 中山大学软件学院 2.1 Propositions and Logical Operations 5) Disjunction of statements – 析取式 If p and q are statements, the disjunction of p and q is “p or q”, denote by pq.  denotes the connective or. The compound pq is true if at least one of p or q is true, it is false when both p and q are false. The truth table of pq pq p q T T T F F T F F T T T F

  18. 中山大学软件学院 2.1 Propositions and Logical Operations 5) Disjunction of statements Ex. From the disjunction of p and q for each of the following. (a) p: 2 is a positive integer q: 21/2 is a rational number. (b) p: 2 + 3  5 q: London is the capital of France. Solution: (a) pq: 2 is a positive integer or 21/2 is a rational number. p is true, q is false, so pq is true. (b) pq: 2 + 3  5 or London is the capitcal of France. p and q are false, so pq is false.

  19. 中山大学软件学院 2.1 Propositions and Logical Operations 6) Compound statement – 复合命题 The compound statement has many component parts, both of component parts are connected by connective. pq(pr) is compound statement and has three compound parts (propositions): p, q and r. pq(pr) = pqr pr q(pr) pq(pr) p q r T T T T T F T F T T F F F T T F T F F F T F F F T T T T T F T F T T F F T F F F T T T T T F F F

  20. 中山大学软件学院 2.1 Propositions and Logical Operations 7) The truth table – 真值表 If a compound statement s has n component statements, there will need to be 2n rows in the truth table for s. its truth table may be systematically constructed in the following way. (1). The first n columns of the table are labeled by statements, further columns are included for all intermediate expression, the last column is for the full statement. (2). Under each of the first n headings, we list the 2n possible n-tuples of truth values for the n component statements. (3). For each of the remaining columns, we compute the remaining truth values in sequence.

  21. 中山大学软件学院 2.2 Conditional Statements If p and q are statements, the compound statement “if p then q” denoted by pq, is called a conditional statement (条件命题), or implication (蕴涵). To pq, p is called the antecedent (前件) or hypothesis (假设), and q is called the consequent (后件) or conclusion(结论). Ex. Write the implication pq for each of the following. (a) p: I am hungry. q: I will eat. (b) p: It is snowing. q: 3 + 5 = 8 Solution: (a) If I am hungry, then I will eat. (b) If it is snowing, then 3 + 5 = 8.

  22. 中山大学软件学院 2.2 Conditional Statements pq: p implies q; q if p; p only if q. p is a sufficient condition for q, q is necessary condition for p. If pq is a implication, the converse (逆命题) of pq is the implication qp, and the contrapositive (逆否命题) of pq is the implication ~q ~p. Ex. Give the converse and contrapositive of the implication “If it is raining, then I get wet.” Solution: p: It is raining;q: I get wet. the converse is qp: If I get wet, then It is raining. the contrapositive is ~q ~p: If I don’t get wet, then it is not raining.

  23. 中山大学软件学院 2.2 Conditional Statements If p and q are statements, the compound statement p if and only if q, denoted by pq, is called an equivalence (等价) or biconditional (双条件). The connective if and only if is denoted by the symbol . conditional statement (条件命题), or implication (蕴涵). The truth table of pq is following. pq is true only when both p and q are true or when both p and q are false. The equivalence pq can also be stated as p is a necessary and sufficient condition for q. The truth table of p  q p q p  q T T T F F T F F T F F T

  24. 中山大学软件学院 2.2 Conditional Statements Ex. Compute the truth table of the statement (p q)  (~q ~p). Solution: pq p q ~q ~p ~q ~p (p q)  (~q ~p) T T T F F T F F T F T T F T F T F F T T T F T T T T T T

  25. 中山大学软件学院 2.2 Conditional Statements A statement that is true for all possible values of its propositional variables is called a tautology(重言式/永真式). A statement that is always false is called a contradiction (矛盾/永假式) or an absurdity (谬论). A statement that can be either true or false, depending on the truth values of its propositional variables, is called a contingency (不定式). Ex. (a) (p q)  (~q ~p) is a tautology. (b) p ~p is an absurdity. (c) (pq)  (pq) is a contingency.

  26. 中山大学软件学院 2.2 Conditional Statements If p q is a tautology, p and q are logically equivalent (逻辑等价), or simply equivalent (等价). “p is equivalent to q” is denoted by p q. Ex. p qqp. pq p q qp (p q)  (qp) T T T F F T F F T T T F T T TF T T T T The truth table for (p q)  (qp) shows the statement is a tautology.

  27. 中山大学软件学院 2.2 Conditional Statements Ex. p q is equivalent to (~pq). p q ~p ~p q pq T T T F F T F F T F T T F F T T T F T T Column 1 and 3 in the above table show that for any truth values of p and q, p q and (~pq) have the same truth values.

  28. 中山大学软件学院 2.2 Conditional Statements Theorem 1 The operations for propositions have the following properties. (1) Commutative properties p qqp p qqp (2) Associative properties p (q r)  (pq) rp (q r)  (pq) r (3) Distributive properties p (q r)  (pq)  (pr) p (q r)  (pq)  (pr) (4) Idempotent properties p ppp pp (5) PropertiesofNegation ~(~p) p ~(p q)  (~p)  (~q) ~(p q)  (~p)  (~q)

  29. 中山大学软件学院 2.2 Conditional Statements Theorem 2 (a) (p q)  ((~p) q) (b) (p q)  (~q ~p) (c) (p q)  ((pq)  (qp)) (d) ~(p q)  (p ~q) (e) ~(p q)  ((p ~q)  (q ~p))

  30. 2.2 Conditional Statements 中山大学软件学院 Theorem 4 Each of the following is a tautology. (a) (pq) p (b) (pq) q (c) p (pq) (d) q (pq) (e) ~p (pq) (f) ~(pq) p (g) (p (pq)) q (h) (~p (pq)) q (i) (~q (pq))  ~p (j) ((pq)  (qr))  (pr)

  31. Theorem If A and B are finite sets, then |A∪B|=|A|+|B|-|A∩B|. Implicitly, we are saying that for all sets A and B, if A and B are finite, then |A∪B|=|A|+|B|-|A∩B|. Here we have a predicate P(x): x is a finite set. Formalization of math statements

  32. Theorem Let a, b and c be integers. If a | b and a | c, then a | (b+c). Implicitly, we are saying that for all integers a, b and c If a | b and a | c, then a | (b+c). Here we have a binary predicate (or a relation) R(x,y): x | y.

  33. 2.1 Propositions and Logical Operations 中山大学软件学院 8) Quantifiers – 量词 A = { x | P(x) } The set A is the collection that an object t for which P(t) is true. P(x) is called predicate(谓词) or propositional function (命题函数). To each choice of x, P(x) is a proposition that is either true ot false. Ex. A = { x | x is an integer less than 8 }. P(x) is the sentence “x is an integer less than 8”. P(1) and P(2) are true, P(9) is false.

  34. 2.1 Propositions and Logical Operations 中山大学软件学院 9) Universal quantification – 全称量化 The universal quantification of a predicate P(x) is the statement “For all values of x, P(x) is true”, it is denoted by xP(x). The symbol  is called universal quantifier(全称量词). Ex. P(x): -(-x) = x, x is a real number. xP(x) is true because for all real numbers, -(-x) = x. Q(x): x + 1 = 4. xQ(x) is false because Q(1) is false. 判定xP(x)真假的一般方法: (1) 当要确定xP(x)为“真”时, 则要确定所有P(x)都为“真”; (2) 当要确定xP(x)为“假”时, 只要找一个y, 使得: P(y)为“假”.

  35. 2.1 Propositions and Logical Operations 中山大学软件学院 9) Universal quantification A predicate may contain many variables. The universal quantification may be applied to each of the variables. if P(x, y) is a predicate, its universal quantification is xyP(x, y). For example, P(x, y): x + y = y + x xyP(x, y) is true for every x and y. Q(x, y): x ∪ y = y ∪ x xyQ(x, y) is true for any set x and y.

  36. 2.1 Propositions and Logical Operations 中山大学软件学院 10) Existentialquantification – 存在量化 The existentialquantification of a predicate P(x) is the statement “There exists a value of x for which P(x) is true”, it is denoted by xP(x). The symbol  is called existentialquantifier(存在量词). Ex. P(x): x + 1 < 4, x is a real number. xP(x) is true because P(2) is true. Q(y): y + 2 = y. yQ(y) is false because Q(y) is false for any y. 判定xP(x)真假的一般方法: (1) 当要确定xP(x)为“真”时, 只要找到一个x, 使得: P(x)为“真”; (2) 当要确定xP(x)为“假”时, 则要确定所有的x, 都有: P(x)为“假”.

  37. 2.1 Propositions and Logical Operations 中山大学软件学院 10) Existential quantification A predicate may contain many variables. The existentialquantification may be applied to each of the variables. if P(x, y) is a predicate, its existentialquantification is xyP(x, y). Ex. P(x, y): x * y = y + x xyP(x, y) is true because x = 2 and y = 2. Q(x, y): x∩y = x - y xyQ(x, y) is false for any set x and y. x=?

  38. 2.1 Propositions and Logical Operations 中山大学软件学院 10) The order of quantifiers The order of same quantifiers is not important, it does n’t affect the truth value. The order of different quantifiers is important, it affects the truth value. Ex. P(x, y): x + y = 0 xyP(x, y) is true, xyP(x, y) is false. Q(x, y): x * y = 0 xyP(x, y) is true, xyP(x, y) is true too. R(x, y): <x, y>  E(G), x, y  V(G) xyR(x, y) is true, xyR(x, y) is false. v2 v1 v3 v4 图G

  39. 2.1 Propositions and Logical Operations 中山大学软件学院 11) Negation of quantifiers Let p: xP(x), what is the negation of p? (~p) ~p: ~xP(x) = x~P(x). Let q: xQ(x), what is the negation of q? (~q) ~q: ~xQ(x) = x~Q(x). 3

  40. 中山大学软件学院 2.2 Conditional Statements Theorem 3 (a) ~(xP(x))  x~P(x) (b) ~(xP(x))  x(~P(x)) (c) x(P(x)  Q(x))  xP(x) xQ(x) (d) x(P(x)  Q(x))  xP(x) xQ(x) (e) x(P(x)  Q(x))  xP(x) xQ(x) (f) xP(x) xQ(x)  x(P(x)  Q(x)) is a tautology (g) x(P(x)  Q(x))  xP(x) xQ(x) is a tautology

  41. 中山大学软件学院 2.3 Methods of Proof If an implication p q is a tautology, where p and q may be compound statements involving any number of proposition variables, we say that qlogically follows from p. Suppose that an implication of the form (p1p2 … pn) q is a tautology. We say that q logically follows from p1,p2,…, pn, and write p1 p2 ┆ pn q If p1,p2, …, pn are true, we know q is true. 

  42. 中山大学软件学院 2.3 Methods of Proof (p1p2 … pn) q The pi’s are called the hypotheses (假设) or premises (前提), and q is called the conclusion(结论). To “prove the theorem” means to show that the implica-tion is a tautology. If p1,p2,… and pn are true, q will be true. For this reason, mathematical proofs often begin with the statement “suppose that p1,p2,… and pn are true” and conclude with the statement “therefore, q is true.” The proof does not show that that q is true, but simply shows if the pi are all true, then q has to be true.

  43. Arguments based on tautologies represent universally correct methods of reasoning. The validity only depends on the form of the statements involved and not on the truth values of the variables they contain. Such arguments are called rules of inference. A mathematical proof of a theorem must start with the hypotheses, proceed through various steps, each justified by some rule of reference, and arrive at the conclusion. (see page 63). Methods of Proofs

  44. 中山大学软件学院 2.3 Methods of Proof Ex. ((pq)  (qr))  (pr) The argument pq qr pr  is valid, and so is a rule of inference. Ex. Is the following argument valid? If you invest in the stock market, then you will get rich. If you get rich, then you are happy. If you invest in the stock market, then you are happy.  The argument is valid, although the conclusion may be false.

  45. 中山大学软件学院 2.3 Methods of Proof A important rule of inference is p pq q  That is, p is true and p q is true, so q is true. The rule is called modus ponens (假言推理), or the method of asserting (论断方法).

  46. 中山大学软件学院 2.3 Methods of Proof Ex. Is the following argument valid? Smoke is healthy. If Smoke is healthy, then cigarettes are prescribed by physicians. Cigarettes are prescribed by physicians.  The argument is valid. However, the conclusion is false. Ex. Is the following argument valid? If taxes are lowered, then income rises. Income rises. Taxes are lowered.  Solution: p: taxes are lowered, q: income rises. p q may be true with p being false. Then the conclusion p is false. The argument is not valid. p q q p 

  47. 中山大学软件学院 2.3 Methods of Proof Ex. Let n be an integer. Prove that if n2 is odd, then n is odd. Proof: p: n2 is odd. q: n is odd. We have to prove that p q is true. Suppose that ~q is true, i.e. n is not odd. Then n = 2k, where k is an integer. n2 = (2k)2 = 4k2 = 2(2k2), so n2 is even. So we have that if n is even, then n2 is even, which is the contrapositive of the given statement. Hence the given statement has been proved.

  48. 中山大学软件学院 2.3 Methods of Proof An important indirect proof technique is proof by contradiction(反证法). This method is based on the tautology ((pq)  (~q))  ~p Thus the rule of inference is valid. pq ~q ~p Suppose we prove that a statement q logically follows from statements p1,p2, …, pn. If p1p2 … pn (~q) implies a contradiction, then at least one of the statements p1, p2, …, pn, (~q) must be false. If all the pi’s are true, then ~q must be false, so q is true. This is proof by contradiction. 

  49. 中山大学软件学院 2.3 Methods of Proof Ex. Prove there is no rational number p/q whose square is 2. In other words, show 21/2 is irrational. Proof: Assume (p/q)2 = 2 for some integers p and q, which have no common factors. Then p2 = 2q2, so p2 is even. Since the square of an odd number is odd, so p is even. Suppose that p = 2k for some integer k. 2q2 = (2k)2 = 4k2 q2 = 2k2 Thus, q2 is even, and q is even. Now p and q are even, and have a common factor 2. This is a contradiction to the assumption. Thus the assumption is false.

  50. 中山大学软件学院 2.3 Methods of Proof In order to prove a theorem of the form (p1p2 … pn) q, we begin with the hypothesis p1, p2, …, pn and show that some result r1 logically follows. Then, using p1, p2, …, pn, r1, we show that some other statement r2 logically follows. We continue this process, producing intermediate statements r1, r2, …, rk, called steps in the proof, until we can finally show that the conclusion qlogically follows from p1, p2, …, pn, r1, r2, …, rk. Each logical step must be justified by some valid proof technique, based on the rules of inference, or on some other rules that come from tautological implications. 4

More Related