Compute the number of subsets of (1,2,3,...20) with four elements such that no two elements are consecutive. Please explain explicitly! Thank you very much!!
-
1Have you started by working through a few examples. E.g., if 1 is in the set of 4, how many choices are there for the 2nd, 3rd and 4th elements? What now if 2 is in the set of 4? – Simon S Oct 30 '14 at 21:01
-
A good starting point would be a formula for how many nonconsecutive pairs are in ${1,\ldots,n}$. This leads to counting triples from ${1,\ldots,n}$ without consecutive numbers, and thence to subsets of size 4. – hardmath Oct 30 '14 at 21:04
-
Are you saying that in selecting 4 elements from the set, no two of them should be consecutive? Because then your question will be much similar to this one:http://math.stackexchange.com/questions/957940/choice-problem-choose-5-days-in-a-month-consecutive-days-are-forbidden/957968#957968 – najayaz Oct 31 '14 at 22:02
-
thank you, it helps me a bit with the concept!! – Annie Nov 04 '14 at 02:06
1 Answers
You are pretty much looking for any subset such that values next to each other are not equal to each other (i.e. $\{1, 1, 3, 4\}$ is invalid, but $\{1, 3, 1, 4\}$ is valid)
Let the subset be represented by $\{ n_{1} ,\, n_{2} ,\, n_{3} ,\, n_{4} \}$. Your possible choices for $n_{1}$ are $\{1, 2, 3, \dots, 20\}$. This gives us 20 possible choices for $n_{1}$. Our next value, $n_{2}$, can be any of the 20 numbers except for $n_{1}$. That leaves us with 19 possible choices for $n_{2}$. The value for $n_{3}$ can be any of the 20 numbers except for $n_{2}$ ($n_{1}$ can be included because it's not next to $n_{3}$). Finally, $n_{4}$ can be any of the possible values except for $n_{3}$.
This gives you:
$$ \left|\{n_{1} ,\, n_{2} ,\, n_{3} ,\, n_{4} \}\right| = 20 \cdot 19 \cdot 19 \cdot 19$$
Notice that I am approaching this problem in a left-to-right way (i.e. $n_{2}$ cannot be defined until $n_{1}$ is defined). If you are randomly assigning numbers to the subset (i.e. $n_{4}$ is assigned first, then $n_{2}$ is assigned, etc.) you will need to consider the values on either side of the value you're assigning and not just on the left-hand side.
Hope this helps!

- 229