Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

You are sorting assigning 6 people, A, B, C, D, E and F, into 3 different hotel rooms. How many ways can they be sorted such that A is in the same room with C, and B is not in the same room with D? (Some hotel rooms may be empty.)

7C5 * 2! * 5! - 6C4 * 2! * 2! *4!



share|cite|improve this question
I’ve not been able to figure out what you were thinking, so I don’t know just where you went astray. What are the $7$ things from which you’re choosing $5$? – Brian M. Scott Dec 9 '12 at 8:34
I am confused with the placing distinct object into identical container(hotels) and the container maybe empty. – Noob Dec 9 '12 at 8:43
First of all, A and C placed in the same room Then, we count A and C as one object AC , B , D , E ,F to place them in 3 hotels it should be 7C5 right? – Noob Dec 9 '12 at 8:44
But the rooms aren’t identical. Were you perhaps thinking of this method that is used when the objects are identical and the containers are not? It doesn’t apply here, because the objects (people) are not identical. – Brian M. Scott Dec 9 '12 at 8:48

Another solution.

Since A and C are in same room we have to assign 5 to 3 rooms. It can be done in $3^5$ ways.This also contains cases when B and D are in same room. The count of ways is $3^4$ because we have to assign 4 to 3 room.

Subtracting we get $3^5 - 3^4 = 162$

share|cite|improve this answer

There are $3$ ways to assign B to a room, and then $2$ ways to assign D. That leaves the pair AC and the individuals E and F to be assigned; each of these three ‘people’ can be assigned to any of the three rooms, so they can be assigned in $3^3$ ways. The total number of allowable assignments is therefore $$3\cdot2\cdot3^3=2\cdot3^4=162\;.$$

Note that your answer can’t possibly be right: if there were no restrictions, each of the $6$ people could be assigned to any of the $3$ rooms; that’s a $3$-way choice made $6$ times, so it can be done in $3^6=729$ ways. Thus, your answer is way bigger than the number of possible assignments when there are no restrictions at all. The number of assignments satisfying the restrictions on A, B, C, and D must be smaller than $729$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.