Example 2:
Let a relation, R(PQRST)
FDs: {PQR->T, RSTP->S, P->Q, Q->T, TS->R}
Here P is not on the LHS of any FD, i.e P cannot be derived from any of the FD. Therefore it is an essential Attribute and will be present in all the Candidate Keys.
(P)+ = {P,Q,T} => Not a Candidate Key
Now take 2-attributes combinations:
(PQ)+ = {P,Q,T} => Not a Candidate Key
(PR)+ = {P,R,Q,T} => Not a Candidate Key
(PS)+ = {P,S,Q,T,R} => Candidate Key
(PT)+ = {P,T,Q} => Not a Candidate Key
Now check for 3-attributes combinations:
(PQR)+ = {P,Q,R,T} => Not a Candidate Key
(PQS)+ => Super Key because PS is a Candidate Key already
Total no. of Candidate Keys possible: 2^n-1 = 2^5-1 = 32-1 = 31