Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W. 13-15 Th. 13-15, F. 13-15.

Slides:



Advertisements
Similar presentations
Chapter 8 Vocabulary. Section 8.1 Vocabulary Sequences An infinite sequence is a function whose domain is the set of positive integers. The function.
Advertisements

Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W Th , F
Calculus I – Math 104 The end is near!. Series approximations for functions, integrals etc.. We've been associating series with functions and using them.
Sequences, Induction and Probability
A sequence is a set of numbers arranged in a definite order
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
9-4 Sequences & Series. Basic Sequences  Observe patterns!  3, 6, 9, 12, 15  2, 4, 8, 16, 32, …, 2 k, …  {1/k: k = 1, 2, 3, …}  (a 1, a 2, a 3, …,
INFINITE SEQUENCES AND SERIES
1 Section 3.2 Sequences and Summations. 2 Sequence Function from a subset of Z (usually the set beginning with 1 or 0) to a set S a n denotes the image.
Unit 7: Sequences and Series
Investigating Sequences and Series
Series NOTES Name ____________________________ Arithmetic Sequences.
Patterns and Sequences
For a geometric sequence, , for every positive integer k.
Arithmetic Sequences A sequence in which each term after the first is obtained by adding a fixed number to the previous term is an arithmetic sequence.
Sec 11.3 Geometric Sequences and Series Objectives: To define geometric sequences and series. To define infinite series. To understand the formulas for.
11.4 Geometric Sequences Geometric Sequences and Series geometric sequence If we start with a number, a 1, and repeatedly multiply it by some constant,
Slide 5-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
1 Appendix E: Sigma Notation. 2 Definition: Sequence A sequence is a function a(n) (written a n ) who’s domain is the set of natural numbers {1, 2, 3,
1 © 2010 Pearson Education, Inc. All rights reserved 10.1 DEFINITION OF A SEQUENCE An infinite sequence is a function whose domain is the set of positive.
Geometric Sequences and Series
Explicit, Summative, and Recursive
© 2010 Pearson Education Inc.Goldstein/Schneider/Lay/Asmar, CALCULUS AND ITS APPLICATIONS, 12e– Slide 1 of 57 Chapter 11 Taylor Polynomials and Infinite.
Sequences & Summation Notation 8.1 JMerrill, 2007 Revised 2008.
Chapter 6 Sequences And Series Look at these number sequences carefully can you guess the next 2 numbers? What about guess the rule?
Copyright © Cengage Learning. All rights reserved.
Computational Method in Chemical Engineering (TKK-2109)
SEQUENCES AND SERIES Arithmetic. Definition A series is an indicated sum of the terms of a sequence.  Finite Sequence: 2, 6, 10, 14  Finite Series:2.
M3U1D3 Warm Up 12, 6, 0, -6, , 4, 4/3, 4/9, 4/27 2, 5, 8, 11, 14 0, 2, 6, 12, 20 Arithmetic an = an Geometric an = a1(1/2)n-1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
Series and Sequences An infinite sequence is an unending list of numbers that follow a pattern. The terms of the sequence are written a1, a2, a3,...,an,...
Sequences & Series. Sequences  A sequence is a function whose domain is the set of all positive integers.  The first term of a sequences is denoted.
Section Finding sums of arithmetic series -Using Sigma notation Taylor Morgan.
13.1 SEQUENCES Functions Modeling Change: A Preparation for Calculus, 4th Edition, 2011, Connally.
Series Adding terms of a sequence (11.4). Add sequence Our first arithmetic sequence: 2, 7, 12, 17, … What is the sum of the first term? The first two.
In section 11.9, we were able to find power series representations for a certain restricted class of functions. Here, we investigate more general problems.
The Convergence Problem Recall that the nth Taylor polynomial for a function f about x = x o has the property that its value and the values of its first.
Sequences and Series (Section 9.4 in Textbook).
Section 9-4 Sequences and Series.
Series & Sequences Piecewise Functions
Investigating Sequences and Series Arithmetic Sequences.
Numerical Analysis CC413 Propagation of Errors.
3 DIFFERENTIATION RULES. We have:  Seen how to interpret derivatives as slopes and rates of change  Seen how to estimate derivatives of functions given.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.
Arithmetic Series Definitions & Equations Writing & Solving Arithmetic Series Practice Problems.
Sequences and Series Explicit, Summative, and Recursive.
Investigating Sequences and Series Arithmetic Sequences.
U8L1: Arithmetic Sequences and Series EQ: What are arithmetic sequences and series? How do I find values regarding them?
8.1 Sequences and Series Essential Questions: How do we use sequence notation to write the terms of a sequence? How do we use factorial notation? How.
Unit 10: Sequences & Series By: Saranya Nistala. Unit Goal: I can find and analyze arithmetic and geometric sequences and series. Key Concepts:  Define.
Sequences and Series Arithmetic & Geometric Sequences & Series Arithmetic Sequences.
Investigating Sequences and Series Arithmetic Sequences.
Topic 5 “Modeling with Linear and Quadratic Functions” 5-1 Arithmetic Sequences & Series.
 A sequence is a function whose domain is a set of consecutive integers. If a domain is not specified, it is understood that the domain starts with 1.
Introduction Terms of geometric sequences can be added together if needed, such as when calculating the total amount of money you will pay over the life.
The symbol for summation is the Greek letter Sigma, S.
9 The Mathematics of Spiral Growth
Infinite Geometric Series
Section 11.1 Sequences and Series
10.2 Arithmetic Sequences and Series
Geometric Sequences.
9-1 Mathematical Patterns
Arab Open University Faculty of Computer Studies Dr
Arithmetic Sequences.
Sequences & the Binomial Theorem Chapter:___
The sum of an Infinite Series
Presentation transcript:

Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W Th , F

Outlines 1. Number series : Basic Theory 2. Taylor series 3. Number series in Excel 4. Application in chem.eng

Number series (basic theory) Numbers  Integer numbers  Binary numbers

Number series (basic theory) Integer Numbers We represent integers using a base-10 positional notation. So the number means: 9    10 0

Number series (basic theory) Binary Numbers Representing integers using a base-2 positional notation. So the number means: 1     2 0 132 + 016 + 18 + 04 + 12 + 11 43

Number series (basic theory) Converting decimal to binary 123 ÷2 61remainder 1 ÷2 30remainder 1 ÷2 15remainder 0 ÷2 7remainder 1 ÷2 3remainder 1 ÷2 1remainder 1 ÷2 0remainder 1

Number series (basic theory) Converting decimal to binary 123 ÷2 61  remainder 1 ÷2 30  remainder 1 ÷2 15  remainder 0 ÷2 7  remainder 1 ÷2 3  remainder 1 ÷2 1  remainder 1 ÷2 0  remainder 1

Number series (basic theory) Converting decimal to binary ÷2 61  remainder 1 ÷2 30  remainder 1 ÷2 15  remainder 0 ÷2 7  remainder 1 ÷2 3  remainder 1 ÷2 1  remainder 1 ÷2 0  remainder 1

Number series (basic theory) Number series  Arithmetic series  Geometric series

Number series (basic theory) Arithmetic Sequences  Monday : $150  Tuesday: $300  Wednesday: $450  Thursday:$600  Friday:$750 These prize amounts form a sequence, more specifically each amount is a term in an arithmetic sequence. To find the next term we just add $150.

Number series (basic theory) Definition Sequence: a list of numbers in a specific order. Term: each number in a sequence Arithmetic Sequence: a sequence in which each term after the first term is found by adding a constant, called the common difference (d), to the previous term.

Number series (basic theory) Example 150, 300, 450, 600, 750… The first term of our sequence is 150, we denote the first term as a 1. What is a 2 ? a 2 : 300 (a 2 represents the 2nd term in our sequence) To find the common difference (d), just subtract any term from the term that follows it.

Number series (basic theory) Formula Formula for finding any term in an arithmetic sequence is a n = a 1 + d(n-1). All you need to know to find any term is the first term in the sequence (a 1 ) and the common difference.

Number series (basic theory) Arithmetic series = 28 Series: the sum of the terms in a sequence. Arithmetic Series: the sum of the terms in an arithmetic sequence.

Number series (basic theory) Arithmetic series Arithmetic sequence:2, 4, 6, 8, 10 Corresponding arith. series: Arith. Sequence: -8, -3, 2, 7 Arith. Series: S n is the symbol used to represent the first ‘n’ terms of a series. Given the sequence 1, 11, 21, 31, 41, 51, 61, 71, … find S 4 We add the first four terms = 64

Number series (basic theory) Formula S n = n / 2 (a 1 + a n ) Find the sum of the first 10 terms of the arithmetic series with a 1 = 6 and a 10 =51 S 10 = 10/2(6 + 51) = 5(57) = 285

Number series (basic theory) Formula To write out a series and compute a sum can sometimes be very tedious. Mathematicians often use the Greek letter sigma & summation notation to simplify this task. last value of n formula used to find sequence First value of n This means to find the sum of the sums n + 1 where we plug in the values for n

Number series (basic theory) Geometric sequence Geometric Sequence: a sequence in which each term after the first is found by multiplying the previous term by a constant value called the common ratio. Find the first five terms of the geometric sequence with a 1 = -3 and common ratio (r) of 5. -3, -15, -75, -375, -1875

Number series (basic theory) Geometric sequence-Formula Formula for finding any term of a geometric sequence is a n = a 1 r n-1 Find the 10th term of the geometric sequence with a 1 = 2000 and a common ratio of 1 / 2. a 10 = 2000 ( 1 / 2 ) 9 = / 512 = 2000 / 512 = 500 / 128 = 250 / 64 = 125 / 32

Number series (basic theory) Geometric series Geometric Series - the sum of the terms of a geometric sequence. Geo. Sequence: 1, 3, 9, 27, 81 Geo. Series: What is the sum of the geometric series? = 121 The formula for the sum S n of the first n terms of a geometric series is given by

Number series (basic theory) Fibonacci series and the golden ratio let's examine an interesting sequence (or list) of numbers. Actually the series starts with 0, 1 but to make it easier we’ll just start with: 1, 1 To get the next number we add the previous two numbers together. So now our sequence becomes 1, 1, 2. The next number will be 3. What do you think the next number in the sequence will be? Remember, we add the previous two numbers to get the next. So the next number should be 2+3, or 5. Here is what our sequence should look like if we continue on in this fashion for a while: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610… Fibonacci sequence

Number series (basic theory) Fibonacci series and the golden ratio The relationship of this sequence to the Golden Ratio lies not in the actual numbers of the sequence, but in the ratio of the consecutive numbers. Let's look at some of the ratios of these numbers: Notice that as we continue down the sequence, the ratios seem to be converging upon one number (from both sides of the number)! 2/1 = 2.0 (bigger) 3/2 = 1.5 (smaller) 5/3 = 1.67(bigger) 8/5 = 1.6(smaller) 13/8 = (bigger) 21/13 = (smaller) 34/21 = (bigger) 55/34 = 1.618(smaller) 89/55 = 1.618

Number series (basic theory) Fibonacci series and the golden ratio The Golden Ratio is what we call an irrational number: it has an infinite number of decimal places and it never repeats itself! Generally, we round the Golden Ratio to

Number series (basic theory) Fibonacci series and the golden ratio The Golden Ratio is not just some number that math teachers think is cool. The interesting thing is that it keeps popping up in strange places - places that we may not ordinarily have thought to look for it. It is important to note that Fibonacci did not "invent" the Golden Ratio; he just discovered one instance of where it appeared naturally and it incorporates into art, architecture, and designs. The Golden Ratio seems to be Nature's perfect number.

Number series (basic theory) Count the number of keys (notes) in each of the brackets… You will see the numbers 2,3,5,8,13….coincidence? Does it look like the Fibonacci sequence…it should because it is!

Number series (basic theory)

Taylor series How does a CPU compute the following functions for a specific x value? cos(x) sin(x) e x log(x) etc. Non-elementary functions such as trigonometric, exponential, and others are expressed in an approximate fashion using Taylor series when their values, derivatives, and integrals are computed. Taylor series provides a means to predict the value of a function at one point in terms of the function value and its derivatives at another point.

Taylor series Taylor Series (n th order approximation): Define the step size as h=(x i+1 - x i ), the series becomes: The Reminder term, R n, accounts for all terms from (n+1) to infinity.

Taylor series Any smooth function can be approximated as a polynomial. Take x = x i+1 Then f(x) ≈ f(x i ) zero order approximation first order approximation Second order approximation: n th order approximation: Each additional term will contribute some improvement to the approximation. Only if an infinite number of terms are added will the series yield an exact result. In most cases, only a few terms will result in an approximation that is close enough to the true value for practical purposes

Taylor series Example Approximate the function f(x) = x - 0.5x x x 4 from x i = 0 with h = 1 and predict f(x) at x i+1 = 1.

Taylor series Example: computing f(x) = e x using Taylor Series expansion (1) Choose x = x i+1 and x i = 0 Then f(x i+1 ) = f(x) and (x i+1 – x i ) = x Since First Derivative of e x is also e x : (2.) (e x ) ” = e x (3.) (e x ) ”’ = e x, … (n th.) (e x ) (n) = e x As a result we get:

Taylor series Yet another example: computing f(x) = cos(x) using Taylor Series expansion Choose x= x i+1 and x i =0 Then f(x i+1 ) = f(x) and ( x i+1 – x i ) = x Derivatives of cos(x): (1.) (cos(x) ) ’ = -sin(x) (2.) (cos(x) )” = -cos(x), (3.) (cos(x) ) ”’ = sin(x) (4.) (cos(x) ) ”” = cos(x), …… As a result we get:

Number series in excel Evaluating function

Number series in excel Taylor series in Excel With : at x = 1, F(x) = Evaluating F(x) at x = 1.6 using Taylor series

Number series in excel Taylor series in Excel With : Evaluating F(x) at x = 1.6 using Taylor series

Taylor series (application) The application of Taylor series Solving differential equation Subject to at Example The concentration of salt x in a home made soap maker is given as a function of time by at initial time, t = 0, the salt concentration in the tank is 50 g/L, Using Taylor series expansion, what is the salt concentration after 3 minutes