@Sauron20 said: @YouMadFellow said:
Why can't we do it like this:- There are N different books. P books of each kind. Total books=n*p Now, for each book, we have a choice of picking up or not. therefore total cases, 2^(N*P)-1 Kindly point out if there is anything wrong in the approach.
The flaw here is the approach of having a choice of picking up of not picking up works when all the things are different from each other.
Say there are 3 kinds of books - B1 , B2 , B3
And each of them have 4 books of each. So, the total number of books is 12.
In the library, the books will look like this.
B1B1B1B1 B2B2B2B2 B3B3B3B3
Now, when you say 2^12 -1, you are double counting few cases, for eg:-
You don't take any from first four books , you don't take the next four too, but then two take the 9th book and the last book. - This is one case and you will have B3 B3 as the selection
Next, you don't take any from first four books, you don't take the next four too, but you take the 10th book and the 11th book - This is another case , when you will have B3 B3 as the selection, and this is the same as above and hence you counted cases like this twice.
So, instead of considering every book's choice, you do it for books of different kind, in this case- B1, B2 , B3 where each one of them have 5 ways to pick up ( pick 1, pick2, .. pick nothing).. hence answer for this would be 5^3 - 1 = 124