Cosc Full
Cosc Full
Logic Operations
Provided by the Academic Center for Excellence 1 Logic and Truth Tables
Reviewed August 2017
IF AND ONLY IF If and Only If Statements – These statements are true only when
(bi-conditional) both p and q have the same truth values.
Example: “Taxes will go down IF AND ONLY IF I am
p q p↔q
elected.”
T T T Only if I am elected and taxes go down, or I am not elected and taxes
T F F do not go down is this true.
F T F
F F T
Constructing Truth Tables
To create a truth table, follow these steps:
1. Determine the number of variables; for n variables, create a table with 2n rows.
• If there are two variables (p, q), then you will need 22 or 4 rows.
• If there are three variables (p, q, and r), you will need 23 or 8 rows.
2. List the variable and every combination of T and F for the given variables.
TWO VARIABLE THREE VARIABLE
p q p q r
T T T T T
T F T T F
F T T F T
F F T F F
F T T
F T F
F F T
F F F
3. Then start with negations (“nots” or “~”), create a new column for each “piece” of
the statement or argument, filling in the truth values as you go. Work from simple
pieces to more difficult pieces until you have the truth values for the whole problem.
4. If two statements have the same truth values, then they are equivalent.
Equivalents
There are a number of equivalents in logic. This means that these statements have been
proven true, and you can use these statements without having to prove them. The symbol
for equivalent is ≡. The following are the most commonly used equivalents:
• p∧T≡p • p∧p≡p • ~(p ∨ q) ≡ ~p ∧ ~q
• p∧F≡F • p∨p≡p DeMorgan’s Law #1
• p∨T≡T • p ∧ ~p ≡ F • ~(p ∧ q) ≡ ~p ∨ ~q
• p∨F≡p • p ∨ ~p ≡ T DeMorgan’s Law #2
• p → q ≡ ~p ∨ q • p ∨ (q ∧ r) ≡ (p ∨ q) ∧ • p ∧ (q ∨ r) ≡ (p ∧ q) ∨
• p → q ≡ ~q → ~p (p ∨ r) (p ∧ r)
Provided by the Academic Center for Excellence 2 Logic and Truth Tables
Truth Table Example
Statement: (p ∧ q) ↔ (~p ∨ q)
p q
T T 1:
Step
T Determine
F the number of variables and rows needed, then
F write
T down all possible combinations of p and q.
F F
p qStep~p
2:
T T F
p ∧ q ↔ ~p ∨ q
T F F
F T T
Write down values of ~p (or “not p”)
F F T
q 3:~p p ∧ q
p Step
T T F
T p F∧ qF↔ ~pF∨ q
T
F T T F
F Left T Is (pF∧ q) true? Use values from p and q columns.
F Side:
pStepq 4: ~p p ∧ q ~p ∨ q
p ∧ q ↔ ~p ∨ q
T T F T T
T F F F F
F T T F T
FRight
F Side: F ∨ q) true?
T Is (~p T Use values from ~p and q columns.
q 5:~p p ∧ q ~p ∨ q p ∧ q ↔ ~p ∨ q
p Step
T p T∧ qF↔ ~p T ∨q T T
T F F F F T
F Is T T F T
the entire statement true? No. F
F F T F T F
The entire statement is true only when the last column’s truth values are all “True.” In this
case, (p ∧ q) is not equivalent to (~p ∨ q) because they do not have the same truth values.
If every cell in the last column is “True,” then the entire statement is true.
This is called a tautology.
Provided by the Academic Center for Excellence 3 Logic and Truth Tables
Truth Tables for Arguments
A logical argument is made up of two parts: the premises and the conclusion.
Arguments are usually written in the following form:
Arguments of this form can be turned into a logical statement. First, assign variables to each
premise and conclusion.
“It is cold” = p
If it is cold, then my motorcycle will not start.
“It is not cold” = ~p
My motorcycle started.
“My motorcycle will start” = q
It is not cold. “My motorcycle will not start” = ~q
You can now re-write the argument using logical operators. Look for keywords like “if” and
“not.”
Finally, the argument can be rewritten as a logical statement. Arguments can always be
written in the following form:
[ (p → ~q) ∧ q ] → ~p
This statement can then be proven valid or invalid using a truth table, as shown on the
following page.
Provided by the Academic Center for Excellence 4 Logic and Truth Tables
Truth Table Example
Statement: [ (p → ~q) ∧ q ] → ~p
p q
T TStep 1:
T FDetermine the number of variables and rows needed,
F Tthen write down all possible combinations of p and q.
F F
p q ~p
T T Step
F 2:
T F [F(p → ~q) ∧ q ] → ~p
F T Write
T down values of ~p (or “not p”)
F F T
pStep
q 3:
~p ~q
T T →F~q) ∧Fq ] → ~p
[ (p
T F
F down
Write T
values of ~q (or “not q”)
F T T F
F F T T
Step 4:
(p → ~q)
[ (p → ~q) ∧ q ] → ~p
p q ~p ~q
T T F F F
T F FLeftTSide: StartTwithin the inner most parentheses. Is (p → ~q)
true? Use values from p and ~q columns.
F T T F T
F F T T T
Step 5:
p q ~p ~q [ (p (p → ~q) ∧(pq→]~q)
→ ~q) ∧q
→ ~p
T T F F Left Side: F Work outwards F towards the outer
T F F T most parentheses. T F → ~q) ∧ q ] true?
Is [ (p
F T T F Use values T from (p → ~q) T and q columns.
F F T T T F
p q6: ~p ~q (p → ~q)
Step (p → ~q) ∧ q [ (p → ~q) ∧ q ]
[ (p → ~q) ∧ q ] → → ~p
T T F F F F T
~p
T F F T T F T
IsF theTentire
T statement
F true?
T T T
Yes. This is a tautology
F F T T T F T
Provided by the Academic Center for Excellence 5 Logic and Truth Tables
INTRODUCTION TO
DISCRETE STRUCTURE
Used to combine
propositions
KINDS OF CONNECTIVES
Rule
Let P and Q be two propositions. Then P=>Q is false if P is true
and Q is false, and P=>Q is true otherwise. P=>Q is called the
conditional of P and Q. “If P, then Q”, in other words, P=>Q
means that whenever P is correct, so is Q. The statement P is
called the antecedent and Q the consequent.
BICONDITIONAL
Rule
Let P and Q be two propositions. Then P<=>Q is true
whenever P and Q have the same truth-values. P<=>Q is
called the biconditional or equivalence and it is
pronounced “P if and only if Q” or “P iff Q” as an
abbreviation.
TRANSLATING FROM ENGLISH TO SYMBOLS
TRANSLATING FROM ENGLISH TO SYMBOLS
ACTIVITY 2:
LOGICAL CONNECTIVES
Using the statements M for “Mariz is rich” and C for “Mariz is happy”,
respectively, write the ff statements in symbolic form:
Rules of Inference
NATURE OF CATEGORICAL
PROPOSITIONS
WHAT IS A CATEGORICAL PROPOSITION?
NATURE OF CATEGORICAL PROPOSITION
1. Quality of Proposition
2. Quantity of Proposition
Quantity Of Proposition
The quantity of a categorical proposition, on the other
hand, is a measure of the degree to which the relationship
between its subject and predicate terms holds.
• Universal Proposition
• Particular Proposition
• Singular Proposition
ACCORDING TO QUANTITY
UNIVERSAL PROPOSITIONS
A universal proposition is one whose subject term stands for each and all
individuals to which it is applied.
Ex.
Every man is created by God.
Filipinos are industrious.
All cows are animals.
Environment is vital.
An eagle is a flying bird.
ACCORDING TO QUANTITY
PARTICULAR PROPOSITIONS
This is a kind of proposition whose subject stands for a portions of a
given totality, or for an indeterminate individual or group.
Ex.
Many people are generous.
Some plants are edible.
Four billion people are Christians.
Not every bright girl is beautiful.
ACCORDING TO QUANTITY
SINGULAR PROPOSITIONS
A singular proposition is one whose subject is singular concept. The subject
refers only to a specific or definite individual or group.
Ex.
The Philippines is a Christian nation on Asia.
Miss Miriam is beautiful woman.
This guy is my friend.
I am not a Chinese.
Quality Of Proposition
The quality of a categorical proposition indicates the
nature of the relationship it affirms between its subject and
predicate terms.
• Affirmative Proposition
• Negative Proposition
ACCORDING TO QUALITY
AFFIRMATIVE PROPOSITION
An affirmative proposition is one whose subject and predicate
terms are united by the copula: IS, ARE or AM.
Ex.
All tress are with leaves.
This man is my friend.
Some teachers are late – comers.
Dr. Samonte is a Department Chair.
ACCORDING TO QUALITY
NEGATIVE PROPOSITIONS
These propositions have subjects and predicate terms that are
separated from each other due to negative copula: IS NOT, ARE NOT or
AM NOT.
Ex.
A person is not a dog.
Some people are not poor.
Not all glittery is gold.
Symbols of Categorical Propositions. Since Aristotle’s time, there have
been an attempt to make logic a science of symbols to achieve shortcuts
to correct reasoning. Among these are symbols for the four categorical
statements, namely, universal affirmative (A), universal negative (E),
particular affirmative (I), and particular negative (O).
A-E-I-O
ACCORDING TO QUANTITY ANDQUALITY
Examples:
All idiots are slow learners.
Every judgment is an act of the mind.
Also, indefinite affirmative and singular affirmative propositions:
Man is fallible.
This insect is Poisonous
ACCORDING TO QUANTITY ANDQUALITY
Example:
No transparencies are plastic.
Also, indefinite negative and singular negative propositions:
Beauty is not sensible.
This snake is not venomous.
ACCORDING TO QUANTITY ANDQUALITY
Examples:
Few students are in the dean’s list.
Some policemen are rich.
Certain men are geniuses.
Most parents are proud of their children.
Also, indefinite affirmative propositions
Men are selfish. (Most?)
Women are fickle (Some? A large minority? Most?)
ACCORDING TO QUANTITY ANDQUALITY
Examples.
Some honest people are not married.
Majority of the soldiers are not brave.
Also, indefinite negative propositions:
Politicians are not corrupt. (A few?)
Priests are not celibate. (Many?)
The four standard Categorical
Propositions.
Quality
Affirmative Negative
A E
Universal
Quantity
I O
Particular
LOGICAL FORM OF CATEGORICAL
PROPOSITION
The PREMISES are the statements that set forth the evidence, and
the CONCLUSION is the statement that is claimed to follow from the
evidence.
Here is an example of an argument:
1ST PREMISE: Every flower is a plant (T)
2ND PREMISE: Fish is not a flower (F)
CONLUSION: Therefore, fish is not a flower (F).
There are (3) univocal terms contained in the premises.
1.MAJOR TERM symbolized as P
2.MINOR TERM symbolized as Q
3.MIDDLE TERM represented by B
In this statement the conclusion really does follow from the premises, and
so the argument is a good one. Now consider this argument:
FIELDS OF DISCRETE MATH? • Graphs are useful for representing all kinds
of real-world problems.
Combinatorics
• A probability is a number, between 0 and
• Combinatorics is the mathematics of 1 inclusive, that represents the likelihood of
counting and arranging. Of course, most an event.
people know how to count, but
combinatorics applies mathematical • Discrete probability is a probability based
operations to count things that are much on discrete sets of outcomes. The most
too large to be counted the conventional basic type of probability is a uniform
way. probability. If each outcome in a set is
equally likely, then the probability of an
• Combinatorics is especially useful event is equal to a ratio of cardinalities.
in computer science. Combinatorics
methods can be used to develop estimates • A discrete probability distribution is a
about how many operations a computer function that takes a numerical outcome as
algorithm will require. Combinatorics is an argument and gives a probability as a
also important for the study of discrete result. Discrete probability distributions can
probability. Combinatorics methods can be be created using the rules and guidelines
used to count possible outcomes in a described above. There are also some
uniform probability experiment. discrete probability distributions that show
up in many problems:
• A permutation is an arrangement of
objects with regard to order. • Geometric Distribution: Given repeated
trials in which the probability of success is
• A combination is an arrangement of the same each time, this gives the
objects without regard to order. probability that the first success will occur
on a certain trial. Example: You roll a dice
As a field of mathematics, combinatorics is until you roll a 6. What is the probability
nearly as broad as discrete mathematics. that the first 6 will occur on the third roll?
Other topics within combinatorics include:
• Binomial Distribution: Given a certain
• derangements: a permutation such that number of trials in which the probability of
no object is in its original spot in the order; success is the same each time, this gives
• rectangular grid walks: determining the the probability of a certain number of
number of ways a rectangular lattice can successes. Example: You flip a coin 10
be traversed; times. What is the probability that there will
be exactly 5 heads?
• distribution of objects into bins:
determining how objects can be grouped • Poisson Distribution: Given a time period
into bins. in which an event occurs a certain average
number of times, this gives the probability
• Set theory is the branch of mathematics that the event will occur a specific number
that is concerned about collections of of times. Example: A fast food drive-
objects. Sets can be discrete or through gets 3 customers per minute.
continuous; discrete mathematics is What's the probability they will get 4
primarily concerned with the former. At a customers in the next minute?
basic level, set theory is concerned with
how sets can be arranged, combined, and • A statistic is a number used to describe a
set of data or a probability distribution.
Statistics is widely used in many fields
outside of mathematics, from biology to
politics to sports. The power of statistics
lies in taking a massive, varied set of data
and making sense out of it. Furthermore,
statistics has the power to quantify
confidence in those findings. Of course, the
usefulness of statistics is not without
controversy, but an understanding of its
theoretical underpinnings can help one
avoid its misuse.
• One major kind of statistic is a measure of
central tendency. A measure of central
tendency is a number which describes
what a value of a probability distribution or
data set will tend to. An expected value is
the theoretical long-run average outcome
of a probability experiment when it is
performed many times.
• Measure Of Variation is a number which
describes the distribution of a probability
distribution or data set. The standard
deviation of a probability distribution is a
number that represents how much the
outcomes differ from the expected value.
Likewise, the standard deviation of a data
set is a number that represents how much
the elements of the set differ from the
mean.
• A bijection is a relationship between two
sets such that each element in a set is
paired with exactly one element in the
other set, and vice versa. Bijections can be
applied to problem solving by establishing
a bijection between a set that is difficult to
enumerate and a discrete stucture that is
well understood. By establishing a
bijection, one can take advantage of the
known formulas and theorems that the
discrete structure affords. r from the mean.
• A proposition is a statement that can
either be true or false. Propositional
logic aims to outline the rules of how these
statements can be altered and combined.