1 / 23

CSC 415 Foundations of CS

CSC 415 Foundations of CS. Logic Part II. Logic Part 2. Predicate logic Propositional functions Domain of Discourse Quantifiers For all …  There exists …  For some Theorems and Proofs Mathematical induction. Propositions vs propositional functions.

lang
Télécharger la présentation

CSC 415 Foundations of CS

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. CSC 415 Foundations of CS Logic Part II

  2. Logic Part 2 • Predicate logic • Propositional functions • Domain of Discourse • Quantifiers • For all …  • There exists …  • For some • Theorems and Proofs • Mathematical induction

  3. Propositions vs propositional functions q: 2+2 is a positive numberp: x+2 is a positive number • q is a proposition (T) • p is not a proposition since its truth value depends on the value of x • x here is a variable • For each value of x, p(x) is a different proposition p(1): 1+2 is positive (T) p(-3): -3+2 is positive (F) • p(x) is a propositional function

  4. Propositional functions Definition: Let p(x) be a statement involving the variable x. We say that p(x) is a propositional function if for each x in a set D, p(x) is a proposition. The set D is call Domain of Discourse (DoD). • p(t) : t+2 is a positive integer DoD={integers} it’s a propositional fct. • q(x): x+2 is a positive integer DoD={real numbers} it is NOT a propositional fct.

  5. Mini test • Which of the following are propositions, which are prop. fcts and which are neither ? • Every apple is red • The car was brown • There are some apples that are red • May I have a glass of water, please ? • Every positive integer n is a multiple of 3 • There is at least one positive integer n that is a multiple of 3 Proposition Propositional Function Proposition Neither Proposition Proposition

  6. What is the difference ? Consider the following sentences: • The apple is red • Every apple is red • There are some apples that are red • The apple is the variable in the first sentence • The variable apple in the last two sentences is not exactly specified, but it is QUANTIFIED • The quantification of the variable turns a sentence which was bound to be a propositional function into an actual proposition Propositional Function Proposition Proposition

  7. Quantified Statements • For all triangle, the sum of the internal angles is equal to 180 degrees • There exists an algorithm that solves the Tower of Hanoi puzzle in an optimal way • For some odd positive integer n, n is not prime

  8. Universal quantifiers Definition: Let p(x) be a propositional function over D. The statement for all x, p(x) is called a universally quantified statement, noted:  x, p(x) • The statement x P(x) is • True if P(x) is true for every x  D • False if P(x) is not true for some x  D • The statement x P(x) is a proposition HO 1

  9. Universal quantifiers (example) • For all real numbers x, it is x2 + 1  0 • D.o.D. = real numbers • p(x) : x2 + 1  0 •  x, p(x) true ? • YES, why? Because • the square of any real number is positive or at least zero. • When we add 1, we certainly get a number strictly greater, and as such different, than zero.

  10.  x, p(x) • What do I have to do to SHOW that  x, p(x)is true ? • Give a reasonable argument • Do some work • What do I have to do to SHOW that  x, p(x)is false ? • It is enough to produce a particular, specific x for which p(x) is false. Such an x is called a COUNTEREXAMPLE HO 2

  11. Existential quantifiers Definition: Let p(x) be a propositional function over D. The statement for some x, p(x) (or there exists an x, p(x)),is called an existentially quantified statement, noted:  x, p(x) • The statement  x, p(x)istruewhen we can exhibit at least one particular, specific x in the D.o.D. for which p(x) is true. • Ex : For some real number x, x /(x+3) = - 1/5it is true because X= -1/2 satisfies the equality HO 3

  12.  x, p(x) • What do I have to do to SHOW that  x, p(x) is true ? • It is enough to produce a particular, specific x for which p(x) is true. • What do I have to do to SHOW that  x, p(x) is false ? • Give a reasonable argument. • Answer the “why?” question satisfactorily

  13. De Morgan, again….. • How do we show that  x, p(x) is false? • We find a counterexample • We find x such that p(x) is false • We exhibit x, such that p(x) is false • We exhibitx, such that not(p(x)) is true !!! • But this means that to show the truth of not (  x, p(x) ) we showed the truth of  x, not (p(x))

  14. De Morgan again…..  x, p(x)   x, p(x) First generalized De Morgan Law for logic Group Exercise Guess what the second generalized De Morgan law for logic looks like and try to give an argument for its validity.

  15. English Equivalence

  16. In order to prove the universally quantified statement x P(x) is true It is not enough to show P(x) true for some x  D You must show P(x) is true for every x  D In order to prove the universally quantified statement x P(x) is false It is enough to exhibit some x  D for which P(x) is false This x is called the counterexample to the statement x P(x) is true Summary of propositional logic

  17. In order to prove the existentially quantified statement x P(x) is true It is enough to show P(x) true for one x  D You don’t need to show P(x) is true for every x  D In order to prove the existentially quantified statement x P(x) is false You need to show P(x) is false for every x  D Summary of propositional logic

  18. Mixing quantifiers • When an existential quantifier and a universal quantifier appear together, their order is crucial. • Let the D.o.D. be the set of real numbers. Consider the following statements: •  x,  y, x + y = 0 •  x,  y, x + y = 0 TRUE FALSE HO 4

  19. Negation of combined quantifiers Write the negation of the statements involving combined quantifiers presented in the previous handout HO 4

  20. The way Mathematics is done • How does mathematics develop ? • In a specific context, a PROBLEM arises • Efforts to solve the problem lead to the introduction of new concepts and the discovery of properties of the newly introduced concepts. • New concepts DEFINITIONS • Properties THEOREMS

  21. Example • In many contexts (engineering, physics, theoretical computer science) it is necessary to solve systems of linear equations • This leads to the introduction of matrices and the whole theory of matrix algebra

  22. Presenting your findings to the world • You worked on a problem • You created new definitions for your new interesting concepts • Now you think you have discovered some important property of your new concepts • How do you convince the rest of the world that the properties you say are true are indeed true?

  23. Proofs • You need to come up with an argument that answers the “WHY” question. • You need A CONVINCING ARGUMENT FOR A REASONABLE, INTELLIGENT, SKEPTIC PERSON • You need a P R O O F

More Related