Umm Al-Qura University
Al Jumoum University College
Department of Computer Science
Discrete Structures (CS1101)
Assignment 1
Answer the following questions:
1. Write each of these statements in the form “if p, then q” in English.
Hint: Refer to the list of common ways to express conditional statements provided
in this section.
a) It is necessary to wash the boss’s car to get promoted.
b) Winds from the south imply a spring thaw.
c) A sufficient condition for the warranty to be good is that you bought the computer
less than a year ago.
d) Willy gets caught whenever he cheats.
e) You can access the website only if you pay a subscription fee.
f ) Getting elected follows from knowing the right people.
2. Translate the given statement into propositional logic using the propositions pro-
vided.
(a) 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.”
(b) To use the wireless network in the airport you must pay the daily fee unless
you are a subscriber 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.”
3. Show that each of these conditional statements is a tautology by using truth tables.
a) [¬p ∧ (p ∨ q)] → q
b) [(p → q) ∧ (q → r)] → (p → r)
c) [p ∧ (p → q)] → q
4. Let P (x) be the statement “x can speak Russian” and let Q(x) be the statement “x
knows the computer language C++.” Express each of these sentences in terms of P
(x), Q(x), quantifiers, and logical connectives.
The domain for quantifiers consists of all students at your school.
a) There is a student at your school who can speak Russian and who knows C++.
b) There is a student at your school who can speak Russian but who doesn’t know
C++.
c) Every student at your school either can speak Russian or knows C++.
d) No student at your school can speak Russian or knows C++.
5. Let M(x, y) be “x has sent y an e-mail message” and T (x, y) be “x has telephoned y,”
where the domain consists of all students in your class. Use quantifiers to express
each of these statements. (Assume that all e-mail messages that were sent are
received, which is not the way things often work.)
a) Chou has never sent an e-mail message to Koko.
b) Arlene has never sent an e-mail message to or telephoned Sarah.
c) José has never received an e-mail message from Deborah.
d) Every student in your class has sent an e-mail message to Ken.
e) No one in your class has telephoned Nina.
f ) Everyone in your class has either telephoned Avi or sent him an e-mail message.
g) There is a student in your class who has sent everyone else in your class an e-mail
message.
h) There is someone in your class who has either sent an e-mail message or telephoned
everyone else in your class.
i) There are two different students in your class who have sent each other e-mail
messages.
j) There is a student who has sent himself or herself an e-mail message.
k) There is a student in your class who has not received an e-mail message from
anyone else in the class and who has not been called by any other student in the
class.
l) Every student in the class has either received an email message or received a
telephone call from another student in the class.
m) There are at least two students in your class such that one student has sent the
other e-mail and the second student has telephoned the first student.
n) There are two different students in your class who between them have sent an
e-mail message to or telephoned everyone else in the class.
6. For each of these collections of premises, what relevant conclusion or conclusions
can be drawn? Explain the rules of inference used to obtain each conclusion from
the premises.
Page 2
a) “If I take the day off, it either rains or snows.” “I took Tuesday off or I took
Thursday off.” “It was sunny on Tuesday.” “It did not snow on Thursday.”
b) “If I eat spicy foods, then I have strange dreams.” “I have strange dreams if there
is thunder while I sleep.” “I did not have strange dreams.”
c) “I am either clever or lucky.” “I am not lucky.” “If I am lucky, then I will win the
lottery.”
d) “Every computer science major has a personal computer.” “Ralph does not have
a personal computer.” “Ann has a personal computer.”
e) “What is good for corporations is good for the United States.” “What is good
for the United States is good for you.” “What is good for corporations is for you to
buy lots of stuff.”
f ) “All rodents gnaw their food.” “Mice are rodents.” “Rabbits do not gnaw their
food.” “Bats are not rodents.”
7. Show that these statements about the integer x are equivalent: (i) 3x + 2 is even,
(ii) x + 5 is odd, (iii) x2 is even.
8. . Prove that if x and y are real numbers, then max(x, y) + min(x, y) = x + y.
[Hint: Use a proof by cases, with the two cases corresponding to x ≥ y and x<y,
respectively.]
Page 3