0% found this document useful (0 votes)
65 views11 pages

DMFinal Fall 2017

This document contains a 50 question discrete mathematics final exam with multiple choice questions covering topics such as logic, sets, functions, proofs, number theory, matrices, sequences, counting, probability, and graph theory. The exam tests understanding of concepts like logical equivalences, translating English statements to logical expressions, properties of graphs like Euler circuits, and analyzing runtimes of algorithms using techniques like the master theorem.

Uploaded by

name
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)
65 views11 pages

DMFinal Fall 2017

This document contains a 50 question discrete mathematics final exam with multiple choice questions covering topics such as logic, sets, functions, proofs, number theory, matrices, sequences, counting, probability, and graph theory. The exam tests understanding of concepts like logical equivalences, translating English statements to logical expressions, properties of graphs like Euler circuits, and analyzing runtimes of algorithms using techniques like the master theorem.

Uploaded by

name
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/ 11

Discrete Mathematics Final Exam, Fall 2017

Name: _____________________________

NetID: _____________________________

1. “If it is raining then the sky is gray.” Which one of the following options is the inverse of this
statement?
*a. If it is not raining then the sky is not gray.
b. If the sky is gray then it is raining.
c. If the sky is not gray then it is not raining.
d. Converse is not possible.

2. How can the following English sentence be translated into a logical expression?
“It is not the case that if it is raining then John is sultry.”
Let p = It is raining and s = John is sultry.
a. p → ¬s
b. ¬p → ¬s
*c. ¬(p → s)
d. ¬p → s

3. How can the following English sentence be translated into a logical expression?
“Mary is sick; and it is raining implies that Bob stayed up late last night.”
Let p = It is raining
q = Mary is sick
t = Bob stayed up late last night
a. ((q ∧ p) → ¬t)
*b. (q ∧ (p → t))
c. ((q ∧ p) → t)
d. (q → t)

4. Consider the following statement: “If something is a mirror, it is shiny.”


What is the converse of that statement?
a. “If something is not shiny, then it is not a mirror.”
b. "If something is not a mirror, it is not shiny."
*c. "If something is shiny, it is a mirror."
d. "If something is not a shiny mirror, it is nothing."

5. The statement “(p ∧ q) ∧ (¬p ∨ ¬q)” is a ________?


a. tautology
*b. contradiction
c. converse
d. inverse

6. Which statement best captures in logic the English sentence, "No person is special to
everyone"?
a. ¬∀x∃y(S(x, y))
b. ¬∀x∀y(S(x, y))
*c. ¬∃x∀y(S(x, y))
d. ∃x∀y(S(x, y))

7. Which statement best captures in logic the English sentence, "Somewhere, somebody done
everyone wrong?"
a. ∀x∃y(W(x, y))
b. ∃x∀y(W(x, y))
c. ∀x∀y∀z(W(x, y, z))
*d. ∃x∃y∀z(W(x, y, z))

8. Which of the following is a tautology?


a. (q ∧ (p → q)) → p
b. (q ∧ (p → q)) → ¬p
*c. (¬q ∧ (p → q)) → ¬p
d. (¬q ∧ (¬p → q)) → ¬p

9. Which of the following is a tautology?


*a. ((p ∧ q) ∧ (¬p ∧ r)) → (q ∨ r)
b. ((p ∨ q) ∨ (¬p ∨ r)) → (q ∨ r)
c. ((p ∨ q) ∨ (p ∨ r)) → (q ∨ r)
d. None of the above

10. Which of the following is a logical equivalence?


a. (p → q) ≡ p ∧ ¬q
*b. ¬(p → q) ≡ p ∧ ¬q
c. ¬(p → q) ≡ p ∧ q
d. None of the above

