CMPSCI 250: Introduction to Computation

Solutions to Second Midterm Exam Spring 2018

David Mix Barrington

Exam given 3 April 2018

Solutions posted 22 April 2018

Directions:

Exam text is in black, solutions in blue.

  Q1: 20 points
  Q2: 20+10 points
  Q3: 30 points
  Q4: 30 points
Total: 100+10 points

Here are definitions of some terms, sets, predicates, and statements used on this exam.

Remember that a natural is a non-negative integer, so that the set N or all naturals is {0, 1, 2, 3,...}.

For every natural n, we define a directed graph Gn as follows. G0 has a single node with no edges, and we will call that one node its root. For any natural n, Gn+1 consists of two copies of Gn, one new node which is the root of Gn+1, and three new edges -- one from the new root to the root of each of the Gn's, and one from one of the Gn roots to the other.


Directed graphs G_0, G_1, G_2, G_3.  "V" and ">" are arrowheads.


G_0   a     G_1     a      G_2          a
                   / \                 / \
                  V   V               V   V
                 b --> c             b --> c 
                                    / \   / \
                                   V   V V   V 
                                  d -> e f -> g

G_3                a
                  / \
                 /   \
                /     \
               /       \
              V         V
             b --------> c
            / \         / \
           V   V       V   V
          d --> e     f --> g
         / \   / \   / \   / \
        V   V V   V V   V V   V
       h -> i j ->k l-> m n -> o

The labeled undirected graph OC represents an imagined orienteering course, with seventeen nodes and 25 edges. Each edge is labeled "run", "walk", or "fight", indicating that it takes two, four, or six minutes respectively for an ordinary human competitor to traverse the edge.


Map of orienteering course -- edges are run (r), walk (w), or fight
(f). Normal human competitors take 2 minutes to run, 4 to walk, 
6 to fight.  The Hulk takes 1 minute to traverse any edge.
 


        
          (a)--r--(d)--w--(i)--f--(l)--w--(o)
        /            \             |       |
      r                f           f       w
     /                   \         |       |
  (s)--w--(b)--w--(e)--f--(j)--w--(m)--w--(g)
     \                   / |     /         |
       r               f   f   f           r
         \           /     | /             |
          (c)--f--(f)--f--(k)--r--(n)--f--(p)
             \     |     /
               w   w   w
                 \ | /
                  (h)

Last modified 22 April 2018