What is the number of different ways to seat 15 students where no two students of the same group are next to...











up vote
4
down vote

favorite
1












Question:



There are 15 different students: 4 students of group A, 5 students of group B and 6 students of group C. What is the number of different ways to seat these students into a row of seats where no two students of the same group are next to each other?





I tried to seat the students of group C first: $$-C-C-C-C-C-C-$$
Then I would put the students of group A and B into the spaces. I tried 2A (2 students from group A) on both ends, A on one end and B on one end, only A on one end, etc, then decide how many students of each group to put in the middle spaces.



There is so many different possibilities that I thought there could be a better way. Do you have any idea? Thanks in advance.





Solution



Let's count the number of strings containing 4 letter A, 5 letter B and 6 letter C.



To begin with, let's set up the $C$s: $$*C-C-C-C-C-C*$$



There are $7$ gaps: $5$ obligatory $(-)$ gaps and $2$ optional $(*)$ gaps.



Now we shall fill in the gaps with $A$s first and $B$s later. The $A$s can't stand next to one another but have some $B$s separate them. Consider some cases:



Case 1: $ABABABA$ and $2$ spare $B$s.



Obviously this is not enough to fill in $5$ $(-)$ gaps



Case 2: $ABABA$, $A$ and $3$ spare $B$s.



Just enough to fill in $5$ $(-)$ gaps: 1 for $ABABA$, $1$ for $A$ and remaining $3$ for $B$s. There are ${5 choose 1} cdot {4 choose 1} = 20$ strings.



Case 3: $ABA$, $ABA$ and $3$ spare $B$s.



Just enough to fill in $5$ $(-)$ gaps: $2$ for $ABA$ and $3$ remainings for $B$s. There are ${5 choose 2} = 10$ strings.



Case 4: $ABA$, $A$, $A$ and $4$ spare $B$s.



We have more than enough to fill in the $(*)$ gaps now, with $3$ options:



Option 1: Fill in $2$ $(*)$: Just enough for $7$ gaps: $1$ for $ABA$, $2$ for $A$s and $4$ remainings for $B$. There are ${1 choose 7} cdot {2 choose 6} = 105$ strings.



Option 2: Fill in $1$ $(*)$, we have $3$ more sub-options:




  • Fill it with $ABA$. To fill the $5$ $(-)$s: $2$ for $A$s and $3$ remaining for $B$s. One spare $B$.


  • Fill it with $A$. To fill the $5$ $(-)$s: $1$ for $ABA$, $1$ for $A$s and $3$ remaining for $B$s. One spare $B$.


  • Fill it with $B$. To fill the $5$ $(-)$s: $1$ for $ABA$, $2$ for $A$s and $2$ remaining for $B$s. One spare $B$.



Note that we have $2$ $(*)$ gaps and the spare $B$ can be put into $6$ gaps next to $A$s. There are $2 cdot left[ {5 choose 2} + {5 choose 1} cdot {4 choose 1} + {5 choose 1} cdot {4 choose 2}right] cdot {6 choose 1} = 720$ strings.



Option 3: Fill $0$ $(*)$ gap. To fill the $5$ $(-)$s: $1$ for $ABA$, $2$ for $A$s and $2$ remaining for $B$s. Two spare $B$s can be put into $6$ gaps next to $A$s. There are ${5 choose 1} cdot {4 choose 2} cdot {6 choose 2} = 450$ strings.



Case 5: $A$, $A$, $A$, $A$ and $5$ spare $B$s.



This should be the same:



Option 1: This one is different from last time but just like Option 2. There are $left[ {5 choose 2} + {2 choose 1} cdot {5 choose 3} + {5 choose 4}right] cdot {8 choose 2} = 980$ strings.



Option 2: $2 cdot left[ {5 choose 3} + {5 choose 4} right] cdot {8 choose 3} = 1680$ strings.



Option 3: ${5 choose 4} cdot {8 choose 4} = 350$ strings.



To sum it up:



The total number of desired strings is $20 + 10 + 105 + 720 + 450 + 700 + 1680 + 350 = 4315$ strings.



So there should be $4315 cdot 4! cdot 5! cdot 6! = 8947584000$ ways of seating these students.










share|cite|improve this question
























  • Welcome to MSE. You'll get a lot more help and fewer votes to close if you show that you've tried to solve the problem yourself. What are your thoughts on it? What have you tried? How far have you gotten? Reply by editing the question body, please; many people browsing questions will vote to close without reading the comments.
    – saulspatz
    Oct 29 at 14:18










  • Case 1,2,3 are OK, but the cases 4 and 5 not yet. In the analysis the locations "*" and "-" need to be occupied by a string containing one or more $A$s. The positioning of the $B$s does not need to be restricted by that. For instance case 5, option 3: there are 5 ways to distribute the $A$s, one $B$ is forced to be on the last "-" location, that leaves 4 $B$'s to be distributed over 10 places, eight of them between "AC" or "CA", but also the two at the beginning or end. This gives $5 *10!/(4! 6!)=1050$ different sequences.
    – Ronald Blaak
    Nov 20 at 11:05










  • @Ronald Blaak: Thanks, I got the correct result now.
    – Iceghost
    Dec 3 at 8:10















