Distribution of a random variable waiting for a consecutive sequence of bits? Suppose we're trying to transmit a message comprised of $n$ bits. Assume each bit has a probability $p$ of being correct. Success means we succeed at consecutively transmitting all $n$ bits. As soon as an incorrect bit is sent, the transmitter restarts and tries to send the message again from scratch. Let $X$ be the random variable which gives the number of total bits transmitted until the moment of success.
What is the distribution of $X$? It doesn't seem like this is a standard geometric random variable because the "trials" are not Bernoulli - a "success" is a bunch of dependent Bernoulli trials..
I'm not probabilist so I may be missing something simple, but I'm fairly stuck here.
 A: The problem is not clear, I assume that the trasmitter receives feedback (error or not) after each bit, and that in case of error it resets, ie., it retries the full block trasmision from the start (this makes little practical sense, but...)
Let $T_i \in \{1\cdots n\}$ be the length of the $i$-th block with errors.
Then $T_i$ are iid truncated geometric variables, with $p_j=P(T_i=j)= \alpha p (1-p)^{j-1} $.  I leave up to you to compute the normalization factor $\alpha$ and the mean $\mu_T=E[T_i]$.
Let $Y$ be the total number of sent blocks (including the good one). That is itself a geometric variable, with probability of success $p_B=p^n$. Then $E(Y)=1/p_B=p^{-n}$
Now let $X$, the total number of sent bits. Then $X=T_1 + T_2 + \cdots +T_{Y-1}+n$
This means that 
$$E[X|Y]=(Y-1) \mu_T+n$$
Hence
$$E[X]=E[E[X|Y]]=(p^{-n}-1) \mu_T+n$$

Update: I missed that you wanted the distribution, not merely the expectation.
Well, let $Z=X-n$ be the bits in excess:
$$P_Z(z)=\sum_y P_{Z,Y}(z,y)=\sum_y P_{Z\mid Y}(z,y)P_Y(y)=\\
=\sum_{y=1}^\infty G(z;p,y-1) (1-p^{n})^{y-1}p^{n}
=\sum_{k=0}^\infty G(z;p,k) (1-p^{n})^{k}p^{n}$$
where $G(z;p,k)$ is the probability function of a sum $k$ geometric variables with parameter $p$, truncated to $[1\cdots n]$. 
(Good luck with simplifying that). Of course, $P(X=x)=P_Z(x-n)$

BTW: A more familiar way of presenting this problem is: we throw coins with probability of head $p$. How many coins must we throw till we get a run
of $n$ consecutive heads? See eg here http://www.cs.cornell.edu/~ginsparg/physics/info295/mh.pdf
