0% found this document useful (0 votes)
44 views8 pages

Lesson 2

This document defines and explains propositional logic. It discusses: 1. Propositions are statements that can be either true or false. Logical connectives like AND, OR, NOT are used to combine propositions into compound statements. 2. Truth tables are used to determine the truth values of compound statements based on the truth values of the component propositions. 3. Important logical connectives include negation, conjunction, disjunction, implication, equivalence, and their derived operators. Laws of propositional logic ensure logical equivalences between statements.

Uploaded by

jaspertaguiam7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views8 pages

Lesson 2

This document defines and explains propositional logic. It discusses: 1. Propositions are statements that can be either true or false. Logical connectives like AND, OR, NOT are used to combine propositions into compound statements. 2. Truth tables are used to determine the truth values of compound statements based on the truth values of the component propositions. 3. Important logical connectives include negation, conjunction, disjunction, implication, equivalence, and their derived operators. Laws of propositional logic ensure logical equivalences between statements.

Uploaded by

jaspertaguiam7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

DISCRETE STRUCTURES: PROPOSITIONAL LOGIC

PROPOSITION
A Proposition or a statement or logical sentence is a declarative sentence which is either
true or false.

Example1: The following statements are all propositions:


“It is raining in Cebu right now”
It rained Yesterday.
8 * 5 = 45

Example2: The following statements are not propositions:


Please report at 11 a.m. sharp
What is your name?
x2=13

Propositional Variables
The lower-case letters p, q, r is used to represent propositions

Example: p: Grass is green


q: 2 + 5 = 5

The first proposition has the truth value of "true" and the second "false".
But "Close the door", and "Is it hot outside?" are not propositions.
Also "x is greater than 2", where x is a variable representing a number, is not a
proposition, because unless a specific value is given to x we cannot say whether it is true
or false, nor do we know what x represents.

Example: Let p: “It is sunny” and q: “it is cold”


p∧q It is sunny and cold
p∨q It is either sunny or cold
p→q If it is sunny, then it is cold
~p It is not sunny

COMPOUND STATEMENTS
Statements or propositional variables can be combined by means of logical connectives
(operators) to form a single statement called compound statements.

The five logical connectives are:

Symbol Connective Name

~ Not Negation

∧ And Conjunction

∨ Or Disjunction

⟶ or ⇒ Implies or if...then Implication or conditional


⟷ or ⇔ If and only if Equivalence or biconditional

BASIC LOGICAL OPERATIONS

1. Negation: It means the opposite of the original statement. If p is a statement, then


the negation of p is denoted by ~p and read as 'it is not the case that p.' So, if p is true
then ~p is false and vice versa.
Example: If statement p is Paris is in France, then ~p is 'Paris is not in France'.
p ~p

T F

F T

2. Conjunction: If p, q are two statements, then "p and q" is a compound statement,
denoted by p ∧ q and referred as the conjunction of p and q. The conjunction of p and q
is true only when both p and q are true. Otherwise, it is false.
Example: Xylee is tall AND slim.
p q p∧q

T T T

T F F

F T F

F F F
3. Disjunction: If p, q are two statements, then "p or q" is a compound statement,
denoted by p ∨ q and referred to as the disjunction of p and q. The disjunction of p and
q is true whenever at least one of the two statements is true, and it is false only when
both p and q are false.
Example: Xylee is beautiful OR wise.
p q p∨q

T T T

T F T

F T T

F F F
4. Implication / if-then (⟶): An implication or conditional p⟶q is the proposition
"if p, then q." It is false if p is true and q is false. The rest cases are true.
Example:
• If this car costs less than $10000, then Xyvier will buy it.
• If a = b and b = c, then a = c.
• If I get money, then I will purchase a computer.
p q p⟶q

T T T

T F F

F T T

F F T

Terminology for implication


• “if p, then q”.
• “q, if p”.
• “p, only if q”.
• “p implies q”.
• “p is sufficient for q”.
• “q is necessary for p”.
• “q follows from p”.

Examples:
p→q
• That Xylee is smart is sufficient for Xylee to be honest.
• “Xylee is honest” if “Xylee is smart”.
q→p
• That Xylee is smart is necessary for Xylee to be honest.
• “Xylee is honest” only if “Xylee is smart”.

