0% found this document useful (0 votes)
20 views3 pages

Discrete Mathematics Midterm 2 Q&A

hi

Uploaded by

ahmadjoba2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

Discrete Mathematics Midterm 2 Q&A

hi

Uploaded by

ahmadjoba2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Answers:

Question No. 1 [5 Marks]


1. Determine whether ¬𝒑 ∨ 𝒑 is a tautology or not. (1 Mark)

𝒑 ¬𝒑 ¬𝒑 ∨ 𝒑
T F T
F T T
is a tautology

2. Determine whether ¬(𝒑 ∨ 𝒒) ↔ 𝒓 𝐚𝐧𝐝 𝒒 ∧ (𝒑 → 𝒓) are logically equivalent or not. (2 Marks)

𝑝 𝑞 𝑟 (𝑝 ∨ 𝑞) ¬(𝑝 ∨ 𝑞) ¬(𝑝 ∨ 𝑞) ↔ 𝑟 (𝑝 → 𝑟) 𝑞 ∧ (𝑝 → 𝑟)
T T T T F F T T
T T F T F T F F
T F T T F F T F
T F F T F T F F
F T T T F F T T
F T F T F T T T
F F T F T T T F
F F F F T F T F
Not Logically Equivalent

3. State True or False with reasons. (2 Marks)

A. (01111 ∧ 10101) ∨ 01000 is 01101 ( T )

(01111 ∧ 10101) = 00101


00101 ∨ 01000 = 01101

B. If 2𝑆 = {∅}, then 𝑆 = {{∅}} ( F )

𝑆 = ∅, or 2𝑆 = {∅, {{∅}}}

Discrete Mathematics Page 1 of 3


Question No. 2 [5 Marks]
1. Express the statement “Every student in BFCAI has an email” in logical expression.
Where 𝑃 (𝑥 ) is “𝑥 in BFCAI”, 𝐹(𝑥) is “𝑥 has an email”. (2 Marks)
The domain of 𝑥 is the set of all students in Benha.

2. Use set builder notation and logical equivalences to prove the second distributive law,
(2 Marks)
which states that 𝑨 ∩ (𝑩 ∪ 𝑪) = (𝑨 ∩ 𝑩) ∪ (𝑨 ∩ 𝑪) for all sets 𝑨, 𝑩, and 𝑪.
----------------------------------------------------------------------------------------------------------------------------
𝑨 ∩ (𝑩 ∪ 𝑪) = {𝒙| 𝒙 ∈ 𝑨 ∧ 𝒙 ∈ (𝑩 ∪ 𝑪)}

𝑨 ∩ (𝑩 ∪ 𝑪) = {𝒙| 𝒙 ∈ 𝑨 ∧ (𝒙 ∈ 𝑩 ∨ 𝒙 ∈ 𝑪)}

𝑨 ∩ (𝑩 ∪ 𝑪) = {𝒙| (𝒙 ∈ 𝑨 ∧ 𝒙 ∈ 𝑩) ∨ (𝒙 ∈ 𝑨 ∧ 𝒙 ∈ 𝑪)}

𝑨 ∩ (𝑩 ∪ 𝑪) = {𝒙| (𝒙 ∈ (𝑨 ∩ 𝑩)) ∨ (𝒙 ∈ (𝑨 ∩ 𝑪))}

𝑨 ∩ (𝑩 ∪ 𝑪) = {𝒙| 𝒙 ∈ ((𝑨 ∩ 𝑩) ∪ (𝑨 ∩ 𝑪))}

----------------------------------------------------------------------------------------------------------------------------

3. State True or False with reason. (1 Mark)


The composition 𝒇 ∘ 𝒈 cannot be defined unless the range of 𝒇 is a subset of the domain of 𝒈. ( F )

*The range of 𝒈 is a subset of the domain of 𝒇.

Discrete Mathematics Page 2 of 3


Question No. 3 [5 Marks]
1. Complete the following matrices multiplication (1 Mark)

1 2 2 1 2 9 2
[0 0 3 ] × [3 −1] = [ 3 1]
1 3 −1 1 1 9 −2

2. Is the following matrix 𝐀 symmetric or not? Why? (1 Mark)

1 0 2
𝐀 = [2 0 5]
2 5 −1

NO, because 𝐀 ≠ 𝐀𝑡

3. List all the steps used to search for 9 in the sequence 4, 3, 5, 9, 6, 11, 8, using a linear (3 Marks)
search algorithm. (Note: start from the left)
----------------------------------------------------------------------------------------------------------------------------

1- Start from the left, and set the first location 𝑖 = 1.

2- Compare 9 with the value in the location 𝑖 = 1, because the numbers are not equal (9 ≠ 4), then

3- Increase the location by 1, then the new location will be 𝑖 = 2.

4- Compare 9 with the value in the location 𝑖 = 2, because the numbers are not equal (9 ≠ 3), then

5- Increase the location by 1, then the new location will be 𝑖 = 3.

6- Compare 9 with the value in the location 𝑖 = 3, because the numbers are not equal (9 ≠ 5), then

7- Increase the location by 1, then the new location will be 𝑖 = 4.

8- Compare 9 with the value in the location 𝑖 = 4, because the numbers are equal (9 = 9), then

9- Stop, we found the number in this location (i.e., 𝑖 = 4) and then return 4.

----------------------------------------------------------------------------------------------------------------------------
GOOD LUCK,
Dr. Ahmed Hagag

Discrete Mathematics Page 3 of 3

You might also like