Assignment # 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

National University of Computer and Emerging Sciences, Karachi.

FAST School of Computing


Assignment # 1, Fall 2024
CS1005-Discrete Structures
Instructions: Max. Points: 100
1- This is hand written assignment only. You have to submit the hard copy on 16th September 2024 in
your respective classes .
2- Just write the question number instead of writing the whole question.
3- You can only use A4 size paper for solving the assignment.Show all your steps if neceessary.
4- You have to write your student ID and Section on the top of each page.
_________________________________________________________________________________________________

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.

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

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

4. Let p, q, and r be the propositions


p: You have the flu. q: You miss the final examination. r: You pass the course.
Express each of these propositions as an English sentence.

a) p → q b) ¬q ↔ r c) q →¬r
d) p ∨ q ∨ r e) (p →¬r) ∨ (q →¬r) f) (p ∧ q) ∨ (¬q ∧ r)

1
5. Let p, q, and r be the propositions
p: You get an A on the final exam. q: You do every exercise in this book. r: You get an A in this class.
Write these propositions using p, q, and r and logical connectives.

a) You get an A in this class, but you do not do every exercise in this book.
b) You get an A on the final, you do every exercise in this book, and you get an A in this class.
c) To get an A in this class, it is necessary for you to get an A on the final.
d) You get an A on the final, but you don’t do every exercise in this book; nevertheless, you get an A in this class.
e) Getting an A on the final and doing every exercise in this book is sufficient for getting an A in this class.
f) You will get an A in this class if and only if you either do every exercise in this book or you get an A on the final.

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

7. Consider the statement: “If it is sunny tomorrow, then I will go for a walk in the woods.”

a) Describe at least five different ways to write the conditional statement p → q in English.
b) State the converse, inverse and contrapositive of a conditional statement.
c) Given a conditional statement p → q, find the inverse of its inverse, the inverse of its converse, and the
inverse of its contrapositive.

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

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

10. Prove the following equivalences by using laws of logic:

a) (p ∧ (¬ (¬p ∨ q))) ∨ (p ∧ q) ≡ p
b) ¬ (p ⟷ q) ≡ (p ⟷ ¬q)
c) ¬p ⟷ q ≡ p ⟷ ¬q
d) (p ∧ q) → (p → q) ≡ T
e) ¬ (p ∨ ¬ (p ∧ q)) ≡ F

2
11. 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)

12. 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)

13. 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)

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

15. 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++.

16. 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)

17. 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)

18. What rule of inference is used in each of these arguments?

a) Alice is a mathematics major. Therefore, Alice is either a mathematics major or a computer science major.
b) Jerry is a mathematics major and a computer science major. Therefore, Jerry is a mathematics major.
c) If it is rainy, then the pool will be closed. It is rainy. Therefore, the pool is closed.
d) If it snows today, the university will close. The university is not closed today. Therefore, it did not snow today.
e) If I go swimming, then I will stay in the sun too long. If I stay in the sun too long, then I will sunburn. Therefore,
if I go swimming, then I will sunburn.

3
19. 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.

20. 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:
a) (A ∩ B) ∩ 𝑪̅ b) 𝑨̅ ∪ (B ∪ C) c) (A − B) ∩ C d) (A ∩𝑩 ̅
̅) ∪ 𝑪
Draw the Venn diagrams for each of these combinations of the sets A, B and C.

21. 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 − B) – C = (A − C) – B d) (̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅ ∪ (𝑩
𝑩 ̅ – 𝐀)) = B

22. 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)

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

(i) Determine the Domain, Co-domain and Range of the functions.


(ii) Determine whether the functions are Injective, Surjective and Bijective or not?
(iii) Determine the inverse of function if exists.
𝒙𝟐
24. (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 ⌈−𝒙 ⌉ = − ⌊ 𝒙 ⌋.

25. 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?

4
Assistant Prof:Jamilusmani Submission date : Monday 16th Sep.2024

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy