View
5
Download
2
Embed Size (px)
DESCRIPTION
PnC
Citation preview
Distribution of How many balls boxes can contain
k Balls into n Boxes No Restrictions≤ 1
(At most one)≥ 1
(At least one)= 1
(Exactly one)
Distinct Distinctnk
(formula 1)
nPk
(formula 2)
S(k,n) × n!
(formula 3)(See more details below)
nPn = n! if k = n
0 if k ≠ n
(formula 4)
Identical Distinct
(n+k-1)Ck
(formula 5)
nCk
(formula 6)
(k-1)C(n-1)
(formula 7)
1 if k = n 0 if k ≠ n
(formula 8)
Distinct Identical
(formula 9)(See more details below)
1 if k ≤ n 0 if k > n
(formula 10)
S(k,n)
(formula 11)(See more details below)
1 if k = n 0 if k ≠ n
(formula 12)
Identical Identical
(formula 13)(See more details below)
1 if k ≤ n 0 if k > n
(formula 14)
P(k, n)
(formula 15)(See more details below)
1 if k = n 0 if k ≠ n
(formula 16)
S(k,n) Stirling number of the second kind and can be defined as
Special Cases :S(0,0) = 1, S(k,0) = 0 for k ≥ 1S(k,n) = 0 for k < nP(k,n) = The number of partitions of the integer k into n parts.
Formula for P(k,n) is much harder than that of S(k, n). The following example will explain how we can find the value of P(k,n).
What is the value of P(6,3) ?
The partitions of 6 into 3 parts are4 + 1 + 13 + 2 + 12 + 2 + 2(Note that 4 + 1 + 1 ,1 + 4 + 1, and 1 + 1 + 4. all are same. Similarly we need to consider all other cases as well)
Hence the number of partitions of 6 into 3 parts are = 3=> P(6,3) = 3
What is the value of P(6,2) ?
The partitions of 6 into 2 parts are1 + 52 + 43 + 3Hence the number of partitions of 6 into 2 parts are = 3=> P(6,2) = 3
What is the value of P(6,1) ?
Here, we count the number of partitions of 6 into 1 part. Clearly the number of such partitions = 1=> P(6,1) = 1
Now try to find out the value of P(6,4)
The partitions of 6 into 4 parts are1 + 1 + 1 + 31 + 2 + 2 + 2Hence the number of partitions of 6 into 4 parts are = 2
S(k,i)∑i=1
n
P(k, i)∑i=1
n
S(k,n) = (n − i1n!
∑i=0
n−1(−1)i
nCi)k
= [ (n − 0 − (n − 1 + (n − 2 + ⋯ + (1 ]1n!
nC0 )knC1 )k
nC2 )k (−1)n−1nCn−1 )k
Page 1 of 2Distributing Balls into Boxes
29/10/2014http://www.careerbless.com/aptitude/qa/permutations_combinations_imp7.php
=> P(6,4) = 2
Special Cases: P(0, 0) = P(k, k) = P(k, k-1) = P(k, 1) = 1
Page 2 of 2Distributing Balls into Boxes
29/10/2014http://www.careerbless.com/aptitude/qa/permutations_combinations_imp7.php