Sie sind auf Seite 1von 10

Chapter 2: Logic

Logic (from Classical Greek λόγος logos; meaning word, thought, idea, argument,
account, reason, or principle) is the study of the principles of valid inference and
demonstration.

2.1 Logical Statements and logic rules

A statements or proposition is declarative sentence that either true or false, but not both.

Example: Which of the following are statements?

a) The earth is round.

b) 2 + 3 = 5.

c) Do you speak English?

d) Excuse me please!

e) 3 – x = 5.

f) The sun will come out tomorrow.

Compound propositions can be formed by combining statements with and, or, not,
implies, if and only if and other similar words.
Instead of using words to connect propositions we shall use the following symbols:

p∧q means p and q


p∨q means p or q
¬p means not p
p→q means p implies q ( if p, then q)
p↔q means p if and only if q

Example: Write each of the following statements in terms of p, q and r and logical
connectives.

1 SBMA 3024/NS/Jan 09
a) I dream of home only if I am awake.

b) I am not awake if and only if I dream of home.

c) If I dream of home, then I am awake and I work hard.

d) If I am not awake or I am not work hard, then I will not dream a home.

Converse and Contrapositive

If p → q is an implication, then the converse of p → q is the implications q → p .

Example: State the converse of each of the following implications.

a) If I have a time, then I will go to the store.

b) If I am late, then I did not take the train to work.

c) If I have enough money, then I will buy a car and I will buy a house.

The contrapositive of p → q is the implication ¬q → ¬p .

Example: State the contrapositive of each of the following implications.

a) If I am in a good mood, then I will go to the movie.

b) I will not go to the movie if I study discrete structures.

c) If I am not in a good mood, then I will not study discrete structures.

2.2 Logical Implications and Equivalence using Truth table

2 SBMA 3024/NS/Jan 09
We use the truth tables to show the truth values of the five basic compound propositions.
T is use for TRUE and F is use for FALSE.

Logical negation is an operation on one logical value, typically the value of a


proposition, that produces a value of true if its operand is false and a value of false if its
operand is true.

The truth table for NOT p (also written as ~p or ¬p) is as follows:

Logical Negation

p ¬p

F T

T F

Logical conjunction is an operation on two logical values, typically the values of two
propositions, that produces a value of true if and only if both of its operands are true.

The truth table for p AND q (also written as p ∧ q, p & q, or p q) is as follows:

Logical Conjunction

p q p ∧ q

T T T

T F F

F T F

F F F

Logical disjunction is an operation on two logical values, typically the values of two
propositions, that produces a value of false if and only if both of its operands are false.

3 SBMA 3024/NS/Jan 09
The truth table for p OR q (also written as p ∨ q, p || q, or p + q) is as follows:

Logical Disjunction

p q p ∨ q

T T T

T F T

F T T

F F F

Logical implication and the material conditional are both associated with an operation on two
logical values, typically the values of two propositions, that produces a value of false just in the
singular case the first operand is true and the second operand is false.

The truth table associated with the material conditional not p or q (symbolized as p → q) and
the logical implication p implies q is as follows:

Logical Implication

p q p→q

T T T

T F F

F T T

F F T

4 SBMA 3024/NS/Jan 09
Logical equality (also known as biconditional) is an operation on two logical values,
typically the values of two propositions, that produces a value of true if and only if both
operands are false or both operands are true.

The truth table for p if and only if q (also written as p = q, p ↔ q, or p ≡ q) is as


follows:

Logical Equality

p q p↔ q

T T T

T F F

F T F

F F T

Example 1: Draw the truth tables for the following propositions

a) ¬( p ∨ q )

b) p ∧ ( p → q )

c) p ↔ (q ∧ p)

Example 2: Draw the truth table for the following implication

( p ∧ ¬q) → ¬( p → q)

Example 3: Show that the following pairs are equivalent:

( p ∨ q) → r ; (¬p ∧ ¬q ) ∨ r

In propositional logic, a tautology is a propositional formula that is true under any


possible valuation (also called a truth assignment or an interpretation) of its propositional
variables.

5 SBMA 3024/NS/Jan 09
A tautology's negation is a contradiction, a propositional formula that is false regardless
of the truth values of its propositional variables. Such. Conversely, a contradiction's
negation is a tautology.

A formula that is neither a tautology nor a contradiction is said to be logically


