2
$\begingroup$

For example, we have $n = 5$ boys and $m = 6$ girls, we don't want $k \le min(n, m)$ | $k = 3$ boys or girls to sit next to each other.

A valid arrangement: $BBGGBGGBGG$

An invalid arrangement: $BBBGGBGGBGG$ - There are $3$ boys sit next to each other.

And we ignore the permutation between any group of boys and girls so $BBGGBGGBGG$ is considered only $1$ way

$\endgroup$
  • $\begingroup$ elcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to. $\endgroup$ – José Carlos Santos Nov 18 '18 at 9:58
  • $\begingroup$ Note that sometimes it is impossible, for example if you have 10 boys and 2 girls and k=3, because in any arrangement you use there will be 3 or more boys sitting next to each other. I think for the general case you must have $k>\frac{|m-n|}{2}-2$ But I might be wrong in this one $\endgroup$ – Fareed AF Nov 18 '18 at 10:20
  • $\begingroup$ I'm sorry, It should be like this $k \le min(n, m)$. $\endgroup$ – Nhân Nguyễn Nov 18 '18 at 10:22
  • $\begingroup$ @FareedAF If that scenario happens, the answer can only be 0 because there are no way we can arrange, right? $\endgroup$ – Nhân Nguyễn Nov 18 '18 at 10:32
  • $\begingroup$ Yes thats what I meant by impossible, 0 ways $\endgroup$ – Fareed AF Nov 18 '18 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.