2021 MT Discrete Model 1 v2
2021 MT Discrete Model 1 v2
Discrete Mathematics
SSP Fall 2021
Faculty of Engineering Midterm Exam
Alexandria University Time Allowed: 60 Minutes
Model 1
(2) Let 𝑝 be the statement “DATAENDFLAG is off,” 𝑞 the statement “ERROR equals 0,” and 𝑟
the statement “SUM is less than 1,000.” What is the logic form of the statement “Either
DATAENDFLAG is on or it is the case that both ERROR equals 0 and SUM is less than
1,000”?
a. 𝑝 ∨ (𝑞 ∧ 𝑟) b. ¬𝑝 ∨ 𝑞 ∨ 𝑟 c. ¬𝑝 ∨ (𝑞 ∧ 𝑟) d. ¬𝑝 ∧ (𝑞 ∧ 𝑟)
(3) Assume 𝑥 is a particular real number and using De Morgan’s laws, what is the negation for
the statement 0 > 𝑥 ≥ −7?
a. (𝑥 ≥ 0) ∨ (𝑥 < −7) b. (𝑥 > 0) ∨ (𝑥 < −7) c. (𝑥 ≤ 0) ∧ (𝑥 > −7) d. (𝑥 ≥ 0) ∧ (𝑥 < −7)
(4) Let num_orders and num_instock are particular values. What is the negation for the
statement “(𝑛𝑢𝑚_𝑜𝑟𝑑𝑒𝑟𝑠 > 100 𝑎𝑛𝑑 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 ≤ 500) 𝑜𝑟 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 < 200”?
a. (𝑛𝑢𝑚_𝑜𝑟𝑑𝑒𝑟𝑠 ≤ 100 𝑎𝑛𝑑 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 > 500) 𝑜𝑟 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 ≥ 200
b. (𝑛𝑢𝑚_𝑜𝑟𝑑𝑒𝑟𝑠 ≤ 100 𝑜𝑟 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 > 500) 𝑎𝑛𝑑 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 ≥ 200
c. (𝑛𝑢𝑚𝑜𝑟𝑑𝑒𝑟𝑠 < 100 𝑜𝑟 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 > 500) 𝑎𝑛𝑑 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 > 200
d. (𝑛𝑢𝑚_𝑜𝑟𝑑𝑒𝑟𝑠 ≥ 100 𝑜𝑟 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 < 500) 𝑎𝑛𝑑 𝑛𝑢𝑚_𝑖𝑛𝑠𝑡𝑜𝑐𝑘 ≤ 200
(6) Write each of the below statements in logic form and determine whether they are logically
equivalent. Let 𝑝 = 2 𝑖𝑠 𝑎 𝑓𝑎𝑐𝑡𝑜𝑟 𝑜𝑓 𝑛; 𝑞 = 3 𝑖𝑠 𝑎 𝑓𝑎𝑐𝑡𝑜𝑟 𝑜𝑓 𝑛; 𝑟 = 6 𝑖𝑠 𝑎 𝑓𝑎𝑐𝑡𝑜𝑟 𝑜𝑓 𝑛.
- If 2 is a factor of n and 3 is a factor of n, then 6 is a factor of n.
1/8
- 2 is not a factor of n or 3 is not a factor of n or 6 is a factor of n.
a. 𝑝 ∧ 𝑞 → 𝑟; ¬𝑝 ∨ ¬𝑞 ∧ 𝑟; No they are not equivalent.
b. 𝑝 ∧ 𝑞 → 𝑟; ¬𝑝 ∧ ¬(𝑞 ∨ 𝑟); Yes they are equivalent.
c. 𝑝 ∧ 𝑞 → 𝑟; ¬𝑝 ∨ ¬𝑞 ∨ 𝑟; Yes they are equivalent.
d. 𝑝 ∧ 𝑞 → 𝑟; ¬𝑝 ∨ ¬𝑞 ∨ 𝑟; No they are not equivalent.
(7) Suppose that 𝑝 and 𝑞 are statements so that 𝑝 → 𝑞 is false. What are the truth values of the
following (¬𝑝 → 𝑞 ; 𝑝 ∨ 𝑞 ; 𝑞 → 𝑝).
a. (T; T; F) b. (F; F; F) c. (T; F; T) d. (T; T; T)
(8) The below statement can be written in if-then form in two ways, one of which is the
contrapositive of the other.
“Sam will be allowed on racing boat only if he is an expert sailor.” The contrapositive (that
has negations) is …
a. If Sam will be allowed on racing boat, then he is an expert sailor.
b. If Sam is not an expert sailor; he will not be allowed on racing boat.
c. If Sam is an expert sailor; he will be allowed on racing boat.
d. If Sam will not be allowed on racing boat, then he is not an expert sailor.
(9) “If compound X is boiling, then its temperature must be at least 150°C.” Assuming that this
statement is true, which of the following must also be true?
a. Compound X will not boil only if its temperature is at least 150°C.
b. If compound X is not boiling, then its temperature is less than 150°C.
c. A sufficient condition for compound X to boil is that its temperature be at least
150°C.
d. A necescsary condition for compound X to boil is that its temperature be at least
150°C.
(10) You are visiting an island containing two types of people: knights who always tell the
truth and knaves who always lie. Two natives A and B address you as follows:
A says: Both of us are knights.
B says: A is a knave.
What are A and B?
a. A is knave and B is knight.
b. A is knight and B is knave.
c. Both A and B are knaves.
d. Both A and B are knights.
(11) Which conclusion follows from the below argument
𝑝
𝑝 → 𝑞
¬𝑞 ∨ 𝑟
a. ∴ ¬𝑟 b. ∴ 𝑞 c. ∴ 𝑟 d. ∴ ¬𝑞
(12) To show if the below is a valid argument form, we need to show ….
𝑝 → 𝑞
𝑞 → 𝑝
∴𝑝∨𝑞
a. [(𝑝 → 𝑞) ∧ (𝑞 → 𝑝)] → (𝑝 ∨ 𝑞) ≡ 𝐹
b. (𝑝 → 𝑞) ∨ (𝑞 → 𝑝) ∨ (𝑝 ∨ 𝑞) ≡ 𝑇
c. [(𝑝 → 𝑞) ∧ (𝑞 → 𝑝)] → (𝑝 ∨ 𝑞) ≡ 𝑇
2/8
d. (𝑝 → 𝑞) ∧ (𝑞 → 𝑝) ∧ (𝑝 ∨ 𝑞) ≡ 𝐹
(13) (cont.) Is the argument form in Q12 valid?
a. Yes b. No c. Only when 𝑝 and 𝑞 are true d. Only when 𝑝 or 𝑞 is true
(14) Consider the statement “∀ basketball player x, x is tall.” Which of the following is an
equivalent way of expressing this statement?
a. Among all the basketball players, some are tall.
b. Some of all the tall people are basketball players.
c. Anyone who is a basketball player is a tall person.
d. Anyone who is tall is a basketball player.
(15) What is a counterexample that shows the below statement is false?
∀ positive integers m and n, 𝑚 ∙ 𝑛 > 𝑚 + 𝑛.
a. 𝑚 = 1, 𝑛 = 1
b. 𝑚 = −3, 𝑛 = −2
c. The statement is always true.
d. The statement is always false.
(16) Rewrite in logic form the statement “No irrational numbers are integers.”
a. ∃ irrational number x such that x is not an integer.
b. ∀ rational number x, x is an integer.
c. ∃ rational number x such that x is not an integer.
d. ∀ irrational number x, x is not an integer.
(17) Consider the statement “All integers are rational numbers but some rational numbers are
not integers.” What is its logic form? Let 𝑅𝑎𝑡𝑙(𝑥) be “𝑥 is a rational number” and 𝐼𝑛𝑡(𝑥) be
“𝑥 is an integer.”
a. ∃𝑥(𝐼𝑛𝑡(𝑥) ∧ 𝑅𝑎𝑡𝑙(𝑥)) ∧ ∀ 𝑥(𝑅𝑎𝑡𝑙(𝑥) → ¬𝐼𝑛𝑡(𝑥))
b. ∀𝑥(𝐼𝑛𝑡(𝑥) → 𝑅𝑎𝑡𝑙(𝑥)) ∧ ∃ 𝑥(𝑅𝑎𝑡𝑙(𝑥) ∧ ¬𝐼𝑛𝑡(𝑥))
c. ∀𝑥(𝑅𝑎𝑡𝑙(𝑥) → 𝐼𝑛𝑡(𝑥) ) ∧ ∃ 𝑥(𝑅𝑎𝑡𝑙(𝑥) ∨ ¬𝐼𝑛𝑡(𝑥))
d. ∀𝑥(𝐼𝑛𝑡(𝑥) → 𝑅𝑎𝑡𝑙(𝑥)) ∧ ∃ 𝑥(𝑅𝑎𝑡𝑙(𝑥) → ¬𝐼𝑛𝑡(𝑥))
(18) Which of the following is a negation for “All dogs are loyal”?
a. Some dogs are disloyal.
b. All dogs are disloyal.
c. No dogs are loyal.
d. There is a disloyal animal that is not a dog.
(19) What is the negation of the statement “Every valid argument has a true conclusion.”?
a. There is no valid argument that has true conclusion.
b. There is a valid argument that does not have a true conclusion.
c. All valid arguments don’t have true conclusion.
d. All valid argument do have a true conclusion.
(20) Let 𝐷 = {−48, −14, −8, 0, 1, 3, 16, 23, 26, 32, 36}. Determine which of the following
statements is true.
a. ∀𝑥 ∈ 𝐷, if x is less than 0 then x is odd.
b. ∀𝑥 ∈ 𝐷, if x is even then x ≠ 0.
c. ∀𝑥 ∈ 𝐷, if the ones digit of x is 5, then the tens digit is 3 or 4.
d. ∀𝑥 ∈ 𝐷, if the ones digit of x is 6, then the tens digit is 1 or 2.
3/8
(21) (cont.) Consider same 𝐷 as Q20. Determine which of the following statements is false.
a. ∀𝑥 ∈ 𝐷, if x is less than 0 then x is even.
b. ∀𝑥 ∈ 𝐷, if x is odd then 𝑥 > 0.
c. ∀𝑥 ∈ 𝐷, if the ones digit of x is 5, then the tens digit is 3 or 4.
d. ∀𝑥 ∈ 𝐷, if the ones digit of x is 6, then the tens digit is 1 or 2.
(22) What is the converse of the statement “If 𝑛 is any prime number that is greater than 2,
then 𝑛 + 1 is even.”?
a. If 𝑛 is odd, then 𝑛 − 1 is not a prime number
b. If 𝑛 is even, then 𝑛 + 1 is a prime number greater that 2
c. If 𝑛 is even, then 𝑛 − 1 is a prime number greater than 2
d. If 𝑛 is not a prime number that is greater than 2, then 𝑛 + 1 is odd
(23) What is the logic form of the statement “Having a large income is not a sufficient
condition for a person to be happy”?
a. There is a person who has a large income and is not happy.
b. All persons who have large income are not happy.
c. Every person is either happy or has large income.
d. There is a person who has a large income and is happy.
(24) Suppose 𝑃(𝑥, 𝑦) is some property involving 𝑥 and 𝑦, and suppose the statement
“∀𝑥 𝑖𝑛 𝐷, ∃ 𝑦 𝑖𝑛 𝐸 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑃(𝑥, 𝑦)” is true. Then the statement
“∃ 𝑥 𝑖𝑛 𝐷 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 ∀𝑦 𝑖𝑛 𝐸, 𝑃(𝑥, 𝑦)” ….
a. is true. b. is false. c. may be true or may be false. d. it depends on the domains D and E.
(25) The following statement is true: “∀ 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑥, ∃ 𝑎𝑛 𝑖𝑛𝑡𝑒𝑔𝑒𝑟 𝑛 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑛 > 𝑥. ”
For x = 15.83 , find an 𝑛 to make the predicate true.
a. 𝑛 = 15 b. 𝑛 = 16 c. 𝑛 = 14 d. 𝑛 = 0
(26) Let 𝐷 = 𝐸 = {−2, −1, 0, 1, 2}. Write the negation for the below statement and
determine which is true, the given statement or its negation.
∀𝑥 𝑖𝑛 𝐷, ∃ 𝑦 𝑖𝑛 𝐸 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑥 + 𝑦 = 0.
a. ∃ 𝑥 𝑖𝑛 𝐷, ∀ 𝑦 𝑖𝑛 𝐸 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑥 + 𝑦 ≠ 0. Original statement is True.
b. ∃ 𝑥 𝑖𝑛 𝐷, ∀ 𝑦 𝑖𝑛 𝐸 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑥 + 𝑦 = 0. Negation statement is True.
c. ∀𝑥 𝑖𝑛 𝐷, ∃ 𝑦 𝑖𝑛 𝐸 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑥 + 𝑦 ≠ 0. Original statement is True.
d. ∀𝑦 𝑖𝑛 𝐸, ∃ 𝑥 𝑖𝑛 𝐷 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑥 + 𝑦 = 0. Negation statement is True.
(27) Indicate whether each of the below arguments is valid or invalid.
A B C D
No good car is cheap. No good car is cheap. No good car is cheap. No good car is cheap.
A Rimbaud is a good car. A Simbaru is not cheap. A VX Roadster is cheap. An Omnex is not a good car.
∴ A Rimbaud is not cheap. ∴ A Simbaru is a good car. ∴ A VX Roadster is not good. ∴ An Omnex is cheap.
a. A, B b. B c. B, D d. A, C
4/8
(28) In the following a single conclusion follows when all the given premises are taken into
consideration. Reorder the premises to make it clear that a conclusion follows logically.
a. 3 – 2 – 4 – 1 b. 2 – 4 – 1 – 3 c. 4 – 1 – 2 – 3 d. 2 – 3 – 1 – 4
(29) (cont.) For same argument as Q28, state the valid conclusion that can be drawn.
a. if a bird lives on honey, then it is not in this cage.
b. if a bird is in this cage, then it lives on honey.
c. if a bird is not in this cage, then it lives on honey.
d. if a bird is in this cage, then it does not live on honey.
(30) Consider the below graph, find all vertices that are adjacent to 𝑣3 .
a. 𝑒6 , 𝑒7 b. 𝑣1 , 𝑣2 c. 𝑣1 , 𝑣2 , 𝑣4 d. 𝑒2 , 𝑒6 , 𝑒7
a. {𝑣0 , 𝑣1 }, {𝑣3 , 𝑣4 }
b. {𝑣1 , 𝑣2 }, {𝑣7 , 𝑣8 }
c. {𝑣1 , 𝑣2 }, {𝑣3 , 𝑣4 }, {𝑣7 , 𝑣8 }
d. {𝑣0 , 𝑣1 }, {𝑣3 , 𝑣7 }, {𝑣5 , 𝑣6 }
5/8
(34) Is it possible to take a walk around the city whose map is shown below, starting and
ending at the same point and crossing each bridge exactly once? If so, how can this be done?
(an edge is identified by its two land points).
a. No.
b. Yes. B-A, A-C, C-D, D-A, A-E, E-D, D-B
c. Yes. C-A, A-B, B-D, D-C
d. a and c are correct
(35) The below is a floor plan of a house. Is it possible to enter the house in room A, travel
through every interior doorway of the house exactly once, and exit out of room E? If so, how
can this be done? Hint: Each room can be represented by a node in a graph, and each
doorway is represented by an edge that connects two rooms.
6/8
(37) What is the adjacency matrix for the 𝐾2,3, the complete bipartite graph on (2, 3) vertices?
00111 11000 01010 00000
00111 11000 10101 00000
a. 1 1 0 0 0 b. 0 0 1 1 1 c. 0 1 0 1 0 d. 1 1 1 1 1
11000 00111 10101 11111
[1 1 0 0 0] [0 0 1 1 1] [0 1 0 1 0] [1 1 1 1 1]
(38) The below is an adjacency matrix for a graph. Answer the following by examining the
matrix and its powers only, not by drawing the graph:
(39) (cont.) How many paths of length 2 are there from v3 to v4?
a. 3 b. 2 c. 6 d. 1
(40) The below 𝐺 and 𝐺′ are isomorphic. Give a function 𝑔: 𝑉(𝐺) → 𝑉 (𝐺′) that defines the
isomorphism.
7/8
Find all leaves (or terminal vertices).
a. 𝑣1, 𝑣7 b. 𝑣1, 𝑣4, 𝑣7 c. 𝑣1, 𝑣5, 𝑣7 d. 𝑣3, 𝑣6, 𝑣7
(43) (cont.) Find all internal (or branch) vertices in Q42.
a. 𝑣1, 𝑣4, 𝑣7 b. 𝑣2, 𝑣3, 𝑣4, 𝑣6 c. 𝑣2, 𝑣3, 𝑣6 d. 𝑣3, 𝑣4, 𝑣6
(44) Consider the below tree with root 𝑎.
a. 𝑎 ∙ 𝑏 − 𝑐/ 𝑑 + 𝑒
b. 𝑑 + 𝑒/𝑐 − 𝑎 ∙ 𝑏
c. (𝑑 + 𝑒)/𝑐 − 𝑎 ∙ 𝑏
d. (𝑎 ∙ 𝑏) − (𝑐/ (𝑑 + 𝑒))
(49) How many edges does a full binary tree with 1000 internal vertices have?
a. 1998 b. 1999 c. 999 d. 2000
(50) What can you deduce about the height of a binary tree if it has 25 leaves.
8/8
9/8