What is the probability that a particle will overcome a barrier consisting of the same N obstacles located one after another? Someone is shooting a particle at an obstacle. The particle can either overcome the obstacle (with probability D), or bounce off it and fly back. After overcoming the obstacle or after reflection from it, the state of motion of the particle does not change in any way (that is, if it meets the second exactly the same barrier, then the probability of overcoming it will still be equal to D).
I tried to draw it, in theory it looks something like this:

this, as I understand it, will be a random walk: https://en.wikipedia.org/wiki/Gambler%27s_ruin Although... it seems like you just need to add up all the reflections. Well, or maybe there is a connection between the problem... But I can't figure out something. I am wondering how to get the recurrence relation, because with random walks the problem gets more complicated.
 A: 
EDIT: while this does not answer OP's question, this yields the probability of overcoming all obstacles without ever passing backwards the obstacles.

With two obstacles. Probability of overcoming is $p$. So we have
$$\begin{aligned}P(\textrm{overcome both})=&P(\textrm{over 1})P(\textrm{over 2})+ \\ &P(\textrm{over 1})P(\textrm{bounce 2})P(\textrm{bounce 1})P(\textrm{over 2})+\\
&P(\textrm{over 1})P(\textrm{bounce 2})P(\textrm{bounce 1})P(\textrm{bounce 2})P(\textrm{bounce 1})P(\textrm{over 2})+\\&...\\&P(\textrm{over 1})P(\textrm{bounce 2})^nP(\textrm{bounce 1})^nP(\textrm{over 2})+\\&...\end{aligned}$$
So essentially
$$P(\textrm{overcome both})=\sum_{k=0}^\infty p^2(1-p)^{2k}=\frac{p^2}{1-(1-p)^2}=\frac{p}{2-p}$$
With three obstacles
$$\begin{aligned}P(\textrm{overcome all three})=&P(\textrm{over 1})P(\textrm{over 2})P(\textrm{over 3})+ \\ &P(\textrm{over 1})P(\textrm{bounce 2})P(\textrm{bounce 1})P(\textrm{over 2})P(\textrm{over 3})+\\
&...\\&P(\textrm{over 1})P(\textrm{bounce 2})^nP(\textrm{bounce 1})^nP(\textrm{over 2})P(\textrm{over 3})+\\&...\\ &P(\textrm{over 1})P(\textrm{bounce 2})P(\textrm{bounce 1})P(\textrm{over 2})P(\textrm{bounce 3})P(\textrm{bounce 2})P(\textrm{over 3})+\\
&...\\&P(\textrm{over 1})P(\textrm{bounce 2})^nP(\textrm{bounce 1})^nP(\textrm{over 2})P(\textrm{bounce 3})P(\textrm{bounce 2})P(\textrm{over 3})+\\&...\end{aligned}$$
So
$$P(\textrm{overcome all three})=\sum_{m=0}^\infty\sum_{k=0}^\infty p^3(1-p)^{2k}(1-p)^{2m}=\frac{p}{(2-p)^2}$$
I think we can do
$$P(\textrm{overcome n})=\sum_{k_1=0}^\infty\sum_{k_2=0}^\infty(...)\sum_{k_{n-1}=0}^\infty p^n(1-p)^{2k_1}(1-p)^{2k_2}...(1-p)^{2k_{n-1}}=\frac{p}{(2-p)^{n-1}}$$
A: We consider $2(n+1)$ states of the particle: $(k,d),\;k\in\{0,\ldots,n\}\;,d\in\{0,1\}$, which means that the particle is between obstacle $k$ and obstacle $k+1$ ($k=0$ means left of the leftmost obstacle, $k=n$ means right of the rightmost obstacle), and it moves in the direction $d$, where $d=0$ means towards the obstacles with higher indices and $d=1$ means towards the obstacles with the smaller indices. The probability of overcoming is $p$, and the probability of reflection is $q.$
Let $x_m\in\mathbb{R}^{2(n+1)}$ be the vector that contains the probabilities of the particle being in the states $(0,0),\;(0,1),\;(1,0),\;(1,1),\;\ldots,(n,0),\;(n,1)$ after $m$ obstacles. Then $x_0 = e_1$, because $(0,0)$ means starting at the left side of the first obstacle and going to the right, and $x_{m+1}=Ax_m$ with
$$
A=\begin{pmatrix}
0 &   &   &   &   &   &   &   &   &   0 \\
q & 1 &   & p &        &        &   &   &   &     \\
p &   &   & q &        &        &   &   &   &     \\
  &   & q &   &        & \ddots &   &   &   &     \\
  &   & p &   &        & \ddots &   &   &   &     \\
  &   &   &   & \ddots &        &   & p &   &     \\
  &   &   &   & \ddots &        &   & q &   &     \\
  &   &   &   &        &        & q &   &   & p   \\
  &   &   &   &        &        & p &   & 1 & q   \\
0 &   &   &   &        &        &   &   &   & 0
\end{pmatrix}
$$
The end states we are interested in are $(0,1)$, which is the second one in the list and represents the situation in which the particle has come back but now moves to the left, and $(n,0)$  which is the second to last one in the list and represents the situation in which the particle has overcome all obstacles and moves to the right.
The probability of the former one is
$$
(0\;1\;0 \ldots 0) \cdot \lim_{m\to\infty}x_m 
= (0\;1\;0 \ldots 0) \cdot\lim_{m\to\infty}A^m e_1 
= (0\;1\;0 \ldots 0) \cdot\left(\lim_{m\to\infty}A^m \right) e_1
$$
while the probability of the latter one is
$$
(0 \ldots 0\;1\;0) \cdot \lim_{m\to\infty}x_m 
=(0 \ldots 0\;1\;0) \cdot  \lim_{m\to\infty}A^m e_1
=(0 \ldots 0\;1\;0) \cdot  \left(\lim_{m\to\infty}A^m \right) e_1
$$
With a little bit of linear algebra, we can show that
$$
\lim_{m\to\infty}A^m = 
\frac{1}{n-(n-1)p}
\begin{pmatrix}
0 & 0 \\
1 & 0 \\
0 & 0 \\
\vdots & \vdots \\
0 & 0 \\
0 & 1 \\
0 & 0
\end{pmatrix}
\begin{pmatrix}
nq        &  -1q+1 \\
(n-1)q+1  &   0q   \\
(n-1)q    &   0q+1 \\
(n-2)q+1  &   1q   \\
(n-2)q    &   1q+1 \\
\vdots & \vdots \\
1q+1  &  (n-2)q \\
1q    &  (n-2)q+1 \\
0q+1  &  (n-1)q \\
0q    &  (n-1)q+1 \\
-1q+1 &  nq 
\end{pmatrix}^T
$$
So the probability of the particle getting back to the start is
$$ \frac{nq}{n-(n-1)p}
$$
and the probability of the particle overcoming all obstacles is
$$ \frac{p}{n-(n-1)p}
$$
