CS 5614 Homework #3

Date Assigned: September 17, 1999
Date Due: September 24, 1999, in class, before class starts
  1. (15 points) We say that a set of attributes X is closed (with respect to a given set of FDs) if the closure of X is X itself. Consider a relation R(A,B,C,D) and an unknown set of FDs. If we are told which sets of attributes are closed, we can do some reverse engineering and figure out what the unknown FDs could be. Determine the unknown FDs for each of the following three cases:

    • All sets of the four attributes are closed. What can you conclude from this case? In other words, can you make a general statement?

    • The only closed sets are {}, and {A,B,C,D}.

    • The closed sets are {}, {A,B}, and {A,B,C,D}.

  2. (5*3=15 points) Consider an E/R diagram that has a four-way relationship Births between the entity sets - Babies, Mothers, Nurses and Doctors. Explain how the E/R diagram needs to be modified for the following situations:

    1. For every baby, there is a unique mother.

    2. For every combination of baby, nurse and doctor, there is a unique mother.

    3. For every combination of a baby and a mother, there is a unique doctor.

    4. Every baby is the result of a unique birth, and every birth is of a unique baby. In addition, every baby has a unique mother. Further, for every birth, there is a unique doctor.

    5. A birth can involve more than one baby born to one mother (example, twins). But every baby still has a unique mother (as in Case 1)

    Your answer will consist of five separate E/R diagrams, one for each of the cases outlined above.

  3. (10 points) Let X and Y be two subsets of attributes. Show that if X is a subset of Y, then the closure of X is a subset of the closure of Y (where the closures are calculated with respect to the same set of FDs).

  4. (10 points) One way to check if a given FD X->Y holds in a schema R is to determine all the FDs that follow for R and then determine if X->Y appears in that list. We did this in class by computing the closure of all subsets of the attributes of the schema. We now know that this is an exponential time algorithm.

    However, there is a neater linear-time algorithm to check if a given FD holds that doesn't involve precomputing closures of all possible subsets. Your task is to present such a linear-time algorithm. Realize that we are not looking for an "argument" or "reasoning", rather a concrete algorithm that can be used mechanically to determine if an FD holds.


Return Home