Let say we have a bookshelf that can fit 6 books, we want 4 computer science books and 2 physics books but computer books should be together and physics books also should be together, we have 8 computer and 6 physics book in total in how many ways we can do that?
I believe that the answer is like this:
c(8,4)*c(6,2) + c(6,2)*c(8,4)
but my instructor sloved it in this way(by p I mean permutation):
p(8,4)*p(6,2) + p(6,2)*p(8,4)
could u please tell me which one is right?
It depends.
If the order of the books matter (as in, computer science book A needs to come before computer science book B, for example), then your instructor would be right.
If they don't, then you would be right.