Top Banner
kavita hatwal fall 200 2 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or intuitive logic. But the need to put it scientifically is to avoid ambiguity. Sentences considered in propositional logic are not arbitrary sentences but are the ones that are either true or false, but not both. This kind of sentences are called propositions. By reading a sentence and basing your conclusion directly from the facts mentioned in the sentence only, you can conclude the truth or falsity of the statement. Examples: If x is a real number such that x < -2 or x > -2, then > 4. Therefore, if , then Grass is green 2 + 5 = 5 x + 3 = 3 x +3 > 5 2 x 4 x 2 x and 2 x
63

Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

Dec 16, 2015

Download

Documents

Phebe Morgan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

PROPOSITIONAL LOGIC

Most of the definitions of formal logic have been developed so that they agree with the natural or intuitive logic. But the need to put it scientifically is to avoid ambiguity.Sentences considered in propositional logic are not arbitrary sentences but are the ones that are either true or false, but not both. This kind of sentences are called propositions. By reading a sentence and basing your conclusion directly from the facts mentioned in the sentence only, you can conclude the truth or falsity of the statement.Examples:•If x is a real number such that x < -2 or x > -2, then > 4. Therefore, if , then •Grass is green•2 + 5 = 5•x + 3 = 3•x +3 > 5

2x

4x 2 xand 2 x

Page 2: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

• A statement is a sentence that is either true or false, but not both.• Statements:

– It is raining.– I am carrying an umbrella.

• Non-statements:

– a. (Question): Why are you late?

– b. (Command): Open the door.

– c. (Wish): If only I had studied a little harder…

– d. (Something Vague): x + y = 4.

Page 3: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Elements of Propositional Logic

Simple sentences.A simple statement is one that does not contain any other statement as a part. We will use the lower-case letters, p, q, r, ..., as symbols for simple statements.If p or q, then rTherefore, if not r, then not p and not q.Page 2, example 1.1..1If Jane is a math major or Jane is a computer science major, then Jane will take Math 150.Jane is a computer science major.Therefore, Jane will take Math 150.Page 15, #1, 2, 4

Page 4: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

COMPOUND STATEMENTS:A compound statement is one with two or more simple statements as parts or what we will call components. A component of a compound is any whole statement that is part of a larger statement; components may themselves be compounds. Simple sentences which are true or false are basic propositions. Larger and more complex sentences are constructed from basic propositions by combining them with connectives. Thus propositions and connectives are the basic elements of propositional logic. Though there are many connectives, we are going to use the following five basic connectives here:

IF and ONLY IF

IF_THEN

OR

AND

or ~NOT

Page 5: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

• Binary operators– Conjunction – “and”.– Disjunction – “or”.

• Unary operator– Negation – “not”.

• Other operators– XOR – “exclusive or”– NAND – “not both”– NOR – “neither”

Logical Operators

Page 6: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

is read as p and q and is called the conjunction of p and q is read as p or q and is called the disjunction of p and q.

In compound statements each simple statement can be seen as individual terms just like in algebra. Just like in algebra, where when there are more than one operators involved, there is an order of operation, there is an order of operation in compound statements which include ~ and and that Order of operation or ~ has the higher precedence than and But can be overridden with the use of parenthesis.So the order of operation in propositional logic can be summed asThe last one can lead to ambiguity.

q p q p

~ or

( ) and

Page 7: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Examples

Translating from english to Symbols

• Basic statements– p = “It is raining.”– q = “I am carrying an umbrella.”

• Compound statements– p q = “It is raining and I am carrying an umbrella.”– p q = “ It is raining or I am carrying an umbrella.” p = “It is not raining.”

Page 8: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Translating from english to Symbols:Let p = “It is hot”q = “It is sunny”

Queen’s english Logic translation

but but is opposite of and but and and mean the same thing

neither nor Not this or that one, none

not this and not that one.

So it is not hot but sunny is written as

It is not hot and it is not sunnyIt is neither hot nor sunnyneither nor

