Assignment # 1
Assignment # 1
1. Which of these sentences are propositions? What are the truth values of those that are propositions?
a) Boston is the capital of Massachusetts. b) Miami is the capital of Florida. c) 2 + 3 = 5. d) 5 + 7 = 10.
e) x + 2 = 11. f) Answer this question.
g) Napoleon won the battle of Waterloo. h) In 1492 Columbus sailed the ocean blue. i) Does John love
Discrete Mathematics? j) Solve the equation: 2 + x = 3.
2. Identify the proposition using variables and then express the given statements using logical connectives.
a) A student gets A in Discrete if and only if his weight total is ≥ ����%.
b) Either Alice is smart, or she is not smart but honest.
c) √���� is greater than 6 or √���� ���� �������� �������� ��.
d) Sam had pizza last night and Chris finished her homework.
e) Either Chris finished her homework or Pat watched the news this morning, but not both.
4. Suppose that Smartphone A has 256MB RAM and 32GB ROM, and the resolution of its camera is 8 MP; Smartphone
B has 288 MB RAM and 64 GB ROM, and the resolution of its camera is 4 MP; and Smartphone C has 128 MB RAM
and 32 GB ROM, and the resolution of its camera is 5 MP. Express the given statements using Logical
Connectives. Also determine the truth value of each of these propositions.
a) Smartphone B has the most RAM of these three smartphones.
b) Smartphone C has more ROM or a higher resolution camera than Smartphone B.
c) Smartphone B has more RAM, more ROM, and a higher resolution camera than Smartphone A. d) If Smartphone
B has more RAM and more ROM than Smartphone C, then it also has a higher resolution camera. e) Smartphone A
has more RAM than Smartphone B if and only if Smartphone B has more RAM than Smartphone A.
1
5. Suppose that during the most recent fiscal year, the annual revenue of Acme Computer was 138 billion dollars and
its net profit was 8 billion dollars, the annual revenue of Nadir Software was 87 billion dollars and its net profit
was 5 billion dollars, and the annual revenue of Quixote Media was 111 billion dollars and its net profit was 13
billion dollars. Express the given statements using Logical Connectives. Also determine the truth value of each
of these propositions for the most recent fiscal year.
a) Quixote Media had the largest annual revenue.
b) Nadir Software had the lowest net profit and Acme Computer had the largest annual
revenue. c) Acme Computer had the largest net profit or Quixote Media had the largest net
profit.
d) If Quixote Media had the smallest net profit, then Acme Computer had the largest annual revenue. e)
Nadir Software had the smallest net profit if and only if Acme Computer had the largest annual revenue.
7. 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) You send me an e-mail message only if I will remember to send you the address.
b) To be a citizen of this country, it is sufficient that you were born in the United States.
c) If you keep your textbook, it will be a useful reference in your future courses.
d) The Red Wings will win the Stanley Cup if their goalie plays well.
e) That you get the job implies that you had the best credentials.
f) The beach erodes whenever there is a storm.
g) It is necessary to have a valid password to log on to the server.
h) You will reach the summit unless you begin your climb too late.
8. Conditional Statement “If it is sunny tomorrow, then I will go for a walk in the woods.”
a) Describe all different ways to write the conditional statement p → q in English.
b) State the converse, inverse and contrapositive of a conditional statement in words.
c) Given a conditional statement p → q, find the inverse of its inverse, the inverse of its converse, and the
inverse of its contrapositive in words.
9. i) Use De Morgan’s laws to find the negation of each of the following statements.
a) Jan is rich and happy. b) Carlos will bicycle or run tomorrow. c) The fan is slow or it is very hot.
d) Akram is unfit and Saleem is injured. e) �� ≤ �� ≤ �� f) −�� < �� ≤ ��
g) The fan is slow, or it is very hot. h) Akram is unfit and Ahmed is injured.
2
ii) The following proposition uses the English connective “or”. Determine from the context whether “or” is
intended to be used in the inclusive or exclusive sense.
a) “Tonight, I will stay home or go out to a movie.”
b) “If you fail to make a payment on time or fail to pay the amount due, you will incur a penalty.” c)
“If I can’t schedule the airline flight or if I can’t get a hotel room, then I can’t go on the trip.” d) “If
you do not wear a shirt or do not wear shoes, then you will be denied service in the restaurant.”
(ii) Using the premises(statements) from part(i), apply rules of inference to obtain conclusion(s) from these
premises. Also, explain the rules of inference used to obtain each conclusion from the premises.
(iii) Using the truth table prove or disprove that the contrapositive of statement (b) in part (i) is equivalent to the
converse of its inverse. Also write the statements in words.
ii) Using Truth table, show that these compound propositions are logically equivalent or not. a) (p → r)
∧ (q → r) and (p ∨ q) → r b) (p → q) ∨ (p → r) and p → (q ∨ r) c) (p → q) → (r → s) and (p → r) → (q
→ s) d) p ↔ q and (p → q) ∨ (p → r)
12. i) Assume F (x):” x is a fox.”, S(x): “x is sly.”, T (x): “x is trustworthy.”, and the universe of discourse for all three
functions is the set of all animals. Use quantifiers to express each of these statements.
a) Everything is a fox.
b) All foxes are sly.
c) If any fox is sly, then it is not trustworthy.
ii) Let F(x, y) be the statement “x can fool y,” where the domain consists of all people in the world. Use quantifiers
to express each of these statements.
a) Everybody can fool Bob. b) Alice can fool everybody.
c) Everybody can fool somebody. d) There is no one who can fool everybody. e) Everyone can be
fooled by somebody.
iii) 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++.
3
13. i) Let Q(x, y) be the statement “x has sent an e-mail message to y,” where the domain for both x and y consists of
all students in your class. Express each of these quantifications in English.
a) ∃ x ∃ y Q(x, y) b) ∃ x∀ y Q(x, y) c) ∀ x ∃ y Q(x, y) d) ∃ y∀ x Q(x, y) e) ∀ y ∃ x Q(x, y) f) ∀ x ∀ y Q(x,
y)
ii) Let P(x, y) be the statement “Student x has taken class y,” where the domain for x consists of all students in
your class and for y consists of all computer science courses at your school. Express each of these
quantifications in English.
a) ∃x ∃y P(x, y) b) ∃x ∀y P(x, y) c) ∀x ∃y P(x, y) d) ∃y ∀x P(x, y) e) ∀y ∃x P(x, y) f) ∀x ∀y P(x, y)
14. i) Given propositional function q (x, y): x + y = 1, which of the following are propositions; which are not? For those
that are, determine their truth values.
a) q (x, y) b) q (-6, 7) c) q (x + 1, -x) d) q (x, 3) e) q (1, 1) f) q (5, -4)
ii) Let P(m, n) be the statement “m divides n,” where the domain for both variables consists of all positive integers.
(By “m divides n” we mean that n = km for some integer k.) Determine the truth values of each of these statements.
a) P(4, 5) b) P(2, 4) c) ∀ m ∀ n P(m, n) d) ∃ m ∀ n P(m, n) e) ∃ n ∀ m P(m, n) f) ∀ n P(1, n)
iii) Determine the truth value of each of these statements if the domain of each variable consists of all real
numbers. a) ∃x(x2 = 2) b) ∃x(x2 = −1) c) ∀x(x2 + 2 ≥ 1) d) ∃x(x2= x)
iv) Most of the Historical buildings in the Pakistan are in Karachi and Lahore. Table # 1 lists the 10 Historical
buildings in the Pakistan and some data about them. Consider H to be the set of all the historical buildings, K to
be the set of historical buildings that are in Karachi, and L to be the set of historical buildings that are in Lahore.
Furthermore, consider P to be the set of historical buildings that are exactly 1546 Sq. ft. tall. Use the information
given to find the truth value (and explain) of each statement below.
Building Name Location Area (Sq. Number of books Year Built
ft.) written
4
ii) By using Laws of inference, show that the following statement is valid:
a) If today is Tuesday, I have a test in Mathematics or Economics. If my Economics professor is sick, I will not
have a test in Economics. Today is Tuesday, and my Economics professor is sick. Therefore, I will have a test in
Mathematics.
b) If Ali is a lawyer, then he is ambitious. If Ali is an early riser then he does not like chocolates. If Ali is
ambitious then he is an early riser. Therefore, if Ali is a lawyer then he does not like chocolates.
c) ((�� → (�� ∨ ��)) → ((¬�� ∨ ��) ∧ ¬��)) → ¬��
16. i) Let U= {1, 2, 3, 4, 5, 6, 7,8}, A = {1, 2, 4, 5}, B = {2, 3, 5, 6}, and C = {4, 5, 6, 7}. Find and draw the Venn diagrams
for each of these combinations of the sets A, B and C:
a) (A ∩ B) ∩ ��̅ b) ��̅ ∪ (B ∪ C)
c) (A − B) ∩ C d) (A ∩��̅) ∪ ��̅
ii) Solve the following:
a) Let A= {1,2,3} and B= {1,2,3,4}. Determine whether A is a subset of B, and whether A is a proper subset of B.
b) Given the set C= {x∣x is a prime number less than 10), list all the proper subsets of C. c) Given L= {1,2,3}, list
all the subsets of L and then find the power set of L.
d) If M is a set with k elements, how many elements are in its power set? Express your answer in terms of k.
e) Define the set N= {x∣x is a prime number between 10 and 20). What is the cardinality of the power set of N?
f) Let E = {1, 2, 4} and F = {a, b, c, d}. Find E × F (the Cartesian product of E and F).
17. i) Prove or disprove the following expression by using the set identities:
a) (A − (A B)) (B − (A B)) = Φ
b) (A − B) ∪ (A B) = A
̅
c) A̅̅̅ − (A − B) = A B
̅̅
̅̅
̅=B
ii) a) Suppose that in a bushel of 100 apples there are 20 that have worms in them and 15 that have bruises. Only
those apples with neither worms nor bruises can be sold. If there are 10 bruised apples that have worms in them,
how many of the 100 apples can be sold?
b) In a university of 1000 students, 350 like Computer Science and 450 like Software Engineering. 100 students
like both CS & SE. How many like either of them and how many like neither?
c) In a survey on the gelato preferences of college students, the following data was obtained: 78 like mixed berry,
32 like Irish cream, 57 like tiramisu, 13 like both mixed berry and Irish cream, 21 like both Irish cream and
tiramisu, 16 like both tiramisu and mixed berry, 5 like all three flavors, and 14 like none of these three flavors.
How many students were surveyed?
d) Use set-builder notation and logical equivalences to prove the following. A X (B ∩ C) = (A X B) ∩ (A X C) iii)
Consider a domain |U| = {CS, SE, AI, CY, EE, BA, FT, DS}.
a) What is the characteristics vector of the set:
i) A= {CY, SE, AI, CS} ii) B = {BA, FT} iii) C = {EE, CS, FT}
b) What is the set corresponding to the characteristic vector:
i) D = {0,1,1,0,0,0,1,0} ii) E = {1,1,0,0,1,1,1,0} iii) F = {1,0,1,0,1,0,1,0} c) Find AUB, AUC,
DUC, E∩F, A∩C, D∩F, and AU(E∩D).
iv) Consider the Multiset A= {0,1,1,0,0,0,1,0,0,1,0,0}, B= {a, b, b, a, b, a, b, b, a, a, b, a, a}, C = {1, 2, 3, 1, 2, 2, 3, 2, 3},
D = {ABC, BCA, ACB, ABC, BCA, ABC}, E = {0, 0, 1, 0, 1, 1, 1, 1, 0, 1}, and F = {a, a, c, b, a, b, a, b, c, a, c, a}. a)
Represent the above set in ordered pair (X, mA(X)).
b) Find AUB, A∩C, BUF, CUE, B∩F, A C, and D D.
5
18. Ali is enrolled in CS1005-Discrete Structures this semester. Due to the illness, he missed the lectures for the
topics “Set theory and Functions”. He asked his friend to help him in understanding the topic and asked the
questions given below:
(i) Suppose that A = {b, d, f}, B = {b, f}, C = {d, f}, and D = {d, f, h}.
a) Determine which of these sets are subsets of each other.
b) Determine the Cardinality of each set.
(ii) Among 5000 patients admitted to a hospital, 2500 are diagnosed with Pneumonia, 3000 with Bronchitis, and
1000 with both pneumonia and bronchitis. Using Venn diagram determine:
a) The number of patients diagnosed with pneumonia or bronchitis (or both).
b) The number of patients not diagnosed with pneumonia or bronchitis.
(iii) Using Set Identities, prove or disprove the following set operations: P − (Q ∩ R) = (P − Q) ∩ (P −R).
(iv) Suppose g: P → Q and f: Q → R where P = {1, 2, 3, 4}, Q = {a, b, c}, R = {2, 7, 10}, and f and g are defined by f
= {(a, 10), (b, 7), (c, 2)} and g = {(1, b), (2, a), (3, a), (4, b)}.
a) Is Function f and g invertible? If yes find f −1 and g −1 or if not why?
b) Find f o g and g o f if exists.
19. Let A= {a, b, c, d} and B = {a, b, c, d}. Consider the following functions:
a) f(a) = b, f(b) = a, f(c) = c, f(d) = d b) f(a) = b, f(b) = b, f(c) = d, f(d) = c
c) f(a) = d, f(b) = b, f(c) = c, f(d) = d d) f(a) = c, f(b) = a, f(c) =b, f(d) = d
��
20. a) Let ƒ (��) =⌊ ����⌋, Find ƒ (S) if :
(i) S = {-2,-1,0,1,2,3} (ii) S = {0,1,2,3,4,5} (iii) S = {1,5,7,11} (iv) S = {2,6,10,14}
b) (i) ⌈����⌉ (ii) ⌊����⌋ iii) ⌈−����⌉ (iv) ⌊−����⌋ (v) ⌈�� ⌉ (vi) ⌊− �� ⌋ (vii) ⌊����+ ⌈����⌉ ⌋
(viii) ⌊����.⌊����⌋⌋
c) Prove or disproof that if �� is a real number, then ⌊− �� ⌋ = −⌈ �� ⌉ and ⌈ −�� ⌉ = − ⌊ �� ⌋.
21. Let ƒ and g be the functions from the set of integers to the set of integers defined by ƒ(a) = 2a + 3 and g(a) = 3a + 2.
a) What is the composition of ƒ and g? What is the composition of g and ƒ?
b) Which type of function ƒ and g are?
c) Are ƒ and g invertible?
22. A math test has a bonus question. The directions simply state that if you answer the question correctly you will receive
5 bonus points and your test grade will be increased by 7% of your score.
a) Write a function f(x), to represent just the 5 bonus points.
b) Write a function g(x), to represent just the percent of increase.
c) Find f(g(x)) and explain it.
d) Find f(g(75)).
e) Find g(f(x)) and explain it.
f) Find g(f(75)).
g) Does f(g(x)) = g(f(x)) in this problem?
6
23. As we have discussed, the practical application of all the topics in the class. Now you are required to provide at least
two detailed real-world applications for the following: [12 Points]
a) Propositional Logic
b) Predicates and quantifiers
c) Sets
d) Functions
7