Module Logic and Set Theory BSED1
Module Logic and Set Theory BSED1
DIFFUN CAMPUS
Diffun, 3401 Quirino
LOGIC
DEFINITION. A proposition is a declarative sentence that is either true or false, but not both.
If a proposition is true, then its truth value is true, which is denoted by T; otherwise, its truth
value is false, which is denoted by F.
Propositions are usually denoted by small letters. For example, the proposition
may be read as p is the proposition “Everyone should study logic.” If a sequence of propositions
is considered, we denote the propositions by p1, p2,…
t: 2 + 3 = 5.
w: I am lying.
not p
p and q
p or q
If p, then q
where <.> stands for some proposition. A proposition is simple if it cannot be broken down any
further into other component propositions.
Furthermore, we can determine the simple propositions that make up the propositions p1, p2,
p3, and p4. We do so in the following table
d: logic is boring
p3 e: you study hard
f: you get good grades
p4 g: you are a Grade 11 student
h: you are a Filipino
p1: not a
p2: b and c or d
p3: if e, then f
p4: if g then h
EXERCISES:
Determine whether the following statements are propositions. If the proposition is a compound
proposition, identify the simple components and the logical connectors used.
2. Justin Bieber has over one million followers on Twitter and Instagram.
3. If Ted’s score is less than 50, then Ted will fail the course.
7. If a, b and c denote the lengths of the legs and the hypotenuse of a right triangle, then
2 2 2
a + b =c .
8. Timothy’s average is at least 92 and he is getting an A for the course.
10. A password must be at least 6 characters long or it must be at least 8 characters long.
12. If you fix my computer, then I will pay you Php 2,000 and if I pay you Php 2,000, then you
will fix my computer.
13. If you do not run 1 kilometer a day or do not eat properly, then you will not be healthy.
Logical Operators
DEFINITION. Given a proposition, its truth table show all its possible truth values.
Example 1. Since a proposition has two possible truth values, a proposition p would have the
following truth table.
p
T
F
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
Truth tables can also be used to display various combinations of the truth values of two
propositions p and q. The rows of the table will correspond to each truth value combination of
p and q, so there will be 22=4 rows. The truth table for propositions p and q are as follows:
p q
T T
T F
F T
F F
i: 2 is an odd number.
P q p ∧q
T T T
T F F
F T F
F F F
p: Forever exists.
q: 2 is less than 3.
Express the following conjunctions in English sentences or in symbols, as the case may be.
1. p ∧q
2. p ∧∽q
3. ∽ p ∧q
p q p ∨q
T T T
T F T
F T T
F F F
q: Janree is sleeping.
r: Eumir is eating
Express the following propositions in English sentences or in symbols, as the case may be.
1. p ∨q
2. q∨r
3. q ∨(∽ r )
4. p ∨¿ ∨r ¿
5. “Either Victor has a date with Liza or Janree is sleeping, or Eumir is eating.”
6. “Either Victor has a date with Liza and Janree is sleeping, or Eumir is eating.”
7. “Either Victor has a date with Liza, or Janree is sleeping, and Eumir is eating.”
8. “Either Victor has a date with Liza and Janree is sleeping, or Victor has a date with Liza
and Eumir is eating.”
REMEMBER!
p q R ∽p q∧r ∽ p ∨ (q ∧ r ¿
F F T T F T
DEFINITION. The conditional of the propositions p and q is denoted by p →q : (If p, then q) and
is defined through its truth table
P Q p →q
T T T
T F F
F T T
F F T
The conditional p →q may also be read as “p implies q”. The proposition p is called the
hypothesis, hypothesis, while the proposition q is called the conclusion.
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
Example. Suppose that Geebee is a Grade 11 student. Consider the following conditionals.
Analyze the truth value of these conditionals
p1: If Geebee is in Grade 11, then she is a senior high school student.
p3: If Geebee has a degree in computer science, then she believes in true love.
p Q p ↔q
T T T
T F F
F T F
F F T
The proposition may also be written as “p iff q”. The propositions p and q are the components
of the biconditional.
Example 9. Suppose that Geebee is a Grade 11 student. Let us now consider the following
biconditionals.
q1: Geebee is in Grade 11 if and only if she is a senior high school student.
q3: Geebee has a degree in Computer Science if and only if she believes in true love.
Example 1. Let p and q be propositions. Construct the truth table for the compound
proposition ( p →q ) ∧ ( q → p ).
Example 2. Let p, q, and r be propositions. Construct the truth table for the compound
proposition [ ( p →r ) ∧ ( q → r ) ] → [ ( p ∨q ) → r ] .
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
Example 1. Let p and q be propositions. Construct the truth table for the compound
proposition ( p →q ) ∧ ( q → p ).
P q p →q q→ p ( p →q ) ∧ ( q → p )
T T T T T
T F F T F
F T T F F Example 2. Let p, q,
F F T T T and r be propositions.
Construct the truth table for the compound proposition [ ( p →r ) ∧ ( q → r ) ] → [ ( p ∨q ) → r ] .
p q r p →r q→r ( p →r ) ∧ ( q →pr ∨q
) ( p ∨q ) → r [ ( p →r ) ∧ ( q → r ) ] → [ ( p ∨q ) → r ]
T T T T T T T T T
T F T T T T T T T
T T F F F F T F T
T F F F T F T F T
F T T T T T T T T
F F T T T T F T T
F T F T F F T F T
F F F T T T F T T
Definition. A proposition that is always true is called a tautology, while a proposition that is
always false is called a contradiction. We denote tautologies by τ and contradictions by ϕ .
Example. Let p and q be propositions. Using truth tables, show the following:
1. p ∨τ is a tautology.
2. p ∧ϕ is a contradiction
3. p → ( p ∨q )is a tautology.
4. ( p ⋀ ( ∼ q ) ) ∧ ( p ∧q )is a contradiction
a. Converse: q → p
b. Contrapositive: ∼ q → ∼ p
c. Inverse: ∼ p →∼q
Example. Determine the converse, contrapositive, and inverse of the following conditional
propositions.
a. “If the clothes are neatly stacked and pressed, then the house help arrived today.”
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
b. “If it did not flood yesterday, then the streets are dry today.”
c. “Whenever Nico studied alone, he got the highest score in the class.”
d. “Her parents gave her monetary allowance if Bianca accompanied her parents to
the PTA meeting.”
e. “If Mariah hit the high whistle note, then the audience gave her a standing ovation.”
( p ¿ ¿ 1 ∧ p2 ∧ p 3 ∧ …) → q ¿
The propositions ( p ¿ ¿ 1 ∧ p2 ∧ p 3 ∧ …)¿ are the premises of the argument, and q is the
conclusion. Arguments can be written in propositional form, as in above, or in column or
standard form:
p1
p2
___________
∴q
Example 1. Explain why the following set of propositions is an argument.
a. If General Antonio Luna is a national hero, then he died at the hands of the Americans
in 1899.
General Luna is a national hero.
Therefore, General Luna died at the hands of the Americans in 1899.
b. If your grades are high, then you studied hard.
You studied hard.
Therefore, your grades are high.
Definition. A valid argument satisfies the validity condition; that is, the conclusion is true
whenever the premises are all true. Alternatively, the argument is valid if the conditional
( p ¿ ¿ 1 ∧ p2 ∧ p 3 ∧ …) → q ¿ is a tautology.
Example 1. Tell whether the following arguments are valid or not. Explain.
a. If General Antonio Luna is a national hero, then he died at the hands of the Americans
in 1899.
General Luna is a national hero.
Therefore, General Luna died at the hands of the Americans in 1899.
b. If your grades are high, then you studied hard.
You studied hard.
Therefore, your grades are high.
***Note that all these arguments are in the form [( p → q)∧ p]→ q or p →q
p
___________
∴q
RULES OF INFERENCE
These are used to prove that the argument is VALID
RULES/LAWS Propositional Form Standard
Form
Rule of Simplification ( p ∧q ) → q p∧q
q
Rule of Addition p → ( p ∨q ) p
p∨q
Rule of Conjunction ( p ∧q ) → ( p ∧ q ) p∧q
p∧q
Modus Ponens [ ( p →q ) ∧ p ] → q p→q
p
q
Modus Tollens [ ( p →q ) ∧ ( ∼q ) ] → ( ∼ p ) p→q
∼q
∼p
Law of Syllogism [ ( p →q ) ∧ ( q → r ) ] → ( p → r ) p→q
q→r
p→r
Rule of Disjunctive [ ( p ∨q ) ∧ ( ∽ p ) ] → q p∨q
Syllogism ∽p
q
Rule of Contradiction [( p)→ ∅ ]→ p p→∅
p
Rule of Proof by Case [ ( p →r ) ∧ ( ∼q → r ) ] → [ p ∨ ( ∼q ) ] → r p→r
q →r
p
∼q
r
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
Definition. An argument which is not valid is called a fallacy. In a fallacy, it is possible for the
premises to be true, while the conclusion is false. In this case, the conditional is not a
tautology.
FALLACIES IN LOGIC
These are used to prove that an argument is NOT VALID
Example 11. The following arguments were already shown to be valid. Tell whether they are
sound or bad arguments.
a. Antonio Luna and Jose Rizal like Nelly Boustead.
Therefore, Antonio Luna likes Nelly Boustead.
*VALID BY THE RULE OF SIMPLIFICATION
b. Antonio Luna is a scientist.
Therefore, either Antonio Luna or Jose Rizal is a scientist.
*VALID BY THE RULE OF ADDITION
SOLUTION:
A simple history verification will show that the premises of both arguments are true. Nelly
Boustead was the object of affection of Antonio Luna and Jose Rizal while they were in Spain.
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
Moreover, Luna is known as a brilliant general, but he is also a scientist. He studied Chemistry
at the University of Santo Tomas, and went to Spain where he obtained his license and
doctorate in pharmacy.
Hence, these arguments satisfy both truth condition (all the premises are generally true) and
validity condition(through the different Rules of Inference), so they are sound arguments.
Example 12. Determine whether each of the following arguments is valid, and if each is sound.
a. If I was born poor, then I cannot serve my country.
I was born poor.
Therefore, I cannot serve my country.
b. If I study every day, then I will develop a good work ethic.
I study every day
Therefore, I will develop a good work ethic.
Solution. By Modus Ponens, both arguments are valid. We then check for soundness through
the truth condition.
a. Note that being poor does not prevent one from serving one’s country (you can probably
think of some examples). Hence, the given argument is a bad argument.
b. It is accepted as true that if one studies every day, then a good work ethic will be developed.
However, it cannot be assumed true that “I study every day”. If it is true, then the argument is
sound. Otherwise, the argument is bad
EXERCISES
1. Determine whether the following arguments are valid. If it is valid, then identify the rule of
inference which justifies its validity. Otherwise, state a counterexample or identify the type of
fallacy exhibited by the argument.
b. Either Lina or Lino will take the trash to the recycling center.
Lina did not take the trash to the recycling center.
Hence, Lino must have taken the trash to the recycling center.
c. If Joe makes a reviewer for his class and studies it well, then he will get a high
grade in his exam.
Joe did not get a high grade in his exam.
Therefore, either Joe did not make a reviewer for his class or he did not study it
well.
e. If Leona wins the singing competition, then she will land a recording contract
with a famous company.
She landed a recording contract with a famous company.
It follows that Leona won the singing competition.
Sets
A set is a collection of objects, called elements of the set. A set can be represented by
listing its elements between braces: A={1 , 2, 3 , 4 ,5 }. The symbol ∈ is used to express that an
element is (or belongs to) a set, for instance 3 ∈ A . Its negation is represented by 6 ∈, e.g. 7 ∉ A
. If the set is finite, its number of elements is represented ¿ A∨¿, e.g. if A={1 , 2, 3 , 4 ,5 } then
¿ A∨¿5 .
This means that Z contains all positive integers greater than 2 and all negative integers
lesser than -2.
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
2. Set – Builder Notation. What if we want to know the set containing ALL real numbers
between 0 and 1 (including 0 and 1)?
This means that S contains all x ’ s such that x is greater than or equal to 0 and x is
less than or equal to 1.
We can also write it this way:
Subset
If A and B are sets, then A is
called a subset of B, written A ⊆ B , if and
only if every element of A is also an
element of B .
In symbols, we write:
A ⊆ B means that for all elements x , if
x ∈ A then x ∈ B .
It follows from the definition that if A ⊈ B , it means that there is at least one element x
such that x ∈ A and x ∉ B . If A and B are sets, A is a proper subset of B if and only if, every
element of B is in B but there is at least one element of B that is not in A .
Complement of a Set
Suppose A is any set, then A'
is a complement of A .
If A={1 , 4 , 5 , 6 } then
'
A ={2 ,3 , 7 , 8 , 9 , 0}
If B= {1 , 2 ,3 } then B' ={ 4 ,5 ,6 , 7 , 8 , 9 , 0 } .
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
Set Operations
1. The union of sets A and B, denoted by ∪, is
the set that contains all the elements that
belong to A or to B or to both.
3. Cartesian Product
Consider two sets A∧B where:
Set of all ordered pairs of elements of A∧B is {(1,3),(1,4),( 1,5) ,(2,3) ,(2,4),(2,5) }.
This set is denoted by A × B={( 1,3 ) , ( 1,4 ) , ( 1,5 ) , ( 2,3 ) , (2,4 ) , (2,5 ) }
Clearly, A × B ≠ B × A .
Relations
Consider the following example:
A={Mohan , Sohan , David , Karim }
B= { Rita , Marry , Fatima }
QUIRINO STATE UNIVERSITY
DIFFUN CAMPUS
Diffun, 3401 Quirino
Suppose Rita has two brothers Mohan and Sohan, Marry has one brother David, and
Fatima has one brother Karim. If we define a relation R "is a brother of" between the elements
of A∧B then clearly.
Mohan R Rita, Sohan R Rita, David R Marry, Karim R Fatima. After omiting R between
two names these can be written in the form of ordered pairs as:
The above information can also be written in the form of a set R of ordered pairs as
R={(Mohan , Rita),(Sohan , Rita ),( David , Marry), Karim, Fatima }
Another example:
Let A={1,2 } and B={1,2,3} and define a relation R from A ¿ B as follows:
x− y
Given any (x , y ) means that is an integer.
2
Solution:
a. A × B={( 1,1 ) , ( 1,2 ) , (1,3 ) , ( 2,1 ) , ( 2,2 ) , ( 2,3 ) }. To determine explicitly the composition of R ,
examine each ordered pair in A × B to see whether its elements satisfy the defining
condition in R .
1−1 0
( 1,1 ) ∈ R becasuse = =0 , whichis an integer
2 2
1−2 −1
( 1,2 ) ∈ R becasuse = , whichis not aninteger
2 2
….
….
2−3 −1
( 2,3 ) ∈ R becasuse = , which is not integer
2 2
Function
A function F ¿ a Set A ¿ a Set B is a relation with domain A and co-domain B that satisfies
the following properties:
1. For every element x in A , there is an element y in B such that ( x , y ) ∈ F .
2. For all elements x in A and y and z in B ,
if ( x , y ) ∈ F and ( x , z ) ∈ F , then y=z .
From the given example we can conclude that range is a subset of co-domain. Symbolically,
this function can be written as
f : A→B