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

Sections1 2

Uploaded by

mayadanasr996
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Sections1 2

Uploaded by

mayadanasr996
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Cairo University

Faculty of Computers and Information


Course MATH 112
Discrete Mathematics

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

Express each of these prepositions as an English sentence.


c) (p →  r) ˅ (q →  r)
If you have the flu then you do not pass the course, or if you miss the final examination then
you do not pass the course.
Or
Either if you have the flue, then you do not pass the course, or if you miss the final exam,
then you do not pass the course.
................................................................................................................................................................................................
12. Determine whether these biconditionals are true or false.
a) 2+2 =4 if and only if 1+1=2.
True
b) 1+1=2 if and only if 2 + 3=4.
False
................................................................................................................................................................................................
Determine whether each of these conditional statements is true or false.
a) If 1 + 1 = 2, then 2 + 2 = 5.
False
c) If monkeys can fly, then 1 + 1 = 3.
True
................................................................................................................................................................................................
(From Book)
15. Write each of these statements in the form “if p, then q” in English.
a) It snows whenever the wind blows from the northeast
If the wind blows from the northeast, then it snows.
h) Jan will go swimming unless the water is too cold.
If the water isn't too cold, Jan will go swimming.
................................................................................................................................................................................................
How many rows appear in a truth table for each of these compound prepositions?
(p ˅  t) ˄ (p ˅  s)

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.”

g only if r ∧ ¬m ∧ ¬b that is g → (r ∧ ¬m ∧ ¬b)

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

7. Express these system specifications using the propositions


p ”The message is scanned for viruses” and
q ”The message was sent from an unknown system” together with logical connectives (including
negations).
a) ”The message is scanned for viruses whenever the message was sent from an unknown system.”
q→p
b) ”The message was sent from an unknown system but it was not scanned for viruses.”
q ∧ ¬p

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

8. Express these system specifications using the propositions


p ”The user enters a valid password,”
q ”Access is granted,” and
r ”The user has paid the subscription fee” and logical connectives (including negations).
a) ”The user has paid the subscription fee, but does not enter a valid password.”
r ∧ ¬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

9. Are these system specifications consistent?


”The system is in multiuser state if and only if it is operating normally.
If the system is operating normally, the kernel is functioning.
The kernel is not functioning or the system is in interrupt mode.

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.

10. Are these system specifications consistent?


”Whenever the system software is being upgraded, users cannot access the file system.
If users can access the file system, then they can save new files.
If users cannot save new files, then the system software is not being upgraded.”
Let p denote ”The system software is being upgraded”
, q denote”Users can access the file system ”
, and r denote ”Users can save new files”
The specifications would be:
p → ¬q
q→r
¬r → ¬p

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.”

You might also like