Combinatorics theory - number of ways to select
Let's say there are 5 distinct objects. How many ways to select them?
Or to rephrase it: How many subsets are there of a set containing 5 elements?
To solve it, realize that each object may or may not be there in a subset.
So there are 2 states per object.
=> 2^5 ways to select objects or create subsets.
Now a little modification: How many ways to select at least one object?
So subtract that case when no object is selected.
That is exactly one case.
So 2^5 - 1.
----------------------------------
Now what if there are identical objects?
For e.g.
AA BBB CCCC
Now there are 3 ways of selecting A:
1. 0 A's
2. 1 A's
3. 2 A's
Similarly there are 4 ways to select B and 5 for C.
Total ways to select objects: 3*4*5 = 60
Number of ways to select at least one: 60 - 1 = 59
------------------
Ex1: Out of 4 oranges, 5 mangoes and 7 bananas, how many ways of selection possible if
a) at least one fruit:
Since objects are identical => 5*6*8 - 1 = 239
b) at least one orange:
0 orange case is gone.
So 4*6*8
c) at least one orange and one mango:
4*5*8
d) at least 2 oranges, 3 mangoes and 4 bananas:
3*3*4 = 36
---------------------
Ex2 -
Find the total number of divisors for 75600:
a) No restriction
Solution:
Prime factors: 2^4.3^3.5^2.7
So 2 can occur 0,1,2,3,4 times
Similarly for others.
Answer: 5.4.3.2 = 120
Note that this includes 1 also when none of the factors above is chosen.
b) Even divisor:
2^0 is not allowed.
Answer: 4.4.3.2 = 96
c) Odd divisor:
Either total - even = 120 - 96 = 24
Or remove all 2's: 4.3.2 = 24.
d) Divisors which are divisible by 6:
2 and 3 are needed for sure.
4.3.3.2 = 72
e) Divisors which are divisible by 60:
2^2,3,5 are needed for sure.
3.3.2.2 = 36
f) Proper divisors(all except the number itself):
Total - 1 = 120 -1 = 119
g) Find the sum of all divisors:
(2^0 + 2^1 + 2^2 + 2^3 + 2^4).(3^0+3^1+3^2+3^3).(5^0 + 5^1 + 5^2).(7^0 + 7^1)
= 31.40.31.8 = 307520
How did we get this?
Let's take a small example.
Let's say the number is 6, so prime factors are 2^1.3^1
List down all the divisors:
2^0.3^0 = 1
2^0.3^1 = 3
2^1.3^0 = 2
2^1.3^1 = 6
Add them:
2^0(3^0 + 3^1) + 2^1(3^0 + 3^1)
(2^0 + 2^1)(3^0 + 3^1)
Let's take slightly bigger number: 30
Prime factors: 2^1.3^1.5^1
List down all the divisors with 2^0:
5^0.3^0 = 1
5^0.3^1 = 3
5^1.3^0 = 5
5^1.3^1 = 15
Let's sum these factors:
2^0.(5^0 + 5^1).(3^0 + 3^1)
All this will repeat for 2^1, 2^2.
So finally: (2^0 + 2^1).(5^0 + 5^1).(3^0 + 3^1)
h) Find the sum of all even divisors
(2^1 + 2^2 + 2^3 + 2^4).(3^0+3^1+3^2+3^3).(5^0 + 5^1 + 5^2).(7^0 + 7^1)
------------
Ex3 -
Find the number of ways of selection of fruits out of 5 mangoes, 4 apples, 3 bananas and 3 different fruits.
a) if each selection consists of at least one fruit.
6.5.4.2.2.2 - 1(choosing 0 fruit) = 959
b) if each selection consists of at least two fruits.
There are 6 ways to choose only one fruit.
So 960 - 1(choosing 0 fruit) - 6(choosing 1 fruit) = 953
--------------
Ex4
Find the number of ways of selecting exactly 4 fruits from 4 apples, 5 mangoes and 6 oranges.
Answer: 15
Solution:
15!/4!4!5!6! Why not? Not for arranging.
15C4? Why not? That’s when all those 11 letters are distinct.
We have to make cases.
All 4 same => 3C1 = 3
3 Same, 1 diff => 3C1.2C1 = 6
2 Same, 2 diff => 3C1.1C1 = 3
2 Same 2 Same => 3C2 = 3
Comments
Post a Comment