Question Details

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?

Options

A

6

B

7

C

9

D

3

Show Answer
Correct Answer
A 6

Solution :

The correct answer is 6.

To find the number of distinct superkeys for the relation R(A,B,C,D), 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 R 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:


N ( A B ∪ A C ) = N ( A B ) + N ( A C ) - N ( A B ∩ A C )

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:

2 2 = 4
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:

2 2 = 4
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:

2 1 = 2
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:

Total Superkeys = 4 + 4 - 2 = 6

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}

Transparent Access on Mindyard

Built for Learners & Educators Alike

Completely free for students. Educators & coaching institutes get 2 months free Pro trial to create tests.

FREE FOR STUDENTS

Practice & Learn Free for Students

Access unlimited practice questions, detailed step-by-step solutions, and exam study materials — completely free for students.

  • Unlimited mock tests & question bank practice
  • Full access to curated study library & formula notes
  • 100% free for students • No credit card required
2 MONTHS FREE TRIAL

Educators & Coaching Institutes

Create and conduct professional online assessments with AI question generation, tab proctoring, and comprehensive batch management.

  • AI question uploader & rapid test generator
  • Anti-cheating tab proctoring & performance reports
  • Full Pro access free for 60 days • No upfront commitment
Discover more resources

You may also like

Mock Tests

View All
  • GATE
  • beginner
  • 3 hours
  • civil engineering

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.

  • GATE
  • beginner
  • 3 hours
  • electronics and communication engineering

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.

Ask AI Tutor
5 left
Q1 View Question & Options
AI Tutor is solving this question...
Reading question context & options...
Ask your own doubt or choose a quick prompt: