The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
764 views

The number of superkeys possible for the relation R(A B C D E) with {ABCCDE} as three candidate keys are _________.

Please EXPLAIN the solution.

in Combinatory by Active (2.2k points) | 764 views

2 Answers

+4 votes
Best answer

There are three Ck : A, BC, CDE

Take Each CK alone

No. of superkeys when CK is A alone = 24 (Because each remaining 4 values may or may not be in the SK, hence 2 posibilities for each)

No. of superkeys when CK is BC alone = 23 (Because each remaining 3 values may or may not be in the SK, hence 2 posibilities for each)

No. of superkeys when CK is CDE alone = 22 (Because each remaining 2 values may or may not be in the SK, hence 2 posibilities for each)

Now, take combinations from given CK

No. of superkeys when CK is ABC = 22 (Because each remaining 2 values may or may not be in the SK, hence 2 posibilities for each)

No. of superkeys when CK is BCDE = 21 (Because each remaining 2 values may or may not be in the SK, hence 2 posibilities for each)

No. of superkeys when CK is ACDE = 21 (Because each remaining 2 values may or may not be in the SK, hence 2 posibilities for each)

Now, take all three CK together

No. of superkeys when CK is ABCDE = 20 (Because each remaining 2 values may or may not be in the SK, hence 2 posibilities for each)

Hence total SK = 24 + 23 + 22 - 22 - 21 - 21 + 20 = 16 + 8 + 4 - (4+2+2) + 1 = 28 - 8 + 1 = 21

Hence total super keys are 21

by Boss (18.5k points)
selected by
0 votes

using inclusion exclusion principle

no of superkeys :

2^4 +2^3 +2^2 - 2^2 -2^1 -2^1 +2^0

=21

by Loyal (7.6k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,781 questions
53,593 answers
185,825 comments
70,880 users