9

The problem is as follows:

How many ways are there to pick $6$ of the first $20$ positive integers such that no $2$ of them are consecutive?

At first glance, this seems like a fairly straightforward combinatorics problem, but after trying it (and failing) I decided it isn't as easy as it looks.

My method was to find the number of ways you can choose $6$ integers such that there does exist consecutive integers, then subtract that from the total number of possibilities (${20 \choose 6}$ )

The first thing I did was to take all the possibilities for pairs of consecutive integers (there are $19$ of them, starting $(1,2),(2,3),(3,4),\dots,(19,20)$). There are $\binom{18}{4}$ ways to pick the remaining $4$ integers, hence there are a total of

$$19\times \binom{18}{4}=58140$$ possibilites. However, this number is greater than the total number of possibilities (which is $38760$). What am I doing wrong?

Edward Jiang
  • 3,670
  • 1
    The problem is that you're overcounting. For example, suppose you initially select the pair $(1,2)$, then pick $3,4,5,6$. If you pick $(3,4)$ initially, then this is not distinct from $(3,4),(1,2,5,6)$, but you are treating them as different in your computation. – Alex Wertheim Nov 20 '14 at 02:09
  • You could use your basic idea, supplemented by Inclusion/Exclusion. However, there is a simpler way. – André Nicolas Nov 20 '14 at 02:13

3 Answers3

8

Solution via stars and bars:

Suppose the numbers you select are bars and the non-selected numbers are stars. Then we need to find the number of arrangements such that between any two bars there is at least one star.(there are $6$ bars and $14$ stars).

There are $5$ spaces between bars. Thus there must necessarily be $5$ stars in there. So all we have to do now is fix the remaining $15$ objects ($9$ stars and $6$ bars) we can do this in $\binom{15}{6}$ ways.

Asinomás
  • 105,651
6

Suppose you have already selected the $6$ integers.Order them in increasing order. Subtract $1$ to the second number, $2$ to the third number $3$ to the fourth number, $4$ to the fifth number and $5 to the sixth number.

You will now have $6$ different numbers between $1$ and $15$. These numbers are uniquely determined by the initial integers.

Conversely take $6$ numbers between $1$ and $15$(Possibly some of them consecutive) and add $1$ to the second, $2$ to the third and so on. You will now have $6$ numbers, none of them consecutive, and all of them between $1$ and $20$.

Thus there are as many ways to pick $6$ non-consecutive numbers as there are to pick $6$ number between $1$ and $15$ freely.

Thus the answer is $\binom{15}{6}$

Asinomás
  • 105,651
2

For any selection of k non-constitutive integers from a n-element set X={$x_1x_2...x_n$}

Any subset of S of X can be represented as a binary string,
$b_s$ = $a_1a_2...a_n$ , where $a_i=1$ if $x_i \in S$,$0$ otherwise.

Clearly we want to count $b_s$ having exactly k $1$'s and (n-k) $0$'s $s.t$ $b_s$ contains no consecutive $1$'s. There are total $(n-k+1)$ positions for $1$'s to appear, as it can appear between any two consecutive $0$'s (total n-k-1 options)or left to first $0$ or right to the last $0$. We need to select k of these positions to place k $1$'s. So, there are total ${n-k+1\choose k}$ ways.

arindam mitra
  • 1,421
  • 1
  • 12
  • 20