You construct a binary sequence of length $12$ consisting of seven zeros and five ones.
(a) How many strings are there?
(b) How many of them have no two consecutive zeros?
(c) How many have at least three ones among the first four entries?
(d) How many do not contain the substring $0000$?
(e) How many strings are there with the property that each entry has at least one neighboring digit identical with it? Good examples are 110000111000, 001100111000, 111110000000.
My attempts:
How many strings are there?
We cannot tell the zeros and the ones apart, so using the multinomial coefficient, there are $\displaystyle\frac{12!}{7!5!}=792$ strings.
How many of them have no two consecutive zeros?
Group the zeros into groups of 2. So we have to arrange: 00,00,00,0,1,1,1,1,1
We have 9 elements to arrange and we cannot distinguish the three groups of 00 and the five ones. So there are $\displaystyle\frac{9!}{3!5!}=504$ strings that contain two consecutive zeros.
So there are $792-504=288$ strings.
How many have at least three ones among the first four entries?
Case $1$: 3 ones in the first four entries
Step $1$: Place 3 ones in the first four entries: $1$ way
Step $2$: Place a zero in the fourth entry: $1$ way
Step $3$: Arrange $1,1,0,0,0,0,0,0$: $\displaystyle\frac{8!}{2!6!}=28$ ways
Case $2$: $4$ ones in the first four entries
Step $1$: Place $4$ ones in the first four entries
Step $2$: Arrange remaining one and seven zeros: $\displaystyle\frac{8!}{7!}=8$ strings
So there are $28+8=36$ strings.
How many do not contain the substring $0000$?
Arrange $0000,0,0,0,1,1,1,1,1$
$\displaystyle\frac{9!}{3!5!}=504$ strings containing $0000$
So there are $792-504=288$ strings that do not contain $0000$.
How many strings are there with the property that each entry has at least one neighboring digit identical with it? Good examples are 110000111000, 001100111000, 111110000000.
I am stuck on this part.
To start off, let me help you fix some mistakes.
For (b) there are no ways to create such a string, so I don't know what happened there.
For (c) there is more than one way to place three ones in the first four slots. This should be an easy fix.
For (d) you are counting for example 100000101011 twice. (1 0000 0 1 0 1 0 1 1 = 1 0 0000 1 0 1 0 1 1) You can fix this by considering two cases: the string starts with 0000 or it does not. The first case is pretty easy. For the second case, you can consider permuting 10000 with four ones and three zeroes.
For (e) I admit I don't have an elegant solution. You can consider two cases again: the five ones are together or they are not. The first case is pretty easy. For the second case you have a bunch of two ones and a bunch of three ones. You could first consider the case where the string either starts or ends with a one, there are only a few options there. For the other case, the string starts and ends with a zero, and the remaining is permuting 0110 with 01110 and the last 0.