Introduction to Logic
- The Greeks studied a t type of logic called Aristotelian or syllogistic logic.
- If we have time we will look at this in 3.6
- In the 18th and 19th century the study switched to symbolic logic.
- In attempt to form a foundation for mathematics and science.
- And this is the basis for building computers.
- George Boole
- Foundations for Boolean Algebra
- Two values: true, false
- A sentence which can be judged to be true or false is a statement
- A simple statement conveys one idea.
- Today is Wednesday.
- Snow is falling.
- A compound statement is composed of simple statements and connectives
- not, and, or, if then, if and only if
- Today is not Wednesday.
- Today is Wednesday and snow is not falling.
- Snow is falling if and only if today is Wednesday.
- If today is Wednesday then snow is falling.
- Representing statement symbolically
- We use a lower case letter to represent a simple statement.
- We only represent positive statements, if there is a not, remove it.
- p: Today is Wednesday
- q: Snow is falling
- Not
- Called negation
- The symbol is ~
- The statement "Today is not Wednesday"
- p: Today is Wednesday
- The statement becomes : ~p
- If the statement is "Snow is falling"
- q: Snow is falling
- What is ~q?
- Quantifiers make negation more difficult.
- All, Some, None are the problem.
- Consider: All trees are tall.
- This statement is false, bonsai trees.
- But the statement "No trees are tall" is false as well, consider the Giant Redwood trees.
- So the negation is "Some trees are not tall."
- Notice we did not have the problem with "Today is Wednesday".
- Just learn the following:
- All Are becomes Some Are Not
- None Are becomes Some Are
- Negate "No frogs are green"
- This is close to the syllogistic logic mentioned above.
- And
- Called a conjunction
- represented by ∧
- Today is Wednesday and snow is falling.
- p: Today is Wednesday
- q: Snow is falling
- The statement becomes: p ∧ q
- Snow is not falling and it is Wednesday
- OR
- Called disjunction
- Symbol ∨
- Today is Wednesday or snow is falling
- Becomes: p ∨ q
- Today is not Wednesday or snow is not falling
- Becomes: ~p ∨ ~q
- Simple statements on the same side of a comma re grouped together with parentheses.
- Snow is falling, and today is Wednesday or the month is October.
- r: the month is October
- Becomes q ∧ (p ∨ r)
- Snow is falling and today is Wednesday, or the month is October.
- Becomes: (q ∧ p) ∨ r
- Negation again
- ~p is the negation of p: Today is not Wednesday
- ~p ∧ q: Today is not Wednesday and snow is falling.
- ~(p ∨ q) : It is not true that today is Wednesday or snow is falling.
- If - Then
- Called a conditional
- written →
- If today is Wednesday then snow is falling
- p → q
- It is not true that if snow is falling then the month is October.
- ~(q → r)
- If and only if
- Called biconditional
- Written ↔
- Snow is falling if and only if today is Wednesday
- q ↔ p
- The month is October, if and only if Today is Wednesday and snow is falling.
- r ↔ (p ∧ q)