logic notes

21
Logic

Upload: acavis

Post on 20-Jan-2015

1.783 views

Category:

Technology


7 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Logic Notes

Logic

Page 2: Logic Notes

Statements• Statement – a sentence that is either true or

false• Examples:

– Lansing is the Capitol of Michigan– All swimming pools are rectangles– Mr. Cavis is an amazing teacher– Class will be cancelled next Wednesday– 2 is an even number– 13 is an even number

• We often use ‘P’ or ‘Q’ to represent statements– Ex – P1: Lansing is the Capitol of Michigan

P2: All swimming pools are rectangles

Page 3: Logic Notes

Statements – Simple and Compound

• A Simple Statement is a statement that conveys 1 idea

• A Compound Statement is a statement that combines 2 or more simple statements

• Examples:– Mr. Cavis drives a minivan– Seven times four is 28 and today is Friday– The earth is flat or I had waffles for

breakfast

Page 4: Logic Notes

Truth Values and Open Sentences

• A statement’s Truth Value is whether it is true (T) or false (F)

• So P1: Lansing is the Capitol of Michigan has a truth value of true (T)

• While P2: All swimming pools are rectangles, has a truth value of false (F)• Open sentence – a sentence whose truth value depends on the value of some variable.

• Example:

- 3x = 12; is a open math sentence.

Page 5: Logic Notes

Truth Tables• Truth Tables are a way of organizing the possible truth values of a statement or series of statements

P

T

F

Q

T

F

P Q

T T

T F

F T

F F

Page 6: Logic Notes

Negation – “Not statements”

• Negation – Changing a statement so that it has the opposite meaning and truth values

- We generally do this by inserting the word ‘NOT’

- The symbol for negation is ‘~’ and is read “Not”

- So if we have a statement P: five plus two is seven; the negation of that would be ~P: five plus two is not seven

• Example:

P: There is snow on the ground

~P: There is not snow on the ground

Page 7: Logic Notes

Truth Table for Negation

P

T

F

~P

F

T

Page 8: Logic Notes

“And Statements” (Conjunctions)

• When we are making the conjunction of 2 or more statements, we use the word “And,” and the symbol that we use is ‘^’ (Looks like an A without the middle line – ‘And’ starts with ‘A’)

• Example:– P: I found $5– Q: I crashed my car into a telephone pole– P^Q:

I found $5 AND I crashed my car into a telephone pole.

Page 9: Logic Notes

Truth Table for “And”

• A conjunction is only true if all of the statements in it are true, otherwise it is false

P Q P^Q

T T T

T F F

F T F

F F F

Page 10: Logic Notes

“Or Statements” (Disjunctions)

• When we are making the disjunction of 2 or more statements, we use the word “Or,” and the symbol that we use is ‘V’

• Example:– P: The number 3 is odd– Q: 57 is a prime number– PVQ:

The number 3 is odd OR 57 is a prime number.

Page 11: Logic Notes

Truth Table for “Or”

• A disjunction is true if at least one of the statements in it are true, otherwise it is false.

P Q PVQ

T T T

T F T

F T T

F F F

Page 12: Logic Notes

Implication

• Called an implication because we are “Implying” something to be true

• Also known as an “If-Then” Statement

• An implication for statements P and Q is denoted P=> Q

• An implication is read either “If P, then Q” or “P implies Q”

Page 13: Logic Notes

Truth Table for “If-Then”

• An implication is only false when the first statement is true and the second one is false, otherwise it is true.

P Q P=>Q

T T T

T F F

F T T

F F T

Page 14: Logic Notes

Example of an “If-Then”-Suppose a student in here is getting a B+ and asks me “Is there any way for

me to get an ‘A’ in this class?”- I tell that student “If you get an ‘A’

on the final exam, then you will get an ‘A’ in the class.”

-So here are our 2 statements*P: You get an ‘A’ on the Final Exam*Q: You get an ‘A’ in the class

Page 15: Logic Notes

Example of an “If-Then” (Cont.)

-Think of the combinations of outcomes as if I was telling the truth to that student or not and then consider the possible outcomes:1)Both P and Q are true

- The student got an ‘A’ on the exam and then received an ‘A’ in the class- Therefore, I was telling the truth about the student’s final grade

Page 16: Logic Notes

Example of an “If-Then” (Cont.)

2) P is true, but Q is false- The student got an ‘A’ on the exam and then did not receive an ‘A’ in the class- Therefore, I was not telling the truth about the student’s final grade- What I said was false, which agrees with the 2nd row of the truth table

Page 17: Logic Notes

Example of an “If-Then” (Cont.)

3) P is false and Q is true- The student did not get an ‘A’ on the exam (say they got a ‘B’) and then received an ‘A’ in the class- I did not lie when I spoke with the student initially, so I was telling the truth

Page 18: Logic Notes

Example of an “If-Then” (Cont.)

4) Both P and Q are false- The student did not get an ‘A’ on the exam and did not get an ‘A’ in the class- I only promised an ‘A’ in the class if the student got an ‘A’ on the exam, so again I was telling the truth, which agrees with the last row in the truth table.

Page 19: Logic Notes

Converse (Not the shoe brand)

-The converse is when you take an “If-Then” statement (P=>Q) and reverse the order of the statements (Q=>P)

*So, Q=>P is the converse of P=>Q- Example:

*Let this be an implication about a triangle ‘T’:

- If T is equilateral, then T is isosceles*So the converse would be:

- If T is Isosceles, then T is equilateral

- Note that the implication (If-Then) is true in this case, but the converse is not.

Page 20: Logic Notes

Biconditional• A biconditional of statements P and

Q is denoted P<=>Q and is read “P if and only if Q”

• A biconditional is nothing more than an “if-then” statement joined with its converse by an “And” – [(P=>Q)^(Q=>P)]

• Note: the prefix “bi” means 2, so biconditional means “2 conditionals (If-Then)’

Page 21: Logic Notes

Truth Tables for Biconditional

- We will work out the 1st truth table in order to complete the

bottom oneP Q P<=>Q

T T T

T F F

F T F

F F T

- Note: A Biconditional is only true when the truth values of ‘P’ and ‘Q’ are the same