0

$$\sum _{r=0}^{9} (-1)^r \left( \begin{matrix} 10 \\ r \end{matrix} \right)(10-r)^{9-r} $$

I'm trying to find a decent closed form for the above sum, but have unfortunately failed in the attempt. The main problem I'm facing is that the exponent of $(10-r)$ is $(9-r)$, which varies with $r$ too.

How should I go about this? Any help will be appreciated!

Moreover, I feel we might be able to generalize the result of the above problem, to - $$\sum _{r=0}^{n-1} (-1)^r \left( \begin{matrix} n \\ r \end{matrix} \right)(n-r)^{n-r-1} $$

Could someone please help me with the solution, or point me in the right direction? Thanks a lot!

P.S. I tried to code the above into Python3, hoping to get some insight (but didn't) - so I'll just share the code here:

    from math import comb
    sum=0
    n=10
    for r in range(n):
       a = (-1)**r
       b = comb(n,r)
       c = n - r
       d = c - 1

       print(("iteration no. {} - a={},b={},c={},d={}").format(r,a,b,c,d))
       sum+=(a*b*(c**d))
       print(("sum is {}").format(sum))
    print(sum)

Here's the output -

iteration no. 0 - a=1,b=1,c=10,d=9
sum is 1000000000
iteration no. 1 - a=-1,b=10,c=9,d=8
sum is 569532790
iteration no. 2 - a=1,b=45,c=8,d=7
sum is 663904630
iteration no. 3 - a=-1,b=120,c=7,d=6
sum is 649786750
iteration no. 4 - a=1,b=210,c=6,d=5
sum is 651419710
iteration no. 5 - a=-1,b=252,c=5,d=4
sum is 651262210
iteration no. 6 - a=1,b=210,c=4,d=3
sum is 651275650
iteration no. 7 - a=-1,b=120,c=3,d=2
sum is 651274570
iteration no. 8 - a=1,b=45,c=2,d=1
sum is 651274660
iteration no. 9 - a=-1,b=10,c=1,d=0
sum is 651274650
651274650

1 Answers1

2

If you change the index $$f_n=\sum _{r=0}^{n-1} (-1)^r \binom{n}{r}(n-r)^{n-r-1}=\sum _{r=1}^{n} (-1)^{(n-r)} \binom{n}{r}r^{r-1}$$

This is sequence $A277474$ in $OEIS$ (have a look here).

In the linked page, you will find a good approximation $$f_n \sim e^{-1/e}\, n^{n-1}$$