in Combinatory
3,951 views
0 votes
0 votes

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
4.0k views

2 Answers

5 votes
5 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

selected by
0 votes
0 votes

using inclusion exclusion principle

no of superkeys :

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

=21

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