0

Find the number of ways in which from the set 1, 2, ..., 49 you can choose six different numbers so that at least two of them are consecutive.

I tried to solve it in this way: Two consecutive numbers can be:

  • 1,2 | 1,3 | 1,4 | ... | 1,49
  • 2,3 | 2,4 | 2,5 | ... | 2,49

and so on.So total ways of picking two consecutive numbers will be 1+2+3+..+48 which is 1176. And number of ways of picking other 4 numbers will be 47 * 46 * 45 * 44. So total combination will be 1176 * 47 * 46 * 45 * 44. Am I right? (sorry for bad english)

Bill Dubuque
  • 272,048
  • Can't follow your method (not even sure what you are saying the final result is). Look at the gaps between the numbers (and before the first and after the last). Use Stars and Bars. – lulu Oct 25 '23 at 11:51
  • 1
    Oh, you are saying "first pick a consecutive pair and then choose $4$ others without restrictions"? Well, that won't work. That method overcounts selections with multiple consecutive pairs. If the selection was, say $1,2,3,4,5,6$...which was the first consecutive pair you chose? – lulu Oct 25 '23 at 11:59
  • My method counts the complement: the number of selections with no consecutive pair. You can then get the desired result by subtracting from the total. – lulu Oct 25 '23 at 12:00
  • If you need convincing why your method doesn't work, consider what happens if we ask you to find the number of ways that you choose six different numbers from the set 1,2,3,4,5,6 such that at least two are consecutive. It should be obvious that there is only one way to choose six numbers from this set. Your erroneous approach would have you believe there were $\binom{6}{2}\times 4!$ ways which is clearly not equal to $1$. – JMoravitz Oct 25 '23 at 12:13

2 Answers2

2

The number of ways to choose 6 numbers will be $\binom{49}{6}$ and the number of ways to choose 6 non-consecutive numbers will be $\binom{44}{6}$ (refer to this).

Hence, the answer is $\binom{49}{6} - \binom{44}{6} = \boxed{6924764}$.

Infiniticity
  • 124
  • 9
1

You have done a bit of overcounting... Consider the case when the consecutive numbers of your choice are |1,2|. Also, let us suppose 3 and 4 are in the random four numbers that you have chosen from the remaining 47 numbers. Well, the case that 3 and 4 are in the six numbers that you have chosen is once again being considered in the case |3,4|. I hope you see your flaw...

This is how you actually do it:

Step 1Count the ways to choose any 6 distinct numbers: $\frac{49!}{6!43!}$.

Step 2Count the ways to choose 6 distinct non-consecutive numbers. Let the 6 non-consecutive numbers by $x_1, x_2, ..., x_6$. Now, $$(x_1-1)+[(x_2-x_1-2)+(x_3-x_2-2)...(x_6-x_5-2)]+(49-x_6)=38=a_1+a_2+...+a_7$$ where $a_1=x_1-1, a_2=x_2-x_1-2....$ We see that $a_1\ge 0, a_2\ge 0, ...$. Apply the formula for combination with repetition to get $\frac{44!}{38!6!}$

Step 3:If you deduct Step 2 from Step 1 you get the number of ways to choose 6 distinct numbers with at least two of them consecutive.