# Homework Assignment #2

#### (Due for off-campus by 3:00 pm EDT Tuesday 18 October 2005)

There are five questions for 90 total points plus 10 extra credit. All are based on lectures 4-7, and thus on Chapter 3 of the Adler notes.

Edits in green are from Sunday 2 October.

Edits in orange are from Wednesday 5 October.

Edits in purple are from Saturday 8 October.

Students are responsible for understanding and following the academic honesty policies indicated on the course main page.

• Problem 2.1 (10): Give an example of a subset system (E,I) that is not a matroid and has as few elements as possible. That is, prove that any subset system whose E has fewer elements than yours does is a matroid. Also, give an example of a non-negative weight function for your subset system where the greedy algorithm does not find a maximum element of I.

• Problem 2.2 (15): Let (E,I) and (E,J) be two matroids with the same set of elements. Prove that the subset system (E, I∪J) need not be a matroid by giving an example of E, I and J where it is not. Let K be the set {X: ∃Y:∃Z: (Y∈I) ∧ (Z∈J) ∧ (X = Y∪Z)}. Prove that (E,K) is a matroid. (Note that it's not obvious how to test quickly whether X is in K if you only have black-box tests for membership in I and J.)

• Problem 2.3 (40+10): Let G = (V,E) be an undirected graph and let r be a fixed element of V. We define a subset-system-like-entity (E,I) where I is the set {X: X is a connected acyclic set of edges and either X = ∅ or r is a vertex of some edge in X}. (As originally stated, I asserted that (E,I) is a subset system -- I am no longer asserting that. I is a family of subsets of E.)

• (a,10) Prove that (E,I) satisfies the Exchange Property.
• (b,10) Describe the generic greedy algorithm to find a maximal element of I, given a weight assignment to E. Give an example where G is connected but this algorithm fails to produce an MST. How can this be, given part (a)?
• (c,10) A greedoid is a set E and family I of subsets of E that satisfies the Exchange Property and also has the property that if X is a nonempty set in I, then there exists an element b of X such that X - {b} is in I. (Note that a greedoid need not be a subset system.) Prove that the (E,I) defined in the introduction to this problem is a greedoid. (With the correct definition (E,I) is a greedoid without need for further modification.)
• (d,10) The Prim algorithm, to find a minimum spanning tree in a weighted graph, can be adapted to any greedoid. Describe an algorithm based on Prim's that will find a maximal element in any greedoid for any non-negative weight function. Prove that your algorithm does so.
• (e, 10 extra credit) Give an example of a greedoid (E,I) and a weight function such that the greedy algorithm from (d) does not produce a maximum element of I. Prove that your (E,I) is a greedoid. (I have an example where E has four elements.)
• Problem 2.4 (10): Given an n by n chessboard, the n rooks problem is to find a set of n squares of the board so that no two squares are in the same row or in the same column. (So if the chosen squares are occupied by rooks, none of the rooks attacks another rook.) Describe a subset system whose maximum independent sets are solutions to the n rooks problem. Is this subset a matroid? (Prove your answer.) If not, is it the intersection of two matroids?

• Problem 2.5 (15): Look up the definition of a deterministic finite automaton (DFA) if you're not already familiar with it. Suppose we are given two DFA's M1 = (Q1,s1,F11) and M2 = (Q2,s2,F22), each with the same input alphabet Σ, and we want to know whether they accept the same language. We do this by forming an equivalence relation on Q1 ∪ Q2, where for any word w the states δ1*(s1,w) and δ2*(s2,w) must be equivalent. Describe an algorithm to test equivalence using a queue for the pairs of states and a union-find data structure to maintain the equivalence relation. Once the relation is computed, how can we use it to determine whether the languages are equivalent?