Difference between revisions of "Taylor Series Pi and e"

From WLCS
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
* You will use loops to determine the approximations of mathematical constants
 
* You will use loops to determine the approximations of mathematical constants
 
* You will implement the Taylor series approximation of Pi (~3.1415...)
 
* You will implement the Taylor series approximation of Pi (~3.1415...)
* You will implement the Taylor series approximation of e (~2.178...)
+
* You will implement the Taylor series approximation of e (~2.718...)
  
 
'''Resources:'''
 
'''Resources:'''
 
* [[Media:PythonWhileLoops.pptx]]
 
* [[Media:PythonWhileLoops.pptx]]
 
* [https://en.wikipedia.org/wiki/Taylor_series Wikipedia: Taylor series]
 
* [https://en.wikipedia.org/wiki/Taylor_series Wikipedia: Taylor series]
 +
* [[Media:CommonTaylorSeriesFunctions.pdf]]
  
 
'''Directions:'''
 
'''Directions:'''
 
# Prompt the user for a number N (this will be how many terms you will sum in your approximation)
 
# Prompt the user for a number N (this will be how many terms you will sum in your approximation)
 
# Use a while loop to iterate N times (you will need a loop counter -- N is '''not''' your loop counter)
 
# Use a while loop to iterate N times (you will need a loop counter -- N is '''not''' your loop counter)
# Use several variables to create the summations for Pi and e seen below
+
# Use several variables to create the summation for Pi
# Print out Pi and e
+
# Print out Pi
 +
# Repeat the above steps for approximating '''e'''
  
 
'''Taylor Series Approximation for Pi:'''
 
'''Taylor Series Approximation for Pi:'''
 +
 
[[File:TaylorSeriesPi.png]]
 
[[File:TaylorSeriesPi.png]]
 +
 
(Wikipedia)
 
(Wikipedia)
 +
  
 
'''Taylor Series Approximation for e:'''
 
'''Taylor Series Approximation for e:'''
 +
 
[[File:TaylorSeriesE.png]]
 
[[File:TaylorSeriesE.png]]
 +
 
(Wikipedia)
 
(Wikipedia)
 +
 +
 +
'''Challenge:'''
 +
* Implement the Taylor series calculations for sin(x) and cos(x)
 +
* [https://en.wikipedia.org/wiki/Taylor_series#List_of_Maclaurin_series_of_some_common_functions Taylor/Maclaurin series of common functions]
 +
* [[Media:CommonTaylorSeriesFunctions.pdf]]

Latest revision as of 10:15, 11 January 2017

Objective:

  • You will use loops to determine the approximations of mathematical constants
  • You will implement the Taylor series approximation of Pi (~3.1415...)
  • You will implement the Taylor series approximation of e (~2.718...)

Resources:

Directions:

  1. Prompt the user for a number N (this will be how many terms you will sum in your approximation)
  2. Use a while loop to iterate N times (you will need a loop counter -- N is not your loop counter)
  3. Use several variables to create the summation for Pi
  4. Print out Pi
  5. Repeat the above steps for approximating e

Taylor Series Approximation for Pi:

TaylorSeriesPi.png

(Wikipedia)


Taylor Series Approximation for e:

TaylorSeriesE.png

(Wikipedia)


Challenge: