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

Assignment 1 Solution.

Uploaded by

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

Assignment 1 Solution.

Uploaded by

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

1. Which of these are propositions?

What are the truth values of those that are


propositions?
a. Not a proposition
b. Proposition: F.
c. Not a proposition
d. Proposition: T
e. Not a proposition

2. Express the given statements using logical connectives.


a. p:student gets A in Discrete, q:student weights total is ≥95% : (𝑝 ↔ 𝑞)
b. p: Alice is smart, q: Alice is honest: (𝑝 ∨ (¬𝑝 ∧ 𝑞)
c. (√30 >6) ∨ (√30 < 5)
d. p: Sam had pizza last night, q: Chris finished her homework: (𝑝 ∧ 𝑞)
e. p:Chris finished her homework, q: Pat watched the news this morning:
(𝑝 ∨ 𝑞) ∧ ¬(𝑝 ∨ 𝑞)

3. Let 𝑝 = "2≤5", 𝑞 = "8 𝑖𝑠 𝑎𝑛 𝑒𝑣𝑒𝑛 𝑖𝑛𝑡𝑒𝑔𝑒𝑟", and 𝑟 = "11 𝑖𝑠 𝑎 𝑝𝑟𝑖𝑚𝑒 𝑛𝑢𝑚𝑏𝑒𝑟". Express
the following as a statement in English and determine whether the statement is true or
false.
a. 2>5 or 8 is an even integer.= False
b. if 2≤5, 8 𝑖𝑠 𝑎𝑛 𝑒𝑣𝑒𝑛 𝑖𝑛𝑡𝑒𝑔𝑒𝑟 then 11 is a prime number= True
c. if 2≤5 then 8 is an even integer of 11 is not a prime number.= False
d. if 2 > 5 then 8 is an odd integer.

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.

a) Smartphone B has the most RAM of these three smartphones.


Solution: True Statement: p
p: Smartphone B has the most RAM of these three smartphones.
b) Smartphone C has more ROM or a higher resolution camera than Smartphone B.
Solution: True Statement: p v q (p OR q)
First identify propositions:
p: C has more ROM than B. FALSE q: C has a higher resolution camera than B TRUE
c) Smartphone B has more RAM, more ROM, and a higher resolution camera than
Smartphone A.
Solution: False Statement: p ∧ q ∧ r (p AND q AND r )
First identify propositions:
p: B has more RAM than A. TRUE q: B has more ROM than A. TRUE
r: B has a higher resolution camera than A. FALSE
d) If Smartphone B has more RAM and more ROM than Smartphone C, then it also has a
higher resolution camera.
Solution: False Statement: (p ∧ q) → r ( IF (p AND q) THEN r )
p: B has more RAM than C. TRUE q: B has more ROM than C. TRUE
r: B has a higher resolution camera than C. FALSE
e) Smartphone A has more RAM than Smartphone B if and only if Smartphone B has
more RAM than Smartphone A.
Solution: False Statement: (p ⟷ q) (p IF AND ONLY IF q)
p: A has more RAM than B. FALSE q: B has more RAM than A. TRUE

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.
Solution
a) Quixote Media had the largest annual revenue.
Solution: False (the largest annual revenue had Acme Computer, 138 billion dollars)
p: Quixote Media had the largest annual revenue.
b) Nadir Software had the lowest net profit and Acme Computer had the largest annual
revenue.
Solution: True Statement: (p ∧ q) p: Nadir Software had the lowest net profit. True q:
Acme Computer had the largest annual revenue. True
c) Acme Computer had the largest net profit or Quixote Media had the largest net profit.
Solution: True Statement: (p v q) p: Acme Computer had the largest net profit. False q:
Quixote Media had the largest net profit. True
d) If Quixote Media had the smallest net profit, then Acme Computer had the largest
annual revenue.
Solution: True Statement: (p → q) p: Quixote Media had the smallest net profit. False q:
Acme Computer had the largest annual revenue. True
e) Nadir Software had the smallest net profit if and only if Acme Computer had the largest
annual revenue.
Solution: True Statement: (p ⟷ q) p: Nadir Software had the smallest net profit. True q:
Acme Computer had the largest annual revenue. True

6. Consider the statement: “if you keep your textbook, it will be a useful reference in your future
course.”
e. Solution: 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” “q provided that p”