up vote
4
down vote

favorite
1












Question:



There are 15 different students: 4 students of group A, 5 students of group B and 6 students of group C. What is the number of different ways to seat these students into a row of seats where no two students of the same group are next to each other?





I tried to seat the students of group C first: $$-C-C-C-C-C-C-$$
Then I would put the students of group A and B into the spaces. I tried 2A (2 students from group A) on both ends, A on one end and B on one end, only A on one end, etc, then decide how many students of each group to put in the middle spaces.



There is so many different possibilities that I thought there could be a better way. Do you have any idea? Thanks in advance.





Solution



Let's count the number of strings containing 4 letter A, 5 letter B and 6 letter C.



To begin with, let's set up the $C$s: $$*C-C-C-C-C-C*$$



There are $7$ gaps: $5$ obligatory $(-)$ gaps and $2$ optional $(*)$ gaps.



Now we shall fill in the gaps with $A$s first and $B$s later. The $A$s can't stand next to one another but have some $B$s separate them. Consider some cases:



Case 1: $ABABABA$ and $2$ spare $B$s.



Obviously this is not enough to fill in $5$ $(-)$ gaps



Case 2: $ABABA$, $A$ and $3$ spare $B$s.



Just enough to fill in $5$ $(-)$ gaps: 1 for $ABABA$, $1$ for $A$ and remaining $3$ for $B$s. There are ${5 choose 1} cdot {4 choose 1} = 20$ strings.



Case 3: $ABA$, $ABA$ and $3$ spare $B$s.



Just enough to fill in $5$ $(-)$ gaps: $2$ for $ABA$ and $3$ remainings for $B$s. There are ${5 choose 2} = 10$ strings.



Case 4: $ABA$, $A$, $A$ and $4$ spare $B$s.



We have more than enough to fill in the $(*)$ gaps now, with $3$ options:



Option 1: Fill in $2$ $(*)$: Just enough for $7$ gaps: $1$ for $ABA$, $2$ for $A$s and $4$ remainings for $B$. There are ${1 choose 7} cdot {2 choose 6} = 105$ strings.



Option 2: Fill in $1$ $(*)$, we have $3$ more sub-options:




  • Fill it with $ABA$. To fill the $5$ $(-)$s: $2$ for $A$s and $3$ remaining for $B$s. One spare $B$.


  • Fill it with $A$. To fill the $5$ $(-)$s: $1$ for $ABA$, $1$ for $A$s and $3$ remaining for $B$s. One spare $B$.


  • Fill it with $B$. To fill the $5$ $(-)$s: $1$ for $ABA$, $2$ for $A$s and $2$ remaining for $B$s. One spare $B$.



Note that we have $2$ $(*)$ gaps and the spare $B$ can be put into $6$ gaps next to $A$s. There are $2 cdot left[ {5 choose 2} + {5 choose 1} cdot {4 choose 1} + {5 choose 1} cdot {4 choose 2}right] cdot {6 choose 1} = 720$ strings.



Option 3: Fill $0$ $(*)$ gap. To fill the $5$ $(-)$s: $1$ for $ABA$, $2$ for $A$s and $2$ remaining for $B$s. Two spare $B$s can be put into $6$ gaps next to $A$s. There are ${5 choose 1} cdot {4 choose 2} cdot {6 choose 2} = 450$ strings.



Case 5: $A$, $A$, $A$, $A$ and $5$ spare $B$s.



This should be the same:



Option 1: This one is different from last time but just like Option 2. There are $left[ {5 choose 2} + {2 choose 1} cdot {5 choose 3} + {5 choose 4}right] cdot {8 choose 2} = 980$ strings.



Option 2: $2 cdot left[ {5 choose 3} + {5 choose 4} right] cdot {8 choose 3} = 1680$ strings.



Option 3: ${5 choose 4} cdot {8 choose 4} = 350$ strings.



To sum it up:



The total number of desired strings is $20 + 10 + 105 + 720 + 450 + 700 + 1680 + 350 = 4315$ strings.



So there should be $4315 cdot 4! cdot 5! cdot 6! = 8947584000$ ways of seating these students.










share|cite|improve this question
























  • Welcome to MSE. You'll get a lot more help and fewer votes to close if you show that you've tried to solve the problem yourself. What are your thoughts on it? What have you tried? How far have you gotten? Reply by editing the question body, please; many people browsing questions will vote to close without reading the comments.
    – saulspatz
    Oct 29 at 14:18










  • Case 1,2,3 are OK, but the cases 4 and 5 not yet. In the analysis the locations "*" and "-" need to be occupied by a string containing one or more $A$s. The positioning of the $B$s does not need to be restricted by that. For instance case 5, option 3: there are 5 ways to distribute the $A$s, one $B$ is forced to be on the last "-" location, that leaves 4 $B$'s to be distributed over 10 places, eight of them between "AC" or "CA", but also the two at the beginning or end. This gives $5 *10!/(4! 6!)=1050$ different sequences.
    – Ronald Blaak
    Nov 20 at 11:05










  • @Ronald Blaak: Thanks, I got the correct result now.
    – Iceghost
    Dec 3 at 8:10













