Module 1 Mathematical Logic Annotated
Module 1 Mathematical Logic Annotated
Mathematical
Logic
MS. LOQUE
Introduction to Logic
What is Logic?
Logic is the basis of all mathematical reasoning.
It has practical applications in the design of computing machines, artificial intelligence,
computer programming, programming languages, and other areas of computer science.
Propositions are declarative sentences that are either true or false but not both.
Propositional logic studies the ways statements can interact with each other. It is
important to remember that propositional logic does not care about the content of the
statements.
Propositions
Propositions are declarative sentences that are either true or false but not both.
Which of the following are statements? If it is a statement, determine if possible
whether it’s true or false.
1. “3 is a prime number, but 6 is not.”
2. “Napoleon Bonaparte was president of the United States.”
3. “0 = 1.”
4. “The diameter of the earth is 1 inch or I ate a pizza.”
5. “Do you have a pork barbecue sandwich?”
6. “Give me a cafe mocha!”
7. “1 + 1 = 2.”
8. “1 + 1.”
Logical Connectives
There are several logical connectives:
1. Negation (“not”), denoted ഥ , ¬
2.Conjunction (“and”), denoted ∧.
3.Disjunction (“or”), denoted ∨.
4. Conditional (“if-then” or “implication”), denoted →.
5. Biconditional (“if and only if” or “double implication”), denoted ↔
6. Exclusive Or, denoted by ⨁ Remark. You may see different symbols used
by other people. For example, some people use
∼ for negation. And ⇒ is sometimes used for
the conditional, in which case ⇔ is used for
the biconditional.
NEGATION
Negation (𝑃ത , ~𝑃 , ¬𝑃)
Let P be a proposition.
The statement “It is not the case that P” is another proposition called the negation of P,
ഥ.
denoted by 𝑷
ഥ is read as “not p”.
The proposition 𝑷
ഥ should not be true exactly when P is true and vice versa.
The proposition 𝑷
CONJUNCTION
Conjunction (∧ , ⋅ , &)
The proposition is true when both P and Q are true. Otherwise, it is false.
Other ordinary language conjoiners besides "and" include some uses of "but,"
"although," "however "yet," and "nevertheless.“
DISJUNCTION
Disjunction ∨ , )
The proposition is false when both P and Q are false. Otherwise, it is true.
Given the following proposition.
P: 2 is an even integer.
Q: 3 is an odd integer.
Conditional Propositions
A conditional proposition is also known as an Implication.
The implication 𝑷 → 𝑸 can be
Definition: expressed in the following:
Let P and Q be propositions.
“If P then Q”
The implication “𝑷 → 𝑸” is the proposition that is “P implies Q”
false when P is true and Q is false and true otherwise. “P is sufficient for Q”
“A necessary condition for P is Q”
In this implication “Q is necessary for P”
“Q follows from P”
Statement P - antecedent, premise, or hypothesis. “P only if Q”
Statement Q - consequent or conclusion. “Q if P”
Examples:
Mary will be a good student if she studies hard. Having a grade of 50 and above is a necessary
condition for passing MATH 006.
Three (3) Related Implication
Given an implication 𝑝 → 𝑞, we define three related implication:
1. Converse
It is defined as 𝒒 → 𝒑
2. Inverse
It is defined as 𝒑
ഥ→𝒒
ഥ
3. Contrapositive
It is defined as 𝒒
ഥ→𝒑
ഥ
Example 1:
Determine the propositions P and Q.
If you get 100% on the finals, then you will get a “1.00”.
P:
Q:
𝑸 → 𝑷:
ഥ:
ഥ→𝑸
𝑷
ഥ →𝑷
𝑸 ഥ:
Bi-conditional Propositions
Definition:
Let P and Q be propositions. The bi-conditional “𝑷 ↔ 𝑸” is the proposition that is true when P
and Q have the same truth values and false otherwise.
2.P iff Q
3.Q iff P
Note: Mathematicians rarely use exclusive or. In math, or is understood to be inclusive unless
stated otherwise.
Represent the following statements
using logical connectives.
Examples:
1. P or not Q
2. If P and R, then Q
6. If P and Q, then R or S.
Other words or phrases may occur in statements. Here’s a table of some of them and how
they are translated.
Phrase Logical Translation
P, but Q P∧Q
Either P or Q P∨Q
P or Q, but not both (P ∨ Q) ∧ ¬(P ∧ Q)
P if Q Q→P
P is necessary for Q Q→P
P is sufficient for Q P→Q
P only if Q P→Q
P is equivalent to Q P↔Q
P whenever Q Q→P
“A necessary condition for P is Q” P→Q
“Q follows from P” P→Q
“p is a necessary and sufficient P↔Q
condition for q”
Example.
Translate the following statements into logical notation, using the following symbols:
S = “The stromboli is hot.”
L = “The lasagna is cold.”
P = “The pizza will be delivered.”
d) “If the pizza won’t be delivered, then both the Stromboli is hot and the lasagna is cold.”
Example.
Translate the following statements into logical notation, using the following symbols:
S = “The stromboli is hot.”
L = “The lasagna is cold.”
P = “The pizza will be delivered.”
e) “The lasagna isn’t cold if and only if the stromboli isn’t hot.”
g) “The stromboli is hot and the lasagna isn’t cold, but the pizza will be delivered.”
Truth Table
Logical Connectives and Truth Table
NEGATION
P ഥ
𝑷
T F
F T
P Q 𝑃∧𝑄
T T T
T F F
F T F
F F F
There is only one condition 𝑷 ∧ 𝑸 to be TRUE and this is when both statements are true.
Logical Connectives and Truth Table
DISJUNCTION
P Q 𝑷∨𝑸
T T T
T F T
F T T
F F F
This means that the disjunction of two statements is TRUE if at least one of the statements is true.
Logical Connectives and Truth Table
EXCLUSIVE OR
P Q 𝐏⨁𝐐
T T F
T F T
F T T
F F F
The Truth Table for Implication
𝑃 𝑄 𝑃→𝑄
T T T
T F F
F T T
F F T
This means if P is true, then Q must be true. The only way that this can fall (or be false)
is when P is true while Q is false.
The Truth Matrix for Bi-conditional
𝑃 𝑄 𝑃↔𝑄
T T T
T F F
F T F
F F T
Biconditional statement is true when both 𝑝 and 𝑞 carry the same truth value, and is false otherwise
Classes of Compound Statement
1. Tautology is a compound statement that is true for all possible combinations of the truth
values of the propositional variables.
2. Contradiction is a compound statement that is false for all possible combinations of the truth
values of its propositional variables.
It is also called as absurdity.
3. Contingency is a compound statement that can either be true or false, depending on the truth
values of the propositional variables. It is neither a tautology nor a contradiction.
Examples:
Determine the following if it is a tautology, contradiction or contingent.
1. 𝑷∧ 𝑷→𝑸 →𝑸
Practice this!
1. ഥ→𝑷
𝑷→𝑸 ↔ 𝑸 ഥ
ഥ→𝑩
2. 𝑨 → 𝑨
3. 𝑷 → [~𝑷 ↔ 𝑷 → 𝑸 ]
DIAGRAM OF DECISION VALUE
We can give the decision value of compound propositions if we know the decision values of
the component parts.
Example: Given the truth values of propositions A, B, C, and D. If A is true, B is false, C is true
and D is false, give the truth value of the following:
ഥ∧𝑩 →𝑪 ∧ 𝑩→𝑫
𝑨 ഥ ഥ ↔𝑩
𝑨→𝑩 →𝑪 ഥ → 𝑪∧𝑫 ൣ
Logic Gates
Logic Gates
Logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs
and one output. At any given moment, every terminal is in one of the two binary conditions low (0)
or high (1), represented by different voltage levels.
Computers use logic gates to transform the 1s and 0s from input wires. A logic gate accepts
inputs and then outputs a result based on their state.
There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
NOT Gate
The simplest gate is the NOT gate, also known as an inverter. It accepts a single input
and outputs the opposite value.
Based on that description, what value do you think this OR gate outputs?
OR Gate
XOR Gate
The XOR ( exclusive-OR ) gate acts in the same way as the logical "either/or."
The output is "true" if either, but not both, of the inputs are "true."
The output is "false" if both inputs are "false" or if both inputs are "true."
Another way of looking at this circuit is to observe that the output is true if the inputs are different,
but false if the inputs are the same.
XOR
NAND Gate
The NAND gate operates as an AND gate followed by a NOT gate. It acts in the manner of the
logical operation "and" followed by negation.
Its output is "true" if the inputs are the same, and "false" if the inputs are different.
XNOR
Example:
Example:
Example: 𝑃 ∨ 𝑄ത ∧ 𝑅ത
Example: 𝑃ത ∨ 𝑄ത ∧ 𝑃ത ∨ 𝑅ത
Example :
𝑃 ∨ 𝑄ത ∧ 𝑅ത ∧ 𝑃ത ∨ 𝑄ത ∧ 𝑃ത ∨ 𝑅ത
Example: 𝑃ത ∧ 𝑄ത ∨ 𝑅
Example: 𝑃 ∧ 𝑄 ∧ 𝑃 ∨ 𝑄
ҧ 𝐵ത ∨ 𝐴⋀𝐷
𝐴⨁ ҧ
𝑃ത ∨ 𝑄ത ∧ 𝑃ത ∨ 𝑅ത
𝑃 ∨ 𝑄ത ∧ 𝑅ത ∧ 𝑃ത ∨ 𝑄ത ∧ 𝑃ത ∨ 𝑅ത
𝑃∧𝑄 ∧ 𝑃∨𝑄
𝑃ത ∧ 𝑄ത ∨ 𝑅
ҧ 𝐵ത ∨ 𝐴⋀𝐷
𝐴⨁ ҧ
Reference:
https://www.khanacademy.org
https://sites.millersville.edu/bikenaga/math-proof/logical-connectives/logical-connectives.pdf
Module 1
Introduction to Logic
Logical Connectives
Truth Table
Conditional Propositions
End of
Biconditional Propositions
Logic Gates
Presentation!