Home > Mobile >  definition of functional dependency, ambigiuous "for all pairs"
definition of functional dependency, ambigiuous "for all pairs"

Time:10-17

for all pairs of tuples t1 and t2 such that
t1[A] = t2[A] then t1[B] = t2[B]

Can "a pair" also be a pair of the same tuple, meaning t1 = t2, or does it mean only two distinct tuples?

CodePudding user response:

It means 2 times finding a value for a name: finding a value to call by "t1" & finding a value to call by "t2".

So for each name you might or might not find a value; so you might get zero, one or both names naming values; and if both, the names might or might not end up with the same value; and if they do, you might or might not have got the value from the same tuple-valued element of the set that is the relation body.

From my answer at Determining if this data is really in 4th normal form? re MVDs (mulitvalued dependencies):

"There exist" says some values exist, and they don't have to be different. EXISTS followed by some name(s) says that there exist(s) some value(s) referred to by the name(s), for which a condition holds. Multiple names can refer to the same value. (FOR ALL can be expressed in terms of EXISTS.)

When such statements are given formally we say, "for all X" (universal quantification) or "there exists X" (existential quantification) where "X" is a name and we mean that "for all values" or "there exists a value" that you could use that name for in what follows. This is basic logic as used in mathematics, science and engineering.

They say "for all pairs of tuples", but they mean for all sequences that are a tuple-valued value followed by a tuple-valued value. "The first value" and "the second value" might be equal, ie be "the same value" even though there are two "values". The natural language is not clear, you have to learn what certain phrasings mean.

A free resource https://www.fecundity.com/logic/ :

forall x is an Open Education Resource (OER) introductory textbook in formal logic. It covers translation, proofs, and formal semantics for sentential and predicate logic.

A variant at https://open.umn.edu/opentextbooks/textbooks/1139 is forall x: Calgary.

CodePudding user response:

I think this gives a good explanation: https://www.geeksforgeeks.org/types-of-functional-dependencies-in-dbms/ I personally understand it as a given set of attributes A can uniquely determine a given set of attributes B. But t1 does not have to equal t2. t1 and t2 can have additional attributes like C which can be completely different. But indeed, if every tuple has unique A and unique B, then the functional dependency also holds.

  • Related