up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





Question:



There are 15 different students: 4 students of group A, 5 students of group B and 6 students of group C. What is the number of different ways to seat these students into a row of seats where no two students of the same group are next to each other?





I tried to seat the students of group C first: $$-C-C-C-C-C-C-$$
Then I would put the students of group A and B into the spaces. I tried 2A (2 students from group A) on both ends, A on one end and B on one end, only A on one end, etc, then decide how many students of each group to put in the middle spaces.



There is so many different possibilities that I thought there could be a better way. Do you have any idea? Thanks in advance.





Solution



Let's count the number of strings containing 4 letter A, 5 letter B and 6 letter C.



To begin with, let's set up the $C$s: $$*C-C-C-C-C-C*$$



There are $7$ gaps: $5$ obligatory $(-)$ gaps and $2$ optional $(*)$ gaps.



Now we shall fill in the gaps with $A$s first and $B$s later. The $A$s can't stand next to one another but have some $B$s separate them. Consider some cases:



Case 1: $ABABABA$ and $2$ spare $B$s.



Obviously this is not enough to fill in $5$ $(-)$ gaps



Case 2: $ABABA$, $A$ and $3$ spare $B$s.



Just enough to fill in $5$ $(-)$ gaps: 1 for $ABABA$, $1$ for $A$ and remaining $3$ for $B$s. There are ${5 choose 1} cdot {4 choose 1} = 20$ strings.



Case 3: $ABA$, $ABA$ and $3$ spare $B$s.



Just enough to fill in $5$ $(-)$ gaps: $2$ for $ABA$ and $3$ remainings for $B$s. There are ${5 choose 2} = 10$ strings.



Case 4: $ABA$, $A$, $A$ and $4$ spare $B$s.



We have more than enough to fill in the $(*)$ gaps now, with $3$ options:



Option 1: Fill in $2$ $(*)$: Just enough for $7$ gaps: $1$ for $ABA$, $2$ for $A$s and $4$ remainings for $B$. There are ${1 choose 7} cdot {2 choose 6} = 105$ strings.



Option 2: Fill in $1$ $(*)$, we have $3$ more sub-options:




  • Fill it with $ABA$. To fill the $5$ $(-)$s: $2$ for $A$s and $3$ remaining for $B$s. One spare $B$.


  • Fill it with $A$. To fill the $5$ $(-)$s: $1$ for $ABA$, $1$ for $A$s and $3$ remaining for $B$s. One spare $B$.


  • Fill it with $B$. To fill the $5$ $(-)$s: $1$ for $ABA$, $2$ for $A$s and $2$ remaining for $B$s. One spare $B$.



Note that we have $2$ $(*)$ gaps and the spare $B$ can be put into $6$ gaps next to $A$s. There are $2 cdot left[ {5 choose 2} + {5 choose 1} cdot {4 choose 1} + {5 choose 1} cdot {4 choose 2}right] cdot {6 choose 1} = 720$ strings.



Option 3: Fill $0$ $(*)$ gap. To fill the $5$ $(-)$s: $1$ for $ABA$, $2$ for $A$s and $2$ remaining for $B$s. Two spare $B$s can be put into $6$ gaps next to $A$s. There are ${5 choose 1} cdot {4 choose 2} cdot {6 choose 2} = 450$ strings.



Case 5: $A$, $A$, $A$, $A$ and $5$ spare $B$s.



This should be the same:



Option 1: This one is different from last time but just like Option 2. There are $left[ {5 choose 2} + {2 choose 1} cdot {5 choose 3} + {5 choose 4}right] cdot {8 choose 2} = 980$ strings.



Option 2: $2 cdot left[ {5 choose 3} + {5 choose 4} right] cdot {8 choose 3} = 1680$ strings.



Option 3: ${5 choose 4} cdot {8 choose 4} = 350$ strings.



To sum it up:



The total number of desired strings is $20 + 10 + 105 + 720 + 450 + 700 + 1680 + 350 = 4315$ strings.



So there should be $4315 cdot 4! cdot 5! cdot 6! = 8947584000$ ways of seating these students.










share|cite|improve this question















Question:



There are 15 different students: 4 students of group A, 5 students of group B and 6 students of group C. What is the number of different ways to seat these students into a row of seats where no two students of the same group are next to each other?





I tried to seat the students of group C first: $$-C-C-C-C-C-C-$$
Then I would put the students of group A and B into the spaces. I tried 2A (2 students from group A) on both ends, A on one end and B on one end, only A on one end, etc, then decide how many students of each group to put in the middle spaces.



There is so many different possibilities that I thought there could be a better way. Do you have any idea? Thanks in advance.





Solution



Let's count the number of strings containing 4 letter A, 5 letter B and 6 letter C.



To begin with, let's set up the $C$s: $$*C-C-C-C-C-C*$$



There are $7$ gaps: $5$ obligatory $(-)$ gaps and $2$ optional $(*)$ gaps.



