The equivalent function 3

1
2
3
4
5
6
def fun(x,y):
    s,p=1,1
    for i in range(1,y):
        p*=x/float(i)
        s+=p
    return s

For sufficiently large value of y y , what does the above function closely approximate?

x y x^{y} x \sqrt{x} e x e^{x} ln ( x + 1 ) \ln(x+1)

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Henry U
Dec 12, 2018

The for-loop that adds a number to s s in every iteration can be seen as a sum from 1 to y y

i = 1 y something \displaystyle \sum_{i=1}^y \text{something}

In every iteration, the previous value of p p is multiplied by x i \frac x i , so the something that is added is a product of i i terms for every i y i \leq y .

i = 1 y j = 1 i x j = i = 1 y x i i ! \displaystyle \sum_{i=1}^y \prod_{j=1}^i \frac x j = \sum_{i=1}^y \frac {x^i} {i!}

and these are exactly the first y y terms of the Taylor Series of the exponential function e x \boxed{e^x} , so for sufficiently large y y , the sum converges to e x e^x .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...