the foundations logic and proofs

24
The Foundations Logic and Proofs by raedRASHEED 2014

Upload: wayde

Post on 16-Feb-2016

90 views

Category:

Documents


0 download

DESCRIPTION

The Foundations Logic and Proofs. by raed RASHEED 2014. 1.1 Propositional Logic. A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both . EXAMPLE 1 All the following declarative sentences are propositions. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: The   Foundations Logic  and  Proofs

The Foundations Logic and Proofs

by

raedRASHEED2014

Page 2: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both.

EXAMPLE 1 All the following declarative sentences are propositions.1. Washington, D.C., is the capital of the United States of America. 2. Toronto is the capital of Canada. 3. 1 + 1 = 2. 4. 2 + 2 = 3.

Propositions 1 and 3 are true, whereas 2 and 4 are false.

Page 3: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

Some sentences that are not propositions are given in Example 2.

EXAMPLE 2 Consider the following sentences.1. What time is it? 2. Read this carefully. 3. x + 1 = 2 . 4. x + y = Z.

Sentences 1 and 2 are not propositions because they are not declarative sentences. Sentences 3 and 4 are not propositions because they are neither true nor false.

Page 4: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

We use letters to denote propositional variables (or statement variables), that is, variables that represent propositions, just as letters are used to denote numerical variables. The conven tional letters used for propositional variables are:

, , , , . . . .

The truth value of a proposition is true, denoted by T, if it is a true proposition and false, denoted by F, if it is a false proposition.

Page 5: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

DEFINITION 1 Let be a proposition. The negation of , denoted by (also denoted by ), is the statement "It is not the case that ."

EXAMPLE 3 Find the negation of the proposition "Today is Friday." and express this in simple English.

Solution: The negation is "It is not the case that today is Friday." This negation can be more simply expressed by "Today is not Friday," or "It is not Friday today."

TABLE 1 The Truth Table for the Negation

of a Proposition.

T FF T

Page 6: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

DEFINITION 2 Let and be propositions. The conjunction of and , denoted by , is the proposition “ and ." The conjunction is true when both and are true and is false otherwise.

EXAMPLE 5 Find the conjunction of the propositions and where is the proposition "Today is Friday" and is the proposition "It is raining today."

Solution: The conjunction of these propositions, , is the proposition "Today is Friday and it is raining today." This proposition is true on rainy Fridays and is false on any day that is not a Friday and on Fridays when it does not rain.

Page 7: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

DEFINITION 2 Let and be propositions. The disjunction of and , denoted by , is the proposition " or ." The disjunction is false when both and are false and is true otherwise.

EXAMPLE 6 What is the disjunction of the propositions and where and are the same propositions as in Example 5?

Solution: The disjunction of and , , is the proposition "Today is Friday or it is raining today."

Page 8: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

The Truth Table for the Conjunction and Disjunction of Two Propositions

TABLE 2 The Truth Table for the Conjunction of Two

Propositions

TABLE 3 The Truth Table for the Disjunction of Two

Propositions

T T T T T TT F F T F TF T F F T TF F F F F F

Page 9: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

DEFINITION 4 Let and be propositions. The exclusive or of and , denoted by , is the proposition that is true when exactly one of and is true and is false otherwise.

DEFINITION 5 Let and be propositions. The conditional statement , is the proposition "if , then ." The conditional statement is false when is true and is false, and true otherwise. In the conditional statement , is called the hypothesis (or antecedent or premise) and is called the conclusion (or consequence).

Page 10: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

The Truth Table for the Exclusive Or and Conditional Statement of Two Propositions

TABLE 2 The Truth Table for the Exclusive Or of Two

Propositions

TABLE 3 The Truth Table for the Conditional Statement of Two

Propositions

T T F T T TT F T T F FF T T F T TF F F F F T

Page 11: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

EXAMPLE 7 Let be the statement "Maria learns discrete mathematics" and the statement "Maria will find a good job." Express the statement as a statement in English.

Solution: From the definition of conditional statements, we see that when is the statement "Maria learns discrete mathematics" and is the statement "Maria will find a good job," represents the statement

"If Maria learns discrete mathematics, then she will find a good job.“or

"Maria will find a good job when she learns discrete mathematics.“

Page 12: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

EXAMPLE 8 What is the value of the variable x after the statementif then

if before this statement is encountered? (The symbol stands for assignment. The statement means the

assignment of the value of to .)

Solution: Because is true, the assignment statement is executed. Hence, x has the value after this statement is encountered.

Page 13: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