contingent. Such a formula can be made either true or false based on the values assigned
to its propositional variables.

Example: Construct truth tables to determine whether each of the following is a


tautology, contradiction or contingency.

a) p ∧ ¬p

b) (p ∧ q) ↔ (q ∧ p)

c) p ∧ q ∧ r

2.3 Laws of logic

6 SBMA 3024/NS/Jan 09
Bivalence
≡ F
¬T
¬F ≡ T
Involution ¬¬p ≡ p
∨ p
p ≡ p
Idempotence
p ∧ p ≡ p
p ∧ T ≡ p
Identity
p∨ F ≡ p

Conditional Identity
p→q ≡ ¬ p∨ q

p∧¬p ≡ F
Excluded Middle
p ∨ ¬p ≡ T
p ∧ (p ∨ q) ≡ p
Absorption
p ∨ (p ∧q) ≡ p
p ∨ q ≡ q ∨ p
Commutativity
p ∧ q ≡ q ∧ p
¬(p ∨ q) ≡ ¬p ∧ ¬q
DeMorgan's
¬(p ∧ q) ≡ ¬p ∨ ¬q
p ∨ (q ∨ r) ≡ (p ∨ q) ∨ r
Associativity
p ∧ (q ∧ r) ≡ (p ∧ q) ∧ r
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
Distributivity
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧r)
p ∨ T ≡ T
*Dominant
p ∧ F ≡ F

Example 1: By using the laws of logic, simplify the following

a) ( p ∨ q ) ∧ ¬(¬p ∨ q)

b) (a → b) ∧ (a → ¬b)

7 SBMA 3024/NS/Jan 09
Example 2: Prove the following propositions are equivalent

a) { p∨ (p → q) }↔ T

b) { ¬ ¬
[ ( p ∨ q ) ∧ r ] ∨ ¬q } ↔T

2.4 Logical Implications and Equivalence using Laws of logic

Example 1: By using the laws of logic prove the following implications.

( p ∧ ¬q) → ¬( p → q)

Example 2: Show that the following pairs are equivalent by using laws of logic:

a) { ( p ∨ q) → r } ↔ { (¬p ∧ ¬q) ∨ r }

b) ¬ ¬{ [ ( p ∨ q) ∧ r ] ∨ ¬q } ↔{q ∧r }

2.5 Rules of Inference

In logic, a rule of inference is a function from sets of formulae to formulae. The


argument is called the premise set (or simply premises) and the value the conclusion.

8 SBMA 3024/NS/Jan 09
They can also be viewed as relations holding between premises and conclusions, whereby
the conclusion is said to be inferable (or derivable or deducible) from the premises.

I. Modus ponens

Modus ponens is a very common rule of inference, and takes the following form:

If P, then Q. It can also be written as:


P.
Therefore, Q.

An example of an argument that fits the form modus ponens:

If today is Tuesday, then I will go to work.


Today is Tuesday.
Therefore, I will go to work.

II. Modus Tollens

Modus Tollens is the formal name for indirect proof or proof by contraposition
(contrapositive inference). It can also be referred to as denying the consequent.

Modus tollens has the following argument form:

It can also be written as:


If P, then Q.
¬Q
Therefore, ¬P.

Example:

If there is fire here, then there is oxygen here.


There is no oxygen here.
Therefore, there is no fire here.

III. Disjunctive Syllogism

A disjunctive syllogism is a classically valid, simple argument form:

9 SBMA 3024/NS/Jan 09
In logical operator notation:
P or Q
Not P
Therefore, Q _¬
q

Note that the disjunctive syllogism works whether 'or' is considered 'exclusive' or
'inclusive' disjunction. See below for the definitions of these terms.

Here is an example:

Either I will choose soup or I will choose salad.


I will not choose soup.
Therefore, I will choose salad.

Example:

Find the conclusion from the following hypothesis:

a) If there is a gas in the car, then I will go to the store. If I go to the store, then I will
get a soda. I do not get a soda.

b) I get A’s or I get rich. If I get A’s, my best friend will buy me a present. If I get
rich, I will always give present to my friend. I didn’t get rich.

c) I get A’s or I get rich. If I get A’s, my best friend will buy me a present. If I get
rich, I will always give present to my friend. My friend didn’t buy me a present.

10 SBMA 3024/NS/Jan 09

Das könnte Ihnen auch gefallen