0% found this document useful (0 votes)
23 views

Module 1 Mathematical Logic Module Final

The document discusses mathematical logic and propositional logic. It defines key concepts like propositions, logical connectives, truth tables, and how to represent statements using logical symbols. It also discusses how to determine if a compound statement is a tautology, contradiction, or contingent.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Module 1 Mathematical Logic Module Final

The document discusses mathematical logic and propositional logic. It defines key concepts like propositions, logical connectives, truth tables, and how to represent statements using logical symbols. It also discusses how to determine if a compound statement is a tautology, contradiction, or contingent.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Mathematical

Logic

KENNETH TERCERO
INTENDED LEARNING OUTCOMES
At the end of the session, the students should be able to:

1. Determine a proposition.
2. Identify the different logical connectives.
3. Translate a propositional logic to symbols.
4. Convert a conditional statement.
5. Construct truth tables of compound propositions.
Introduction to Logic
What is Logic?
Logic is the basis of all mathematical reasoning, and it has a practical applications to the
design of computing machines, to artificial intelligence, to computer programming, to programming
languages and to other areas of computer science.

Propositions are declarative sentences that are either true or false but not both.

Propositional calculus is a branch of logic. It is also called Propositional Logic.


Propositional logic studies the ways statements can interact with each other. It is
important to remember that propositional logic does not really 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. “Give me a cafe mocha!”

5. “1 + 1 = 2.”

6. “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.
Represent the following statements
using logical connectives.
Examples:

1. P or not Q

2. If P and R, then Q

3. P if and only if (Q and R).


4. Not P and not Q.

5. It is not the case that if P, then Q.

6. If P and Q, then R or S.
IF-THEN STATEMENTS
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)
Q if P P→Q
Q is necessary for P P→Q
P is sufficient for Q P→Q
P only if Q P→Q
P is equivalent to Q P↔Q
Q whenever P P→Q
“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: All birds only if they have feathers

CONDITIONAL STATEMENT
IF AN ANIMAL IS A BIRD, THEN IT HAS A FEATHER.

INVERSE
IF AN ANIMAL IS NOT A BIRD, THEN IT DOES NOT HAVE A FEATHER

CONVERSE
IF AN ANIMAL HAS FEATHER, THEN IT IS A BIRD

CONTRAPOSITIVE
IF AN ANIMAL DOES NOT HAVE A FEATHER, THEN IT IS NOT A BIRD
Joy will pass the subject if her score is 70.

CONDITIONAL STATEMENT
IF JOY GOT A SCORE OF 70, THEN SHE WILL PASS THE SUBJECT

INVERSE
IF JOY DID NOT GET A SCORE OF 70 THEN SHE WILL NOT PASS THE
SUBJECT

CONVERSE
IF JOY PASSED THE SUBJECT, THEN SHE GOT A SCORE OF 70.

CONTRAPOSITIVE
IF JOY DID NOT PASS THE SUBJECT THEN SHE WILL NOT GET A SCORE OF
70.
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.”

a) “The stromboli is hot and the pizza will not be delivered.”


b) “If the lasagna is cold, then the pizza will be delivered.”
c) “Either the lasagna is cold or the pizza won’t be delivered.”
d) “If the pizza won’t be delivered, then both the Stromboli is hot and the lasagna is cold.”
e) “The lasagna isn’t cold if and only if the stromboli isn’t hot.”
f) “The pizza will be delivered only if the lasagna is cold.”
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

The Truth Matrix of the Negation of a Proposition

P ഥ
𝑷
T F
F T

ഥ , since a proposition may either be true or false.


The matrix gives two possible decisions for 𝑷
Logical Connectives and Truth Table
CONJUNCTION
The Truth Matrix for the Conjunction of Two Propositions

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

The Truth Matrix for the Disjunction of Two Propositions

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

The Truth Matrix for the Exclusive Or of Two Propositions

P Q 𝐏⨁𝐐
T T F
T F T
F T T
F F F

It is true when either of the statements are true (one is true and the other one is false) otherwise it’s false.
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. 𝑷∧ 𝑷→𝑸 →𝑸

2. ഥ→𝑷
𝑷→𝑸 ↔ 𝑸 ഥ

ഥ→𝑩
3. 𝑨 → 𝑨

4. 𝑷 → [~𝑹 → 𝑸]
Examples:
Determine the following if it is a tautology, contradiction or contingent.

1. 𝑷∧ 𝑷→𝑸 →𝑸

2. ഥ→𝑷
𝑷→𝑸 ↔ 𝑸 ഥ

ഥ→𝑩
3. 𝑨 → 𝑨

4. 𝑷 → [~𝑹 → 𝑸]
Examples:
Determine the following if it is a tautology, contradiction or contingent.

1. 𝑷∧ 𝑷→𝑸 →𝑸

2. ഥ→𝑷
𝑷→𝑸 ↔ 𝑸 ഥ

ഥ→𝑩
3. 𝑨 → 𝑨

4. 𝑷 → [~𝑹 → 𝑸]

]
Examples:
Determine the following if it is a tautology, contradiction or contingent.

1. 𝑷∧ 𝑷→𝑸 →𝑸

2. ഥ→𝑷
𝑷→𝑸 ↔ 𝑸 ഥ

ഥ→𝑩
3. 𝑨 → 𝑨

4. 𝑷 → [~𝑹 → 𝑸]
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.

If the input is 0, the output is 1:

If the input is 1, the output is 0:


AND Gate
All other logic gates operate on multiple inputs. The AND gate accepts two wires, and if both
of those wires are "on" (representing 1), it outputs 1:

If either of those wires are "off" (representing 0), then it outputs 0:

What do you think this combination will output?


AND Gate
OR Gate
The OR logic gate accepts two inputs, and as long as either of those inputs is a 1, it
outputs a 1:

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.

The output is "false" if both inputs are "true."

Otherwise, the output is "true."


NAND
NOR Gate
The NOR gate is a combination OR gate followed by an inverter.

Its output is "true" if both inputs are "false."

Otherwise, the output is "false."


NOR Gate
XNOR Gate
The XNOR (exclusive-NOR) gate is a combination XOR gate followed by an inverter.

Its output is "true" if the inputs are the same, and "false" if the inputs are different.
XNOR
Example:
Example:
Example: 𝑃ത ∨ 𝑄ത ∧ 𝑃ത ∨ 𝑅ത
CREATE A LOGIC GATE DIAGRAM USING THE LOGIC.LY
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!

You might also like