The question is general, but I'll first give a simple example.
Suppose you have a candy machine with $N$ candies. The machine is weird, when you give it a quarter it gives you $1$ to $N$ candies (all numbers equally probable), this is called one "buy". You may assume you have more than $N$ quarters, so you can exhaust the machine completely.
Moreover, when you see how many candies it gave you, you can decide whether you'll keep them all to yourself or give them all to a friend.
You'll keep buying candies until the machine is empty, and you wish to maximize the expected number of candies you have at the end.
The restriction here is that if you decide to keep a buy to yourself, you must give the next buy to your friend.
So the obvious recurrence is as follows:
$E[n] = \frac{1}{n}\sum_{k=0}^{n-1}\max\{n-k+Z[k], E[k]\}$
$Z[n] = \frac{1}{n}\sum_{k=0}^{n-1}E[k]$
$E[n]$ represents the maximum expected number of candies if played optimally.
$Z[n]$ represents the same thing if you have to skip a buy.
My question is, are there any established methods for getting a more/less closed form for such recurrences? I could guess that there might be a constant $\alpha$ such that if I get below $n\alpha$ candies I would give it to the friend (haven't checked this on a computer yet), but even then the math gets hairy.