Geometric Summation and Roblox
03 October 2022

Intro

The formula for the summation of a geometric progression is one of my favourite bits of maths (that I can still remember). It would not be if it was not for a lecturer who faced is as slightly annoyed student in the class I was in responded in such a nice way. This student, with some frustration, said to the lecture we can't keep remembering all these equations. We had all done used the formula years before but for some they had not stuck in their heads as well as it should.

The lecturer, unperturbed, just quietly said no one is expecting you to sit and memorised them. He said you can usually look them but really the simpler ones you should be able to derive. He then proceed to derive the formula for the summation of a geometric progression.

It usually takes me a little while to remember how to derive it these days. I probably only do it once every 5 years of so, but since that day it has been one of my favourite derivations. So lets take a look at it.

The derivation

We want to work the the summation of n terms of geometric progression. Starting with

Sn=a+ar1+ar2...arn1+arn

Multiply by sides by r to give us

rSn=ar1+ar2...arn1+arn+arn+1

The next step is too work out what SnrSn is

SnrSn=a+arn+1

It helps if you do this on paper and with Sn on one line and rSn on the other. Make the columns line up on the powers of r then hopefully make this above step quite clear. If not play with it some more, or brush up on the taking one equation away from another equation skills.

Now lets factor out the r on the left hand side and the a on the right hand side.

(1r)Sn=a(1rn+1)

and divide by (1r) to give us the summation formula

Sn=a(1rn+1)(1r)

Obviously this assumes r!=1 if r=1 then rn is one. so the summation becomes Sn=na

Usually at school geometric summations often begin with n being infinite and |r|<1. In this case rn+1 goes to zero leaving us with

S=a(1r)

And to Roblox.

One of my children likes to make Button Simulator Games in Roblox. It is fairly niche and really take the ideas of RPG grind back to it's very raw elements. The cost of things often goes up as a geometric series.

The question arose where he wanted to know how many items a player could buy if the price increases after each purchase following a geometric progression.

Sn is the total money the player has than we want to know what value of n, the number of items they can buy. He had found an solution online but didn't quite understand it at the time. The game configures a and r so the only unknown is n.

Lets start with

Sn=a(1rn+1)(1r)

Rearranging

Sn(1r)=aarn+1

and then Sn(1r)aa=rn+1

To recap the only unknown is n. So we now need to take the log of both sides.

log(Sn(1r)aa)=(n+1)log(r)

A final bit of rearranging and we get

n=log(Sn(1r)aa)log(r)1

n is the number of items that can be purchased. Well you will want to take the floor of the value (round down to nearest integer) to get the number. The total cost can be calculated with the summation formula above and you are good to go.

In the UK students would normally hit this in their 16-18 year old education in maths, probably the early part of that age range. Or at least have developed the skills to understand it. Assuming they elect to take Maths during those years.

While Roblox games can often be fairly simple that is certainly not always the case. The demographic of the creators is young but that is not to say what they are creating is simple or relying on simplistic maths. I don't currently feel this group of game developers gets enough credit for what they do.