Teaching Kids Programming – Sum of Geometric Progression (Math Proof and Python Function)


Teaching Kids Programming: Videos on Data Structures and Algorithms

Geometric Progression of numbers are:

tex_088bf51fe37c5e50d92a0011b0d5ec1b Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video

where q is neither 1 or 0. We want to compute the sum, aka tex_0e2d14ab5f29197a2f2f2df137288717 Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video

Sum of Geometric Progression (Math Proof)

Let tex_f986c187af0c862e12bc5674d5c7d03c Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video where tex_7cf1fba3f4e21ce650401b20a702f23f Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video , tex_5041cb3dd15836bc792cd3dca5fa1d2f Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video and tex_498c0a0399181b285f9a00d6a7f7a218 Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video
Multiple both sides with q (since q can’t be zero)
tex_7f157ab62e413529b778eb4c2fb94032 Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video
which is tex_1e83e620946f003b0de58196961921d6 Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video
We can subtract both side from tex_fe9965137943def4ad82fe327f4b2d76 Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video aka
tex_6311743ee3a7290328be8d579a8956c7 Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video
tex_c117937308ce38d468fe1633c54cfe3a Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video
Therefore tex_a4b17b4a932c9e0297b3de4061ba482c Teaching Kids Programming - Sum of Geometric Progression (Math Proof and Python Function) algorithms math python teaching kids programming youtube video

Python Algorithm to Compute the Sum of Geometric Progression

Here is the simple python function to compute the sum of a geometric progression.

1
2
3
4
5
def sum(a, q, n):
    s = 0
    for i in range(n):
        s += a * (q ** i)
    return s
def sum(a, q, n):
    s = 0
    for i in range(n):
        s += a * (q ** i)
    return s

We can also use math.pow(q, i) to compute the value of q to the power of i.

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
736 words
Last Post: Teaching Kids Programming - Delete the Middle Node of a Linked List (Fast and Slow Pointer)
Next Post: Teaching Kids Programming - Words That Can Be Typed using a Single Keyboard Row (Hash Set)

The Permanent URL is: Teaching Kids Programming – Sum of Geometric Progression (Math Proof and Python Function)

Leave a Reply