Now we shall fill in the gaps with $A$s first and $B$s later. The $A$s can't stand next to one another but have some $B$s separate them. Consider some cases:



Case 1: $ABABABA$ and $2$ spare $B$s.



Obviously this is not enough to fill in $5$ $(-)$ gaps



Case 2: $ABABA$, $A$ and $3$ spare $B$s.



Just enough to fill in $5$ $(-)$ gaps: 1 for $ABABA$, $1$ for $A$ and remaining $3$ for $B$s. There are ${5 choose 1} cdot {4 choose 1} = 20$ strings.



Case 3: $ABA$, $ABA$ and $3$ spare $B$s.



Just enough to fill in $5$ $(-)$ gaps: $2$ for $ABA$ and $3$ remainings for $B$s. There are ${5 choose 2} = 10$ strings.



Case 4: $ABA$, $A$, $A$ and $4$ spare $B$s.



We have more than enough to fill in the $(*)$ gaps now, with $3$ options:



Option 1: Fill in $2$ $(*)$: Just enough for $7$ gaps: $1$ for $ABA$, $2$ for $A$s and $4$ remainings for $B$. There are ${1 choose 7} cdot {2 choose 6} = 105$ strings.



Option 2: Fill in $1$ $(*)$, we have $3$ more sub-options:




  • Fill it with $ABA$. To fill the $5$ $(-)$s: $2$ for $A$s and $3$ remaining for $B$s. One spare $B$.


  • Fill it with $A$. To fill the $5$ $(-)$s: $1$ for $ABA$, $1$ for $A$s and $3$ remaining for $B$s. One spare $B$.


  • Fill it with $B$. To fill the $5$ $(-)$s: $1$ for $ABA$, $2$ for $A$s and $2$ remaining for $B$s. One spare $B$.



Note that we have $2$ $(*)$ gaps and the spare $B$ can be put into $6$ gaps next to $A$s. There are $2 cdot left[ {5 choose 2} + {5 choose 1} cdot {4 choose 1} + {5 choose 1} cdot {4 choose 2}right] cdot {6 choose 1} = 720$ strings.



Option 3: Fill $0$ $(*)$ gap. To fill the $5$ $(-)$s: $1$ for $ABA$, $2$ for $A$s and $2$ remaining for $B$s. Two spare $B$s can be put into $6$ gaps next to $A$s. There are ${5 choose 1} cdot {4 choose 2} cdot {6 choose 2} = 450$ strings.



Case 5: $A$, $A$, $A$, $A$ and $5$ spare $B$s.



This should be the same:



Option 1: This one is different from last time but just like Option 2. There are $left[ {5 choose 2} + {2 choose 1} cdot {5 choose 3} + {5 choose 4}right] cdot {8 choose 2} = 980$ strings.



Option 2: $2 cdot left[ {5 choose 3} + {5 choose 4} right] cdot {8 choose 3} = 1680$ strings.



Option 3: ${5 choose 4} cdot {8 choose 4} = 350$ strings.



To sum it up:



The total number of desired strings is $20 + 10 + 105 + 720 + 450 + 700 + 1680 + 350 = 4315$ strings.



So there should be $4315 cdot 4! cdot 5! cdot 6! = 8947584000$ ways of seating these students.







combinatorics






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 3 at 8:09

























asked Oct 29 at 14:01









Iceghost

234




234












  • Welcome to MSE. You'll get a lot more help and fewer votes to close if you show that you've tried to solve the problem yourself. What are your thoughts on it? What have you tried? How far have you gotten? Reply by editing the question body, please; many people browsing questions will vote to close without reading the comments.
    – saulspatz
    Oct 29 at 14:18










  • Case 1,2,3 are OK, but the cases 4 and 5 not yet. In the analysis the locations "*" and "-" need to be occupied by a string containing one or more $A$s. The positioning of the $B$s does not need to be restricted by that. For instance case 5, option 3: there are 5 ways to distribute the $A$s, one $B$ is forced to be on the last "-" location, that leaves 4 $B$'s to be distributed over 10 places, eight of them between "AC" or "CA", but also the two at the beginning or end. This gives $5 *10!/(4! 6!)=1050$ different sequences.
    – Ronald Blaak
    Nov 20 at 11:05










  • @Ronald Blaak: Thanks, I got the correct result now.
    – Iceghost
    Dec 3 at 8:10


















  • Welcome to MSE. You'll get a lot more help and fewer votes to close if you show that you've tried to solve the problem yourself. What are your thoughts on it? What have you tried? How far have you gotten? Reply by editing the question body, please; many people browsing questions will vote to close without reading the comments.
    – saulspatz
    Oct 29 at 14:18










  • Case 1,2,3 are OK, but the cases 4 and 5 not yet. In the analysis the locations "*" and "-" need to be occupied by a string containing one or more $A$s. The positioning of the $B$s does not need to be restricted by that. For instance case 5, option 3: there are 5 ways to distribute the $A$s, one $B$ is forced to be on the last "-" location, that leaves 4 $B$'s to be distributed over 10 places, eight of them between "AC" or "CA", but also the two at the beginning or end. This gives $5 *10!/(4! 6!)=1050$ different sequences.
    – Ronald Blaak
    Nov 20 at 11:05










  • @Ronald Blaak: Thanks, I got the correct result now.
    – Iceghost
    Dec 3 at 8:10
















