Sections1 2
Sections1 2
Section 1
Which of these sentences are propositions? What are the truth values of those that are
propositions?
a. Today is Friday.
A Preposition
b. Where is the library?
Not Preposition
................................................................................................................................................................
7. Let p and q be the prepositions
p: It is below freezing
q: It is snowing
Write these prepositions using p and q and logical connectives
c) It is not below freezing and it is not snowing
p ˄q
e) If it is below freezing, it is also snowing.
p→q
................................................................................................................................................................
Let p, q, and r be the prepositions
p: You have the flu
q: You miss the final examination
r: You pass the course
23 = 8
................................................................................................................................................................................................
Construct a truth table for each of these compound prepositions.
(p → q) ↔ (¬q → ¬p)
p q P→q ¬q ¬p ¬q → ¬p (p → q) ↔ (¬q → ¬p)
T T T F F T T
T F F T F F T
F T T F T T T
F F T T T T T
................................................................................................................................................................................................
2
Construct a truth table for each of these compound prepositions.
(p q) → (p ¬q)
p q (p q) (p ¬q) (p q) → (p ¬q)
q
T T F F T T
T F T T F F
F T F T F F
F F T F T T
................................................................................................................................................................................................
3
Discrete Math
Hamdy Mohamed Hafez
Department of basic Science, Faculty of Computers and Information, Fayoum University, Fayoum 63514,
Egypt
1 Logic
Because conditional statements play such an essential role in mathematical reasoning, a variety of
terminology is used to express p → q. You will encounter most if not all of the following ways to
express this conditional statement:
”if p, then q” ”p implies q”
”if p, q, ”p only if q ”
” p is sufficient for q” ”a sufficient condition for q is p”
” q if p” ” q whenever p”
” q when p” ” q is necessary for p”
”a necessary condition for p is q” ”q follows from p”
”q unless ¬p”
To remember that ” p only if q ” expresses the same thing as ”if p, then q,”
note that ” p only if q ” says that p cannot be true when q is not true. That is, the statement is
false if p is true, but q is false. When p is false, q may be either true or false, because the statement
says nothing about the truth value of q. Be careful not to use ” q only if p ” to express p → q because
this is incorrect. To see this, note that the true values of ” q only if p ” and p → q are different when
p and q have different truth values.
To remember that ” q unless ¬p ” expresses the same conditional statement as ”if p, then q,”
note that ” q unless ¬p ” means that if ¬p is false, then q must be true. That is, the statement ”q
unless ¬p” is false when p is true but q is false, but it is true otherwise. Consequently, ”q unless ¬p ”
and p → q always have the same truth value.
In Exercises 1-5, translate the given statement into propositional logic using the propositions pro-
vided.
1. You cannot edit a protected Wikipedia entry unless you are an administrator. Express your answer
1
in terms of
e : ”You can edit a protected Wikipedia entry” and
a : ”You are an administrator.”
¬e unless a which is ¬a → ¬e ≡ e → a
2. You can see the movie only if you are over 18 years old or you have the permission of a parent.
Express your answer in terms of
m : ”You can see the movie,”
e : ”You are over 18 years old,” and
p : ”You have the permission of a parent.”
m only if e ∨ p that is m → e ∨ p
3. You can graduate only if you have completed the requirements of your major and you do not
owe money to the university and you do not have an overdue library book. Express your answer in
terms of
g : ”You can graduate,”
m : ”You owe money to the university,”
r : ”You have completed the requirements of your major,” and
b : ”You have an overdue library book.”
4. To use the wireless network in the airport you must pay the daily fee unless you are a sub-
scriber to the service. Express your answer in terms of
w : ”You can use the wireless network in the airport,”
d : ”You pay the daily fee,” and
s : ”You are a subscriber to the service.”
The statement would be restated as ”if you use the network in the airport, then either you pay the
fee or you are a subscriber”. Therefore the proposition in symbols is w → (d ∨ s).
5. You are eligible to be President of the U.S.A. only if you are at least 35 years old, were born in
the U.S.A, or at the time of your birth both of your parents were citizens, and you have lived at least
14 years in the country. Express your answer in terms of
e : ”You are eligible to be President of the U.S.A.”
a : ”You are at least 35 years old,”
b : ”You were born in the U.S.A,”
p : ”At the time of your birth, both of your parents where citizens,” and
r : ”You have lived at least 14 years in the U.S.A.”
2
e → a ∧ (b ∨ p) ∧ r
c) ”It is necessary to scan the message for viruses whenever it was sent from an unknown system.”
q→p
d) ”When a message is not sent from an unknown system it is not scanned for viruses.”
¬q → ¬p
b) ”Access is granted whenever the user has paid the subscription fee and enters a valid password.”
r∧p→q
c) ”Access is denied if the user has not paid the subscription fee.”
¬r → ¬q
d) ”If the user has not entered a valid password but has paid the subscription fee, then access is
granted.”
¬p ∧ r → q
3
If the system is not in multiuser state, then it is in interrupt mode.
The system is not in interrupt mode.”
Let p be the proposition ”The system is in multiuser state”
, q be the proposition ”The system is operating normally”
, r be the proposition ”The kernel is not functioning”
, and s be the proposition ”The system is in interrupt mode”
Then the specification system would be :
p↔q
q → ¬r
r∨s
¬p → s
¬s
Then we need (p ↔ q) ∧ (q → r) ∧ (¬r ∨ s) ∧ (¬p → s) ∧ (¬s) to be true :
¬s true, then s is false.
¬p → s to be true, then ¬p must be false and p is true.
r ∨ s to be true, then r must be true.
q → ¬r to be true, then q must be false.
Finally p ↔ q can’t be true since p is true and q is false and the system specifications are not consistent.
11. Are these system specifications consistent?” ”The router can send packets to the edge system
only if it supports the new address space. For the router to support the new address space it is neces-
sary that the latest software release be installed. The router can send packets to the edge system if the
latest software release is installed, The router does not support the new address space.”