Title: LOGIC
1LOGIC
2Statements
- In logic, letters are used to represent
statements that are either true or false - These statements can be joined to form what are
called compound statements - A conjunction is a compound statement composed of
two statements joined by the word and and uses
the symbol - A disjunction is a compound statement composed of
two statements joined by the word or and uses
the symbol -
3Statements(continued)
- Examples of compound statements.
- Statements p Rob plays baseball.
- q John plays basketball.
- Conjunction p q Rob plays baseball and
John plays basketball. - Disjunction p q Rob plays baseball or
John plays basketball.
4Truth Tables
- Truth tables tell you the conditions under which
a compound statement is true or false.
T TRUE F FALSE
Truth Table for a conjunction
If p and q are true, then the conjunction p
q is also true. However, because this is an
"and" statement, if either p or q is false, then
the conjunction p q is false as well.
5Truth Tables (continued)
A disjunction is true when both statements are
true (row 2). If one statement is false and
another is true then the disjunction is true
based the inclusive use of "or" (row 3 4). If
both statements are false then the disjunction is
considered false (row 5).
Truth table for disjunction
6Truth Tables(continued)
- Along with the words "and" and "or", the word
"not" is also used - According to the negation of p, if p is not true,
then it can be called "not p" or p
A contradiction occurs, when the negation of p is
the same thing as the statement p itself. p
p
7Truth Tables(continued)
- Make a truth table for p q
- Make a column for p and a column for q. Write all
possible combinations of T and F in the standard
pattern shown. - Add a column for p and q, and use the first
column to decide whether it is true or false. - Using columns p and q decide whether the
disjunction is true or false
8Truth Tables(continued)
- To find out the number of rows you need in a
truth table - 2
- The number of letters you have is the exponent of
the base 2 - Ex 23 8
9Truth Tables for Conditionals
- For conditional or if-then statements whose basic
form is If p, then q statement p is the
hypothesis and q is the conclusion - If p, then q
- p hypothesis q conclusion
- These statements can also be written as
- p q, "p implies q", and "q follows from p"
10Truth Tables for Conditions(continued)
- Example
- Mom promises, "If I catch the early train home
I'll take you swimming" - Mom catches the early train home and takes you
swimming. She kept her promise her statement was
true. - Mom catches the early train home but does not
take you swimming. She broke her promise her
statement was false. - Mom does not catch the early train home, but
still takes you swimming. She does not break her
promise the statement is true. - Mom does not catch the early train home and does
not take you swimming. She has not broken her
promise her statement was true.
11Truth Tables for Conditionals(continued)
Conditional Statement If p then q If B is
between A and C, then ABBCAC Converse If q
then p If ABBCAC then B is between A and
C Inverse If not p then not q If B is not
between A and C, then ABBC AC Contrapositive
If not q then not p If ABBC AC then B is not
between A and C
12Truth Tables for Conditionals (continued)
- There are two types of Truth Tables
Converse of p q
Contrapositive of p q
The last column of the above table is identical
to the last column of the conditional table
therefore The contrapositive of a statement is
true (or false) if and only if the statement
itself is true (or false).
13Some Rules of Inference
- There are four rules for making logical
inferences. The horizontal line separates the
given information from the conclusion. You must
accept true the conclusions shown.
2. Modus Tollens p q q Therefore,
p 4. Disjunction Syllogism p
q p Therefore, q
- Modus Ponens
- p q
- p
- Therefore, q
- Simplification
- p q
- Therefore, p
14Examples of Rules of Inference
- 1. If today is Tuesday, then tomorrow is
Wednesday. - Today is Tuesday
- Therefore, tomorrow is Wednesday. (Rule 1)
- 2. If a figure is a triangle, then it is a
polygon - This figure is not a polygon.
- Therefore, this figure is not a triangle
(Rule 2) - 3. It is Tuesday and it is April.
- Therefore, it is April. (Rule 3)
- 4. It is a square or it is a triangle.
- It is not a square
- Therefore, it is a triangle. (Rule 4)
15One More Example
- 5. Given p q p r q
- Prove r
- Proof
- Statements
- p q
- q
- p
- p r
- r
- Reasons
- Given
- Given
- Step 1 and 2 and Modus Tollen
- Given
- Steps 3 and 4 and Disj. Syllogism
16Valid Arguments and Mistaken Premises
- Tautology is a statement whose truth table
contains only Ts in the last column - An example is the disjunction of p p ( p or
not p)
Tautology
Valid Argument
Valid Argument represents a tautology in which
the last columns have all Ts.
17An Example of a Logically Valid Argument
- The following is a logically valid argument . Is
the conclusion true? - The weather is sunny.
- If the weather is sunny, then the plane will
arrive on time. - If the plane arrives on time, we will be able to
ski today. - Therefore, we will be able to ski today.
- Solution We cannot evaluate the truth of the
conclusion unless we investigate all of the
premises. The first statement, a given, may not
be accurate. Perhaps it is cloudy. Also, one or
more of the remaining conditional statements may
be wrong. Perhaps the plane will malfunction and
be late even though the weather is sunny. Perhaps
we wont be able to get to the ski area even if
the plane lands on time. Or maybe we dont even
know how to ski! It is important to investigate
the truth of every premise before you can draw
meaningful conclusions.
18Some Rules of Replacement
The symbol means is logically equivalent
to.
8. Associative Rules (p q) r p
(q r) (p q) r p (q
r)
5. Contrapositive Rule p q q
p 6. Double Negation (p) p 7.
Commutative Rules p q q p p
q q p
9. Distributive Rule p (q r) (p
q) (p r) p (q r) (p q)
(p r)
10. DeMorgans Rules (p q) p
q (p q) p q
19Application of Logic to Circuits
Opened Switch
Closed Switch
When switch p is open, the electricity that is
flowing from A will not reach B.
When switch p is closed, the electricity flows
through the switch to B.
Series Circuit
Parallel Circuit
p
p
q
This diagram represents two switches, p and q,
that are connected in series. The current will
flow if, and only if, both switches are closed.
q
The diagram represents the switches, p and q,
that are connected in parallel. Notice that the
current will flow if either switch is closed, or
if both switches are closed.
20Application of Logic to Circuits (continued)
Series Circuit
Parallel Circuit
Notice that the series circuit truth table is the
same as the disjunction truth table.
Notice that the series circuit truth table is the
same as the conjunction truth table.
21Application of Logic to Circuits(continued)
(p q) (p q)
q
p
p
q
Notice that one of the switches is labeled q.
This means that this switch is open if switch q
is closed, and vice versa.
The first and the last columns of the table are
identical. This means that you would be able to
replace this circuit with a simpler circuit that
contains just p.
22THE END