Professional Documents
Culture Documents
If we add all the individual skills of A, B, C and D, we will grossly overcount because there can be common
skills between them which will be counted more than once.
2
n
We know,
n n n
n 2 n n
(1 − x) = 1 − ( )x + ( )x −. . . . +(−1) ( )x
1 2 n
Putting x = 1, we get
n n n
n
0 = 1 − ( ) + ( )−. . . . +(−1) ( )
1 2 n
n n
n
⟹ n − ( )+. . . . −(−1) ( ) = 1
2 n
This proves that after the following manipulations, the skill which is common to n persons is
counted only once.
An element which is common to two sets only, will only have its influence (its value counted) up to the
second step only. In general, an element which is common to n sets, will only have its influence (its value
counted) up to the nth step only. And we have proved that for such a case, it will be counted once only,
giving us the correct result.
Considering only the p type objects, there are (p + 1) ways of selecting any number of p type objects,
including the null case. Similarly, there is (q + 1) ways of choosing any number of the q type objects, and
(r + 1) ways of choosing any number of the r type objects.
Since we have to select p and q and r, these selections are connected by the Rule of AND. So, total number
of selections is (p + 1)(q + 1)(r + 1).
If we want to exclude the case where we don't select anything, there's only One possible case where that
happens, when we choose 0 p objects, 0 q objects, and 0 r objects. So the number of selections where we
select at least 1 object is
(p + 1)(q + 1)(r + 1) − 1
In general, if n = a + a +. . . +a where there are n objects out of which a of them are identical, a of them
1 2 k 1 2
are identical, and so on, then the number of selections of at least one object is
(a 1 + 1)(a 2 + 1). . . (a k + 1) − 1
3. Division vs Distribution
Division and Distribution are two VERY different actions.
In division, the groups into which we are dividing the objects do not have their own identity. But in
distribution, the groups have individuality and have their own identity. Think of division as just
partitioning the objects into groups, whereas if we assign or give those groups to individual people, it
becomes a distribution. Say we have 5 different balls, then (3 + 2) and (2 + 3) are different distributions, as
giving 3 balls to person A and 2 balls to person B is different from giving 2 balls to A and 3 balls to B.
However, dividing 5 balls into (3 + 2) and (2 + 3) is equivalent.
If we find the number of divisions of n objects into a certain number groups, then we do not care about the
arrangement of the groups among themselves.
3.1. Distribution vs Arrangement into groups
There is yet another term, "Arrangement into groups". In distribution, we do not care about the order of the
objects within the group itself. However, in arrangement we do consider the order of the objects within the
groups.
3.2. Example:
Consider the following letters
A, B, C, D
Division
Distribution
Arrangement
p + q + r q + r r
( ) ⋅ ( ) ⋅ ( )
p q r
Which simplifies to
(p + q + r)!
p! × q! × r!
Note that we can only use the nCr formula here because all the objects are said to be distinct.
Think of dividing a bunch of distinct marbles into a glass, a bucket, and a bathtub, and each has to be filled
up completely. There is NO way to have duplicate combinations by rearranging the groups, as the sizes of
the groups act sort of as an identity (even though groups aren't supposed to have any identity in division). So
in this case, number of divisions = number of distributions.
Now say if we were dividing them among three identical buckets. Say we give A marbles to bucket 1, B
marbles to bucket 2, and C marbles to bucket 3. We could ALSO give B marbles to bucket 1, C marbles to
bucket 2, and A marbles to bucket 3. Those would be called DIFFERENT distributions, but they are the
SAME division. So using the previous formula would give the number of distributions and not divisions.
We know,
Distributions = Divisions × Arrangements of groups
So to find the number of divisions, we have to remove the duplicate cases formed by the rearrangement of
the groups AMONG themselves.
Distributions
= Divisions
Arrangements of groups
Considering the previous case, lets assume we have to divide 3p distinct objects into 3 groups of equal sizes,
so each group gets p objects. There are 3 groups, so there are 3! ways to arrange them among themselves. So
the number of ways to divide the objects is
(p + p + p)! 1
⋅
p! × p! × p! 3!
(3p)! 1
= ⋅
(p!) 3 3!
3.4. Distribution of identical objects into a specified number of groups of variable sizes
We consider a row of these objects, and some 'partition elements' that we will put in between the objects to
divide them into groups. For p groups, we require (p − 1) partitions.
★|★★★|★|★★|
Now we consider the possible permutations of the whole system. We have n objects, and (p − 1) partitions,
so there are a total of (n + p − 1) entities. The number of permutations is
(n + p − 1)!
n! ⋅ (p − 1)!
Notice that this is the same as
n + p − 1 n + p − 1
( ) = ( )
p − 1 n
Notice that in this way, we never have a case where two partitions are next to each other, which is the same
as saying no group can have 0 objects in it.
★__★__★_|_★__★_|_★_|_★
3.5. Distribution of distinct objects into a specified number of groups of variable sizes
n
r
Say out of the r groups, we always keep the first group empty. This is basically the same as there being
(r − 1) groups, so the number of choices becomes (r − 1) .
n
Let A be the set containing the distribution of the objects keeping group 1 empty, A be the set containing
1 2
the distribution of the objects keeping group 1 empty, and so on. If one of the groups is empty, the number
of choices per object reduces by 1 and becomes (r − 1). So,
n
n(A 1 ) = n(A 2 ) =. . . = (r − 1)
The set of distributions where both the first and second set are empty is represented by A 1 ∩ A2 , and
n
n(A 1 ∩ A 2 ) = (r − 2)
We want to find n(A ∪ A ∪. . . ∪A ), which is the number of ways in which at least one of the sets is empty.
1 2 r
n
n(A 1 ∪ A 2 ∪. . . ∪A r ) = ∑ n(A i ) − ∑ n(A i ∩ A j )+. . . +(−1) ∑ n(A 1 ∩ A 2 ∩. . . ∩A r )
n
r n r
r n
⟹ n(A 1 ∪ A 2 ∪. . . ∪A r ) = r(r − 1) − ( )(r − 2) +. . . +(−1) ( )(r − (r − 1))
2 r
r n
r n r−1
r
= ( )(r − 1) − ( )(r − 2) +. . . −(−1) ( ) ⋅ 1 (last term becomes zero)
1 2 r − 1
This is the number of ways in which at least one of the sets is empty. So if we subtract this from r , we will
n
n
r n
r n r−1
r
r − ( )(r − 1) + ( )(r − 2) −. . . +(−1) ( ) ⋅ 1
1 2 r − 1
3.6. Arrangement of distinct objects into a specified number of groups of variable sizes
We consider a row of these objects, and some 'partition elements' that we will put in between the objects to
divide them into groups. For p groups, we require (r − 1) partitions.
A | B C D | E | F G |
Now we consider the possible permutations of the whole system. We have n objects, and (r − 1) partitions,
so there are a total of (n + r − 1) entities. The number of permutations in this case is
(n + r − 1)!
(r − 1)!
Notice that in the distribution of identical objects, we had a n! in the denominator to account for the n
identical objects. However in this case all the n objects are different.
Notice that in this way, we never have a case where two partitions are next to each other, which is the same
as saying no group can have 0 objects in it.
★__★__★_|_★__★_|_★_|_★
n − 1
( )
p − 1
However this time, we also have to account for the arrangement of the n objects themselves as they are
different, which have a total of n! arrangements. So it becomes
n − 1
n! ⋅ ( )
p − 1
4. Divisors of N
We can do prime factorisation of N to represent N as the product of powers of prime numbers.
α1 α2 α3 αk
N = p1 ⋅ p2 ⋅ p3 . . . pk
2 1 2 3 1
Eg: 1337700 = 2 ⋅ 3 ⋅ 5 ⋅ 7 ⋅ 13
1337700 = 2 × 2 × 3 × 5 × 5 × 7 × 7 × 7 × 13
By choosing any number of prime factors and multiplying them, we will always get another factor of N.
This is because even after choosing any number of these prime factors, there will be at least another prime
factor left (or 1) which can be multiplied by it to get N itself.
This is similar to the selections from multiple groups of identical objects. In case of 1337700, we can
either choose the prime 7 once, twice, thrice, or not at all. So if a prime p has an exponent of α, the choices
for choosing that prime is (α + 1).
Note that here 1 is included as a divisor because we are including the case where we don't choose any prime
factor at all, and N is included because we are also including the case where we select all of the prime
factors at once.
Accordingly, if we want to exclude 1 or N (or both) from this number, we have to subtract 1 (or 2) from this
quantity.
Let us consider
α1 α2 α3 αk
N = 2 ⋅ p2 ⋅ p3 . . . p
k
Now, we can choose at least one 2 from a total of α 2's in α ways. The choice of the rest of the prime
1 1
factors remains same, as we can choose to pick them or not. So the number of even divisors then becomes
α 1 ⋅ (α 2 + 1)(α 3 + 1). . . (α k + 1)
Case I: 2 is a divisor of N
N can be represented as
α1 α2 α3 αk
N = 2 ⋅ p2 ⋅ p3 . . . p
k
Case I: 2 is a divisor of N
N can be represented as
α1 α2 αk
N = p ⋅ p ...p
1 2 k
x 2
0
2
1
2
2
2
3
2
4
5
0
1 2 4 8 16
5
1
5 10 20 40 80
5
2
25 50 100 200 400
Notice how this their sum is equivalent to the expansion of the following
0 1 2 3 4 0 1 2
(2 + 2 + 2 + 2 + 2 ) ⋅ (5 + 5 + 5 )
0 0 1 2 1 0 1 2 2 0 1 2
= 2 (5 + 5 + 5 ) + 2 (5 + 5 + 5 ) + 2 (5 + 5 + 5 ). . .
Which gives every possible combination, separated by + signs, which gives us exactly what we want.
In general, if
α1 α2 α3 αk
N = p1 ⋅ p2 ⋅ p3 . . . p
k
k 1 = k 2 = √N
To form two co-prime factors, they cannot share any prime factor among themselves. So if one of the factors
has p as their factor, it must include all the p 's with it, as any other p cannot be used to form the other
1 1 1
factor.
So the question becomes equivalent to the number of ways to divide p , p , . . . , p into two groups. For each
1 2 k
prime factor p, it has two choices to go in either group, and there are a total of k such primes, so the number
of distributions becomes 2 . However we don't want ordered pairs, so we have to divide by the number of
k
partitioning lines to divide them into 3 groups which we can call x, y, z. Then we can count the number of
possible permutations.
1 1 1 1 | 1 1 1 | 1 1 1
In general for x 1 , it is
+ x 2 +. . . +x r = k
k + r − 1
( )
r − 1
This is exactly the same approach we used in the distribution of identical objects into a specified number of
groups of variable sizes.
1 _ 1 _ 1 _ 1 | 1 _ 1 _ 1 | 1 _ 1 _ 1
9
( )
2
In general for x 1 , it is
+ x 2 +. . . +x r = k
k − 1
( )
r − 1
This case is similar to the distribution of identical objects into a specified number of groups of variable
sizes, when the groups cannot be empty.