5. If and Only If (⇔): p ⇔ q is bi-conditional logical connective which is true when p


and q are same, i.e., both are false, or both are true.
Example: A student gets A in Discrete Math if and only if his weighted total is ≥ 95%.

p q p⇔q

T T T

T F F

F T F

F F T

DERIVED CONNECTORS
p q AND OR NAND NOR XOR Conditional Bi-conditional
(∧) (∨) (~∧) (~∨) (⊕) (⇒) (⇔)
T T T T F F F T T
T F F T T F T F F
F T F T T F T T F
F F F F T T F T T
AND & NAND Operation
From the table, you can see, for AND operation, the output is True only if both the input
values are true, else the output will be false. The AND operator is denoted by the
symbol (∧).
Whereas the negation of AND operation gives the output result for NAND and is indicated
as (~∧).

OR and NOR Operation


OR statement states that if any of the two input values are True, the output result is
TRUE always. It is represented by the symbol (∨).
But the NOR operation gives the output, opposite to OR operation. It means the statement
which is True for OR, is False for NOR. And it is expressed as (~∨).

XOR Operation
The logical operation exclusive disjunction, also called exclusive or (symbolized XOR,
EOR, EXOR, ⊻ or ⊕, is a type of logical disjunction on two operands that results in a value
of true if exactly one of the operands has a value of true.
p q p⊕q

T T F

T F T

F T T

F F F

Example1: Write the truth table for the following given statement:(p ∨ q) ∧ (~p ⇒ q).
Solution: Given, (p ∨ q) ∧ (~p ⇒ q)
p q p∨q ~p ~p ⇒ q (p ∨ q) ∧ (~p ⇒ q)
T T T F T T
T F T F T T
F T T T T T
F F F T F F

Example2: Prove that x ⨁ y ≅ (x ∧∼y) ∨ (∼x ∧ y).


Solution: Construct the truth table for both the propositions.
x y x ⨁y ∼y ∼x x ∧∼y ∼x ∧ y (x ∧∼y) ∨ (∼x ∧ y)

T T F F F F F F

T F T T F T F T

F T T F T F T T

F F F T T F F F
VARIATIONS IN CONDITIONAL STATEMENT
• Contrapositive: The proposition ~q→~p is called contrapositive of p →q.
• Converse: The proposition q→p is called the converse of p →q.
• Inverse: The proposition ~p→~q is called the inverse of p →q.
Example1: Show that p →q and its contrapositive ~q→~p are logically equivalent.
Solution: Construct the truth table for both the propositions:
p q ~p ~q p →q ~q→~p

T T F F T T

T F F T F F

F T T F T T

F F T T T T

Example2: Show that proposition q→p, and ~p→~q is not equivalent to p →q.
Solution: Construct the truth table for all the above propositions:
p q ~p ~q p →q q→p ~p→~q

T T F F T T T

T F F T F T T

F T T F T F F

F F T T T T T
As, the values of p →q in a table is not equal to q→p and ~p→~q as in fig. So, both of
them are not equal to p →q, but they are themselves logically equivalent.

LAWS OF THE ALGEBRA OF PROPOSITIONS

Idempotent p ∨ p≅p p ∧ p≅p


laws

Associative (p ∨ q) ∨ r ≅ p∨ (q ∨ r) (p ∧ q) ∧ r ≅ p ∧ (q ∧ r)
laws

Commutative p∨q≅q∨p p∧q≅q∧p


laws

Distributive p ∨ (q ∧ r) ≅ (p ∨ q) ∧ (p ∨ r) p ∧ (q ∨ r) ≅ (p ∧ q) ∨ (p ∧ r)
laws

Identity laws p∨F≅p p ∧ T≅ p


p ∧ F≅F p∨T≅T

Involution ¬¬p ≅ p
laws
Complement p ∨ ¬p ≅ T p ∧ ¬p ≅ T
laws

DeMorgan's ¬(p ∨ q) ≅ ¬p ∧ ¬q ¬(p ∧ q) ≅¬p ∨ ¬q


laws:
Example: Consider the following propositions ~p∨∼q and ∼(p ∧ q).
Are they equivalent?
Solution: Construct the truth table for both
p q ~p ~q ~p∨∼q P ∧q ~(p ∧ q)

T T F F F T F

T F F T T F T

F T T F T F T

F F T T T F T

Tautologies and contradictions


A tautology is a compound statement that will always be true for every value of individual
statements. A Greek word is used to derive the tautology where 'tauto' is known as
"same" and "logy" is known as logic. There are some conditional words, which is used to
make a compound statement, i.e., if, then, and, or, not, and if and only if. We will use
these words in the middle of two simple statements.
Example:
• Xyvier is a good boy, or Xyvier is not a good boy.
• Either he will choose to study IT, or he will not choose to study IT.
• A number can be even, or a number cannot be even.

The tautology can be described as a compound statement, which always generates the
truth value. The individual part of the statement does not affect the truth value of the
tautology. The tautologies can be easily translated into mathematical expressions from
the ordinary language by using logical symbols.

Example:
My dad gives me 1000 pesos, or my dad will not give me 1000 pesos.
To understand this example, we will take:
p = My dad gives me 1000 pesos
~p = My dad will not give me dad

The logical operator "OR" is used to generate the above two individual statements,
which is indicated with the help of symbol "∨". So, these statements can be written in
the following form: p ∨ ~p
Now we have to determine whether the above two given statements generate a valid
answer.
Case 1: My dad gives me 1000 pesos. Here, the true value is generated by the first
statement, and the false value is generated by the second statement. With the help of
'OR' operator, the given statement is connected. That's why it will generate a truth
statement.
Case 2: My dad will not give me 1000 pesos. Here, the false value is generated by the
first statement, and the true value is generated by the second statement. That's why it
will generate a true statement.
Now we will describe this statement by the truth table, which is described as follows:
p = My dad gives ~p = My dad will not p ∨ ~p (My dad gives me 1000 pesos or
me 1000 pesos give me 1000 pesos My dad will not give me 1000 pesos)

T F T

F T T
Hence, the last column of the above table is true for all the values. That's why we can
say that the given statement is a tautology.

Example: In this example, we have to determine whether the statement p ⇒ (p ∨ q) is


a tautology.
Solution: There are two statements, p, and q. Truth value of these statements can be
written in the following form:

p q p∨q p ⇒ (p ∨ q)

T T T T

T F T T

F T T T

F F F T
With the help of above table, we can see that the truth value of p ⇒ (p ∨ q) is true for
all the individual statements. That's why this statement is a tautology.

Example: In this example, we have to determine whether the statement ~A ∧ B ⇒


~(A ∨ B) is a tautology.
Solution: There are two statements, A, and B. Truth value of these statements can be
written in the following form:

A ~A B ~A ∧ B A∨B ~ (A ∨ B) ~A ∧ B ⇒ ~(A ∨ B)

T F T F T F T

T F F F T F T

F T T T T F F

F T F F F T T
With the help of above table, we can see that the truth value of ~A ∧ B ⇒ ~(A ∨ B) is
true for all the individual statements. That's why this statement is a tautology.

A proposition P is a tautology if it is true under all circumstances. It means it contains


the only T in the final column of its truth table.
Example: Prove that the statement (p⟶q) ⇔ (∼q⟶∼p) is a tautology.
Solution: Make the truth table of the above statement:
p q p→q ~q ~p ~q⟶∼p (p→q) ⇔ ( ~q⟶~p)

T T T F F T T

T F F T F F T

F T T F T T T

F F T T T T T
As the final column contains all T's, so it is a tautology.

CONTRADICTION
A statement that is always false is known as a contradiction.
Example: Show that the statement p ∧∼p is a contradiction.
Solution:
p ∼p p ∧∼p

T F F

F T F
Since, the last column contains all F's, so it's a contradiction.

CONTINGENCY
A statement that can be either true or false depending on the truth values of its
variables is called a contingency.
p q p →q p∧q (p →q)⟶ (p∧q )

T T T T T

T F F F T

F T T F F

F F T F F

You might also like