11. How many strongly connected components does the directed graph specified by the
following adjacency matrix have?
Adj. Matrix: a -> (b), b -> (d), c -> (b), d -> (c), e -> (a, f), f -> (d, g), g -> (e), h -> (e, g)
*a. 4
b. 1
c. 2
d. 3
12.​ ​Below is ​part​ of an undirected graph. Even though you can only see some of the vertices
and edges, can you deduce whether the graph will have an Euler path or circuit?
Adj. Matrix: a -> (b, c, e), b -> (a, f), c -> (a, h, g), e -> (a, i)
a. It will have both an Euler path and an Euler circuit, as it is a tree.
*b. It will not have an Euler circuit since it has at least one vertex of odd degree, but it might
have an Euler path.
c. It will not have an Euler path or an Euler circuit, since it has too many vertices with odd
degree.
d. It will have both an Euler path but not an Euler circuit, since it has three vertices with odd
degree.

13. What is the postfix form for the following expression (x - y) * a + (z - 7) / 4?


a. x - y a * z 7 - 4 / +
*b. x y - a * z 7 - 4 / +
c. x y - a * z 7 - 4 + /
d. x y - a z * 7 - 4 / +

14. What is the postfix form for the following expression (((4x + y) - 17 * (x - z)) + 7)?
*a. 4x y + 17 x z - * - 7 +
b. y 4x + 17 x z - * - 7 +
c. 4x y 17 + x z - * - 7 +
d. 4x y + 17 x z - * 7 +

15. What is the value of the postfix expression 8 3 * 3 / 8 + 8 - ?


*a. 8
b. 20
c. 12
d. 9

16. If we have a full binary tree with all leaves at the same level, with five levels (including the
root), how many edges does it have?
a. 14
b. 10
*c. 30
d. 32

17. If we have a binary tree with 10 levels (including the root), what is the least number of
leaves we can have in level 10?
*a. 1
b. 20
c. 1024
d. 2048
18. Which of the following is a valid prefix coding scheme?
*a. a = 01, b = 00, c = 10, d = 110, e = 111
b. a = 001, b = 000, c = 110, d = 01, e = 11
c. a = 001, b = 000, c = 101, d = 00, e = 11
d. a = 111, b = 000, c = 101, d = 01, e = 11

19. Consider the following Huffman code: a = 01, b = 00, c = 101, d = 110, e = 1111, f = 1110.
What alphabetical string do the digits 110111111101010100 represent?
a. bacfed
b. decbaf
*c. defcab
d. fedabc

20. A simple graph may...


a. not contain a loop
b. not have multiple edges between nodes
c. have at most a single edge between nodes
*d. all of the above

21. A complete graph with 7 vertices will have ___ edges?


a. 15
*b. 21
c. 42
d. 49

22. The neighborhood of a vertex is?


a. All of the edges connected to it.
b. All of the vertices reachable from it by an Eulerian walk.
c. Any node reachable in fewer than four or five edges.
*d. All of the vertices joined to it by an edge.

23. If my code represents a graph by {a: (b, c, d), b: (a, c), c: (a, b, d), d: (a, c), f: ()} then I am
using a ______ to represent it?
a. adjacency matrix
b. incidence matrix
*c. adjacency list
d. adjacency incident

24. Is C6 a bipartite graph?


*a. Yes
b. No
c. It depends on how it is drawn.
d. Indeterminate

25. Consider the following adjacency matrix:


a b c d e f g
a 0 0 1 0 1 0 1
b 0 0 0 0 0 1 0
c 1 0 0 0 0 1 1
d 0 0 0 0 1 0 0
e 1 0 0 1 1 0 1
f 0 1 1 0 0 0 0
g 1 0 1 0 1 0 0
In the graph so described, there is a loop at vertex ___?
a. a
b. b
*c. e
d. f

26. In the above adjacency matrix, there is an edge from?


a. a to b
b. a to d
*c. e to g
d. f to g

27. The difference between a path and a circuit is that ____.


a. a circuit contains more nodes than a path
*b. a circuit starts and ends at the same vertex, while a path need not
c. a path moves along edges, while a circuit jumps from node to node
d. a circuit applies to electronics, while paths are used for geographical graphs

