Question 1

Part (a)

Part (b)

Graphs with 3 vertices and 6 vertices cannot be self-complementary. Because only graphs with nodes where or . Why? Because a self-complementary graph must have edges. So if both and were not divisible by , and do not have the same number of edges to begin with.

This means we only have to think about and .

For we have:

For we have:

Question 2

So here’s the idea: there are choices of edges to remove in the blue box, and 3 choices of edges to remove in the green triangle to make it a tree. So there are exactly spanning trees.

Question 3

Let’s do the first 3 first:

Now has two choices:

tree-size-4

Part (b)

has way. has way. For , there are choices of what label to put for the center node. for , in the straight line path, there are permutations, but we cannot distinguish among the inner vertices, and we cannot distinguish among the outer vertices. E.g. a-b-c-d is the same as d-c-b-a. So . But we also have the other case to deal with. In that case, we have choices for what is the center node. So choices in total.

Question 4

  1. Assume that is connected. Thus, this means that all nodes have a path to each other.
  2. This means that has a has a sub-graph that is also a spanning tree.
  3. Now has nodes, and therefore it has edges. Call the set of these edges as .
  4. Now . Therefore .

On the other hand just because we have more than edges does not mean we have a connected graph. For example:

Question 6

  1. Let be a tree.

  2. Since is a tree, it is connected. Thus there is a path between any pair of vertices.

  3. Assume of the sake of contradiction that exists such that there are at least two distinct paths between and .

    1. Then contains a cycle.
    2. But is a tree so it has no cycles.
  4. Contradiction. Therefore there is only exactly 1 path between all vertices and .

  5. Let be a graph such that between any two pairs of vertices and , there exists a unique path between them.

  6. Thus is connected. Therefore it suffices to show that is cycle-free.

  7. Assume for the sake of contradiction that is not cycle-free.

    1. Then let be vertices in the cycle.
    2. Then there are 2 distinct paths from .
    3. This contradicts line 1.
  8. Therefore is cycle-free.

  9. Thus, is a tree.

Question 7

Here’s the idea, it doesn’t actually matter how we split them into piles, between some pair of stones , you’ll earn the dollar for it when it’s been separated into different piles. So the game ends when each stone is in its own pile. So really, we’re just counting how many different pairings there are. Which is? .

Question 8

Here’s the idea:

In the pre-order it tells us what we node we see first (which belongs as the root). And if we look for the corresponding in-order, it actually tells us what nodes are to our left of the root.

So here’s the algorithm, take the first element of the pre-order. Make that the root of our tree. Then, we split the in-order list into a pair of lists, based on what is to the left of the current node, and what is to the right of the current node. From there, we also create another pair of lists from the pre-order lists, based on what is in the left list and the right list in the in-order. Then by wishful thinking, we can create our left and right trees.

The part b answer works the same except for the fact that in post-order, you need to find the current node from the end of the list.

So we get this tree:

post-order-result