class: center, middle, inverse, title-slide .title[ # Sequences ] .subtitle[ ## Chapter 13 - Algebra II / Trig ] .author[ ### Fernando Alvear ] .date[ ### Apr 22, 2024 ] --- class: center, middle background-image: url('sluh-assets/zeno-1.png') background-size: contain --- Sequence of individual lengths (with `\(d = 1\)`): `$$\left\{ \frac{1}{2} , \frac{1}{4}, \frac{1}{8}, \frac{1}{16}, \frac{1}{32}, ... \right\}$$` Sequence of _cumulative_ lengths (each term is the sum of half of the previous term): `$$\left\{ \frac{1}{2} , \frac{3}{4} , \frac{7}{8}, \frac{15}{16}, \frac{31}{32}, ... \right\}$$` First four terms of the sequence: `$$\left\{ \frac{1}{2} , \frac{1}{4}, \frac{1}{8}, \frac{1}{16} \right\}$$` Sequences can have an _infinite_ or _finite_ number of terms. --- # Sequence Sequence (informal definition): _Ordered_ collection of objects (usually numbers). .shadow[ .emphasis[ __Sequence__: A sequence is a function whose domain is the set of positive integers. Each element in the sequence is called a _term_. ] ] Ways of representing a sequence: - List - Table - Plot - __Formula__ - Explicit formula - Piecewise explicit formula - Recursive formula --- .pull-left.w45[ - List: `\(\left\{ 2, 4, 8, 16, 32, ... \right\}\)` - Table: | `\(n\)` | 1 | 2 | 3 | 4 | 5 | ... | `\(n\)` | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | `\(a_n\)` | 2 | 4 | 8 | 16 | 32 | ... | `\(2^n\)` | - __Explicit formula__: `\(a_n = 2^n\)` `$$\begin{aligned} n=1 \hspace{20px} a_1 &= 2^1 = 2 \\ n=2 \hspace{20px} a_2 &= 2^2 = 4 \\ n=3 \hspace{20px} a_3 &= 2^3 = 8 \\ n=4 \hspace{20px} a_4 &= 2^4 = 16 \\ n=5 \hspace{20px} a_5 &= 2^5 = 32 \\ \end{aligned}$$` ] .pull-right.w45[ <img src="sluh-assets/sequence-1.png" width="400px"> ] --- # Explicit formula Write the first five terms of the sequence defined by the explicit formula `\(a_n = -3n+8\)`. -- Substitute `\(n = 1\)` in the formula. Repeat with values 2 through 5 for `\(n\)`. `$$\begin{aligned} n=1 \hspace{50px} a_1 &= -3(1) + 8 = 5 \\ n=2 \hspace{50px} a_2 &= -3(2) + 8 = 2 \\ n=3 \hspace{50px} a_3 &= -3(3) + 8 = -1 \\ n=4 \hspace{50px} a_4 &= -3(4) + 8 = -4 \\ n=5 \hspace{50px} a_5 &= -3(5) + 8 = -7 \\ \end{aligned}$$` The first five terms of the sequence are `\(\left\{ 5, 2, -1, -4, -7 \right\}\)`. --- # Explicit formula: Exercise 1 Given the explicit formula, write the first five terms of the sequence. 1: `\(a_n = 2n+3\)`. 2: `\(a_n = 2n-3\)`. 3: `\(a_n = \frac{1}{2n+3}\)`. 4: `\(a_n = \frac{1}{2n-3}\)`. 5: `\(a_n = \frac{1}{2^n}\)`. --- # Explicit formula: Exercise 1 solutions Given the explicit formula, write the first five terms of the sequence. 1: `\(a_n = 2n+3\)`. First five terms: `\(\left\{ 5, 7, 9, 11, 13 \right\}\)`. 2: `\(a_n = 2n-3\)`. First five terms: `\(\left\{ -1, 1, 3, 5, 7 \right\}\)`. 3: `\(a_n = \frac{1}{2n+3}\)`. First five terms: `\(\left\{ \frac{1}{5}, \frac{1}{7}, \frac{1}{9}, \frac{1}{11}, \frac{1}{13} \right\}\)`. 4: `\(a_n = \frac{1}{2n-3}\)`. First five terms: `\(\left\{ -1, 1, \frac{1}{3}, \frac{1}{5}, \frac{1}{7} \right\}\)`. 5: `\(a_n = \frac{1}{2^n}\)`. First five terms: `\(\left\{ \frac{1}{2}, \frac{1}{4}, \frac{1}{8}, \frac{1}{16}, \frac{1}{32} \right\}\)`. --- # Explicit formula: Exercise 2 Given the explicit formula, write the first __six__ terms of the sequence. `$$a_n = \begin{cases} n^2, \text{if \(n\) is not divisible by 3} \\ \frac{n}{3}, \text{if \(n\) is divisible by 3} \end{cases}$$` `$$a_n = \frac{(-1)^n}{n+1}$$` `$$a_n = \frac{(-1)^{n+1}}{n+1}$$` Note: The first sequence is defined by a _piecewise explicit formula_. --- # Explicit formula: Exercise 2 solutions `$$a_n = \begin{cases} n^2, \text{if \(n\) is not divisible by 3} \\ \frac{n}{3}, \text{if \(n\) is divisible by 3} \end{cases}$$` First five terms: `\(\left\{ 2, 4, 1, 16, 25, 2 \right\}\)` `$$a_n = \frac{(-1)^n}{n+1}$$` First five terms: `\(\left\{ -\frac{1}{2}, \frac{1}{3}, -\frac{1}{4}, \frac{1}{5}, -\frac{1}{6}, \frac{1}{7} \right\}\)` `$$a_n = \frac{(-1)^{n+1}}{n+1}$$` First five terms: `\(\left\{ \frac{1}{2}, -\frac{1}{3}, \frac{1}{4}, -\frac{1}{5}, \frac{1}{6}, -\frac{1}{7} \right\}\)` --- # Alternating signs These expressions generate sequences with _alternating signs_. This sequence generates negative signs in _odd_ terms: `$$a_n = (-1)^n = \left\{ -1, 1, -1, 1, -1, 1, ... \right\}$$` This sequence generates negative signs in _even_ terms: `$$a_n = (-1)^{n+1} = \left\{ 1, -1, 1, -1, 1, -1, ... \right\}$$` --- # Finding formulas: Exercise 3 Write an explicit formula for the `\(n\)`th term of each sequence. `$$(1): \hspace{20px} \left\{ e^4, e^5, e^6, e^7, e^8, ... \right\}$$` `$$(2): \hspace{20px} \left\{ -\frac{2}{11}, \frac{3}{13}, -\frac{4}{15}, \frac{5}{17}, -\frac{6}{19}, ... \right\}$$` `$$(3): \hspace{20px} \left\{ \frac{2}{25}, -\frac{2}{125}, \frac{2}{625}, -\frac{2}{3,125}, \frac{2}{15,625}, ... \right\}$$` - Look for patterns! - If the terms are fractions, look for separate patterns within numerators and denominators. - Look for alternating signs, and use the appropriate generating sequence. - Your answer should be a formula for `\(a_n\)`, in terms of `\(n\)`. Test your formula for the first `\(n\)` numbers. --- # Finding formulas: Exercise 3 solutions `$$(1): \hspace{20px} \left\{ e^4, e^5, e^6, e^7, e^8, ... \right\}$$` Explicit formula: `\(a_n = e^{n+3}\)`. `$$(2): \hspace{20px} \left\{ -\frac{2}{11}, \frac{3}{13}, -\frac{4}{15}, \frac{5}{17}, -\frac{6}{19}, ... \right\}$$` Explicit formula: `\(b_n = \frac{(-1)^n (n+1)}{2n+9}\)`. `$$(3): \hspace{20px} \left\{ \frac{2}{25}, -\frac{2}{125}, \frac{2}{625}, -\frac{2}{3,125}, \frac{2}{15,625}, ... \right\}$$` Explicit formula: `\(c_n = \frac{2(-1)^{n+1}}{5^{n+1}}\)`. --- # Fibonacci sequence Consider the Fibonacci sequence: `\(\left\{ 1, 1, 2, 3, 5, 8, 13, 21, 34, ... \right\}\)`. -- The first and second terms are 1, and then each other term is the sum of the preceding two terms. Here is an explicit formula of the Fibonacci sequence: `$$f_n = \frac{(1+\sqrt{5})^n-(1-\sqrt{5})^n}{2^n\sqrt{5}}$$` A recursive formula is much simpler! --- # Recursive formula .shadow[ .emphasis[ A __recursive formula__ is a formula that defines each term of a sequence using preceding term(s). Recursive formulas must always state the initial term (or terms) of the sequence. ] ] Recursive formulas for sequences have two parts: - A __base clause__, that defines the initial terms. - An __inductive clause__, that defines an `\(n\)`th term as a function of previous `\(n\)`th terms. --- Recursive formulas for sequences have two parts: - A __base clause__, that defines the initial terms. - An __inductive clause__, that defines an `\(n\)`th term as a function of previous `\(n\)`th terms. Example: Base clause: `\(a_1 = 3\)`.<br> Inductive clause: `\(a_n = 2a_{n-1}-1 \text{ for \(n \ge 2\).}\)` `$$\begin{aligned} a_1 &= 3 \\ a_2 &= 2a_{1}-1 = 2(3) -1 = 5 \\ a_3 &= 2a_{2}-1 = 2(5) -1 = 9 \\ a_4 &= 2a_{3}-1 = 2(9) -1 = 17 \end{aligned}$$` The first four terms of the sequence are `\(\left\{ 3, 5, 9, 17 \right\}\)`. --- # Fibonacci sequence (recursive formula) Fibonacci sequence: `\(\left\{ 1, 1, 2, 3, 5, 8, 13, 21, 34, ... \right\}\)`. Base clauses: `\(f_1 = 1\)`, `\(f_2 = 1\)` <br> Inductive clause: `\(f_n = f_{n-1} + f_{n-2} \text{ for \(n \ge 3\).}\)` `$$\begin{aligned} f_1 &= 1 \\ f_2 &= 1 \\ f_3 &= f_{2} + f_{1} = 2 \\ f_4 &= f_{3} + f_{2} = 3 \\ f_5 &= f_{4} + f_{3} = 5 \\ f_6 &= f_{5} + f_{4} = 8 \\ f_7 &= f_{6} + f_{5} = 13 \\ f_8 &= f_{7} + f_{6} = 21 \end{aligned}$$` The first eight terms of the Fibonacci sequence are `\(\left\{ 1, 1, 2, 3, 5, 8, 13, 21 \right\}\)`. --- # Recursive formula: Exercise 4 Given the recursive formulas, write the first five terms of each sequence. `$$\begin{aligned} a_1 &= 9 \\ a_n &= 3a_{n-1}-20 \text{ for \(n \ge 2\).} \end{aligned}$$` `$$\begin{aligned} b_1 &= 2 \\ b_n &= 2b_{n-1}+1 \text{ for \(n \ge 2\).} \end{aligned}$$` --- # Recursive formula: Exercise 4 solutions `$$\begin{aligned} a_1 &= 9 \\ a_n &= 3a_{n-1}-20 \text{ for \(n \ge 2\).} \end{aligned}$$` The first five terms of this sequence are `\(\left\{ 9, 7, 1, -17, -71 \right\}\)`. `$$\begin{aligned} b_1 &= 2 \\ b_n &= 2b_{n-1}+1 \text{ for \(n \ge 2\).} \end{aligned}$$` The first five terms of this sequence are `\(\left\{ 2, 5, 11, 23, 47 \right\}\)`. --- # Factorial .shadow[ .emphasis[ __n factorial__ is a mathematical operation that can be defined using a recursive formula. The factorial of `\(n\)`, denoted `\(n!\)`, is defined for a positive integer `\(n\)` as: `$$\begin{aligned} 0! &= 1 \\ 1! &= 1 \\ n! &= n(n−1)(n−2)...(2)(1), \text{for }n≥2. \end{aligned}$$` ] ]