Search code examples
databasefunctional-dependencies

number of functional dependencies


Find the number of functional dependencies in a relation having n attributes?

On first thought , I figure out that left hand side can have N+1 possibilities(null can also be there.) and similarly N+1 possibility for right hand side.
Hence total no of FD should be
(n+1)*(n+1) - 1

But ans given is 2^(n+1) .

On analyzing the answer , We can see they are not including trivital ones like ABC -> A etc .

So what should be the correct ans ???


Solution

  • I think 2^n *2 is the answer because it includes all basic minimal FD’s and the rest can be derived from axioms or are trivial. A -> BC will have A -> B, A -> C, etc. ABC -> A, etc. are trivial.

    Although it’s not clear from question whether to include all trivial cases. In that case the answer will be 2^n * 2^n. Because we can have 2^n choices for both LHS and RHS .