3179fb7a80dcb5a10c5c85cf2b9ab585 MIT6 042JF10 Mid Practice
3179fb7a80dcb5a10c5c85cf2b9ab585 MIT6 042JF10 Mid Practice
Name:
� This quiz is closed book, but you may have one 8.5 × 11” sheet with notes in your
own handwriting on both sides.
� Please show your work. Partial credit cannot be given for a wrong answer if your work
isn’t shown.
� Write your solutions in the space provided. If you need more space, write on the back
of the sheet containing the problem. Please keep your entire answer to a problem on
that problem’s page.
� Be neat and write legibly. You will be graded not only on the correctness of your
answers, but also on the clarity with which you express them.
� If you get stuck on a problem, move on to others. The problems are not arranged in
order of difficulty.
Midterm Practice Problems 2
Problem 1. [10 points] In problem set 1 you showed that the nand operator by itself can be
used to write equivalent expressions for all other Boolean logical operators. We call such an
operator universal. Another universal operator is nor, defined such that P norQ ⇔ ¬(P ∨Q).
Show how to express P ∧ Q in terms of: nor, P , Q, and grouping parentheses.
Problem 3. [20 points] The Slipped Disc Puzzle� consists of a track holding 9 circular
tiles. In the middle is a disc that can slide left and right and rotate 180 ◦ to change the
positions of exactly four tiles. As shown below, there are three ways to manipulate the
puzzle:
Shift Right: The center disc is moved one unit to the right (if there is space)
Rotate Disc: The four tiles in the center disc are reversed
Shift Left: The center disc is moved one unit to the left (if there is space)
1 2 3 4 5 6 7 8 9
t
ft righ
shi
rotate disc
1 2 3 4 5 6 7 8 9 1 2 6 5 4 3 7 8 9
shi
ft le
ft
1 2 3 4 5 6 7 8 9
Prove that if the puzzle starts in an initial state with all but tiles 1 and 2 in their natural
order, then it is impossible to reach a goal state where all the tiles are in their natural order.
The initial and goal states are shown below:
2 1 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
Problem 4. [10 points] Find the multiplicative inverse of 17 modulo 72 in the range
{0, 1, . . . , 71}.
Midterm Practice Problems 6
Problem 5. [15 points] Consider a graph representing the main campus buildings at MIT.
7 10 8
5 3 4 6
1 2
(a) [3 pts] Is this graph bipartite? Provide a brief argument for your answer.
(b) [4 pts] Does this graph have an Euler circuit? Provide a brief argument for your answer.
Midterm Practice Problems 7
Problem 5 continued...
Now suppose each building has separate mail collection and drop-off boxes and each collection
box has a single package destined for a unique drop-off box (i.e. a permutation). We can
model this as a permutation routing problem by treating the buildings as switches, attaching
an input and output terminal to each of the nine buildings, and treating the existing edges
as bidirectional as in the graph below:
(d) [4 pts] What is the max congestion of this graph? That is, in the worst case permutation,
how many packages would need to pass through a single building? Provide a brief argument
for your answer.
Midterm Practice Problems 8
1. transitive
2. symmetric
3. antisymmetric
4. reflexive
Midterm Practice Problems 9
Problem 7. [20 points] An outerplanar graph is an undirected graph for which the vertices
can be placed on a circle in such a way that no edges (drawn as straight lines) cross each
other. For example, the complete graph on 4 vertices, K4 , is not outerplanar but any proper
subgraph of K4 with strictly fewer edges is outerplanar. Some examples are provided below:
Prove that any outerplanar graph is 3-colorable. A fact you may use without proof is that
any outerplanar graph has a vertex of degree at most 2.
Midterm Practice Problems 10
Problem 8. [10 points] Give upper and lower bounds for the following expression which
differ by at most 1.
n
� 1
i=1
i3
Problem 9. [15 points] Circle every symbol on the left that could correctly appear in the
box to its right. For each of the six parts you may need to circle any number of symbols.
6n2 + 7n − 10
� 2�
(a) O Ω Θ o ω ∼ = n
6n
� 6�
(b) O Ω Θ o ω ∼ = n
(c) O Ω Θ o ω ∼ n! = (nn )
n
� 1
(d) O Ω Θ o ω ∼ = (ln n)
j=1
j
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.