ArticleslgStudy

mathematics

Functional dependency

Functional dependency is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Functional dependency rather than just read about it. In short: In relational database theory, a functional dependency (FD) is constraint between two attribute sets, whereby values in one set (the determinant set) determine the values of the other set (the dependent set). A functional dependency between a determinant set X and a dependent set Y can be described as follows: Given a relation R and attribute sets X,Y ⊆ {\displaystyle \subseteq } R, then X is said to functionally de…

Key takeaways

  • Functional dependency belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Functional dependency to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Functional dependency from memory before moving on to harder problems.

Reference excerpt

In relational database theory, a functional dependency (FD) is constraint between two attribute sets, whereby values in one set (the determinant set) determine the values of the other set (the dependent set). A functional dependency between a determinant set X and a dependent set Y can be described as follows: Given a relation R and attribute sets X,Y ⊆ {\displaystyle \subseteq } R, then X is said to functionally determine Y (written X → Y) if each X value is associated with precisely one Y value. R is then said to satisfy the functional dependency X → Y. Equivalently, the projection Π X , Y R {\displaystyle \Pi _{X,Y}R} is a function, that is, Y is a function of X. In other words:

when X attributes have known values (here, x), the values for their corresponding Y attributes can be determined by looking them up in any tuple of R containing x. two tuples sharing the same values of X will necessarily have the same values of Y. A dependency FD: X → Y means that the values of Y are determined by the values of X. A functional dependency FD: X → Y is called trivial if Y is a subset of X. The determination of functional dependencies is an important part of designing databases in the relational model, and in database normalization and denormalization. A simple application of functional dependencies is Heath's theorem; it says that a relation R over an attribute set U and satisfying a functional dependency X → Y can be safely split in two relations having the lossless-join decomposition property, namely into Π X Y ( R ) ⋈ Π X Z ( R ) = R {\displaystyle \Pi _{XY}(R)\bowtie \Pi _{XZ}(R)=R} where Z = U − XY are the rest of the attributes. (Unions of attribute sets are customarily denoted by their juxtapositions in database theory.) An important notion in this context is a candidate key, defined as a minimal set of attributes that functionally determine all of the attributes in a relation. The functional dependencies, along with the attribute domains, are selected so as to generate constraints that would exclude as much data inappropriate to the user domain from the system as possible. A notion of logical implication is defined for functional dependencies in the following way: a set of functional dependencies Σ {\displaystyle \Sigma } logically implies another set of dependencies Γ {\displaystyle \Gamma } , if any relation R satisfying all dependencies from Σ {\displaystyle \Sigma } also satisfies all dependencies from Γ {\displaystyle \Gamma } ; this is usually written Σ ⊨ Γ {\displaystyle \Sigma \models \Gamma } . The notion of logical implication for functional dependencies admits a sound and complete finite axiomatization, known as Armstrong's axioms.

Examples

Cars Suppose one is designing a system to track vehicles and the capacity of their engines. Each vehicle has a unique vehicle identification number (VIN). One would write VIN → EngineCapacity because it would be inappropriate for a vehicle's engine to have more than one capacity. (Assuming, in this case, that vehicles only have one engine.) On the other hand, EngineCapacity → VIN is incorrect because there could be many vehicles with the same engine capacity. This functional dependency may suggest that the attribute EngineCapacity be placed in a relation with candidate key VIN. However, that may not always be appropriate. For example, if that functional dependency occurs as a result of the transitive functional dependencies VIN → VehicleModel and VehicleModel → EngineCapacity then that would not result in a normalized relation.

Lectures This example illustrates the concept of functional dependency. The situation modelled is that of college students visiting one or more lectures in each of which they are assigned a teaching assistant (TA). Let's further assume that every student is in some semester and is identified by a unique integer ID.

We notice that whenever two rows in this table feature the same StudentID, they also necessarily have the same Semester values. This basic fact can be expressed by a functional dependency:

StudentID → Semester. If a row was added where the student had a different value of semester, then the functional dependency FD would no longer exist. This means that the FD is implied by the data as it is possible to have values that would invalidate the FD. Other nontrivial functional dependencies can be identified, for example:

{StudentID, Lecture} → TA {StudentID, Lecture} → {TA, Semester} The latter expresses the fact that the set {StudentID, Lecture} is a superkey of the relation.

Employee department A classic example of functional dependency is the employee department model.

This case represents an example where multiple functional dependencies are embedded in a single representation of data. Note that because an employee can only be a member of one department, the unique ID of that employee determines the department.

Employee ID → Employee Name Employee ID → Department ID In addition to this relationship, the table also has a functional dependency through a non-key attribute

Department ID → Department Name This example demonstrates that even though there exists a FD Employee ID → Department ID - the employee ID would not be a logical key for determination of the department Name. The process of normalization of the data would recognize all FDs and allow the designer to construct tables and relationships that are more logical based on the data.

Properties and axiomatization of functional dependencies

Given that X, Y, and Z are sets of attributes in a relation R, one can derive several properties of functional dependencies. Among the most important are the following, usually called Armstrong's axioms:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Functional dependency

Start with the simplest possible case. Write down what Functional dependency claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Functional dependency before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Functional dependency ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Functional dependency

In research
Functional dependency appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Functional dependency in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Functional dependency is common in secondary-school and first-year university syllabi. It links to neighbouring topics Data modeling, so understanding it makes those chapters shorter.
In everyday life
Look for Functional dependency outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Functional dependency in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Functional dependency means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Functional dependency out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Functional dependency in simple terms?

In relational database theory, a functional dependency (FD) is constraint between two attribute sets, whereby values in one set (the determinant set) determine the values of the other set (the dependent set). A functional dependency between a determinant set X and a dependent set Y can be described…

Why does Functional dependency matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Functional dependency?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Functional dependency.

Tags

  • Data modeling

Keep exploring