Вы находитесь на странице: 1из 33

5: LOGIC

DISCRETE MATHEMATICS

AZLINAJUMADIMARCHJUNE2018
STATEMENTS
 A statement, or a proposition, is a declarative sentence that is either true or
false, but not both.
 The truth value of a proposition is true (T) if it is a true proposition and false
(F), if it is a false proposition.
 Examples:
‣ p: 2 is an even number (true)
‣ q: 2 + 5 = 8 (false)
‣ r: A is a vowel (true)

 The following are not propositions:


‣ a: Take two aspirins.
‣ b: Do you speak English?
STATEMENTS
Example 1:
Determine whether the following sentences are statements or not. If it is a statement,
determine its truth value.
a) Selangor is a state in Malaysia. (T)
b) The sun rises in the west. (F)
c) The sun will come out tomorrow. (T)
d) Do your homework.
e) There is no gravity. (F)
f) What is the time?
g) 3+4
h) 6 May 2018 is a Friday. (T)
STATEMENTS
 A simple statement is known as a primary statement.
 It can be represented by a variable x, y, p, q and others.
 A few primary statement can be combined to form a single compound statement.
 A compound statement is a new statements formed by existing statements and logical
operators (connectives).
 Logical Operators:

negation (not) ~
and ˄
or ˅
conditional →
biconditional (if and ↔
only if, equivalence)
CONDITIONAL STATEMENTS
Conditional statements: p → q

 If p then q
 If p, q
 q if p
 q from p
 q whenever p p→q
 p only if q
 p is sufficient condition for q
 q is necessary condition for p
CONDITIONAL STATEMENTS
If p → q is an implication,
 the converse is q → p,
 the contrapositive is ~q → ~p,
 the inverse is ~p → ~q.

 Example:
Let p: the network is down q: Ahmad cannot access the Internet

 p → q : If the network is down, Ahmad cannot access the Internet


 q → p : If Ahmad cannot access the Internet, the network is down (converse)
 ~q → ~p : If the network is not down, Ahmad can access the Internet (inverse)
 ~p → ~q : If Ahmad can access the Internet, the network is not down (contrapositive)
STATEMENTS
Example 2:
Let p: the switch is on
q: the bulb lights up

Write down using the proposition symbol to represent the statement.


1) The switch is not on and the bulb does not light up ~p ˄ ~q
2) If the switch is off then the bulb does not light up ~p → ~q
3) If the bulb does not light up then the switch is off
~q → ~p
4) It is not true that if the switch is off, the bulb does not light up
~(~p → ~q)
5) It is not true that if the switch is off and the bulb lights up
~(~p ˄ q)
6) It is not true that if the bulb does not light up, then the switch is on
~(~q → p)
STATEMENTS
Example 3:
Let p: Ali is rich q: Ali is happy
Write down using the proposition symbol to represent the statement.
1) Ali is rich and happy p ˄ q
2) Ali is poor but happy ~p ˄ q
3) Ali is poor and not happy ~p ˄ ~q
4) If Ali is happy, he is not poor q→p
5) It is not true that if Ali is poor, he is not happy
~(~p → ~q)
6) Ali is happy only if he is rich
q→p
7) Ali is rich is necessary for Ali is happy
q→p
8) Ali is rich is sufficient for Ali is happy
p→q
9) Ali is sad only if Ali is poor
~q → ~p
STATEMENTS
Example 4:

a) Write the converse and hence the contra positive of the following statement:
“If I am a millionaire, then I will donate some of my properties to the needy people”
Converse: I will donate some of my properties to the needy people only if I am a millionaire
Contrapositive: If I am not donating my properties to the needy people, then I am not a millionaire

b) Give the inverse of the following statement:


“If you brush your teeth with Colgate, then you have fewer cavities”
Inverse: I you do not brush your teeth with Colgate, the you do not have fewer cavities

c) State the converse and inverse of the following statement:


“If I vote, then I am a good citizen”
Converse: If I am a good citizen, then I vote
Inverse: If I do not vote, then I am not a good citizen
TRUTH TABLES
 Truth tables can be used to evaluate statements.
 A simple proposition can either be “true” or “false”.

Negation Conjunction (“and”) Disjunction (“or”) Implication Equivalence


p ¬p p q pΛq p q pVq p q p→q p q p↔q
T F F F F F F F T F F T F F
F T F T F F T T T T T T T T
T F F T F T F F T F F T
T T T T T T F T T F T F

10
TRUTH TABLES
Example 5:
Construct a truth table for the following statements: (𝑝∧q) → ~r

p q r 𝑝∧q ~r (𝑝∧q) → ~r
T T T T F F
T T F T T T
T F T F F T
T F F F T T
F T T F F T
F T F F T T
F F T F F T
F F F F T T
TRUTH TABLES
 A statement that is true for all possible values of its propositional variables is called a
tautology.
 A statement that is always false is called a contradiction or an absurdity.
 A statement that can be either true or false, depending on the truth values of its
propositional variables is called a contingency.
TRUTH TABLES
Example 6: (Method I)
Construct the truth table to determine whether the two statements are logically equivalence:
p →(q ∧ r) ↔ (p →q) ∧ (p→r)
p q r q∧r p →(q ∧ r) p →q p→r (p →q) ∧ (p → r)
T T T T T T T T
T T F F F T F F
T F T F F F T F
T F F F F F F F
F T T T T T T T
F T F F T T T T
F F T F T T T T
F F F F T T T T

equivalence
TRUTH TABLES
Example 6: (Method II)
Construct the truth table to determine whether the two statements are logically equivalence:
p →(q ∧ r) ↔ (p →q) ∧ (p → r)

