Why is the sum of exponential function 2^x for n iterations one less than 2^n?

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 3K views
Bassalisk
Messages
946
Reaction score
2
I posted a related thread, in the same forum regarding matlab, but I want to discuss this here separately.

Few minutes ago I became very confused baffled and surprised at the same time.

consider function [itex]2^{x}[/itex].

Now consider the sum of this function for n iterations.(from 0 to n)

[itex]\sum_{x=0}^n 2^{x}[/itex].

Using my humble knowledge of c++ I found that you need 19 iterations (including zero as iteration) for a number 524287.

so 1+2+4+8+16...+262144=524287

By case, found that this sum is 1 less than the [itex]2^{19}[/itex].

so [itex]524287=2^{19}-1[/itex]

Why? I am not best mathematician you will come across but this i found very interesting.
 
Physics news on Phys.org
The binomial theorem states that
[tex] (x+y)^n = \sum_{k=0}^n {n \choose k}x^{n-k}y^k = \sum_{k=0}^n {n \choose k}x^{k}y^{n-k}.[/tex]

Now set, x=1 and y=1.
 
Charles49 said:
The binomial theorem states that
[tex] (x+y)^n = \sum_{k=0}^n {n \choose k}x^{n-k}y^k = \sum_{k=0}^n {n \choose k}x^{k}y^{n-k}.[/tex]

Now set, x=1 and y=1.

I don't think I understand.

General rule I got out of my numbers is:

[itex]\sum_{i=0}^n 2^{i}=2^{n+1}-1[/itex]

By putting zeros into my binomial equation i get:

[itex]2^n =1+ \sum_{k=1}^n {n \choose k}1^{n-k}1^k=1+\sum_{k=1}^n {n \choose k}[/itex]

How do I relate factorial formula to [itex]\sum_{i=0}^n 2^{i}[/itex]
 
This is an example of a "geometric seriies" (google will find lots of web pages). It is a bit of a "special case" because you used 2 as the multiplying factor.

In general, suppose you have a sum
[tex]S = 1 + x + x^2 \cdots + x^{n-1}[/tex]
You can multiply both sides by x to get
[tex]Sx = x + x^2 + x^3 + \cdots + x^n[/tex]
Now subtract the first sum from the second one. All the terms in the sums cancel out except for the first and last ones, and you get
[tex]Sx - S = S(x-1) = x^n -1[/tex]
When [itex]x = 2[/itex] the result is even simpler because [itex]x-1 = 1[/itex], and you get
[tex]1 + 2 + 2^2 ... + 2^{n-1} = 2^n - 1[/tex]

BTW I don't really understand what the Binomial theorem has to do with this either.
 
AlephZero said:
This is an example of a "geometric seriies" (google will find lots of web pages). It is a bit of a "special case" because you used 2 as the multiplying factor.

In general, suppose you have a sum
[tex]S = 1 + x + x^2 \cdots + x^{n-1}[/tex]
You can multiply both sides by x to get
[tex]Sx = x + x^2 + x^3 + \cdots + x^n[/tex]
Now subtract the first sum from the second one. All the terms in the sums cancel out except for the first and last ones, and you get
[tex]Sx - S = S(x-1) = x^n -1[/tex]
When [itex]x = 2[/itex] the result is even simpler because [itex]x-1 = 1[/itex], and you get
[tex]1 + 2 + 2^2 ... + 2^{n-1} = 2^n - 1[/tex]

BTW I don't really understand what the Binomial theorem has to do with this either.

This makes sense. Thank you !