CS457 Syllabus & Progress

### Equivalence of 2 sets of functional dependencies

• Equivalence of 2 sets of functional dependencies

• Definition: equivalence of sets of functional dependencies

• Two sets of functional dependencies   1   and   2   are equal if:

 ℉1 covers ℉2           and        ℉2 covers ℉1

• Example of equivalent functional dependency set

• Consider the following two sets of functional dependencies:

 ``` Relation R = (A, B, C, D, E, F) ℉1 = { A → C AC → D E → AD E → F } ℉2 = { A → CD E → ADF } ```

Question:

 Are ℉1 and ℉2 equivalent ?

• Does 1 cover 2 ???

Do the check for each functional dependency in 2:

1. A → CD   ∈   ℉2 :

 ``` Compute A+ with respect to ℉1: ℉1 = { A → C AC → D E → AD E → F } A+ = A (Initialization) = AC (A → C) = ACD (AC → D) Done Check: CD ⊆ ACD ?? Yes. Continue (next functional dependency) ```

2. E → ADF   ∈   ℉2 :

 ``` Compute E+ with respect to ℉1: ℉1 = { A → C AC → D E → AD E → F } E+ = E (Initialization) = ADE (E → AD) = ADEF (E → F) = ACDEF (A → C) Done Check: ADF ⊆ ACDEF ?? Yes. Continue (no more functional dependency - DONE) ```

Conclusion:

 ℉1 covers ℉2

• Does 2 cover 1 ???

Do the check for each functional dependency in 1:

1. A → C   ∈   ℉1 :

 ``` Compute A+ with respect to ℉2: ℉2 = { A → CD E → ADF } A+ = A (Initialization) = ACD (A → CD) Done Check: C ⊆ ACD ?? Yes. Continue (next functional dependency) ```

2. AC → D   ∈   ℉1 :

 ``` Compute AC+ with respect to ℉2: ℉2 = { A → CD E → ADF } AC+ = AC (Initialization) = ACD (A → CD) Done Check: D ⊆ ACD ?? Yes. Continue (next functional dependency) ```

3. E → AD   ∈   ℉1 :

 ``` Compute E+ with respect to ℉2: ℉2 = { A → CD E → ADF } E+ = E (Initialization) = EADF (E → ADF) = EADFC (A → CD) Done Check: AD ⊆ EADFC ?? Yes. Continue (next functional dependency) ```

4. E → F   ∈   ℉1 :

 ``` Compute E+ with respect to ℉2: ℉2 = { A → CD E → ADF } E+ = E (Initialization) = EADF (E → ADF) = EADFC (A → CD) Done Check: F ⊆ EADFC ?? Yes. Continue (no next functional dependency - DONE) ```

Conclusion:

 ℉2 covers ℉1

• So these two sets of FDs are equivalent ....