n more each day

360 Views Asked by At

It's been a while since I've been at school and I don't work in a field that practices this sort of stuff so I don't know the formula my brain can't wrap my head around the problem.

The problem:

You start with $0$ points. After $1$ day you gain $100$ points. The next day you gain $110$ points, then $120$ and so on.

If I remember correctly, there is a formula to get how many days until you reach $x$ points.

Side-note: couldn't find any tags to use.

2

There are 2 best solutions below

2
On BEST ANSWER

The number of points you get after $n$ days is $a_n = 90 + n\cdot 10$. There is a simple way to calculate the amount of points after $n$ days:

$$\sum_{i=1}^n a_i = \sum_{i=1}^n (90 + 10i) = \sum_{i=1}^n 90 + 10 \sum_{i=1}^n i = 90 n + 10 \sum_{i=1}^n i$$

Now, all you need to know is that the sum of the first $n$ integers is $$\sum_{i=1}^n i = \frac{n(n+1)}{2}$$ and you are done:

$$\sum_{i=1}^n a_i = 90 n + 10\cdot \frac{n(n+1)}{2} = 5n^2 + 95 n.$$

Now, since you want to know how many days it takes for you to reach at least $x$ points, you are solving an equation $$5n^2 + 95 n = x$$ for $n$. The exact solution to this is the root of the polynomial

$$5n^2 +95 n - x$$ which is $$\frac{-95 \pm \sqrt{95^2 + 20x}}{10}$$ This gives you two solutions, out of which one is negative and one is positive. You are only interested in the positive one, so you take the solution $$\alpha = \frac{-95 + \sqrt{95^2 + 20x}}{10}.$$

Of course, for most $x$, $\alpha$ will not be an integer, but since you know that the value of $p(n) = 5n^2 + 95n$ is strictly increasing and you know that $p(\alpha) = x$, you know that, if $\alpha$ is not an intger, that $p(\lfloor\alpha\rfloor)<x<p(\lceil\alpha\rceil)$, so you need $\lceil\alpha\rceil$ days to have more than $x$ points, and you will have less than $x$ the day before.

1
On

Yes its called AP(Arithmetic Progression) An=a+(n-1)d So for example if you want to calculate at 6th day the points will be An=100+(6-1)10 An=150

Where a=initial amount at day 1 n=no. of days d=difference in increment i.e 10