Tuples with 4 consecutive integers from 1 to 50

combinatoricsdiscrete mathematics

How many ways are there to pick an ordered tuple of 5 elements from the set of positive integers between 1 and 50 inclusive, provided that there must be at least one consecutive sequence of 4 consecutive elements?

So what I think is somehow we need to use inclusion exclusion principle ; So I proceed by calculating sequence with 5 consecutive element but then I have no idea how to proceed with this?

Best Answer

There are 47 sets of 4 consecutive elements, from $\{1,2,3,4\}$ to $\{47,48,49,50\}.$ For each of these, we can choose a fifth element for our 5-tuple in 46 ways, and this fifth element can be placed in the first or last position in the 5-tuple. So far our count is

$$47 \cdot 46 \cdot 2$$

Notice this count would include the 5-tuples with five consecutive elements as well; however each of these 5-tuples with 5 consecutive elements would have been counted twice, either by choosing as our fifth element the first or the last of the five consecutive numbers. [e.g the 5-tuple $(23,24,25,26,27)$ could be created by placing $23$ in front of the 4-tuple $(24,25,26,27)$ or by placing $27$ at the end of the 4-tuple $(23,24,25,26)$.]

Thus we need to subtract the number of 5-tuples with 5 consecutive elements, of which there are clearly 46. So our final count will be

$$47 \cdot 46 \cdot 2 - 46 = \boxed{4278}$$

N.B. I've assumed in the above that the 5-tuples are to be made from five different elements; if repetition were allowed, then in the first part of the computation, when choosing the fifth element there would be 50 choices rather than 46, so then the count would be

$$47 \cdot 50 \cdot 2 - 46 = \boxed{4654}$$