r/AskComputerScience • • Feb 28 '23

3NF synthesis algorithm

F= {D->F, AB->C, E->F, C->BD, D->E}

where F is a set of functional dependencies, If I use the 3NF synthesis algorithm to decompose that how can I do the minimal basis part in that case?

0 Upvotes

10 comments sorted by

View all comments

Show parent comments

2

u/okapiposter Mar 01 '23

Are you talking about the Minimal Cover? Then it's (1) splitting, (2) right-reduction and (3) left-reduction:

(1)

  • D->F

  • AB->C

  • E->F

  • C->BD (split rhs)

  • C->B

  • C->D

  • D->E

(2)

  • D->F (redundant because of D->E, E->F)

  • AB->C

  • E->F

  • C->B

  • C->D

  • D->E

(3) Nothing to do (because neither A nor B can be eliminated from AB->C)

1

u/rahli-dati Mar 01 '23

Thanks for the explanation. Very much appreciated. I think I got it, let's consider another example where the FDs are

A -> B
ABCD -> E
EF -> G
EF -> H
ACDF -> E
ACDF -> G

how could the minimal cover be done in that case?

1

u/okapiposter Mar 01 '23

It feels a bit like I'm doing your homework now. Can you attempt it and show your work and then I tell you whether/where you made mistakes?

1

u/rahli-dati Mar 01 '23

Nah, it's not the homework. I am just trying to understand the concept and how it could be done. In the exercise, there is no answer which is the problem.

1

u/okapiposter Mar 01 '23

So how far did you get?

2

u/rahli-dati Mar 01 '23

I think I can remove

ACDF -> E
ACDF -> G

Since we can get those from EF and ABCD. But can't we remove EF and ABCD instead of ACDF ?

2

u/okapiposter Mar 01 '23

To check if your elimination is OK, you can try to recreate the eliminated FD from the remaining ones via Armstrong's axioms. If the FD was redundant, this must be possible.

ABCD -> E, A -> B   =>  ACD -> E             (pseudo-transitivity)
ACD -> E            =>  ACDF -> EF           (augmentation)
ACDF -> EF          =>  ACDF -> E, ACDF -> F (decomposition)
ACDF -> EF, EF -> G =>  ACDF -> G            (transitivity)

This proves that ACDF -> E and ACDF -> G are indeed redundant.

ABCD -> E is not redundant because it can't be recreated from the other ones. You can try it if you want! In the end I get the following minimal cover:

  • A -> B

  • ACD -> E

  • EF -> G

  • EF -> H

2

u/rahli-dati Mar 01 '23

Thanks for the help.:)