Calculating equation of a curve using (Riemann) sums

34 Views Asked by At

I understand that Riemann sums serve to approximate integrals. But can we use this approximation, and the fundamental theorem of calculus, to work backwards to estimate the original equation of the function we are integrating? I.e. can you create an expression which defines a curve that intersects the individual bin heights of Riemann sum terms?

In short, if some sum $F$ is defined by

$$ F(n)\equiv \sum^{n}_{i} f_{i}, $$

and the incremental change in $F$ as $n$ is varied is given by

$$ \Delta F(n) = F(n)- F(n-1) = f_{n}, $$

then can we solve

$$ \frac{dF}{dn} \approx \frac{\Delta F(n)}{\Delta n} = \frac{f_{n}}{\Delta n} $$

to find an expression for $F(n)$ ?

Consider an example: I sequentially roll independent dice until I roll a 6 (I achieve a pass). The probability $P$ I pass by $n$ rolls is given by a recursion relation:

$$ P_{\mathrm{pass},n} = P_{\mathrm{pass},n-1} + p_{\mathrm{fail}}^{n-1}p_{\mathrm{pass}} $$

where small $p$ is the probability of passing a single roll. When expanded out, this includes a sum of the probabilities that I fail all the previous rolls. The increase in overall probability $P$ of a pass if I roll another die after failing all previous rolls is:

$$ \Delta P_{\mathrm{pass}} = p_{\mathrm{fail}}^{n-1}p_{\mathrm{pass}}. $$

So

$$ \frac{dP_{\mathrm{pass}}}{dn} \approx \frac{\Delta P_{\mathrm{pass}}}{\Delta n} = \frac{p_{\mathrm{fail}}^{n-1}p_{\mathrm{pass}}}{n-(n-1)} = p_{\mathrm{fail}}^{n-1}p_{\mathrm{pass}}. $$

Whereupon integrating you get

$$ P_{\mathrm{pass}} \approx p_{\mathrm{pass}} + \frac{p_{\mathrm{pass}}}{\mathrm{ln}\left(p_{\mathrm{fail}}\right)}\left[ e^{\left(n-1\right)\mathrm{ln}\left(p_{\mathrm{fail}}\right)}-1\right] $$

which gives the correct answer for $n=1$ (just the probability that you pass a single dice throw i.e. $p_{\mathrm{pass}}$. In the limit $n\rightarrow\infty$, where we expect the answer to tend to 1, we see

$$ P_{\mathrm{pass}}\rightarrow p_{\mathrm{pass}}-\frac{p_{\mathrm{pass}}}{\mathrm{ln}\left(1-p_{\mathrm{pass}}\right)} $$

which, when plotted as a function of $p_{\mathrm{pass}}$, hovers between about 1 and 1.3:

--- I can't post the picture due to lack of rep so see this link instead ---

The initial linear nature of this error term makes some sense, since in our expression above we're only valid at $n=1$ and higher, so we're missing a bin width that is proportional to $p_{\mathrm{pass}}$.

Happy to edit question to make clearer - thanks in advance!