## How to solve a specific multivariate recurrence relation (or general ones)

### Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)

How do you solve this recurrence (or multivariate recurrences in general)? Note that $p\in[0,1]$ and $n\in\mathbb{N}$ are given constants, where $np\leq 1$.

$$f:(\mathbb{N}\cup\{0\})\times(\mathbb{N}\cup\{0\})\rightarrow[0,1]$$ Base case: $f(0,b)=(1-np)^b$ $\forall$ $b\geq 0$.

$f(a,b)=f(a-1,b-1)[n-(a-1)]p+f(a,b-1)[1-(n-a)p]$, if $a\leq \min{(n,b)}$.

$f(a,b)=0$, otherwise.

Note: The recursive definition could just be applied for $a\leq b$. The function values for $n< a\leq b$ (if $n < b$) can be set to $0$ afterwards.

I have attempted using a multivariate generating function, but it doesn't yield a good simplification. Also looked into somehow manipulating the formula for multivariate taylor series, but to no avail.

-

The constraint $a \leq \min(n,b)$ can be replaced by simply $a \leq b$ (values $f(a,b)$ for $a>n$ can be set to zero later). The reason is that if the first argument of $f(,)$ in the l.h.s. of the recurrent formula is $\leq n$, then so are the first arguments of $f(,)$ in the r.h.s. – Max Alekseyev Nov 29 at 5:05
What is $f(0,b)$ for $b>0$ ? – Max Alekseyev Nov 29 at 5:17
Oops, $f(0,b)$ for $b>0$ is now specified in the question. I suppose I will also modify the constraint to make working with it simpler. You're right, those values can be fixed to $0$ later. – unknown (google) Nov 29 at 6:36

## 2 Answers

I get $$f(a,b) = \frac{ (1-np)^b n!}{(n-a)!} \sum_{j=0}^b \binom{b}{j} \left\{ j \atop a \right\} \left(\frac{p}{1-np}\right)^j,$$ where $\left\{ j \atop a \right\}$ is a Stirling number of the second kind. I tested the formula in Mathematica against your recurrence for different values of $n$ and $p$, and they agree. Unfortunately I'm having trouble pasting the Mathematica input and output that verifies that agreement on this site without it turning into gobbledygook.

To get the formula I used Theorem 6 (which is actually due to Neuwirth) in my paper "On Solutions to a General Combinatorial Recurrence," Journal of Integer Sequences 14 (9): Article 11.9.7, 2011. The paper is about solution techniques for solving certain multivariate recurrences. Your recurrence happens to be in one of the forms for which the techniques work.

There might be a way to simplify the summation involving binomial coefficients and Stirling numbers, but I don't see it right now.

Added: The formula I used is the following.

Theorem. Suppose $R(n,k)$ satisfies the recurrence $$(\alpha(n-1) + \beta k + \gamma)R(n-1),k) + (\beta' + \gamma')R(n-1,k-1) + [n=k=0].$$ Then $$R(n,k) = \left(\prod_{i=1}^k (\beta' i + \gamma') \right) \sum_{i=0}^n \sum_{j=0}^n \left[ n \atop i \right] \binom{i}{j} \left\{ j \atop k \right\} \alpha^{n-i} \beta^{j-k} \gamma^{i-j}.$$ (Here, $0^0$ is taken to be $1$.)

For the OP's recurrence, we have $\alpha = 0, \beta = p, \gamma = 1-np, \beta' = -p,$ and $\gamma' = (n+1)p$.

-

### You can accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.

Read Bender and Orszag (Advanced Mathematical Methods for Scientists and Engineers), and you will be enlightened.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 33, "mathjax_display_tex": 4, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.90189129114151, "perplexity_flag": "head"}