0
$\begingroup$

Say we can make a sequence of 2 or 4 numbers using elements 0-9. Special sequences are defined as any sequence length 2 or 4 with at least half of the numbers being the same and in a row. So 1,1 is a special sequence, 1,3 is a special sequence, 2,3,4,2 is not, 2,2,3,4 is a special sequence. How many special sequences are there?

Attempt at solution: I know that all 2 number sequences are valid, since each contains at least one of the same number in a row. So there are 10 x 10 = 100 special 2 number sequences.

For 4 number sequences, I am looking at the sequence as 4 slots, _ _ _ _. I need to place at least two of the same number in consecutive order. This means I can choose 1 of 10 possible numbers, and place the start of the sequence in either the first slot, second slot, or third slot. The fourth slot is not long enough to hold a two number sequence.
So, I choose, 1 of 10 numbers to be the repeated number, choose 1 of three slots to add this 2 number sequence, and fill the 2 remaining slots with any of the 10 numbers.

So, for 4 number sequences...

${10 \choose 1}$ x ${3 \choose 1}$ x 2${10 \choose 1}$

However, I realize I am double counting, because a sequence such as 1122 could be obtained by choosing 2 as the repeated element, starting the sequence in the 3rd slot, and happening to fill the other slots with 1s. This could also be obtained by choosing 1 to be the repeated element, starting the sequence of 1s in the first slot, and happening to choose 2s to fill the third and fourth slots.

How could I account for this double counting?

  • 0
    Is 2,2,2,3 a special sequence?2017-02-22
  • 0
    Yes, because "at least half of the numbers are the same and in a row". Hope that clarifies!2017-02-22
  • 0
    Thanks, I wasn't sure whether "half the numbers" meant half the total numbers in the sequence (4) or half the distinct numbers (3). You might want to edit your question to clarify.2017-02-22

1 Answers 1

1

Let us count non-special sequences of length 4. These will be sequences where consecutive digits must be different; if any consecutive digits were the same, we would have two (= half of four) consecutive equal digits and the sequence would be special. How many such sequences are there? For the first digit we have 10 choices, for the second we have 9 (it can't equal the previous digit), for the third we have 9 (similar reasoning), for the fourth, 9. This is $10 \times 9 \times 9 \times 9 = 7290$ non-special sequences.

There are $10^4 = 10000$ total sequences of length 4. So the number of special sequences is $10000 - 7290 = 2710$.

(Your method of counting can be modified to give the same answer, but you have to subtract the double-counted sequences and add the sequences of the type XXXY etc.)

  • 0
    I see. Thank you, this method is a much better approach. Just out of curiosity with this problem, could the same method be applied if we had a sequence of length 6 and special sequences had to contain at least 3 of some number in a row?2017-02-22
  • 0
    In the general case, the method in parentheses in my answer, which is similar to what you were trying, would be easier. The other method works only because the length is 4.2017-02-22