How many ways there are to choose $4 $ books so between each pair of chosen books there are at least $2$ non chosen ones.

combinatorics

A shelf contains $30 $ books in a row, how many ways there are to choose $4 $ books so between each pair of chosen books there are at least $2$ non chosen ones.

Tried to transform the question to stars and bars . But still have no clues. Any hints would be helpful .

Best Answer

Each admissible choice can be encoded as a binary word of length $30$ containing exactly $4$ ones, whereby the first three ones have at least two zeros immediately following. Deleting these zeros gives a binary word of length $24$ with $4$ ones and no extra conditions. Conversely: Given any binary word of length $24$ containing $4$ ones insert two zeros after the first three ones, and you obtain an admissible selection of $4$ books from the shelf. The number $N$ you are looking for therefore is $$N={24\choose4}=10\,626\ .$$