Probability of Binomial twice of Geometric I've come up with an interesting result:
Let X be the amount of failures of $Bernoulli(p)$ until we get $(p)$.
$$X = Geo(p)$$ 
$$B = Bin\left(2X,\frac{1}{2}\right)$$
$$P(B=X)=\ ?$$
Turns out:
$$P(B=X)=\sqrt{p}$$
I found it using the Taylor expansion of $\frac{1}{\sqrt{1-p}}$, where the coefficient of $p^i$ turns out to be $P(Bin(2i,\frac{1}{2}) = i)$.  
I would like to see a probabilistic proof of this result.  

Explanation of the process in words:
Roll a die with probability $p$ of getting "X".
Each time that we don't get "X", toss 2 balanced coins and accumulate the number of heads and tails.
When you get "X", check if you got the same amount of heads and tails.
Programmatic explanation:
$$i = 0$$
$$while(!bernuli(p))\ \text{i++;}$$
$$Bin\left(2i,\frac{1}{2}\right)\stackrel{?}{=}i$$
Example
If we succeed immediately (with probability $p$), $X=0$, and $P(Bin(2\cdot 0, \frac{1}{2})=0)=1$, thus $P(B=0)=1$, thus contributing $p$ to the conditional sum, $p<\sqrt{p}$, and everything is alright.
 A: $\begin{eqnarray}P(B=X)&=&\sum_{x=0}^\infty P(B=X|X=x)P(X=x)\\
&=&\sum_{x=0}^\infty\binom{2x}{x}\left(\frac{1}{2}\right)^{2x}(1-p)^xp\\
&=&\sqrt{p}
\end{eqnarray}$
A: Sorry, I think your result is incorrect, using either definition of the geometric distribution.
A probabilistic interpretation of the experiment is based on the interpretation of the geometric distribution as the probabilities of the first success in a sequence of Bernoulli trials occuring on trial $k$: 
Start with no heads or tails.  Now (for the $p(i-p)^k$ definition) repeatedly roll a die that has a probability $p$ of coming up "X". and unless it comes up "X" flip two fair coins and accumlate the number of heads and tails -- if it comes up "X" just stop, the experiment is over.  For the $p(i-p)^k$ definition, reverse the steps:  Flip the coins and accumulate, and then stop if the $p$-die came up "X".  Your question is, what is the probability, after stopping, that the numbers of accumulated heads and tails will match?
Obviously, for smallish $p$, the probability (for the second interpretation) is at least $\frac{1}{2}p$, which is the probability of stopping after just one pair of coin flips $(p)$, times the probability of getting one head and one tail on those two flips.  For the first interpretation the probability is instead at least $p$ because if you stop immediately, the heads and tails will of course be equal.
However, for small $p$, $\frac12 p>\sqrt{p}$ so the answer $\sqrt{p}$ cannot be correct.
A: Let $S_n$ be simple random walk. For integer $a$, let $p_a=P(2a+S_{2X}=0)$ - that is starting the random walk at $2a$ rather then zero. The quantity of interest is $p_0$.
Consider the single double-step of the random walk and recall memorylessness of $X$ to get
$$p_a=p[a=0]+(1-p)(\frac 1 4 p_{a-1}+\frac 1 2p_a+\frac 1 4 p_{a+1})$$
Solution to this recurrence is $$p_i=p_0r^{|i|}$$ where $$r=\frac {1-\sqrt p}{1+\sqrt p}\sim 1-2\sqrt p$$ and we obtain $p_0=\sqrt p$ through normalization.
To get some further intuition as to how a square root appears, consider standard Brownian motion $B_X$ with exponential clock $X$ of rate $2\lambda$. Then density of $B_X$ at $0$ is $$f_{B_X}(0)=\int_0^\infty \frac 1{\sqrt{2\pi x}}2\lambda e^{-2\lambda x}\,dx=\sqrt\lambda$$
and more generally $$f_{a+B_X}(0)=\sqrt\lambda e^{-2\sqrt {\lambda} |a|}$$