Welcome to MSE. You'll get a lot more help and fewer votes to close if you show that you've tried to solve the problem yourself. What are your thoughts on it? What have you tried? How far have you gotten? Reply by editing the question body, please; many people browsing questions will vote to close without reading the comments.
– saulspatz
Oct 29 at 14:18




Welcome to MSE. You'll get a lot more help and fewer votes to close if you show that you've tried to solve the problem yourself. What are your thoughts on it? What have you tried? How far have you gotten? Reply by editing the question body, please; many people browsing questions will vote to close without reading the comments.
– saulspatz
Oct 29 at 14:18












Case 1,2,3 are OK, but the cases 4 and 5 not yet. In the analysis the locations "*" and "-" need to be occupied by a string containing one or more $A$s. The positioning of the $B$s does not need to be restricted by that. For instance case 5, option 3: there are 5 ways to distribute the $A$s, one $B$ is forced to be on the last "-" location, that leaves 4 $B$'s to be distributed over 10 places, eight of them between "AC" or "CA", but also the two at the beginning or end. This gives $5 *10!/(4! 6!)=1050$ different sequences.
– Ronald Blaak
Nov 20 at 11:05




Case 1,2,3 are OK, but the cases 4 and 5 not yet. In the analysis the locations "*" and "-" need to be occupied by a string containing one or more $A$s. The positioning of the $B$s does not need to be restricted by that. For instance case 5, option 3: there are 5 ways to distribute the $A$s, one $B$ is forced to be on the last "-" location, that leaves 4 $B$'s to be distributed over 10 places, eight of them between "AC" or "CA", but also the two at the beginning or end. This gives $5 *10!/(4! 6!)=1050$ different sequences.
– Ronald Blaak
Nov 20 at 11:05












@Ronald Blaak: Thanks, I got the correct result now.
– Iceghost
Dec 3 at 8:10




@Ronald Blaak: Thanks, I got the correct result now.
– Iceghost
Dec 3 at 8:10










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










The simplest approach would be to set up a counting algorithm using recurrence relations. To this end consider the function $P^{(A)}_n(a,b,c)$ that counts the number of valid strings formed by $a$ times an $A$, $b$ times a $B$, and $c$ times a $C$, that satisfy the constraint that no two $A$'s, $B$'s, or $C$'s will be adjacent, and that will start with an $A$ as the first character. Similarly, we consider the functions $P^{(B)}_n(a,b,c)$ and $P^{(C)}_n(a,b,c)$. The arguments are non-negative $a,b,c geq 0$ and $n=a+b+c geq 1$ is the length of the string.



For $n=1$ the functions are initialised by
$$
P^{(A)}_1(1,0,0) = P^{(B)}_1(0,1,0) = P^{(C)}_1(0,0,1) = 1
$$

and zero otherwise.



We then know that the number of string of length $n+1$ starting with an $A$ can be expressed as:
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(B)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

and like-wise
$$
P^{(B)}_{n+1}(a,b+1,c) = P^{(A)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

$$
P^{(C)}_{n+1}(a,b,c+1) = P^{(A)}_{n}(a,b,c) + P^{(B)}_{n}(a,b,c)
$$



It is clear that the three types of function are symmetric and related under permutations of labels
$$
P^{(A)}_{n}(a,b,c)=P^{(A)}_{n}(a,c,b)=P^{(B)}_{n}(c,a,b)=P^{(C)}_{n}(b,c,a)
$$

We therefore have not three relations but only a single one, i.e.,
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(A)}_{n}(b,c,a) + P^{(A)}_{n}(c,a,b)
$$

Since we know that $n=a+b+c$ we can drop the subscript $n$, and if we choose that the first character of a string corresponds to one of which the total number corresponds to the first argument this simplifies to
$$
P(a+1;b,c) = P(b;c,a) + P(c;a,b)
$$

with $P(1;0,0)=1$ and $P(x;y,z)=0$ whenever one or more arguments are negative.



This can easily be programmed and we find that the total number of strings of the problem can be found as
$$
P(4;5,6) + P(5;6,4) + P(6;4,5) = 4315
$$



It is also possible to directly count the number of strings by using a suitable classification system. For instance the six $C$'s will not be adjacent in the string
$$
*C-C-C-C-C-C*
$$

Hence at the locations $-$ there has to be some combination of $A$'s and $B$'s, and at the locations $*$ there might be such a string.