CONVERSE, CONTRAPOSITIVE, AND INVERSE We can form some new conditional statements starting with a conditional statement . In particular, there are three related conditional statements that occur so often that they have special names. The proposition is called the converse of . The contrapositive of is the proposition . The proposition is called the inverse of . We will see that of these three conditional statements formed from , only the contrapositive always has the same truth valueas .

Page 14: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

EXAMPLE 9 What are the contrapositive, the converse, and the inverse of the conditional statement

"The home team wins whenever it is raining."?

Solution: Because “ whenever ” is one of the ways to express the conditional statement , the original statement can be rewritten as

"If it is raining, then the home team wins“

Page 15: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

BICONDITIONALS We now introduce another way to combine propositions that expresses that two propositions have the same truth value.

DEFINITION 6 Let and be propositions. The biconditional statement is the proposition " if and only if ." The biconditional statement is true when and have the same truth values, and is false otherwise. Biconditional statements are also called bi-implications. TABLE 6 The Truth Table for

the Biconditional .

T T TT F FF T FF F T

Page 16: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

Truth Tables of Compound Propositions

( ¬ )→( )𝒑⋁ 𝒒 𝒑⋀𝒒TABLE 7 The Truth Table of .

T T F T T TT F T T F FF T F F F TF F T T F F

Page 17: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

Precedence of Logical Operators

TABLE 8 Precedence of Logical Operators

1

2

3

4

5

Page 18: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

Translating English Sentences

EXAMPLE 12 How can this English sentence be translated into a logical expression? "You can access the Internet from campus only if you are a computer science major or you are not a freshman."

Solution: In particular, we let , , and represent "You can access the Internet from campus," "You are a computer science major," and "You are a freshman," respectively. Noting that "only if" is one way a conditional statement can be expressed, this sentence can be repre sented as

Page 19: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

System Specifications

EXAMPLE 14 Express the specification "The automated reply cannot be sent when the file system is full" using logical connectives.

Solution: One way to translate this is to let denote "The automated reply can be sent" and denote "The file system is full." Then represents "It is not the case that the automated reply can be sent," which can also be expressed as "The automated reply cannot be sent." Consequently, our specification can be represented by the conditional statement

Page 20: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

Logic and Bit Operations

DEFINITION 7 A bit string is a sequence of zero or more bits. The length of this string is the number of bits in the string.

TABLE 9 Table for the Bit Operators OR, AND, and XOR.

0 0 0 0 00 1 1 0 11 0 1 0 11 1 1 1 0

Page 21: The   Foundations Logic  and  Proofs

1.1 Propositional Logic

EXAMPLE 21 Find the bitwise OR, bitwise AND, and bitwise XOR of the bit strings 0110110110 and 1100011101 . (Here, and throughout this book, bit strings will be split into blocks of four bits to make them easier to read.)Solution: The bitwise OR, bitwise AND, and bitwise XOR of these strings are obtained by taking the OR, AND, and XOR of the corresponding bits, respectively. This gives us

01 1011 0110 11 0001 1101 11 1011 1111 bitwise OR 01 0001 0100 bitwise AND 10 1010 1011 bitwise XOR

Page 22: The   Foundations Logic  and  Proofs

1.2 Propositional Equivalences

An important type of step used in a mathematical argument is the replacement of a statement with another statement with the same truth value. Because of this, methods that produce propo sitions with the same truth value as a given compound proposition are used extensively in the construction of mathematical arguments.

Note that we will use the term "compound propo sition" to refer to an expression formed from propositional variables using logical operators, such as .

Page 23: The   Foundations Logic  and  Proofs

1.2 Propositional Equivalences

DEFINITION 1 A compound proposition that is always true, no matter what the truth values of the propositions that occur in it, is called a tautology. A compound proposition that is always false is called a contradiction. A compound proposition that is neither a tautology nor a contradiction is called a contingency.

TABLE 1 Examples of a Tautology and a Contradiction.

T F T FF T T F

TABLE 2 De Morgan's Laws.

Page 24: The   Foundations Logic  and  Proofs

1.2 Propositional Equivalences

DEFINITION 2 The compound propositions and are called logically equivalent if is a tautology. The notation denotes that and are logically equivalent.

EXAMPLE 2 Show that and are logically equivalent. Solution: The truth tables for these compound propositions are <l:isplayed in Table 3. Because the truth values of the compound propositions ...... (p v q) and """p 1\ ...... q agree for all possible combinations ofthe truth values of p and q, it follows that ...... (p v q) ( ...... p 1\ ...... q) is a tautology and that these compound �propositions are logically equivalent.