# Unit 2: Sequences, Series, and Finicial Applications ## Terms **sequence**: is an ordered set of numbres. **Arithmetic Sequences**: is a sequence where the difference between each term is constant, and the constant is known as the `common difference`. **Geometric Sequences**: is a sequence in which the ratio between each term is constant, and the constant is known as the `common ratio`. **Note:** Not all sequences are arithmetic and geometric! **finite series**: finite series have a **finite** number of terms. - eg. $`1 + 2 + 3 + \cdots + 10`$. **infinite series**: infinite series have **infinite** number of terms. - eg. $`1 + 2 + 3 + \cdots`$ Terms in a sequence are numbered with subscripts: $~t_1, t_2, t_3, \cdots t_n`$ where $`t_n`$is the general or $`n^{th}`$ term. **Series**: A series is the sum of the terms of a sequence. ## Recursion Formula A sequence is defined recursively if you have to calculate a term in a sequence from previous terms. The recursion formula consist of 2 parts. 1. Base term(s) 2. A formula to calculate each successive term. eg. $`t_1 = 1, t_n = t_{n-1} + 1 \text{ for } n \gt 1`$ ## Aritmetic Sequences Basically, you add the **commmon difference** to the current term to get the next term. As such, it follows the following pattern: $`a, a+d, a+2d, a+3d, a+4d, \cdots`$. Where $`a`$ is the first term and $`d`$ is the **common difference**. As such, the general term of the aritmetic sequence is: $`\large t_n = a + (n - 1)d`$ ## Geoemetric Sequences Basically, you multiply by the **common ratio** to the current term toget the next term. As such, it follows the following pattern: $`a, ar, ar^2, ar^3, ar^4, c\dots`$. Where $`a`$ is the first term and $`r`$ is the **common ratio**. As such, the general term of the geometric sequence is: $`\large t_n = a(r)^{n-1}`$ ## Aritmetic Series An arithmetic series is the sum of the aritmetic sequence's terms. The formula to calculate is: $`\large S_n = \dfrac{n(a_1 + a_n)}{2}`$ Or $`\large S_n = \dfrac{n(2a_1 + (n-1)d)}{2}`$ ## Geometric Series - A geoemtric series is created by adding the terms of the geometric sequence. The formula to calulate the series is: $`\large S_n= \dfrac{a(r^n- 1)}{r-1}`$ or $`\large S_n = \dfrac{a(1 - r^n)}{1 - r}`$ ## Series and Sigma Notation Its often convient to write summation of sequences using sigma notation. In greek, sigma means to sum. eg. $`S_ = u_1 + u_2 + u_3 + u_4 + \cdots + u_n = \sum_{i=1}^{n}u_i`$ $`\sum_{i=1}^{n}u_i`$ means to add all the terms of $`u_i`$ from $`i=1`$ to $`i=n`$. Programmers might refer to this as the `for` loop. ```cpp int sum=0; for(int i=1; i<=N; i++) { sum += u[i]; } ``` ## Infinite Geometric Series Either the series **converges** and **diverges**. There is only a finite sum when the series **converges**. Recall the our formula is $`\dfrac{a(r^n-1)}{r-1}`$, and is $`n`$ approaches $`\infty`$, if $`r`$ is less than $`1`$, then $`r^n`$ approaches $`0`$. So this series converges. Otherwise, $`r^n`$ goes to $`\infty`$, so the series diverges. If the series diverges, then the sum can be calculated by the following formula: If $`r = \dfrac{1}{2}`$, then $`\large \lim_{x \to \infty} (\frac{1}{2})^x = 0`$ Therefore, $`S_n = \dfrac{a(1 - 0)}{1 - r}`$. This works for any $`|r| \lt 1`$ ## Binomial Expansion A binomial is a polynomial expression with 2 terms. A binomial expansion takes the form of $`(x + y)^n`$, where $`n`$ is an integer and $`x, y`$ can be any number we want. A common relationship of binomial expansion is pascal's triangle. The $`nth`$ row of the triangle correspond to the coefficent of $`(x + y)^n`$ ``` 1 row 0 1 1 row 1 1 2 1 row 2 1 3 3 1 row 3 1 4 6 4 1 row 4 1 5 10 10 5 1 row 5 ```