Statements In logic, letters are used to represent statements that are either true or false These...

22

Transcript of Statements In logic, letters are used to represent statements that are either true or false These...

Statements• 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

Statements(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.

Truth Tables• Truth tables tell you the conditions under

which a compound statement is true or false.

p q p q

T T T

T F F

F T F

F F F

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.

Truth Tables (continued)

p q p q

T T T

T F T

F T T

F F F

Truth table for disjunction

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 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

p ~p

T F

F T

A contradiction occurs, when the negation of p is the same thing as the statement p itself.

~p p

Truth Tables(continued)

Make a truth table for ~p ~q

1. Make a column for p and a column for q. Write all possible combinations of T and F in the standard pattern shown.

2. Add a column for ~p and ~q, and use the first column to decide whether it is true or false.

3. Using columns ~p and ~q decide whether the disjunction is true or false

Truth Tables(continued)

p q ~p ~q ~p ~q

T T F F F

T F F T T

F T T F T

F F T T T

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: 2^3 = 8

Truth 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"

p q p q

T T T

T F F

F T T

F F T

Truth Tables for Conditions

(continued)Example:

Mom promises, "If I catch the early train home I'll take you swimming"

1. Mom catches the early train home and takes you swimming. She kept her promise; her statement was true.

2. Mom catches the early train home but does not take you swimming. She broke her promise; her statement was false.

3. Mom does not catch the early train home, but still takes you swimming. She does not break her promise; the statement is true.

4. Mom does not catch the early train home and does not take you swimming. She has not broken her promise; her statement was true.

Truth Tables for Conditionals(continued)

Conditional Statement “If p then q”

If B is between A and C, then AB+BC=AC

Converse “If q then p”

If AB+BC=AC then B is between A and C

Inverse “If not p then not q”

If B is not between A and C, then AB+BC AC

Contrapositive “If not q then not p”

If AB+BC AC then B is not between A and C

Truth Tables for Conditionals (continued)

• There are two types of Truth Tables:

p q q p

T T T

T F T

F T F

F F T

Converse of p q Contrapositive of p q

p q ~q ~p ~q ~p

T T F F T

T F T F F

F T F T T

F F T T T

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).

Some 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.

1. Modus Ponens

p q

p

Therefore, q

3. Simplification

p q

Therefore, p

2. Modus Tollens

p q

~q

Therefore, ~p

4. Disjunction Syllogism

p q

~p

Therefore, q

Examples of Rules of Inference1. 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)

One More Example

5. Given: p q ; p r; ~q

Prove: r

Proof:

Statements

1. p q

2. ~q

3. ~p

4. p r

5. r

Reasons

1. Given2. Given3. Step 1 and 2 and

Modus Tollen4. Given5. Steps 3 and 4 and Disj.

Syllogism

Valid 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”)

p ~p p ~p

T F T

F T T

Tautology

Valid Argument

p p p p

T F T

F F T

Valid Argument represents a tautology in which the last columns have all Ts.

An Example of a Logically Valid Argument

The following is a logically valid argument . Is the conclusion true?

1. The weather is sunny.

2. If the weather is sunny, then the plane will arrive on time.

3. If the plane arrives on time, we will be able to ski today.

4. 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 don’t even know how to ski! It is important to investigate the truth of every premise before you can draw meaningful conclusions.

Some Rules of Replacement

The symbol means “is logically equivalent to.”

5. Contrapositive Rule

p q ~q ~p

6. Double Negation

~(~p) p

7. Commutative Rules

p q q p

p q q p

8. Associative Rules

(p q) r p (q r)

(p q) r p (q r)

9. Distributive Rule

p (q r) (p q) (p r)

p (q r) (p q) (p r)

10. DeMorgan’s Rules

~(p q) ~p ~q

~(p q) ~p ~q

Application of Logic to Circuits

A

p

B A

p

B

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

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.

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.

p qp

q

Application of Logic to Circuits

(continued) p q Circuit

T T T

T F F

F T F

F F F

p q Circuit

T T T

T F T

F T T

F F F

Series Circuit Parallel Circuit

Notice that the series circuit truth table is the same as the conjunction truth table.

Notice that the series circuit truth table is the same as the disjunction truth table.

Application of Logic to Circuits

(continued) (p q) (p ~q)p q

p ~qNotice that one of the switches is labeled ~q. This means that this switch is open if

switch q is closed, and vice versa.

p q ~q p q p ~q (p q) (p ~q)

T T F T F T

T F T F T T

F T F F F F

F F T F F F

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.