p q r q∧r p →(q ∧ r) p →q p→r (p →q) ∧ (p → r) p →(q ∧ r) ↔ (p →q) ∧ (p→r)

T T T T T T T T T
T T F F F T F F T
T F T F F F T F T
T F F F F F F F T
F T T T T T T T T
F T F F T T T T T
F F T F T T T T T
F TF F F T T T T T

Therefore, the two statements given are logically equivalence. Tautology


TRUTH TABLES
 
Example 7:

Assuming that p and r are false and that q and s are true, find the truth value for the following proposition:

1) (𝑠→(𝑝∧~𝑟))∧((𝑝→(𝑟∨𝑞))∧𝑠)
(F)
2)
(T)

(T)
TRUTH TABLES
Example
  8:
a) Construct a truth table to determine whether the following statement is a tautology,
a contingency or a contradiction.
i.
ii.

b) Determine whether or not the following fair of statement is equivalent using the
truth table:
and
LAW OF LOGIC (LOGICAL
EQUIVALENCE)

Inverse laws
LAW OF LOGIC
Example
  9:
Simplify the following:

De
De Morgan’s
Morgan’s Law
Law
Double
Double Negation
Negation Law
Law
Distributive
Distributive
Inverse Law
Inverse Law
Identity
Identity
LAW OF LOGIC
Example
  10:
a) Simplify the following.
i.
ii.

b) Prove the following using rules of logic.

c) Consider the logical statement:

Using the rules of logic, show that the statement is logically equivalent to .
LAW OF LOGIC
Example
  11:
Prove the following using rules of logic.
a)

b)
e)
SWITCHING NETWORK
  The logical expression can be used to represent a switching network.
 serial circuit – the connector is used
 parallel circuit – the connector is used
 If two switches p and q connect terminal A to terminal B serially, then it is
represented by .

 If two switches p and q connect terminal A to terminal B in parallel, then it is


represented by .
LAW OF LOGIC
Example
  12:
Prove the following statement are logically equivalent by

a) using law of logic


b) using truth table

b) ~
a)
T T T F T
Def.
Def. of
of implication
implication T F F T T
De
De Morgan
Morgan F T T F F
Double
Double Negation
Negation Law
Law F F T F F
Absorption equivalence
Absorption
SWITCHING NETWORK
Example 13:
Give the logical expression that represent the following circuit.
  p q r
a) b)   p (q ) s

c)
  (p q)
SWITCHING NETWORK
Example 14:
Give the logical expression that represent the following circuit. Hence, use laws of
logic to simplify the circuit and draw the simplified circuit.

 Example 15:
Draw a circuit that represent the following logical expression. Hence, use laws of logic
to simplify the circuit and draw the simplified circuit.
ARGUMENTS
 An argument is a set of two or more sentences or beliefs.
 One of the sentences or beliefs is the conclusion, the rest are premises.
 The structure of an argument:
ARGUMENTS
  A statement A is said to imply B tautologically if and only if A → B is a tautology.

Example 16:
Determine whether are logically implies to .

T T F F T F T
T F F T F F T
F
F T
T T
T F
F T
T F
F T
T
F
F F
F T
T T
T T
T T
T T
T

Tautology
  Therefore, are logically implies to .
ARGUMENTS
Example 17:
Given the following arguments:
If you study hard, you will get an A. You won’t get an A. Therefore, You won’t study hard.

Determine whether the argument is valid or not by using the truth table.

p q p→q ~q (p → q) ∧ ~q ~p [(p → q) ∧ ~p] → ~q


 
T T T F F F T
p: You study hard T F F T F F T
q: You will get an A
F T T F F T T
F F T T T T T
P1:
P2: Tautology
Therefore, the argument is valid .
ARGUMENTS
Example 18:
Use a truth table to test the validity of the following argument.

1. I’ll buy a car or I’ll take a vacation. I won’t buy a car. Therefore, I’ll take a valid
vacation.

2. If Eddie goes to town, then Mabel stays at home. If Mabel does not invalid
stay at home, then Rita will cook. Rita will not cook. Therefore, Eddie
does not go to town.
RULES OF INFERENCES
RULES OF INFERENCES
Example
  19:
Given the following arguments:
I can either drive or take the bus. If I drive then I will be on time. I am late.

a) Write all the primary statements using the variables and


b) Write all the premises using the variables in (i).
c) Find the conclusion of the arguments by using the rules of inference.

a) p: I can drive b)  Premise1:


q: I can take the bus Premise 2 :
r: I will be on time Premise 3 :
RULES OF INFERENCES
Example 19 (continued):

c)
P1 Premise 1
P2 Premise 2
P3 Premise 3
(1) P3 & P2, Modus Tollen
(2) P1 & (1), Resolution

Conclusion: I can take the bus


RULES OF INFERENCES
Example
  20:
Given the following arguments:
“If we go to Langkawi then we can go shopping. If we go shopping, then we have to
spend extra money. We do not want to spend extra money.”

a) Write all the primary statements using the variables and


b) Write all the premises using the variables in (i).
c) Find the conclusion of the arguments by using the rules of inference.
RULES OF INFERENCES
Example
  21:
Given the following arguments:
If there is Petronas gas in the house, then I’ll cook chicken rice.
If I cook chicken rice, then I’ll make the sauce.
If I make the sauce, then the meal will be delicious.
The meal is not delicious.

a) Write all the primary statements using the variables .


b) Write all the premises using the variables in (i).
c) Find the conclusion of the arguments by using the rules of inference.

Вам также может понравиться