I am fairly new to generating functions and have been trying to solve the following recurrence for a computer science problem. 
$$ f(k,d,n) = \sum\_{i=1}^{n-1} \binom{n-2}{i-1} \left(\frac{1}{2}\right)^{n-2} \left(\sum\_{j=0}^{k} f(k-j,d-1,n-i)\cdot f(j,d-1,i)\right)$$
Note that
$$
f:\mathbb{N}^3 \rightarrow [0,1]
$$
with the following base cases:
$$ 
\begin{split}
f(k,d,1)& = \begin{cases} 
 1 & (k=0 \wedge d!=0) \vee (k=1 \wedge d=0)\\
 0 & \text{otherwise}
 \end{cases} \\
 f(k,d,2)&= \begin{cases} 
 1 & ((k=0 \wedge d!=1) \vee (k=2 \wedge d=1))\\
 0 & \text{otherwise}
 \end{cases} \\
\end{split}
$$ 
and the following domains:
$$
\begin{split}
n &\in \{1,2,3,4,\ldots\} \\
k &\in \{0,1,2,\ldots,n-1,n\} \\
d &\in \{-\infty,\ldots,-2,-1,0,1,2,\ldots,\infty\} \\
\end{split}
$$


From f(k,d,n) and base cases we can derive the following for d<0:
$$ f(k,d,n)= \begin{cases} 
 1 & k=0 \\
 0 & k>0
 \end{cases} \\
$$


I would like to mention that $f(k,d,n)$ can also be expressed as the following:
$$ f(k,d,n) = \sum\_{i=1}^{n-1} \binom{n-2}{i-1} \left(\frac{1}{2}\right )^{n-2} \left(\sum\_{j=0}^{k} f(j,d-1,n-i)\cdot f(k-j,d-1,i)\right)$$


Thank you for your time and help in advance.



Solving recurrence of a three variable function
Define
$$F\_d(x,y) := \sum\_{k\geq 0}\sum\_{n\geq 1} f(k,d,n) x^k \frac{y^{n-1}}{(n-1)!}.$$
Then the recurrence is equivalent to
$$\frac{\partial F\_d}{\partial y}(x,y) = F\_{d-1}(x,y/2)^2,$$
while the initial conditions imply
$$F\_0(x,0)=x,\quad F\_d(x,0)=1\ \text{for}\ d\ne 0$$
and
$$\frac{\partial F\_1}{\partial y}(x,0)=x^2,\quad \frac{\partial F\_1}{\partial y}(x,0)=1\ \text{for}\ d\ne 1.$$


This can be seen as a generalization of your [previous question](https://mathoverflow.net/q/360875).


