File

advertisement
Computing
Truth Values
SYMBOLIC LOGIC
Definition
An assertion is a statement. A proposition is a
statement or a declarative sentence which is
either true or false, but not both. If a proposition
is true we assign the truth value “TRUE” to it. If a
proposition is false, we assign the truth value
“FALSE” to it. We will denote by “T” or “1”, for the
truth value TRUE and by “F" or “0” for the truth
value FALSE.
SYMBOLIC LOGIC
Examples
The following are examples of propositions:
1. 2 > 4
2. The billionth prime, when written in base 10,
ends in a 3.
3. All men are mortals.
4. 9 is a prime number.
SYMBOLIC LOGIC
Non-Examples
The following are non-examples of propositions:
1. x < y
2. Factor ๐‘ฅ 2 + 2๐‘ฅ + 1.
3. ๐‘ฅ = 10
4. How old are you?
SYMBOLIC LOGIC
Exercises
*Decide whether the following are propositions or
not:
1.
2.
3.
4.
5.
23 = z
10 – 7 = 3
5 < 27
All women are mammals.
Where do you live?
SYMBOLIC LOGIC
Definition
A propositional variable, denoted by ๐‘ƒ, ๐‘„, ๐‘… …
denotes an arbitrary proposition with an
unspecified truth value.
A propositional variable is a variable that
represents a proposition.
SYMBOLIC LOGIC
Definition
Given two propositional variables ๐‘ƒ and ๐‘„. These two
propositional variables maybe combined to form a
new one. These are combined using
the logical operators or logical connectives : “and”,
“or” or “not”.
SYMBOLIC LOGIC
These new proposition are:
1. (Conjunction of P and Q) P and Q, denoted by ๐‘ƒ ๐‘„;
2. (Disjunction of P and Q) P or Q, denoted by ๐‘ƒ ๐‘„;
3. (Negation of P) not P, denoted by ¬ ๐‘ƒ.
Truth Tables
๐‘ƒ ¬๐‘ƒ
1 0
0 1
๐‘ƒ
1
1
0
0
๐‘„
1
0
1
0
๐‘ƒ ๐‘„
1
0
0
0
๐‘ƒ ๐‘„
1
1
1
0
Note: Other books represent the negation of P as ~P.
SYMBOLIC LOGIC
Inclusive and exclusive disjunction:
1. Inclusive disjunction denoted by ๐‘ƒ ๐‘„ is True when either
or both of the disjuncts are True.
2. Exclusive disjuction denoted by P โ‹ Q is True when only
one of the disjuncts is true and the other is false.
Truth Table:
๐‘ƒ
1
1
0
0
๐‘„
1
0
1
0
๐‘ƒ ๐‘„ Pโ‹Q
1
0
1
1
1
1
0
0
SYMBOLIC LOGIC
Definition
The proposition “P implies Q”, denoted by ๐‘ƒโŸนQ is called an
implication.
The operand P is called the hypothesis, premise or antecedent
while the operand Q is called the conclusion or the
consequence
๐‘ƒ
0
0
1
๐‘„
0
1
0
๐‘ƒโŸนQ
1
1
0
1
1
1
SYMBOLIC LOGIC
Definition
Given the implication ๐‘ƒโŸนQ , its converse is ๐‘„โŸนP , its inverse
is¬๐‘ƒโŸน¬Q, and its contrapositive is ¬๐‘„โŸน¬P .
The operand P is called the hypothesis, premise or antecedent
and the operand Q is called the conclusion or the consequence
๐‘ƒ
๐‘„
๐‘ƒโŸนQ
¬๐‘ƒโŸน¬Q
๐‘„โŸนP
¬๐‘„โŸน¬P
0
0
0
1
1
1
0
0
1
0
1
1
1
1
0
1
0
1
1
0
1
1
0
1
SYMBOLIC LOGIC
Definition
A biconditional proposition is expressed linguistically by
preceding either component by ‘if and only if’.
The truth table for a biconditional propositional form,
symbolised by P โŸท Q is shown below.
๐‘ƒ
๐‘„
0
0
1
1
0
1
0
1
PโŸทQ
1
0
0
1
SYMBOLIC LOGIC
Exercises
I.
1. q = “You miss the final exam.”
r = “You pass the course.”
Express q ๏ƒ  ~r in English.
2. Construct a truth table for ~p ๏ƒ… ~q.
Exercises
II. Let p and q be propositions
p: 4 is a rational number.
q: √3 is an irrational number.
Express each of these propositions as an
English sentence:
3) ~p
6) p ๏ƒ  q
4) p v q
7) p ๏‚ซ q
5) p แดง q
Lecture 1
14
Exercises
III. Given: p: 4 is an even integer.
q: 5 is an odd integer.
Write each of the ff. in terms of p, q and
logical connectives:
8) 4 is an even integer and 5 is an odd integer.
9) 4 is not an even integer or 5 is an odd integer.
10) If 4 is an even integer then 5 is an odd integer.
11) 4 is an even integer whenever 5 is an odd
integer.
12) 4 is not an even integer if and only if 5 is not an
odd integer.
Lecture 1
15
Do Worksheets 2 & 3
Definition
A propositional form is an assertion which contains at least
one propositional variable and maybe generated by the
following rules:
1. A propositional variable standing alone is a propositional
form;
2. If P is a propositional form, then Q is also a propositional
form;
3. If P and Q are propositional forms, then ๐‘ƒ ๐‘„, ๐‘ƒ ๐‘„, ๐‘ƒ โŸบ ๐‘„
are propositional forms;
4. A string of symbols containing propositional variables,
connectives and parentheses is a propositional form if and
only if it can be obtained by infinitely many applications of
rules (1.); (2.) or (3.) above.
SYMBOLIC LOGIC
Definition
Let X be a set of propositions.
A truth assignment (to X) is a function ๏ด : X ๏‚ฎ {true, false} that
assigns to each propositional variable a truth value. (A truth
assignment corresponds to one row of the truth table.
If a truth value of a compound proposition under truth
assignment ๏ด is true, we say that ๏ด satisfies P, otherwise we say
that ๏ด falsifies P.
A tautology is a propositional form where every truth assignment
satisfies P, i.e. All entries of its truth table are true.
A contradiction or absurdity is a propositional form where every
truth assignment is false;
A contingency is a propositional form that is neither tautology nor
contradiction.
Examples:
P V ๏ƒ˜P is a tautology.
P ๏ƒ™ ๏ƒ˜P is a contradiction.
For each of the following compound propositions
determine if it is a tautology, contradiction or
contingency:
1. (p v q) ๏ƒ™ ๏ƒ˜p ๏ƒ™ ๏ƒ˜q
2. P v q v r v (๏ƒ˜p ๏ƒ™ ๏ƒ˜q ๏ƒ™ ๏ƒ˜r)
3. (p ๏‚ฎ q) ๏‚ซ (๏ƒ˜p v q)
Definition
A logically equivalent propositional form have identical values
for each assignment of the truth values to their component
propositional variables.
We can denote the logical equivalent variables P and Q as:
๐‘ƒ โŸบ๐‘„
or
๐‘ƒ ≡๐‘„
(๐‘ฅ + 2)2 and ๐‘ฅ 2 + 4๐‘ฅ + 4 are regarded as equivalent algebraic
expressions.
SYMBOLIC LOGIC
Example
Show that P โŸน Q and ¬P โ‹ Q are logically equivalent
propositional forms.
๐‘ƒ
0
0
1
1
๐‘„
PโŸนQ
¬P
¬P โ‹ Q
0
1
1
1
1
0
1
1
0
1
1
0
0
1
0
1
P โŸน Q and ¬P โ‹ Q are logically equivalent propositional forms.
SYMBOLIC LOGIC
Example
Given the propositional forms Q โ‹ ¬P, ¬Q โŸน ¬P and ¬P โ‹€ ¬Q,
between which pairs of these forms does the relation logical
equivalence exist?
๐‘ƒ
๐‘„
¬P
¬Q
Q โ‹ ¬P
¬Q โŸน ¬P
¬P โ‹€ ¬Q,
0
0
1
1
1
1
0
0
1
1
0
1
1
0
1
0
0
1
0
0
0
1
1
0
0
1
1
1
¬Q โŸน ¬P and ¬P โ‹€ ¬Q are logically equivalent
SYMBOLIC LOGIC
The following are logical identities or rules of replacement.
SYMBOLIC LOGIC
SYMBOLIC LOGIC
12. Exportation
((P สŒ Q) โŸน R) โŸบ (P โŸน (Q โŸน R))
SYMBOLIC LOGIC
SYMBOLIC LOGIC
Example
Show that ¬(Q โ‹€ P) โŸบ P โŸน¬Q.
Solution
¬(Q โ‹€ P)
โŸบ
โŸบ
โŸบ
¬Q โ‹¬P
¬P โ‹¬Q
P โŸน¬Q
(De Morgan’s)
(Commutativity)
(MI)
SYMBOLIC LOGIC
Example
Show that P โ‹€ [(P โ‹€ Q) โ‹ R] โŸบ P โ‹€ (Q โ‹ R).
Solution
P โ‹€ [(P โ‹€ Q) โ‹ R]
โŸบ
โŸบ
โŸบ
โŸบ
[P โ‹€ (P โ‹€ Q)] โ‹ (P โ‹€ R)
(Dist)
[(P โ‹€ P) โ‹€ Q] โ‹ (P โ‹€ R)
(Assoc)
(P โ‹€ Q) โ‹ (P โ‹€ R) (Indempotence)
P โ‹€ (Q โ‹ R)
(Dist)
SYMBOLIC LOGIC
Do Worksheet 4
SYMBOLIC LOGIC
Definition
An argument is a collection of propositions wherein it is
claimed that one of the propositions, called the conclusion,
follows from the other propositions, called the premise of the
argument. the conclusion is usually preceded by such words as
therefore, hence, then, consequently.
Classification of Arguments:
1. Inductive argument is an argument where it is claimed
that within a certain probability of error, the conclusion
follows from a premise; and
2. Deductive argument is an argument where is it claimed
that the conclusion absolutely follows from the premise.
SYMBOLIC LOGIC
A deductive argument is said to be valid if whenever
the premises are all true, then the conclusion is also
true. In other words if ๐‘ƒ1 , ๐‘ƒ2 , … ๐‘ƒ๐‘› are premises and Q
is the conclusion of the argument
๐‘ƒ1 ๐‘Ž๐‘›๐‘‘ ๐‘ƒ2 , ๐‘Ž๐‘›๐‘‘ … ๐‘ƒ๐‘› therefore Q is valid if and only if
the corresponding prepositional form
(๐‘ƒ1
๐‘ƒ2
…
๐‘ƒ๐‘› ) โŸน ๐‘„,
is a tautology. Otherwise, the argument is invalid.
SYMBOLIC LOGIC
To show that an argument is invalid, we have to show
an instance where the conclusion is false and the
premises are all true.
Show that the following argument is invalid using
Truth Table.
SYMBOLIC LOGIC
To show the validity of arguments, we may use
the truth table. However, this method is
impractical specially if the argument contains
several propositional variables. A more
convenient method is by deducing the
conclusion from the premises by a sequence of
shorter, more elementary arguments known to
be valid.
SYMBOLIC LOGIC
Rules of Inference
These are known valid argument forms.
SYMBOLIC LOGIC
SYMBOLIC LOGIC
SYMBOLIC LOGIC
SYMBOLIC LOGIC
Construct a formal proof of validity of the following
arguments:
a) Jack is in Paris only if Mary is in New York. Jack is
in Paris and Fred is in Rome. Therefore, Mary is in
New York.
b) If Mark is correct then unemployment will rise
and if Ann is correct then there will be a hard
winter. Ann is correct. Therefore unemployment
will rise or there will be a hard winter or both.
SYMBOLIC LOGIC
Solution for (a):
J:
M:
F:
Jack is in Paris.
Mary is in New York.
Fred Is in Rome.
The premises of the argument are J โŸน M and J โ‹€ F. The
conclusion is M.
1. J โŸน M
2. J โ‹€ F
3. J
4. M
(premise)
(premise)
(2. Simp)
(1, 3. MP)
SYMBOLIC LOGIC
Solution for (b):
M:
U:
A:
H:
Mark is correct.
Unemployment will rise.
Ann is correct.
There will be a hard winter.
The premises of the argument are: (M โŸน U) โ‹€ (A โŸน H) and A. The
conclusion is: U โ‹ H.
1. (M โŸน U) โ‹€ (A โŸน H)
2. A
3. (A โŸน H) โ‹€ (M โŸน U)
4. A โŸน H
5. H
6. H โ‹ U
7. U โ‹ H
(premise)
(premise)
(1. Comm)
(3. Simp)
(4, 2. MP)
(5. Add)
(6. Comm)
SYMBOLIC LOGIC
Alternative Solution for (b):
M:
U:
A:
H:
Mark is correct.
Unemployment will rise.
Ann is correct.
There will be a hard winter.
The premises of the argument are: (M โŸน U) โ‹€ (A โŸน H) and A. The
conclusion is: U โ‹ H.
1. (M โŸน U) โ‹€ (A โŸน H)
2. A
3. A โ‹ M
4. M โ‹ A
5. U โ‹ H
(premise)
(premise)
(2. Add)
(3. Comm)
(1, 4. CD)
SYMBOLIC LOGIC
Do Worksheet 5
SYMBOLIC LOGIC
Download