f. Solution:
Converse of p → q : q → p
Contrapositive of p → q : ¬ q → ¬ p
Inverse of p → q : ¬ p → ¬ q

g. Solution:
Inverse: if you do not keep your textbook, then It will not be useful
reference in your future course
Inverse of inverse: If you keep your textbook, then it will be a useful
reference in your future course.

Converse: If it is useful reference in your future course then it you keep


your textbook
Inverse of converse: If it will not be a useful reference in your future course
then you do not keep your textbook.

Contrapositive: If it is not useful reference in your future course then you


do not keep your textbook
Inverse of its contrapositive: If It is useful reference in your future then you
keep your textbook

7. Use De Morgan’s law to find the negation of each of the following statements.
h. 0 > 𝑥 or 𝑥 > 4
i. − 2 ≥ 𝑥 or 𝑥 > 5
j. The fan is not slow and it is not very hot.
k. Akram is not unfit or Ahmed is not injured
l. Zia is healthy, wealthy or wise.
a. Original statement: 0 ≤ 𝑥 ≤ 4 Negation: ¬(0 ≤ 𝑥 ≤ 4) Applying De Morgan's Law for
"and": ¬(0 ≤ 𝑥) ∨ ¬(𝑥 ≤ 4) This simplifies to: 𝑥 < 0 ∨ 𝑥 > 4

b. Original statement: −2 < 𝑥 ≤ 5 Negation: ¬(−2 < 𝑥 ≤ 5) Applying De Morgan's Law for
"and": ¬(−2 < 𝑥) ∨ ¬(𝑥 ≤ 5) This simplifies to: 𝑥 ≥ −2 ∨ 𝑥 > 5

c. Original statement: The fan is slow, or it is very hot. Negation: ¬(The fan is slow ∨ It is
very hot) Applying De Morgan's Law for "or": (¬The fan is slow) ∧ (¬It is very hot) This
simplifies to: The fan is not slow ∧ It is not very hot

d. Original statement: Akram is unfit and Ahmed is injured. Negation: ¬(Akram is unfit ∧
Ahmed is injured) Applying De Morgan's Law for "and": (¬Akram is unfit) ∨ (¬Ahmed is
injured) This simplifies to: Akram is fit ∨ Ahmed is not injured

e. Original statement: Zia is neither healthy, wealthy, nor wise. Negation: ¬(Zia is not
healthy ∧ Zia is not wealthy ∧ Zia is not wise) Applying De Morgan's Law for "and": (Zia is
healthy) ∨ (Zia is wealthy) ∨ (Zia is wise)

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.

Solution

Jan is rich and happy. Solution: Jan is not rich or happy. b) Carlos will bicycle or run tomorrow.
Solution: Carlos will not bicycle and not run tomorrow. c) The fan is slow or it is very hot.
Solution: The fan is not slow and it is not very hot. d) Akram is unfit and Saleem is injured.
Solution: Akram is not unfit or Saleem is not injured.

9. Prove the following equivalences by using laws of logic.


m. (𝑝∧𝑞)∨(¬𝑝∧𝑞)⟺𝑞
Solution
(𝑝∧𝑞)∨(¬𝑝∧𝑞) ≡ 𝑞 ∧ (𝑝 ∨ ¬𝑝) Distributive law
≡ 𝑞 ∧ (𝑝 ∨ ¬𝑝) Negation Law
≡ 𝑞∧𝑇 Identity Law
≡ 𝑞

n.
o.

p.

10. Using Truth Table, show that these compound propositions are logically equivalent or not.
q.
r.

11. Given the following logical propositions a premise. Using rule of inference prove that
conclusion is ¬𝑟.
(𝑡→(𝑟∨𝑝))→((¬𝑟∨𝑘)∧¬𝑘)

Given the following logical propositions a premises. Using


rule of inference prove that conclusion is ¬𝑟.
(𝑡 → (𝑟 ∨ 𝑝)) → ((¬𝑟 ∨ 𝑘) ∧ ¬𝑘)
Solution:
12 What rule of inference is used in each of these arguments?
s. Alice is a mathematics major. Therefore, Alice is either a mathematics major or a
computer science major.
Solution: Addition
t. Jerry is a mathematics major and a computer science major. Therefore, Jerry is a
mathematics major.
Solution:Simplification
u. If it is rainy, then the pool will be closed. It is rainy. Therefore, the pool is closed.
Solution: Modus Ponens
v. If it snows today, the university will close. The university is not closed today.
Therefore, it did not snow today.
Solution: Modus Tollens
w. 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 get sunburned.
Solution: Hypothetical syllogism

