1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
solmaris [256]
3 years ago
13

In numerical methods, one source of error occurs when we use an approximation for a mathematical expression that would otherwise

be too costly to compute in terms of run-time or memory resources. One routine example is the approximation of infinite series by a finite series that mostly captures the important behavior of the infinite series.
In this problem you will implement an approximation to the exp(x) as represented by the following infinite series,
exp(x) = Infinity n= 0 xn/xn!
Your approximation will be a truncated finite series with N + 1 terms,
exp(x, N) = Infinityn n = 0 xn/xn!
For the first part of this problem, you are given a random real number x and will investigate how well a finite series expansion for exp(x) approximates the infinite series.
Compute exp(x) using a finite series approximation with N E [0, 9] N (i.e. is an integer).
Save the 10 floating point values from your approximation in a numpy array named exp_approx. exp_approx should be of shape (10,) and should be ordered with increasing N (i.e. the first entry of exp_approx should correspond to exp(x, N) when N = 0 and the last entry when N = 9).
Computers and Technology
1 answer:
Shtirlitz [24]3 years ago
3 0

Answer:

The function in Python is as follows:

import math

import numpy as np    

def exp(x):

   mylist = []

   for n in range(10):

       num = (x**n)/(math.factorial(n))

       mylist.append([num])

   exp_approx = np.asarray(mylist)

   sum = 0

   for num in exp_approx:

       sum+=num

   return sum

Explanation:

The imports the python math module

import math

The imports the python numpy module

import numpy as np    

The function begins here

def exp(x):

This creates an empty list

   mylist = []

This iterates from 0 to 9

   for n in range(10):

This calculates each term of the series

       num = (x**n)/(math.factorial(n))

This appends the term to list, mylist

       mylist.append([num])

This appends all elements of mylist to numpy array, exp_approx

   exp_approx = np.asarray(mylist)

This initializes the sum of the series to 0

   sum = 0

This iterates through exp_approx

   for num in exp_approx:

This adds all terms of the series

       sum+=num

This returns the calculated sum

   return sum

You might be interested in
Give short answers.
Mkey [24]

Answer:

H) Well it depends how you put it. I'm Doing virtual School for my education. And it is so easy when we have technology out their to provide the help that we need. So I think it has affected education pretty good. You can Also google the answers.

I) Looking up Answers at home

J) Parents can check up on their child's school work and see if they can help them. Also The law is involved in Education.

K) It depend's on how you put it

Explanation:

Short Answers

6 0
3 years ago
An example of cooler red is
BARSIC [14]

apple, stop sign, fire truck, stop light... ect

6 0
3 years ago
After an entry in the medical record has been written or keyed and an error is discovered, what procedure should be followed to
Readme [11.4K]

Answer:

(C) Draw a line through the error; then call the patient’s physician.

Explanation:

According to my research on medical procedures, I can say that based on the information provided within the question the best procedure that should be taken in this situation would be to draw a line through the error; then call the patient’s physician. By doing so you get rid of the the error and by telling the patient's physician you get rid of any possibility of the physician still thinking that the error was something that was already done.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
______ is a slow process that takes place in nature. (2 points)
netineya [11]

Natural Selection.


♣Amaranthine
6 0
3 years ago
The 10 IISSCC _____ cover 17 NIST control _____ which are arranged in three _____ called management, operational, and technical.
almond37 [142]

Answer:

Controls, families, domain

Explanation:

ISSCC means international information systems security certification consortium.

They are also known as ISC square, they offer two security certification the cissp and sccp.

7 0
3 years ago
Read 2 more answers
Other questions:
  • HURRRYY After pasting the information on the left side of the comparison slide, Jamal notices the text box extends beyond the bo
    9·1 answer
  • Which is the correct formula to add the values in cells A1 and B1? A. SUM(A1+B1) B. =SUM(A1+B1) C. =SUMA1+B1 D. A1+B1
    9·2 answers
  • A newspaper publishes a negative editorial on how local politicians are dragging their feet in building a new bridge. Select the
    10·2 answers
  • The media literacy movement hopes to _____.
    15·2 answers
  • Within a table, the intersection of a row and a column creates a(n) ____.
    13·1 answer
  • If I was to sort the months of the year in ASCENDING order alphabetically, which
    11·1 answer
  • Uploading Your Work
    14·1 answer
  • Question Mode Matching Question Match the following description with the appropriate programming language generation. 1GL 1GL dr
    7·1 answer
  • String objects are modified with string slices true or false
    9·1 answer
  • What is the factor of 200
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!