Pravin K
Pravin K

Reputation: 311

Count the number of subsequence of length k from an array of size n

Is there any direct formula to count the number of subsequences possible from an array of size n It is not needed to be contiguous and also not needed to be only distinct subsequences

Upvotes: 2

Views: 2750

Answers (1)

MBo
MBo

Reputation: 80187

Yes, there is formula for number of combinations

nCr(n, k) or C(n,k)  = n! / ((n-k)! * k!)

Upvotes: 1

Related Questions