13. By using Law if inference, show that the following statement is valid.
x.

y.

14. Given propositional function 𝑞(𝑥, 𝑦): 𝑥 + 𝑦 = 1, which of the following are propositions;
which are not? For those that are, determine their truth values.
z. 𝑞(𝑥, 𝑦)=Not Proposition
aa. 𝑞(− 6, 7)=True
bb. 𝑞(𝑥 + 1, − 𝑥)=True
cc. 𝑞(𝑥, 3)=Not Proposition
dd. 𝑞(1, 1)=False
ee. 𝑞(5, − 4)=True

15. Determine the truth value of each of these statements if the domain of each variable
consists of all real numbers.
2
ff. ∃𝑥(𝑥 = 2)=False
2
gg. ∃𝑥(𝑥 =− 1)=False
2
hh. ∃𝑥(𝑥 = 2)=True
2
ii. ∀𝑥(𝑥 + 2≥1)=True [closing bracket was missing]

16. 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.
jj. Solution: ∃ x (P(x) ∧ Q(x))
kk. ∃ x (P(x) ∧ ¬Q(x))
ll. ∀ x (P(x) ∨ Q(x))
mm. Solution: ¬∃ x (P(x) ∨ Q(x))
17. 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
nn. ∃𝑥∃𝑦𝑄(𝑥, 𝑦)
Solution: There is some student in your class who has sent a message to some
student in your class.
oo. ∃𝑥∀𝑦𝑄(𝑥, 𝑦)
Solution: There is some student in your class who has sent a message to every
student in your class.
pp. ∀𝑥∃𝑦𝑄(𝑥, 𝑦)
Solution: Every student in your class has sent a message to at least one student in
your class.
qq. ∀𝑦∃𝑥𝑄(𝑥, 𝑦)
Solution: Every student in your class has been sent a message from at least one
student in your class.
rr. ∀𝑥∀𝑦𝑄(𝑥, 𝑦)

Solution: Every student in the class has sent a message to every student in the class.

18.
1. 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.
2. Given the set C={x∣x is a prime number less than 10), list all the proper subsets of C.
3. Given L={1,2,3}, list all the subsets of L and then find the power set of L.
4. If M is a set with k elements, how many elements are in its power set? Express your answer
in
terms of k.
5. Define the set N= {x∣x is a prime number between 10 and 20). What is the cardinality of the
power set of N?

Solution
Set A={1,2,3} and B={1,2,3,4}.

1. A is a subset of B because every element of A (1, 2, and 3) is also in B.


2. A is not a proper subset of B because A is equal to B (there are no additional
elements in B that are not in A).
3. Set C={x∣x is a prime number less than 10). Proper subsets of C:

{} (the empty set) {2}{3}{5}{7}{2, 3}{2, 5}{2, 7}{3, 5}{3, 7}{5, 7}

Set L={1,2,3}. Subsets of L:

● {} (the empty set)


● {1}
● {2}
● {3}
● {1, 2}
● {1, 3}
● {2, 3}
● {1, 2, 3}
4. Power set of L (the set of all subsets of L): P(L) = { {}, {1}, {2}, {3}, {1, 2}, {1, 3},
{2, 3}, {1, 2, 3} } The power set contains 2^k elements, where k is the number of
elements in the original set. In this case, k = 3, so the power set has 2^3 = 8
elements.If M is a set with k elements, its power set has 2^k elements.
5. Set N = {x∣x is a prime number between 10 and 20}. The prime numbers between
10 and 20 are: 11, 13, 17, and 19. So, the set N = {11, 13, 17, 19}.The cardinality
(number of elements) of the power set of N is 2^4 = 16.

19. Let E={1,2,4} and F={a,b,c,d}. Find E×F (the Cartesian product of E and F).
Solution

Subset and Proper Subset:


1. Set A={1,2,3} and B={1,2,3,4}.
A is a subset of B because all elements of A are also in B.
A is not a proper subset of B because A and B have the same elements.
2. Given set C={x∣x is a prime number less than 10).
Proper subsets of C include: {}{}, {2}{2}, {3}{3}, {5}{5}, {7}{7}, {2,3}{2,3}, {2,5}{2,5}, {2,7}{2,7},
{3,5}{3,5},
{3,7}{3,7}, {5,7}{5,7}.
3. Power set of L is: {},{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}{},{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}.
4. If set M has k elements, its power set will have 2 k elements.
5. Power set of N has 2 4 =16 24 =16 subsets.
6. E×F={(1,a),(1,b),(1,c),(1,d),(2,a),(2,b),(2,c),(2,d),(4,a),(4,b),(4,c),(4,d)}
20.
Given the sets 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},
let’s analyze
the expressions:
a) Prove or disprove: (A - (A ∩ B)) ∩ (B - (A ∩ B)) = ∅
b) Prove or disprove: (A - B) ∪ (A ∩ B) = A
c) Prove or disprove: (A - B) - C = (A - C) - B
d) Prove or disprove: (B̅ ∪ (B̅ - A)) = B

Lets go through each expression:


a) Expression: (A - (A ∩ B)) ∩ (B - (A ∩ B))
Using the distributive law and set difference identity: A - (A ∩ B) = A ∩ B̅ So, the expression
becomes: (A ∩ B̅) ∩ (B - (A ∩ B))
Further simplification using distributive law: (A ∩ B̅) ∩ (B ∩ (A ∩ B)̅)
Applying set identity: X ∩ X̅ = ∅ for any set X This simplifies the expression to: ∅
b) Expression: (A - B) ∪ (A ∩ B)
Using distributive law: A - B = A ∩ B̅ Substituting in the expression: (A ∩ B̅) ∪ (A ∩ B) Applying
the
distributive law: A ∩ (B̅ ∪ B)
Applying set union identity: B̅ ∪ B = U (universal set) So, the expression simplifies to: A ∩ U =
A
c) Expression: (A - B) - C This is the set difference: (A ∩ B̅) - C
Using the associativity of set difference: A ∩ (B̅ - C) Expression cannot be simplified further.
d) Expression: (B̅ ∪ (B̅ - A)) = B
Using the distributive law: B̅ ∪ (B̅ - A) = B̅ ∪ (B̅ ∩ A̅) Applying the distributive law: B̅ ∩ (A̅ ∪ B̅)
Applying the set union identity: A̅ ∪ B̅ = U (universal set) So, the expression simplifies to:
B̅ ∩ U = B̅
In summary:
a) Proven: (A - (A ∩ B)) ∩ (B - (A ∩ B)) = ∅ b) Proven: (A - B) ∪ (A ∩ B) = A c) Not proven or
disproven d)
Disproven: (B̅ ∪ (B̅ - A)) ≠ B

21.
a. In a bushel of 200 potatoes, 40 have worms in them, and 30 have bruises. Only those
potatoes with neither worms nor bruises can be sold. If there are 20 bruised potatoes that have
worms in them, how many of the 200 potatoes can be sold?
Solution:
Total number of potatoes, n(P) = 200
Number of potatoes with worm, n(W) = 40
Number of potatoes with bruises, n(B) = 30
Number of potatoes with both worms and bruises, n(W∩B) = 20
Number of potatoes with worms or bruises, n(WᴜB) =
n(W) + n(B) – n(W∩B) = 40 + 30 – 20 = 50
Total number of potatoes without any worms or bruises can be sold = n(P) – n(WᴜB) = 200 – 50
= 150

b) A famous Ice cream company wants to launch exciting deals for their new store in Karachi.
The survey of 1,000 customers shows 250 of them like mixed berry, 400 like Irish cream, and
100 of them like both. How many of them like either of the flavors and how many of them like
none?

Solution:
Total number of students, n(µ) = 1000
Number of customers with mixed berry preference, n(MB) = 250
Number of customers with Irish Cream preference, n(IC) = 400
Number of customers who like both, n(MB ∩ IC) = 100
Number of customers who like either of them, n(MB ᴜ IC) = n(MB) + n(IC) – n(MB ∩ IC)= 400 +
250 – 100 = 550
Number of customers who like neither = n(µ) – n(MB ᴜ IC) = 1000 – 550 = 450.

c) The Computer Science Department of XYZ College is planning to offer elective courses to the
sophomores. In a survey on the course preferences of students, the following data was
obtained:

44 like Accounting, 35 like Psychology, 38 like Business Analytics, 13 like both Accounting and
Psychology, 21 like both Psychology and Business Analytics, 16 like both Business Analytics
and Accounting, 19 like all three subjects, and 14 like none of these three subjects. How many
students were surveyed?

Solution:
Let the set of students who like Accounting be A, those who want Business Analytics be B and
those who like Psychology be P. Then, by the inclusion-exclusion principle, the number of
students who want to take at least one of the courses is:
|A B P| = |A| + |B| + |P| − |A ∩ B| − |B ∩ P| − |A ∩ P| + |A ∩ B ∩ P| = 44 + 35 + 38 − 16 − 21 −
13 + 19 = 86.
Now there are an additional 14 who do not prefer any of these three courses, so the total
number of students surveyed was 86 + 14 = 100.

18. Use set-builder notation and logical equivalences to prove the following. A X (B ∩ C) = (A X
B) ∩ (A X C).
Solution
1. Start with the left-hand side (LHS): A × (B ∩ C)

This means we are taking the Cartesian product of set A with the intersection of sets B and C.
2. Use set-builder notation for Cartesian product: A × (B ∩ C) = {(x, y) | x ∈ A and y ∈ (B ∩
C)}
3. Apply the distributive property of set intersection over Cartesian product: A × (B ∩ C) =
{(x, y) | (x ∈ A) and (y ∈ B ∩ C)}
4. Split the condition into two separate conditions using logical equivalences: A × (B ∩ C) =
{(x, y) | (x ∈ A) and (y ∈ B) and (y ∈ C)}
5. Now, consider the right-hand side (RHS): (A × B) ∩ (A × C)

This means we are taking the intersection of the Cartesian product of A and B with the
Cartesian product of A and C.

6. Use set-builder notation for Cartesian products: (A × B) ∩ (A × C) = {(x, y) | (x, y) ∈ (A ×


B) and (x, y) ∈ (A × C)}
7. Apply the distributive property of set intersection over Cartesian product: (A × B) ∩ (A ×
C) = {(x, y) | ((x, y) ∈ (A × B)) and ((x, y) ∈ (A × C))}
8. Split the conditions into two separate conditions using logical equivalences: (A × B) ∩ (A
× C) = {(x, y) | (x ∈ A) and (y ∈ B) and (x ∈ A) and (y ∈ C)}
9. Notice that the conditions on both sides of the equation are now identical: A × (B ∩ C) =
(A × B) ∩ (A × C)

This proves that A × (B ∩ C) is equal to (A × B) ∩ (A × C) using set-builder notation and logical


equivalences

23. Let A= {1, 3, 5, 7 } and B = {2, 4, 6, 8}. Consider the following functions:
a) f(1) = 4, f(3) = 2, f(5) = 6, f(7) = 8
b) f(1) = 4, f(3) = 4, f(5) = 8, f(7) = 6
c) f(1) = 8, f(3) = 4, f(5) = 6, f(7) = 8
d) f(1) = 6, f(3) = 2, f(5) = 4, f(7) = 8

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

i.
a. Domain = {1, 3, 5, 7} Co-domain = {2, 4, 6, 8} Range = {2, 4, 6, 8}
b. Domain = {1, 3, 5, 7} Co-domain = {2, 4, 6, 8} Range = {4, 6, 8}
c. Domain = {1, 3, 5, 7} Co-domain = {2, 4, 6, 8} Range = {4, 6, 8}
d. Domain = {1, 3, 5, 7} Co-domain = {2, 4, 6, 8} Range = {2, 4, 6, 8}

ii.
a. Injective and Bijective
b. Neither
c. Neither
d. Injective and Bijective.

Iii.
a. f-1( 4 ) = 1, f-1( 2 ) = 3, f-1( 6 ) = 5, f-1( 8 ) = 7
b. Does Not Exist.
c. Does Not Exist.
d. f-1( 6 ) = 1, f-1( 2 ) = 3 , f-1( 4 ) = 5, f-1( 8 ) = 7

24) Let ƒ and g be the functions from the set of integers to the set of integers defined by ƒ(x) =
4x + 3 and
g(x) = 3x + 4.
(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?

Solution:
(a).
(f◦g)(x) = f(g(x)) = f (3x + 4) = 4(3x + 4) + 3 = 12x + 19.
(g◦f)(x) = g(f (x)) = g(4x + 3) = 3(4x + 3) + 4 = 12x + 13.

(b) Solution: ƒ and g are not injective, surjective and bijective.


(c) Solution: Hence ƒ and g are not invertible.

You might also like