1
$\begingroup$

Total number of ways in which $4$ people can be chosen from $16$ people sitting in a circle such that no two of them are neighbors.

Number of ways of choosing $4$ persons out of $16$ persons, is $\displaystyle \binom{16}{4}$.

Won't be able to go further, could someone help me with this, thanks.

  • 1
    See https://math.stackexchange.com/questions/2067356/no-of-ways-of-selecting-3-people-out-of-n for an example with different numbers but same principles.2017-01-14

2 Answers 2

2

Without any restrictions, there are $\dbinom{16}{4}$ ways

$16$ ways where all four people are neighbors

$16\dbinom{11}{1}$ ways where exactly three people are neighbors

Now for the case when two people are neighbors, no. of ways would be $$16\dbinom{12}{2}-\frac{16*11}{2}$$

$16\dbinom{12}{2}$ might look as the number of ways in which $2$ people are also sitting together. But we are counting twice the cases in which $2$ people are neighbors and the other $2$ are also sitting together.

So, first we have to count the number of cases in which $2$ pairs of people are sitting together.

There would be $16$ ways of selecting $2$ people sitting together.

Now for the other two we are left with $12$ people to choose from. There would be $11$ ways to select other $2$ neighboring people. Right now we have $16*11$ but we double counted each pair of neighbors. Ask me in the comments if you didn't get this part.

So, it would be $16*11/2$.

Thus the answer is

$$\dbinom{16}{4}-16-\left(16\dbinom{12}{2}-\frac{16*11}{2}\right)-16\dbinom{11}{1}=660$$

  • 0
    I was very confused after writing my answer. Take a small example. Suppose A,B,C,D,E,F,G,H are 8 persons sitting in a circle. So, can u tell me any combination of 4 persons where all of them are neighbors? if we take ABCD, A is near to B, B is near to C, C is near to D. But A and D are not neighbors. So, in ABCD, only three adjacent pairs are there, right?2017-01-14
  • 0
    Don't go into the term "neighbor". It simply means people sitting besides each other here like your ABCD.2017-01-14
  • 0
    i wrote a small program. if total number of persons is 8, I got answer as 22017-01-14
  • 0
    Are you talking abt 8 out of 16?2017-01-14
  • 0
    selection of 4 persons from 8 persons named (a,b,c,d,e,f,g,h) and valid combinations are aceg and bdfh according to a program I wrote. Verifying the results now. Can u see more?2017-01-14
  • 0
    Some other combinations would be adfh, acfh.2017-01-14
  • 0
    Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/51786/discussion-between-gyanshu-and-kiran).2017-01-14
  • 0
    adfh can not come because a and h are nearby as it is a circular arrangement. so is the case with acfh2017-01-14
  • 0
    Ya right, then I also see only 2 combinations.2017-01-14
  • 0
    then, there is error in both of our answers. I am also trying to find out the error.2017-01-14
  • 0
    Have you implemented correct algo? Can you share the program? Which language did u use?2017-01-14
  • 0
    i used php. how can I upload my program file here? it is too large to share in comment. i think algo is right. tested with selection of 4 from 8 and result was correct. for selection of 4 from 16, it gives output as 12682017-01-14
  • 0
    What is the answer it is showing for this problem?2017-01-14
  • 0
    I can edit my answer with the results of my program2017-01-14
  • 0
    Go on but do tell the answer it is showing2017-01-14
  • 0
    see my edit. answer is $1268$. see the split up in my edit. i have also given all the combinations generated.2017-01-14
  • 0
    do you want me to add the program as another answer?2017-01-14
  • 0
    wait, there is a small error in the program, updating the results.2017-01-14
  • 0
    you are right, i got programmatically 660 as output2017-01-14
  • 0
    I was confident in my solution still cross checking is always good. Thanks :P2017-01-14
  • 0
    i posted my program as an answer for anyone if useful.2017-01-14
  • 0
    Also post the output if you posted the program.2017-01-14
  • 0
    cannot do so. it generated all combinations and hence, maximum character limit does not allow me to post output2017-01-14
2

The number of ways to choose $k$ non-consecutive persons on a circle of size $n$ is -

${n-k+1 \choose k} - {n-k-1 \choose k-2}$

First term is the number of ways to choose k non-consecutive positions on a size n and the second term subtracts off those arrangements where positions 1 and n were both chosen.

I am taking reference Aryabhata explanation in the answer here.

  • 0
    please explain me how you get that formula, thanks2017-01-14
  • 0
    this gives 660 as output2017-01-14
  • 0
    @Kiran Yes 660 is the right answer.2017-01-15