0 votes
1.1k 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 (2k points) 1.1k 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.9k 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.9k points)
...