not p and q->it is not hot but It is sunnybut

Logic translationQueen’s english

qp ~

qp ~~

Page 9: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Inequalities and notation

x < a or x = aax bxa b xand xa

p = “0 < x”q = “x < 3”r = “x = 3”Write the following inequalities symbolically

30

30

3

x

x

x

Page 10: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

RECAPsimple statements compound statements

TRUTH VALUESEach simple statement comprising a compound statement is a statement in its own right, that is it has a truth value, that is it can be true or false but not both.The truth values of each individual statements affect the truth value of the compound statement of which they are part of.

NEGATIONIf p is a statement variable, the negation of p is “not p” or “It is not

the case that p” and is denoted as ~p. It has opposite truth values as p. Wherever p is true, ~p is false and vice versa. The truth values for negation summarized in a truth table are

p ~p

T F

F T

Page 11: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

If p and q are statement variables, the conjunction of p and q is “p and q” denoted p q. It is true when, and only when, both p and q are true. If either p or q is false, or if both are false, p q is false. The truth values for and summarized in a truth table are

FFT

FTF

F

T

q

FF

TT

p qp

Page 12: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

If p and q are statement variables, the disjunction of p and q is “p or q” denoted p q. It is true when at least one of p or q is true and is false only when both p and q are false. The truth values for p or q summarized in a truth table are

TFT

TTF

F

T

q

FF

TT

p qp

Page 13: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

A statement form or (propositional form) is an expression made up of statement variables (such as p, q and r) and logical connectives (such as ~ and and ) that becomes a statement when actual statements are substituted for the component statement variable. The truth table for a given statement form displays the truth values that correspond to the different combinations of truth values for the variables.

The general rule for constructing truth tables is:1. List all the variables mentioned in the statement in separate columns and

then list all the combinations of truth values for them.2. Add columns for operations mentioned in the statement with all the

combinations of truth values for them starting from inside out the parenthesis if there exist any.

3. Evaluate the final result

XORConstruct truth table for• ~(p q) work from inside out.• p (p q)

Page 14: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

LOGICAL EQUIVALENCE:•Two statements are said to be logically equivalent if and only if, they’ve identical truth values for each possible substitution of statements for their statement variables. •Two statements are said to be logically equivalent if and only if, when the same statement variables are used to represent identical component statements, their forms are logically equivalent.It is denoted as QP •Construct the truth table for P•Construct the truth table for Q using the same statement variables for identical component statements.•Check each combination of truth values of the statement variables to see whether the truth value of P is the same as the truth value of Q.

a. If in each row the truth value of P is the same as the truth value of Q, then P and Q are logically equivalent.

b. If in some row the truth value of P is different from the truth value of Q, then P and Q are not logically equivalent.page 9, example 1.1.6, 1.17

Page 15: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

• (p q) (p q) (p q) (p q)

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

T T T T

T F F F

F T F F

F F T T

Page 16: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

De Morgan’s law•~(p q) ~p ~q the negation of and is logically equivalent to the or of the negated components•~(p q) ~p ~q the negation of oris logically equivalent to the and of the negated components

Page 11 examples and cautionary example

Page 17: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Tautology and ContradictionA tautology is a logical expression that is true regardless of the values of its variables. Thus, for a tautology, the value of the expression is TRUE in every row of the truth table. The column of a tautology in a truth table contains only T's.P ~Pp q ( p q)

A proposition which is always false is called a contradiction. The column of a contradiction in a truth table contains only F's. for example P ~P

p q (p q)

If t is a tautology and c is a contradiction, then and

Page 14 blue box

ptp ccp

Page 18: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Conditional statements

If p and q are statement variables, the conditional of q by p is “if p then q” or “p implies q” and is denoted by . It is false when p is true and q is false.

A conditional statement is vacuously true or true by default if its hypothesis is false.

ORDER of PRECEDENCE

qp

~ or

( ) and

TFF

TFF

FFT

TTT

p qqp

Page 19: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

“If it is raining, then I am carrying an umbrella.”This statement is true

•when I am carrying an umbrella (whether or not it is raining), and•when it is not raining (whether or not I am carrying an umbrella).

“IF you earn >=$25K, THEN you must file a tax return.”What if I earn <$25K? Do I violate the tax law when I file/do-not-file a tax return?

Page 20: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

“If p then q” is logically equivalent to “not p or q”.The negation of a conditional statement. The negation of “if p then q” is logically equivalent to “p and not q”.

The negation of a conditional statement does not start with an if …then…

The contrapositive of a conditional statement of the form “if p then q” is

Symbolically the contrapositive of

A conditional statement is logically equivalent to its contrapositive.

qp~qp

p~ then ~ qif

p~q~ isqp

q~pq)(p~

Page 21: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Converse and inverse of a conditional statement.

If ~p then ~qIf q then pIf ~q then ~p

inverseconversecontrapositive

pq qp ~~ pq ~~

Converse and inverse of a conditional statement are not logically equivalent to the statement but the converse and inverse of a statement are logically equivalent to each other.

Page 22: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

DEFINITIONONLY IFIf p and q are statements,

p only if q means “if not q then not p”Or, equivalently,

“if p then q”

Converting Only if to If-Then:

BICONDITIONALThe biconditional of p and q is “p if and only if q” and is denoted by . It is true if both p and q have the same truth values and is false when if p and q have opposite truth values. Another way of looking at p iff q is “p if q” and “p only if q”

qp

)(~)(~ pqqpqp

Page 23: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Necesssary and sufficient conditions:

If r and s are statements:r is a sufficient condition for s means “if r then s”r is a necessary condition for s means “if not r then not s”

r is a necessary condition for s also means “if s then r”r is a necessary and sufficient condition for s also means “r if and only if s”

Page 24: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Argument Forms

• Incorporated Doug Jones's notes on this section with some of mine and some fetched from www

Page 25: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

An argument form is called valid if whenever all the hypothesis are true, the conclusion is also true

Any argument form in which it IS possible to have true premises and a false conclusion at the same time is invalid.

Page 26: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Syllogistic LogicA syllogism is an argument consisting of two premises and one conclusion.

The first premise is the major premise The second premise is the minor premise 

A modus ponens argument is a syllogism of the form"If p then q.  We have p, therefore q."

So if is a tautology, then this is a valid argument form If the sum of digits is divisible by 3, then a number is divisible by 3.  The sum of 123 = 6, so 123 is divisible by 3.

q

p

qp

qpqp ])[(

Page 27: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

A modus tollens argument is a syllogism of the form"If p then q.  We have not q, therefore not p."

This is the contra-positive of the modus ponens If the sum of digits is divisible by 3, then a number is divisible by 3.  The sum 124 = 7 is not divisible by 3, so 124 is not divisible by 3

p

q

qp

~

~

Page 28: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

  Invalid syllogisms

Reason by InverseIf Doug teaches at Sylvania, then he works for PCC.  Doug does not teach at Sylvania, therefore he does not work for PCC. The inverse of a conditional need not be true.

Reason by ConverseIf Doug teaches at Sylvania, then he works for PCC.  Doug works for PCC, therefore he teaches at Sylvania. The converse of a conditional need not be true

Page 29: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Probabilistic SyllogismIf a person is an American, then he is probably not a member of Congress.  This person is a member of Congress.  Therefore he probably is not an American. This seems like a contra-positive: not (not member of Congress) therefore not an American.  But the notion of probability is not part of Boolean logic: a statement is a declaration that something either is true or is false, but is never probably true or probably false.  Analysis of probabilistic statements requires Bayesian logic, rather than Boolean logic.

Page 30: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Inferential LogicDisjunctions are valid argument forms

"p, therefore p or q". Alice is a woman, therefore Alice is a woman or a brain-eating serial killer This is generalization

 

Page 31: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Conjunctions imply the component statements"p and q, therefore p" Alice is a woman and a PCC student, therefore Alice is a woman. This is specialization 

Elimination is a valid form"p or q.  Not q, therefore p" Alice is a woman or a brain-eating serial killer.  Alice is not a serial killer, therefore Alice is a woman 

Transitivity is a valid form"if p then q.  If q then r.  p, therefore r." If Doug teaches at Sylvania, then he works for PCC.  If you work for PCC then you participate in PERS.  Therefore Doug participates in PERS. 

Page 32: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Division into cases in a valid form"p or q.  If p then r.  If q then r.  Therefore r." Doug either robbed a bank or stole a car.  If you rob a bank you go to jail.  If you steal a car you go to jail.  Therefore Doug will go to jail. 

Contradiction is a valid formIf you can show that "p is false" leads to a contradiction then p is true and vice versa

 

Page 33: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Arguments and TruthValid arguments need not true.

If Doug is a teacher then Doug smokes.  Doug is a teacher, therefore Doug smokes. This is valid modus ponens, but the major premise is false, so the conclusion is valid but untrue 

Invalid arguments need not be falseIf Doug is a teacher, then Doug teaches Math. Doug teaches Math, therefore Doug is a teacher. This is a converse error, but the conclusion is true

Page 34: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

A more Complex Deduction

``And now we come to the great question as to the reason why. Robbery has not been the object of this murder, for nothing was taken. Was it politics, or was it a woman? That is the question confronting me. I was inclined from the first to the latter supposition. Political assassins are only too glad to do their work and fly. This murder had, on the contrary, been done most deliberately and the perpetrator had left his tracks all over the room, showing he had been there all the time.'' - A. Conan Doyle, A Study in Scarlet Reference: http://www.cs.sunysb.edu/~skiena/113/lectures/lecture4/lecture4.html

What did Sherlock Holmes conclude?

Page 35: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Propositions and Premises We can break the story into the following propositions: Holmes identifies the following premises defined on these propositions:

p: It was robbery.q: Nothing was taken.r: It was politics.s: It was a woman.t: The assassin left immediately.u: The assassin left tracks all over the room.

tr

tu

pq

q

srp

~

~

)(

Page 36: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

sr

sr

p~

)(p

p~

q

p~ q

Complete the above to logically prove Sherlock Holmes right

Page 37: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Reference:http://www.hku.hk/cgi-bin/philodep/knight/puzzle

A very special island is inhabited only by knights and knaves. Knights always tell the truth, and knaves always lie. You meet five inhabitants: Carl, Zeke, Joe, Peggy and Bart. Carl claims, `Peggy and I are both knights or both knaves.' Zeke claims that at least one of the following is true: that Carl is a knave or that Joe is a knight. Joe says, `Both I am a knight and Bart is a knave.' Peggy says that it's not the case that Bart is a knave. Bart tells you, `Neither I nor Carl are knaves.' So who is a knight and who is a knave?

Knights and Knaves

Page 38: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

1.4

•Logic circuits•In series•Parallel•Truth tables for circuits•Similarity to conjunction and disjunction•Digital logic circuits.•0 and 1 versus T and F•Black box

Page 39: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Logic circuits

• Logic circuits perform operations on digital signals– Implemented as electronic

circuits where signal values are restricted to a few discrete values

• In binary logic circuits there are only two values, 0 and 1

• The general form of a logic circuit is a switching network

• Reference:http://jjackson.eng.ua.edu/courses/ece380/lectures/

PQR

S

Page 40: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Variables and functions

• The simplest binary element is a switch that has two states

• If the switch is controlled by x, we say the switch is open if x =0 and closed if x =1

x 1 = x 0 =

Two states of a switch

Page 41: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Variables and functions (AND)

• Consider the possibility of two switches controlling the state of the light

• Using a series connection, the light will be on only if both switches are closed

– L(x1, x2)= x1· x2

– L=1 iff (if and only if) x1 AND x2 are 1

The logical AND function (series connection)

S

x1 LPowersupply

S

x2Light

“·” AND operator

The circuit implementsa logical AND function

x1· x2 = x1x2

Page 42: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Variables and functions (OR)

• Using a parallel connection, the light will be on only if either or both switches are closed

– L(x1, x2)= x1+ x2

– L=1 if x1 OR x2 is 1 (or both)

1

S

x

L

Powersupply

S

x2

The logical OR function (parallel connection)

Light

“+” OR operator

The circuit implementsa logical OR function

Page 43: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

An efficient way to design more complicated circuits is to build them by connecting less complicated black box circuits.•Logic gates•Not •And•Or

Gates can be combined in variety of ways leading to combinational circuits, one whose output at any time is determined entirely by its input at that time without regard to previous inputs.

•Never combine two input wires•A single input wire can be split halfway and used as input for two separate gates•An output wire can be used as input•No output of a gate can eventually feed back into that gate

Page 47, 1.4.1, 1.4.2Boolean expression corresponding to a circuit1.4.3

Page 44: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Page 45: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Recognizer: is a circuit that outputs a 1 for exactly one particular combination of input signals and outputs 0’s for all other combinations

•Constructing circuits for boolean expressions example 1.4.4, page 49•Simplifying combinational circuits, page 52•Equivalent circuits, example 1.4.6, page 53•Designing a circuit for a given input output table example 1.4.5, page 51

INPUT OUTPUT

P Q R S

1 1 1 1

1 1 0 0

1 0 1 1

1 0 0 1

0 1 1 0

0 1 0 0

0 0 1 0

0 0 0 0

Page 46: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Predicates and Quantified statements

Subject and predicate:Subject is the person being talked about and predicate is what is being talked about the subject. The predicate is part of the sentence from which subject has been removed.Are these statements?•“He is a college student”•“x + y > 0”No they aren’t but they can be made to be true in two ways

In logic, predicates can be obtained from a statement by removing the nouns.“James is a student at PCC.”The nouns are James and PCC.Let P= is a student at PCC Q = is a student atThen both P and Q are predicate symbols.x is a student at y is symbolized as P(x) and as Q(x,y) respectively, where x and y are predicate variables that take values in appropriate sets.

Page 47: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

A predicate is a sentence that contains a finite number of variables and becomes a statement when specific values are substituted for the variables. The domain of a predicate variable is the set of all values that may be substituted in place of the variable.

If P(x) is a predicate and x has domain D, the truth set of P(x) is the set of all elements of D that make P(x) true when substituted for x. The truth set of P(x) is denoted as

Let P(x) and Q(x) be predicates and suppose the common domain of x is D. The notation means that every element in the truth set of P(x) is in the truth set of Q(x). The notation means that P(x) and Q(x) have identical truth sets.

)}(|{ xPDx

Q(x) P(x) Q(x) P(x)

Example 2.1.1 page 77• Predicates are not propositions.• They can be made propositions by Substituting concrete value to the variable quantify the variable using a quantifier.

Page 48: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Quantifiers Universal Quantifier, for allAl human beings are mortal. human beings x, x is mortal. x in S, x is mortal.

Let Q(x) be a predicate and D be the domain of x. A Universal Quantifier is a statement of the form x D, Q(x). It is defined to be true iff Q(x) is true for every x in D. It is defined to be false iff Q(x) is false for atleast one x in D. Such an x if it exists is called a counterexample.

Example 2.1.2 page 78.

Page 49: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Existential Quantifier, there exists,

Let Q(x) be a predicate and D be the domain of x. A Existential Quantifier is a statement of the form x D such that Q(x). It is defined to be true iff Q(x) is true for at least one x in D. It is defined to be false iff Q(x) is false for all x in D.

Example 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7 page 78-81.

Negation of Quantified statements

The negation of a statement of the form

Is logically equivalent to a statement of the form

Symbolically

Example 2.1.8, 2.1.9 page 82.

Q(x) D,in x

Q(x)~such that Din x

Q(x)~such that D ))(,(~ xxQDx

Page 50: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

The negation of a statement of the form

Is logically equivalent to a statement of the form

Symbolically

Q(x)such that Din x

Q(x)~ D,in x

Q(x)~such that D ))( that (~ xxQsuchDx

Example 2.1.10 - 2.1.12 page 84, 85.

Negations of UNIVERSAL CONDITIONAL statements

Q(x)) ~ andP(x such that x Q(x)) then P(x) ,(~ ifx

1. Read the quantifier from left to right.2. If there are more than one quantifiers, read from inside out.

Example 2.1.13 page 86.

Page 51: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

• Multiply quantified universal statements x S, y T, P(x, y)– The order does not matter.

• Multiply quantified existential statements x S, y T, P(x, y)– The order does not matter.

Page 52: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

• Mixed universal and existential statements x S, y T, P(x, y) y T, x S, P(x, y)– The order does matter.– What is the difference?

• Compare x R, y R, x + y = 0. y R, x R, x + y = 0.

Page 53: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

• Negate the statement

x R, y R, z R, x + y + z = 0.(x R, y R, z R, x + y + z = 0)

x R, (y R, z R, x + y + z = 0)

x R, y R, (z R, x + y + z = 0)

x R, y R, z R, (x + y + z = 0)

x R, y R, z R, x + y + z 0

Page 54: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

• A universal conditional statement is of the form

x S, P(x) Q(x).• The converse is

x S, Q(x) P(x).• The inverse is

x S, P(x) Q(x).• The contrapositive is

x S, Q(x) P(x).• Necessary and sufficient condition

Page 55: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Boolean Algebras

• A Boolean algebra is a set S that – includes two elements 0 and 1,– has two binary operations + and ,– has one unary operation ,

which satisfy the following properties for all a, b, c in S:

Page 56: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Boolean Algebras

• Commutativity– a + b = b + a.– a b = b a.

• Associativity– (a + b) + c = a + (b + c).– (a b) c = a (b c).

Page 57: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Boolean Algebras

• Distributivity– a (b + c) = (a b) + (a c)– a + (b c) = (a + b) (a + c)

• Identity– a + 0 = a.– a 1 = a.

Page 58: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Boolean Algebras

• Complementation– a + a = 1.– a a = 0.

Page 59: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Examples: Boolean Algebras

• Let U be a nonempty universal set. Let 0 be and 1 be U. Let + be and be . Let be complementation. Then U is a Boolean algebra.

• Let U be a nonempty universal set. Let 0 be U and 1 be . Let + be and be . Let be complementation. Then U is a Boolean algebra.

Page 60: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Examples: Boolean Algebras

• Let S be the set of all statements. Let 0 be F and 1 be T. Let + be and be . Let be negation. Let = be . Then S is a Boolean algebra.

• Let S be the set of all statements. Let 0 be T and 1 be F. Let + be and be . Let be negation. Let = be . Then S is a Boolean algebra.

Page 61: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Derived Properties

• Theorem: Let S be a Boolean algebra and let a, b in S. Then– a a = a.– a + a = a.– a 0 = 0.– a + 1 = 1.– a b = a if and only if a + b = b.– a b = a + b if and only if a = b.

Page 62: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Derived Properties, continued

– a b = 0 and a + b = 1 if and only if a = b.– 0 = 1.– 1 = 0.– (a) = a.– (a b) = a + b.– (a + b) = a b.

Page 63: Kavita hatwal fall 2002 Math 231 PROPOSITIONAL LOGIC Most of the definitions of formal logic have been developed so that they agree with the natural or.

kavita hatwal fall 2002 Math 231

Example: Boolean Algebra

• Let S = {1, 2, 3, 5, 6, 10, 15, 30}.• Define

– a + b = gcd(a, b).

– a b = lcm(a, b).

– a = 30/a.

• Verify the 10 basic properties.• The 12 derived properties follow.• Ref:

http://en.wikipedia.org/wiki/Greatest_common_divisor#Properties