Discrete Math Lesson - Quiz
Discrete Math Lesson - Quiz
Discrete Math Lesson - Quiz
Proposition
Truth value
Propositional calculus/propositional logic
Negation, conjunction, disjunction
Compound proposition
Exclusive or, inclusive or
Implications
Converse, contrapositive, inverse
LECTURE 1:
Formal logic
The rules of logic give precise meaning to mathematical statements. The rules are used to
distinguish between valid and invalid mathematical statements. Logic is the basis of all
mathematical reasoning. It has practical application in the design of computing machines, artificial
intelligence, programming languages and many other areas in computer science.
Propositions
Let us begin with the building blocks of logic propositions. A proposition is a statement
that is either true or false, but not both.
The following are NOT propositions since their truth value cannot be established:
r+s=t
x+5=7
Letters are used to denote propositions. (eg. p or q). For example the propositions above
could have been written as
p: 5 + 5 = 10
q: 1 + 6 = 2
r: Owen Arthur is the Prime Minister of Barbados
Truth Value
The truth value of a proposition is true, denoted by T, if it is a true proposition, and false
F, if it is a false proposition.
The area of logic which deals with propositions is called propositional calculus or
propositional logic.
Compound propositions are formed from existing propositions using logical operators
called connectives. Some of these connective are the conjunction (AND denoted by ), the
disjunction (OR denoted by ), implication (denoted by ), the equivalence (IF AND ONLY IF
denoted by ) and the exclusive-or (denoted by ).
Let p and q be propositions. The proposition p or q denoted by p .q, is the proposition that
is false when both p and q are false and is true otherwise. The proposition p q is called
the disjunction of p and q. This is often referred to as the inclusive or.
Example: Let p be the proposition Today is Monday and q the proposition It is the first
Discrete Math class. Find the negation of p, the conjunction of p and q and the
disjunction of p and q as expressed in English?
LECTURE 2:
By the end of the lecture you should be familiar with the following terms:
Implications
Converse, contrapositive, inverse
Tautology, contradiction, contingency
Logical equivalence
Let p and q be propositions. The implication p q is the proposition that is false when p is
true and q is false and is true otherwise. p is called the hypothesis and q is called the
conclusion.
The only case when I would have broken my promise is the case when I am elected
to office and did not lower the amenities fees.
If I am not elected to office (~p) you cannot expect me to lower the amenities fees. I
would not have broken my pledge in such a case.
Note that p q is false only in the case where p is true and q is false.
Truth Table
A truth table displays the relationships between the truth values of propositions.
Conjunction
Equivalence
Disjunction
Implication
Exclusive
Negation
OR
p q ~p p q pq pq pq pq
T T F T T T T F
T F F T F F F T
F T T T F T F T
F F T F F T T F
We can form or build new compound propositions using the connectives we have just seen.
Translating sentences into logical expressions removes the ambiguities of the English
language and facilitates their analysis and the application of the rules of inference.
Note: only if is one way an implication can be expressed the sentence can be
expressed as
Answer: if you can access the internet from campus then you are a Computer
Science major or you are not a freshman
which gives a(c f )
Propositional Equivalence
A compound proposition that is always true, no matter what the truth values of the
propositions that occur in it, is called a tautology. A compound proposition that is always false
is called a contradiction. Finally, a proposition that is neither a tautology nor a contradiction is
called a contingency.
Example:
p ~p p ~p p ~p
T F T F
F T T F
Most statements will have some combination of T's and F's in their
truth table final column; they are called contingencies. Some
statements will have nothing but T's; they are called tautologies.
Others will have nothing but F's; they are called contradictions.
Logical Equivalence
Compound propositions that have the same truth values in all possible cases are called
logically equivalent.
Solution: The solution is given using a truth table below. Since the truth values of the
propositions ~(p q) and (~ p) (~ q) are the same in all possible combination of
truth values of p and q, it follows that these propositions are logically equivalent.
p q ~p ~q p q ~(p q) (~ p) (~ q) ~(p q) (~ p) (~
q)
T T F F T F F T
T F F T T F F T
F T T F T F F T
F F T T F T T T
All truth value combinations result to T and it just shows that the above proposition is a
tautolgogy.
EQUIVALENCE NAME
pT p Identity Laws
p F p
pTT Domination Laws
pFF
ppp Idempotent Laws
ppp
~(~p) p Double Negation Law
p q q p Commutative Laws
pq qp
(p q) r p (q r) Associative Laws
(p q) r p (qr)
p (q r) (p q) (p r) Distributive Laws
p (q r) (p q) (p r)
~ (p q) ~p ~q De Morganss Laws
~ (p q) ~p ~q
(p q) (~ p q) Implication
(p q) (~ q ~ p) Contraposition
We can use a truth table to show that compound propositions are logically
equivalent OR we can use a series of logical equivalences.
1. I will eat lunch when I fell hungry or when Amy takes over the shift.
2. If Connie gets the highest honor, she must have read all the books or sent the jurors holiday
gifts.
3. Whether it is a sunny or a rainy day, she brings umbrella.
4. The waiter does not get a tip if the food is cold and the drinks are without ice.
5. When you do not get a 1.25 grade then you cannot qualify to take comprehensive exam nor
can proceed with the dissertation.
II. Convert the 5 statements above into symbolic propositional logic sentences using the assigned
symbols (variables) and connectives.
II. Determine whether the following propositions are Tautology, Contradiction, or Contingency
using truth tables.
God bless
chai
Discussion on Quiz
1. I will eat lunch when I feel hungry or when Amy takes over the shift.
a b c
Ans.: a: I will eat lunch.
b: I feel hungry.
c: Amy takes over the shift.
2. If Connie gets the highest honor, she must have read all the books or sent the jurors
holiday gifts.
4. The waiter does not get a tip if the food is cold and the drinks are without ice.
5. When you do not get a 1.25 grade then you cannot qualify to take comprehensive
exam nor can proceed with the dissertation.
1) Review on Negation
~p is called the negation of p
~p is read not p
not p is also the same as It is not the case that p
Review on Conjunction
p q is called the conjunction of p and q
p q is read p and q
p but q also means p and q
neither p nor q means not p and not q; ~p and ~q ; ~p ~q
Review on Disjunction
Example: Write the ff. sentences symbolically, letting a: It is raining. and b: The air is
cold.
W: It is raining or the air is cold. W= a s
Answer
X: Either it is raining or the air is cold. X= a s
Example: Write the ff. sentences symbolically, letting a: Logic is easy. and b: I will study
hard.
c: I will get 1.0 in this course.
II. Convert the 5 statements above (Part I) into symbolic propositional logic expressions using the assigned
symbols (variables) and connectives.
1. I will eat lunch when I feel hungry or when Amy takes over the shift.
a b c
Ans.: (b c) a
2. If Connie gets the highest honor, she must have read all the books or sent the jurors
holiday gifts.
Ans.: a ( b c)
3. (if) Whether it is a sunny or a rainy day, (then) she brings umbrella.
Ans.: ( a b) c
4. The waiter does not get a tip if the food is cold and the drinks are without ice.
Ans.: (b ~c) ~a
5. When you do not get a 1.25 grade then you cannot qualify to take comprehensive exam nor
can proceed with the dissertation.
II. Determine whether the following propositions are Tautology, Contradiction, or Contingency using
truth tables.
F F T T F F T F F
F T F T T T F F T
F T T T F T T T T
T F F F T F T F F
T F T F F F F F F
T T F F T F T F T
T T T F F F F F T
Therefore, contingency.
IT232: Discrete Mathematics 11 |
Page
Sem2, SY 2014-2015
3. (a b c) ~(~ a ~ b ~ c)
Ans:
a b c ~a ~b ~c (abc) (~ a ~ b ~ (~ a ~ b ~ c) (abc) ~ (~ a ~ b ~ c)
~ c)
F F F T T T F T F F
F F T T T F T T F F
F T F T F T T T F F
F T T T F F T T F F
T F F F T T T T F F
T F T F T F T T F F
T T F F F T T T F F
T T T F F F T F T T
Therefore, contingency.
4. (~ c (a (~ (b c)))) (b (~ (~a~c)))
Ans:
a b c ~ ~ (b ~ (b a (~ (b ~c ~a ~(~a (b (~ (~ c (a
(~ (b
c) c) (~a~c)))
a c c) (a (~ (b ~c) ~c) c)))) (b
c))) (~
(~a~c)))
F F F T T F T T T T F F F
F F T T F T T T T F T T T
F T F T T T T T T T F T T
F T T T F T T T T F T T T
T F F F T T T T T T F F F
T F T F F T T T T T F F F
T T F F T T T T T T F T T
T T T F F T F F T T F T T
Therefore, contingency.
By the end of the lecture you should be familiar with the following terms:
Inequalities
The Exclusive-OR
Inequalities
(p q) ~(pq)
So, p q = (p q) ~( p q)
Showing XOR Truth Table:
P Q
S: p q (p q) ((pq) ~(pq))
p q pq (pq) (pq) ~(pq) (pq) ~(pq)
EQUAL
F F F F F T F
?
F T T T F T T
IT232: Discrete Mathematics 13 |
Page
Sem2, SY 2014-2015
T F T T F T T
T T F T T F F
Just the same or logically equivalent
Example:
m: You may have a milk shake. both means and
b: You may have a beer. m and b , m b
but also means and
m b : You may have a milk shake or you may have a beer, but not both.
m b ~ (m b)
mb Same w/ (m b) ~ (m b)
p implies q is p q p q
p only if q is pq CONVERSE Form : q p
p if q is q p CONTRAPOSITIVE Form : ~q ~p
p is equivalent to q is p q
p if and only if q
is called biconditional
p iff q
p is a sufficient condition for q
q is a necessary condition for p
p is necessary and sufficient condition for q
Example:
f: You get a pass in the foundation. both means and
m: You get a pass in the management. m and b , m b
but also means and
f m : You get a pass in the foundation if and only if you get a pass in the
management.
~(p q) ~p~q
~T T F F
F F
Simplify:
c) (~ p q v ~ p r ) (q r ) by associative law
d) (~ p v ~ p q r ) (q r )
e) (~ p v ~ p) q r ) (q r )
f) ~pq r (q r ) by idempotent law
g) ~ p q (r (q r ) ) by associative law
i) ~ p q ~r v q r
j) ~ p (q v q) (~r r )
k) ~p ( q T) associative
l) ~p T domination
NO IDENTITY LAW CAN BE APPLIED
c) (~ p q v ~ p r ) (q r ) by associative law
d) (~ p v ~ p q r ) (q r )
e) (~ p v ~ p) q r ) (q r )
f) ~pq r (q r ) by idempotent law
g) ~ p q (r (q r ) ) by associative law
j) (p ~ q) (Tvq)
j) p ~ q Tvq by associative
k) p (~ q v q) T associative, complement
k) p (T T)
l) p T identity law
m) p
( (p q) (p r) ) (q r ) p
1. a (~b c)
2. b ~c
3. d (b ~a)
4. ~a ~ (b c)