Logic 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 of 1 - - PowerPoint PPT Presentation

logic
SMART_READER_LITE
LIVE PREVIEW

Logic 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 of 1 - - PowerPoint PPT Presentation

Logic http://localhost/~senning/courses/ma229/slides/logic/slide01.html Logic http://localhost/~senning/courses/ma229/slides/logic/slide02.html Logic prev | slides | next prev | slides | next Propositions A proposition is a statement that is


slide-1
SLIDE 1

Logic http://localhost/~senning/courses/ma229/slides/logic/slide01.html 1 of 1 08/26/2003 03:33 PM prev | slides | next

Logic

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide02.html 1 of 1 08/26/2003 03:33 PM

Logic

prev | slides | next

Propositions A proposition is a statement that is either true or false, but not both.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide03.html 1 of 1 08/26/2003 03:33 PM

Logic

prev | slides | next

Propositions: Example The following statements are propositions: 2 + 2 = 4 I am an American my hair is blue The following statements are not propositions: 6 + 8 Simon says "sit down" Do you want to go to the store?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide04.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Propositions We usually use lowercase letters for propositions: p, q, r, ... Let p be a proposition. The negation of p is written p (or p’) and is read "not p."

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

slide-2
SLIDE 2

Logic http://localhost/~senning/courses/ma229/slides/logic/slide05.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Truth Tables A truth table is a useful tool with which to analyse propositions. It works by listing all possible truth values of a set of propositions. All possible truth values of the proposition p are listed in the truth table

p p t f f t

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide06.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Conjunctions Let p and q be propositions. The proposition "p and q", denoted p q, is true when p and q are both true, otherwise it is false. We say that p q is the conjunction of p and q. p: eyes are blue q: hair is brown p q: eyes are blue and hair is brown.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide07.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Disjunctions Let p and q be propositions. The proposition "p or q", denoted p q, is false when p and q are both false and true otherwise. We say that p q is the disjunction of p and q. p: eyes are blue q: hair is brown p q: eyes are blue or hair is brown.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide08.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Truth Tables for Conjunctions and Disjunctions

conjunction p q p q t t t t f f f t f f f f disjunction p q p q t t t t f t f t t f f f

Notice how the number of rows depends on the number of propositions.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

slide-3
SLIDE 3

Logic http://localhost/~senning/courses/ma229/slides/logic/slide09.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Exclusive Or There are two different types of "or" operations in logic. If you’ve had MA141 or PH121 then you are good at mathematics. 1. You may choose the pizza or the porkchop. 2. The first of these is the disjunction form. The second "or" is an exclusive or; you can have one or the other but not both.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide10.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Exclusive Or Let p and q be propositions. The proposition denoted p xor q is the exclusive or of p and q and is true when exactly one of p and q is true and the other is false.

exclusive or p q p xor q t t f t f t f t t f f f

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide11.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Implications Let p and q be propositions. The implication p q is the proposition that is false when p is true and q is false and is true

  • therwise. It is read "p implies q."

Here p is the hypothesis and q is the conclusion.

implication p q p q t t t t f f f t t f f t

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide12.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Implications Implications are also called conditionals and are usually read "if p then q." Consider the following statement:

if I can write then I can read. p q

When is this true? When is this false? Is it always either true or false?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

slide-4
SLIDE 4

Logic http://localhost/~senning/courses/ma229/slides/logic/slide13.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Biconditionals Consider the compound proposition (p q) (q p) This is called a biconditional and is read "p if and only if q." We denote this proposition with "p q."

p q p q q p p q t t t t t t f f t f f t t f f f f t t t

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide14.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Converse and Contrapositive The converse of p q is q p. Note that the the truth value of an implication and its converse are not necessarily the same. The contrapositive of p q is q

  • p. Note that these have the

same truth values.

p q p q p q q p q p t t f f t t t t f f t f t f f t t f t f t f f t t t t t

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide15.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Propositional Equivalences

Key Idea

Replace one proposition by another that is equivalent in order to achieve a desireable goal. Example: p can always be replaced by ( p) since a truth table indicates that both p and ( p) have the same truth values.

p p ( p) t f t f t f

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide16.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Propositional Equivalences A compound proposition is one involving more than one simple

  • proposition. For example p q is a compound proposition made up
  • f the two simple propositions p and q.

A compound proposition is a tautology if it is always true and it is a contradiction if it is always false; otherwise it is called a contingency. The propositions p and q are logically equivalent if p q is a

  • tautology. We use the notation p q to denote logical equivalence.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

slide-5
SLIDE 5

Logic http://localhost/~senning/courses/ma229/slides/logic/slide17.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Exercises Use truth tables to show the following: p (q r) (p q) (p r). 1. p q is logically equivalent to (p q) ( p q). 2.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide18.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Logical Equivalences

Equivalence Name p T p Identity laws p F p p T T Domination laws p F F p p p Idempotent laws p p p ( p) p Double negation law

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Logic http://localhost/~senning/courses/ma229/slides/logic/slide19.html 1 of 1 08/26/2003 03:34 PM

Logic

prev | slides | next

Logical Equivalences

Equivalence Name p q q p Commutative laws p q q p (p q) r p (q r) Associative laws (p q) r p (q r) p (q r) (p q) (p r) Distributive laws p (q r) (p q) (p r) (p q) p q De Morgan’s laws (p q) p q

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19