28. Consider the following incidence matrix:


e1 e2 e3 e4 e5 e6
v1 0 0 1 0 1 0
v2 0 1 0 0 0 1
v3 1 0 0 0 0 0
v4 0 0 0 1 1 0
v5 0 0 0 1 0 0
v6 1 1 1 0 0 1
Is this a simple graph?
a. Yes
*b. No

29. In the above incidence matrix, the degree of v4 is?


a. 3
b. 6
c. 1
*d. 2

30. For there to be an Eulerian path but not an Eulerian circuit through a graph, there must be
_____.
a. an even number of nodes of odd degree
b. 0 or 2 nodes of odd degree
c. 0 or 2 nodes of even degree
*d. exactly two nodes of odd degree

31. Consider the graph with following adjacency matrix:


a b c d e
a 0 1 1 0 0
b 1 0 0 1 1
c 1 0 0 1 1
d 0 1 1 0 0
e 0 1 1 0 0
Which of the following is an Eulerian path through that graph?
*a. b-a-c-d-b-e-c
b. a-c-d-e-b-c-a
c. a-c-e-d-b-c-b
d. none of the above

32. Consider the ​directed​ graph described by the adjacency list {a -> (b, c, d), b -> (e), c -> (b),
d -> (f) e: (c), f -> (g), g -> (d)}. What are the ​strongly​ connected components of that graph?
a. a-b-c-e and d-f-g
b. a-b-c, e, and d-f-g
*c. a, b-c-e and d-f-g
d. the whole graph is strongly connected

33. If we remove a cut vertex from a graph, we get?


a. a directed graph
b. a multigraph
c. an Eulerian circuit
*d. more connected components

34. An graph is called a ________ if there is not a path between every pair of distinct vertices in
the graph.
a. connected graph
b. distinct graph
*c. disconnected graph
d. cut graph
35. In year one you save $200. Every year thereafter you save $200 more and also you receive
4% interest on what you already had in the bank.
What is the recurrence relation giving your savings after n years?
a. T(1) = 200; T(n) = 1.04 * T(n - 1)
*b. T(1) = 200; T(n) = 200 + 1.04 * T(n - 1)
c. T(1) = 200; T(n) = 200 + T(n - 1)
d. T(1) = 200; T(n) = 200 + 1.04 * T(n)

36. What is the big O of the following equation? T(n) = 16T(n / 16) + n
a. O(16n)
*b. O(n log n)
c. O(n)
d. O(n​2​)

37. What is the big O of the following equation? T(n) = 6T(n / 2) + n​2
a. O(n log n)
b. O(n)
c. O(n​2​)
*d. O(n​2.58​)

38. Let f(x) = f(x - 1) + 4, for all integers x > 4, and let f(4) = 2. What is f(10)?
a. 14
b. 18
c. 22
*d. 26

39. Use the master theorem to give the runtime for the recurrence T(n) = 12T(n) + 16n − 1
a. O(6n)
b. O(n)
c. O(n log n)
*d. The master theorem can't be applied.

40. Consider the graph described by the adjacency list {a: (b, c, d), b: (a, c), c: (a, b, d, e), d: (a,
c, e, f), e: (c, d), f: (d)}. Does it contain an Eulerian path?
*a. Yes
b. No
c. Not enough information

41. Consider the graph from Q-40. Does it contain an Eulerian circuit?
a. Yes
*b. No
c. Not enough information
d. All of the above

42. What is the runtime complexity of T(n) = 12T(n/12) + 64n − 1 using the master theorem?
*a. O(n log n)
b. O(6n)
c. O(n)
d. The master theorem doesn't apply.

43. Let f(n) = 4 * f(n − 1) − 3 * f(n − 3) .


Find f(6) if f(0) = 0, f(1) = 2, and f(2) = 4.
a. 220
*b. 832
c. 468
d. 398

