(Random Walk) Compute average relative number of consecutive cookies eaten from the right side of the gap Currently I am reading the paper 'Excited Random Walk in One Dimension.'
At page $8$ left column, the authors obtain the following: 

Probability that the walk eats precisely $r > 0$ consecutive cookies (we term this event a single “meal”) from the right edge of the cookie-free region is
  $$P(r) = 2q \frac{\Gamma(L)}{\Gamma(L-2q)} \frac{\Gamma(L+r-1-2q)}{\Gamma(L+r)}$$
  where $L-2$ refers to cookie-free gap and $p$ refers to probability of the walk moving to the right and $q$ is the probability of the walk moving to the left.  

However, when they calculate the average relative number of consecutive cookies eaten from the right side of the gap, they compute 
$$\int_0^\infty \tilde{r} \tilde{P}(\tilde{r})\,d\tilde{r}$$
where $\tilde{r} = \frac{r}{L}$ and $\tilde{P} = LP(r).$

Question: Why do they integrate with respect to $\tilde{r}$ with integrand $\tilde{P}?$ 
  I thought to find the average number of cookie eaten, one just needs to compute 
  $$\int_0^\infty r P(r)\, dr$$
  instead of the above. 

 A: The two expressions denote a change of variable (change of scale): they apply
$$
\eqalign{
  & 1 = \int_{\,r\, = \,0}^{\;\infty } {P(r)dr}  = \int_{\,r\, = \,0}^{\;\infty } {LP(r)d\left( {{r \over L}} \right)}  =   \cr 
  &  = \int_{\,r\, = \,0}^{\;\infty } {LP\left( {L{r \over L}} \right)d\left( {{r \over L}} \right)} 
 = \int_{\,\tilde r\, = \,0}^{\;\infty } {LP\left( {L\tilde r} \right)d\tilde r}  =   \cr 
  &  = \int_{\,\tilde r\, = \,0}^{\;\infty } {\tilde P\left( {\tilde r} \right)d\tilde r}  \cr} 
$$
to pass from $r,P(r)$ to $\tilde r,\tilde P\left( {\tilde r} \right)$ by putting
$$
\left\{ \matrix{
  \tilde r = r/L \hfill \cr 
  \tilde P\left( {\tilde r} \right) = LP\left( {L\tilde r} \right) = LP\left( r \right) \hfill \cr}  \right.
$$
This is a totally licit and very common operation done in probability, for example when reconducing 
a Normal distribution with a given $\sigma$ to the standard one.
They explain that such a "standardization" allows to simplify (in some cases) the expressions by "absorbing"
the $L$ parameter, which is in fact a scale parameter.  The parallel with the Normal helps
to understand why.
That premised, concerning your doubt on the average, 
$$
\int_{\,\tilde r\, = \,0}^{\;\infty } {\tilde r\,\tilde P\left( {\tilde r} \right)d\tilde r} 
$$
gives of course the average of $\tilde r$ , denoted as $ \left\langle {\tilde r} \right\rangle$
which tied to $ \left\langle {r} \right\rangle$ by
$$
\left\langle {\tilde r} \right\rangle  = \left\langle {r/L} \right\rangle  = \left\langle r \right\rangle /L
$$
In fact, soon after eq. (31) they speak of avg.$\tilde r$ as the "average relative number of consecutive cookies ..": 
relative is understood to refer to $/L$, and actually immediately below they give 
$\left\langle {\tilde r} \right\rangle  = \left\langle {r/L} \right\rangle  =  \cdots $.
Addendum
Going back to eq.(30) reported at the beginning of your post
$$
P(r) = 2q{{\Gamma (L)} \over {\Gamma (L - 2q)}}{{\Gamma (L + r - 1 - 2q)} \over {\Gamma (L + r)}}
$$
The average number of $r$ would be given by
$$
\left\langle r \right\rangle  = \sum\limits_{0\, < \,r} {r\,P(r)} 
  = 2q{{\Gamma (L)} \over {\Gamma (L - 2q)}}\sum\limits_{0\, \le \,r} {\left( {r + 1} \right)\,{{\Gamma (L + r - 2q)} \over {\Gamma (L + r + 1)}}} 
$$
In the above $q$ is a real number in the range $(0,1)$; the sum above 
can be expressed by means of the Gaussian Hypergeometric Function as
$$
\left\langle r \right\rangle  = {{2q} \over L}\;{}_2F_{\,1} \left( {2,\,L - 2q\,;\;L + 1\,;1} \right)
$$
which, in virtue of the Gaussian theorem gives simply
$$
\eqalign{
  & \left\langle r \right\rangle  = {{2q} \over L}{{\Gamma (L + 1)\Gamma ( - 1 + 2q)} \over {\Gamma (L - 1)\Gamma (1 + 2q)}}
\quad \left| {\,0 < {\mathop{\rm Re}\nolimits} \left( { - 1 + 2q} \right)} \right.\quad  =   \cr 
  &  = \left\{ {\matrix{  {{{\left( {L - 1} \right)} \over {\left( {2q - 1} \right)}}}
  & {\left| \matrix{  \;1 \le L \hfill \cr   \;1/2 < q \hfill \cr}  \right.}  \cr   \infty
   & {\left| \matrix{\;1 \le L \hfill \cr  \;q \le 1/2 \hfill \cr}  \right.}  \cr  } } \right. \cr
} 
$$
which, for large $L$, correspond to eq.(32).
To this regard we shall note that:
 - the summand $\left( {r + 1} \right)\,{{\Gamma (L + r - 2q)} \over {\Gamma (L + r + 1)}}$ has a series expansion at $r=\infty$ which
is $1/r^{2q} + O(1/r^{2q+1})$ and the sum is therefore convergent for $1<2q$;
 - the Hypergeometric $ {}_2F_{\,1} \left( {a,\,b\,;\;c\,;z} \right)$ has a singularity at $z=1$, so that 
its value there shall be taken in the limit with due restrictions;
 - the restrictions are those provided for the validity of its conversion into the fraction with Gammas, i.e. $0<1-2q$.
