Consider a relation R(A, B, C, D). The candidate keys of the relation are AB and AC. How many distinct superkeys does the relation R have?
Solution :
The correct answer is 6.
To find the number of distinct superkeys for the relation , we need to understand the definitions of candidate keys and superkeys:
Candidate Key: A minimal set of attributes that uniquely identifies a tuple in a relation.
Superkey: A set of attributes that contains a candidate key as its subset. Any superset of a candidate key is a superkey.
The relation has the attributes: {A, B, C, D}.
The candidate keys are given as AB and AC.
We need to find the number of distinct subsets of {A, B, C, D} that contain either AB or AC. We can calculate this using the Principle of Inclusion-Exclusion:
Let's calculate each term step-by-step:
Step 1: Find the number of superkeys containing AB
Any superkey containing AB must have the attributes A and B. The remaining attributes {C, D} can either be included or excluded from the superkey. Since there are 2 remaining attributes, the number of possible combinations is:
These 4 superkeys are: {A, B}, {A, B, C}, {A, B, D}, and {A, B, C, D}.
Step 2: Find the number of superkeys containing AC
Any superkey containing AC must have the attributes A and C. The remaining attributes {B, D} can either be included or excluded. The number of possible combinations is:
These 4 superkeys are: {A, C}, {A, B, C}, {A, C, D}, and {A, B, C, D}.
Step 3: Find the number of superkeys containing both AB and AC (Intersection)
A superkey contains both AB and AC if and only if it contains their union, ABC. The only remaining attribute is {D}, which can either be included or excluded. The number of combinations is:
These 2 superkeys are: {A, B, C} and {A, B, C, D}.
Step 4: Apply the Principle of Inclusion-Exclusion
Using the values calculated above:
Thus, the 6 distinct superkeys of the relation R are:
1. {A, B}
2. {A, C}
3. {A, B, C}
4. {A, B, D}
5. {A, C, D}
6. {A, B, C, D}
Completely free for students. Educators & coaching institutes get 2 months free Pro trial to create tests.
Access unlimited practice questions, detailed step-by-step solutions, and exam study materials — completely free for students.
Create and conduct professional online assessments with AI question generation, tab proctoring, and comprehensive batch management.
Prepare for GATE 2026 Civil Engineering with the latest question papers, previous year papers, detailed solutions, syllabus, exam pattern, preparation tips, mock tests, and subject-wise study material. Download GATE 2026 CE question papers with solutions in PDF format and boost your preparation for top engineering institutes and PSU recruitment.
Prepare effectively for GATE 2026 Electronics & Communication Engineering (EC) with this comprehensive Question Paper with Solutions. This resource includes detailed explanations, concept-wise solutions, previous year paper analysis, and exam-oriented practice to help aspirants strengthen core subjects like Electronic Devices, Analog Circuits, Digital Circuits, Signals & Systems, Network Theory, Control Systems, Electromagnetics, Communications, and more. Perfect for revision, self-assessment, and boosting your GATE 2026 EC preparation strategy.
Copyright © 2026 Combe Labs Private Limited. All Rights Reserved.