44. What are the worst-case and average-case complexities of searching in a binary search
tree?
a. O(n​2​), O(n)
b. O(n lg n), O(n)
*c. O(n), O(lg n)
d. O(n​2​ lg n), O(n lg n)

45. If there are 10 children in a family, on how many days of the week were at least 3 children
born?
a. at least 1
*b. maybe none
c. 2
d. at least 2

46. In the English alphabet using (and differentiating) both uppercase and lowercase letters,
how many different two-letter usernames can people have, if they can repeat letters?
a. 15,600
b. 2652
c. 52
*d. 2704

47. You have a dozen eggs in your refrigerator, and one of them is rotten. If you reach in and
pull out one at random, what is the probability that you have the rotten egg?
a. .3
b. .25
c. .125
*d .0833
48. How many possibilities are there for the rst, second, and third positions in a car race with 8
cars if all orders of nish are possible?
a. 212
b. 240
c. 512
*d. 336

49. There are 3 available flights from New York to London and, regardless of which of these
flights is taken, there are 2 available flights from London to Paris, and then 4 flights from Paris to
Istanbul. In how many ways can a person fly from New York to London to Paris to Istanbul?
a. 8
b. 16
*c. 24
d. 32

50. If I tell you that C(15, 2) = 105, and C(15, 3) = 455 (where C means "choose"), then C(16, 3)
is?
a. 4.333
b. 47,775
c. 350
*d. 560

51. I give you part of a row of Pascal's triangle: 1, 13, 78, 286, 715... The start of the next row
is?
a. 14, 91, 364, 1001...
b. 1, 13, 14, 78, 91, 364, 715
*c. 1, 14, 91, 364, 1001....
d. none of the above

52. The formula for "choose" is n! / (k! * (n - k)!). The k! exists in the denominator to account for
the fact that ______________.
*a. order in combinations doesn't matter
b. we only chose a few items out of n possibilities
c. k is the probability of getting n choices
d. none of the above

53. If a menu at a banquet dinner has five possibilities for an appetizer, two for an entree, and
five for dessert, how many possible meals are there?
a. 12
*b. 50
c. 72
d. 144
54. What is the complexity of the program given below ? where o, p >= 1.

int x=0;
for (int i = 1; i <=p; i += c) {
x = x * 3;
for (int i = 1; i <= o; i = i * 2) {
x = x + 2;
}
}
a. O(o * p)
b. O(p)
*c. O(p log o)
d. O(o + p)

55. Consider following code snippet:


for (int i = 0; i < n ; i++) {
for(int j = 0; j < n; j++) {
printf(“Yes!”);
}
}
This code's runtime complexity is:
*a. O(n​2​)
b. O(n)
c. O(n log n)
d. none of the above

56. If f(x) = 1/x and g(x) = log x, out of the following possible functions, which one is both the
upper bound for f(x) and the lower bound for g(x)?
a. h(x) = x
b. h(x) = x​2
c. h(x) = x​1/2
*d. h(x) = 1

57. If f(x) = 64, then f(x) is (​not restricting​ ourselves to the tightest bound):
a. O(1)
b. O(log x)
c. O(x​5​)
*d. all of the above

58. If f(x) = 64, then f(x) is (​restricting​ ourselves to the tightest bound):
*a. O(1)
b. O(log x)
c. O(x​5​)
d. all of the above
59. If set A = {all integers} and set B = {all odd integers}, then the complement of B is:
a. all odd integers
*b. all even integers
c. all composite integers
d. all integers that are multiples of 3

60. What is the powerset of {2, 4, 6}?


a. {​∅​, {2}, {4}, {6}, {2, 4, 6}}
b. {​∅​, {2}, {4}, {6}}
c. {​∅​, {2, 4, 6}}
*d. {​∅​, {2}, {4}, {6}, {2, 4}, {2, 6}, {4, 6}, {2, 4, 6}}

You might also like