The four $A$'s will have to be placed within those 7 locations. They can be distributed in five types of fashion, i.e., ${$ABABABA$}$ when all $A$'s are found at a single of the seven locations (properly separated by $B$'s of course). The other four types split the $A$'s in two, three, or four smaller groups ${$ABABA,A$}$,${$ABA,ABA$}$,${$ABA,A,A$}$,${$A,A,A,A$}$ that each have to be placed at a different location within the 7 possible ones. Within this process some of the $B$'s are already fixed by necessity to separate the $A$'s, some others will have to be at one or more particular locations to form $CBC$ combinations. The remaining $B$'s can be distributed either as $ABC$,$CBA$-combinations or at the outer ends of the string.



A careful counting and analysis is needed for each case to find the appropriate number of strings. For instance the first type ${ABABABA}$ can actually not occur, as it would results in two adjacent $C$'s.



Give it a go and let me know if and where you get in trouble.






share|cite|improve this answer























  • Well, I came up with a different result (updated in the question post)
    – Iceghost
    Nov 20 at 6:30













Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2976168%2fwhat-is-the-number-of-different-ways-to-seat-15-students-where-no-two-students-o%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted










The simplest approach would be to set up a counting algorithm using recurrence relations. To this end consider the function $P^{(A)}_n(a,b,c)$ that counts the number of valid strings formed by $a$ times an $A$, $b$ times a $B$, and $c$ times a $C$, that satisfy the constraint that no two $A$'s, $B$'s, or $C$'s will be adjacent, and that will start with an $A$ as the first character. Similarly, we consider the functions $P^{(B)}_n(a,b,c)$ and $P^{(C)}_n(a,b,c)$. The arguments are non-negative $a,b,c geq 0$ and $n=a+b+c geq 1$ is the length of the string.



For $n=1$ the functions are initialised by
$$
P^{(A)}_1(1,0,0) = P^{(B)}_1(0,1,0) = P^{(C)}_1(0,0,1) = 1
$$

and zero otherwise.



We then know that the number of string of length $n+1$ starting with an $A$ can be expressed as:
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(B)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

and like-wise
$$
P^{(B)}_{n+1}(a,b+1,c) = P^{(A)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

$$
P^{(C)}_{n+1}(a,b,c+1) = P^{(A)}_{n}(a,b,c) + P^{(B)}_{n}(a,b,c)
$$



It is clear that the three types of function are symmetric and related under permutations of labels
$$
P^{(A)}_{n}(a,b,c)=P^{(A)}_{n}(a,c,b)=P^{(B)}_{n}(c,a,b)=P^{(C)}_{n}(b,c,a)
$$

We therefore have not three relations but only a single one, i.e.,
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(A)}_{n}(b,c,a) + P^{(A)}_{n}(c,a,b)
$$

Since we know that $n=a+b+c$ we can drop the subscript $n$, and if we choose that the first character of a string corresponds to one of which the total number corresponds to the first argument this simplifies to
$$
P(a+1;b,c) = P(b;c,a) + P(c;a,b)
$$

with $P(1;0,0)=1$ and $P(x;y,z)=0$ whenever one or more arguments are negative.



This can easily be programmed and we find that the total number of strings of the problem can be found as
$$
P(4;5,6) + P(5;6,4) + P(6;4,5) = 4315
$$



It is also possible to directly count the number of strings by using a suitable classification system. For instance the six $C$'s will not be adjacent in the string
$$
*C-C-C-C-C-C*
$$

Hence at the locations $-$ there has to be some combination of $A$'s and $B$'s, and at the locations $*$ there might be such a string.



The four $A$'s will have to be placed within those 7 locations. They can be distributed in five types of fashion, i.e., ${$ABABABA$}$ when all $A$'s are found at a single of the seven locations (properly separated by $B$'s of course). The other four types split the $A$'s in two, three, or four smaller groups ${$ABABA,A$}$,${$ABA,ABA$}$,${$ABA,A,A$}$,${$A,A,A,A$}$ that each have to be placed at a different location within the 7 possible ones. Within this process some of the $B$'s are already fixed by necessity to separate the $A$'s, some others will have to be at one or more particular locations to form $CBC$ combinations. The remaining $B$'s can be distributed either as $ABC$,$CBA$-combinations or at the outer ends of the string.



A careful counting and analysis is needed for each case to find the appropriate number of strings. For instance the first type ${ABABABA}$ can actually not occur, as it would results in two adjacent $C$'s.



Give it a go and let me know if and where you get in trouble.






share|cite|improve this answer























  • Well, I came up with a different result (updated in the question post)
    – Iceghost
    Nov 20 at 6:30

















up vote
2
down vote



accepted










The simplest approach would be to set up a counting algorithm using recurrence relations. To this end consider the function $P^{(A)}_n(a,b,c)$ that counts the number of valid strings formed by $a$ times an $A$, $b$ times a $B$, and $c$ times a $C$, that satisfy the constraint that no two $A$'s, $B$'s, or $C$'s will be adjacent, and that will start with an $A$ as the first character. Similarly, we consider the functions $P^{(B)}_n(a,b,c)$ and $P^{(C)}_n(a,b,c)$. The arguments are non-negative $a,b,c geq 0$ and $n=a+b+c geq 1$ is the length of the string.



For $n=1$ the functions are initialised by
$$
P^{(A)}_1(1,0,0) = P^{(B)}_1(0,1,0) = P^{(C)}_1(0,0,1) = 1
$$

and zero otherwise.



We then know that the number of string of length $n+1$ starting with an $A$ can be expressed as:
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(B)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

and like-wise
$$
P^{(B)}_{n+1}(a,b+1,c) = P^{(A)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

$$
P^{(C)}_{n+1}(a,b,c+1) = P^{(A)}_{n}(a,b,c) + P^{(B)}_{n}(a,b,c)
$$



It is clear that the three types of function are symmetric and related under permutations of labels
$$
P^{(A)}_{n}(a,b,c)=P^{(A)}_{n}(a,c,b)=P^{(B)}_{n}(c,a,b)=P^{(C)}_{n}(b,c,a)
$$

We therefore have not three relations but only a single one, i.e.,
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(A)}_{n}(b,c,a) + P^{(A)}_{n}(c,a,b)
$$

Since we know that $n=a+b+c$ we can drop the subscript $n$, and if we choose that the first character of a string corresponds to one of which the total number corresponds to the first argument this simplifies to
$$
P(a+1;b,c) = P(b;c,a) + P(c;a,b)
$$

with $P(1;0,0)=1$ and $P(x;y,z)=0$ whenever one or more arguments are negative.



This can easily be programmed and we find that the total number of strings of the problem can be found as
$$
P(4;5,6) + P(5;6,4) + P(6;4,5) = 4315
$$



It is also possible to directly count the number of strings by using a suitable classification system. For instance the six $C$'s will not be adjacent in the string
$$
*C-C-C-C-C-C*
$$

Hence at the locations $-$ there has to be some combination of $A$'s and $B$'s, and at the locations $*$ there might be such a string.



The four $A$'s will have to be placed within those 7 locations. They can be distributed in five types of fashion, i.e., ${$ABABABA$}$ when all $A$'s are found at a single of the seven locations (properly separated by $B$'s of course). The other four types split the $A$'s in two, three, or four smaller groups ${$ABABA,A$}$,${$ABA,ABA$}$,${$ABA,A,A$}$,${$A,A,A,A$}$ that each have to be placed at a different location within the 7 possible ones. Within this process some of the $B$'s are already fixed by necessity to separate the $A$'s, some others will have to be at one or more particular locations to form $CBC$ combinations. The remaining $B$'s can be distributed either as $ABC$,$CBA$-combinations or at the outer ends of the string.



A careful counting and analysis is needed for each case to find the appropriate number of strings. For instance the first type ${ABABABA}$ can actually not occur, as it would results in two adjacent $C$'s.



Give it a go and let me know if and where you get in trouble.






share|cite|improve this answer























  • Well, I came up with a different result (updated in the question post)
    – Iceghost
    Nov 20 at 6:30















up vote
2
down vote



accepted







up vote
2
down vote



accepted






The simplest approach would be to set up a counting algorithm using recurrence relations. To this end consider the function $P^{(A)}_n(a,b,c)$ that counts the number of valid strings formed by $a$ times an $A$, $b$ times a $B$, and $c$ times a $C$, that satisfy the constraint that no two $A$'s, $B$'s, or $C$'s will be adjacent, and that will start with an $A$ as the first character. Similarly, we consider the functions $P^{(B)}_n(a,b,c)$ and $P^{(C)}_n(a,b,c)$. The arguments are non-negative $a,b,c geq 0$ and $n=a+b+c geq 1$ is the length of the string.



For $n=1$ the functions are initialised by
$$
P^{(A)}_1(1,0,0) = P^{(B)}_1(0,1,0) = P^{(C)}_1(0,0,1) = 1
$$

and zero otherwise.



We then know that the number of string of length $n+1$ starting with an $A$ can be expressed as:
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(B)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

and like-wise
$$
P^{(B)}_{n+1}(a,b+1,c) = P^{(A)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

$$
P^{(C)}_{n+1}(a,b,c+1) = P^{(A)}_{n}(a,b,c) + P^{(B)}_{n}(a,b,c)
$$



It is clear that the three types of function are symmetric and related under permutations of labels
$$
P^{(A)}_{n}(a,b,c)=P^{(A)}_{n}(a,c,b)=P^{(B)}_{n}(c,a,b)=P^{(C)}_{n}(b,c,a)
$$

We therefore have not three relations but only a single one, i.e.,
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(A)}_{n}(b,c,a) + P^{(A)}_{n}(c,a,b)
$$

Since we know that $n=a+b+c$ we can drop the subscript $n$, and if we choose that the first character of a string corresponds to one of which the total number corresponds to the first argument this simplifies to
$$
P(a+1;b,c) = P(b;c,a) + P(c;a,b)
$$

with $P(1;0,0)=1$ and $P(x;y,z)=0$ whenever one or more arguments are negative.



This can easily be programmed and we find that the total number of strings of the problem can be found as
$$
P(4;5,6) + P(5;6,4) + P(6;4,5) = 4315
$$



It is also possible to directly count the number of strings by using a suitable classification system. For instance the six $C$'s will not be adjacent in the string
$$
*C-C-C-C-C-C*
$$

Hence at the locations $-$ there has to be some combination of $A$'s and $B$'s, and at the locations $*$ there might be such a string.



The four $A$'s will have to be placed within those 7 locations. They can be distributed in five types of fashion, i.e., ${$ABABABA$}$ when all $A$'s are found at a single of the seven locations (properly separated by $B$'s of course). The other four types split the $A$'s in two, three, or four smaller groups ${$ABABA,A$}$,${$ABA,ABA$}$,${$ABA,A,A$}$,${$A,A,A,A$}$ that each have to be placed at a different location within the 7 possible ones. Within this process some of the $B$'s are already fixed by necessity to separate the $A$'s, some others will have to be at one or more particular locations to form $CBC$ combinations. The remaining $B$'s can be distributed either as $ABC$,$CBA$-combinations or at the outer ends of the string.



A careful counting and analysis is needed for each case to find the appropriate number of strings. For instance the first type ${ABABABA}$ can actually not occur, as it would results in two adjacent $C$'s.



Give it a go and let me know if and where you get in trouble.






share|cite|improve this answer














The simplest approach would be to set up a counting algorithm using recurrence relations. To this end consider the function $P^{(A)}_n(a,b,c)$ that counts the number of valid strings formed by $a$ times an $A$, $b$ times a $B$, and $c$ times a $C$, that satisfy the constraint that no two $A$'s, $B$'s, or $C$'s will be adjacent, and that will start with an $A$ as the first character. Similarly, we consider the functions $P^{(B)}_n(a,b,c)$ and $P^{(C)}_n(a,b,c)$. The arguments are non-negative $a,b,c geq 0$ and $n=a+b+c geq 1$ is the length of the string.



For $n=1$ the functions are initialised by
$$
P^{(A)}_1(1,0,0) = P^{(B)}_1(0,1,0) = P^{(C)}_1(0,0,1) = 1
$$

and zero otherwise.



We then know that the number of string of length $n+1$ starting with an $A$ can be expressed as:
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(B)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

and like-wise
$$
P^{(B)}_{n+1}(a,b+1,c) = P^{(A)}_{n}(a,b,c) + P^{(C)}_{n}(a,b,c)
$$

$$
P^{(C)}_{n+1}(a,b,c+1) = P^{(A)}_{n}(a,b,c) + P^{(B)}_{n}(a,b,c)
$$



It is clear that the three types of function are symmetric and related under permutations of labels
$$
P^{(A)}_{n}(a,b,c)=P^{(A)}_{n}(a,c,b)=P^{(B)}_{n}(c,a,b)=P^{(C)}_{n}(b,c,a)
$$

We therefore have not three relations but only a single one, i.e.,
$$
P^{(A)}_{n+1}(a+1,b,c) = P^{(A)}_{n}(b,c,a) + P^{(A)}_{n}(c,a,b)
$$

Since we know that $n=a+b+c$ we can drop the subscript $n$, and if we choose that the first character of a string corresponds to one of which the total number corresponds to the first argument this simplifies to
$$
P(a+1;b,c) = P(b;c,a) + P(c;a,b)
$$

with $P(1;0,0)=1$ and $P(x;y,z)=0$ whenever one or more arguments are negative.



This can easily be programmed and we find that the total number of strings of the problem can be found as
$$
P(4;5,6) + P(5;6,4) + P(6;4,5) = 4315
$$



It is also possible to directly count the number of strings by using a suitable classification system. For instance the six $C$'s will not be adjacent in the string
$$
*C-C-C-C-C-C*
$$

Hence at the locations $-$ there has to be some combination of $A$'s and $B$'s, and at the locations $*$ there might be such a string.



The four $A$'s will have to be placed within those 7 locations. They can be distributed in five types of fashion, i.e., ${$ABABABA$}$ when all $A$'s are found at a single of the seven locations (properly separated by $B$'s of course). The other four types split the $A$'s in two, three, or four smaller groups ${$ABABA,A$}$,${$ABA,ABA$}$,${$ABA,A,A$}$,${$A,A,A,A$}$ that each have to be placed at a different location within the 7 possible ones. Within this process some of the $B$'s are already fixed by necessity to separate the $A$'s, some others will have to be at one or more particular locations to form $CBC$ combinations. The remaining $B$'s can be distributed either as $ABC$,$CBA$-combinations or at the outer ends of the string.



A careful counting and analysis is needed for each case to find the appropriate number of strings. For instance the first type ${ABABABA}$ can actually not occur, as it would results in two adjacent $C$'s.



Give it a go and let me know if and where you get in trouble.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Oct 29 at 20:27

























answered Oct 29 at 19:22









Ronald Blaak

2,339310




2,339310












  • Well, I came up with a different result (updated in the question post)
    – Iceghost
    Nov 20 at 6:30




















  • Well, I came up with a different result (updated in the question post)
    – Iceghost
    Nov 20 at 6:30


















Well, I came up with a different result (updated in the question post)
– Iceghost
Nov 20 at 6:30






Well, I came up with a different result (updated in the question post)
– Iceghost
Nov 20 at 6:30




















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2976168%2fwhat-is-the-number-of-different-ways-to-seat-15-students-where-no-two-students-o%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How do I know what Microsoft account the skydrive app is syncing to?

When does type information flow backwards in C++?

Grease: Live!