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).

Answers

Answer 1

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


Related Questions

Uhh... What is happening?.. What...

Answers

Answer:

the Redstone underneath is activating the piston

Answer:

lever under each piston

Yo I need to know where to find a ps4 for free or a very cheap price please

Answers

Download offer up from the apple store or play store and search that up there’s many good deals and sometimes comes with games and controls included for cheap!

difference between academic library and school Library

Answers

I think Academic is like books about subjects so educational and school library are like fun books enjoyable

desktop and personal computer are also known as​

Answers

they are also known as general computers

Consolidated Supplies is a medium-sized distributor of restaurant supplies that operates in Canada and several northern U.S. states. They have 12 large warehouses spread across both countries to service their many customers. Products arrive from the manufacturers and are stored in the warehouses until they are picked and put on a truck for delivery to their customers. The networking equipment in their warehouses is old and is starting to give them problems; these problems are expected to increase as the equipment gets older. The vice president of operations, Pat McDonald, would like to replace the existing LANs and add some new wireless LAN technology into all the warehouses, but he is concerned that now may not be the right time to replace the equipment. He has read several technology forecasts that suggest there will be dramatic improvements in networking speeds over the next few years, especially in wireless technologies. He has asked you for advice about upgrading the equipment.
Should Consolidated Supplies replace all the networking equipment in all the warehouses now, should it wait until newer networking technologies are available, or should it upgrade some of the warehouses this year, some next year, and some the year after, so that some warehouses will benefit from the expected future improvements in networking technologies?

Answers

Answer:

Consolidated Supplies

Consolidated Supplies should upgrade some of the warehouses this year, some next year, and others the year after, so that some warehouses will benefit from the expected future improvements in networking technologies.

Explanation:

Gradual technology upgrade should be the way forward for Consolidated Supplies.  Waiting until newer networking technologies are available is not an option.  Total replacement of all the networking equipment in all the warehouses is not an option, as technology equipment becomes obsolete in no time.  Overall, Consolidated Supplies should never forget the numerous benefits from technology upgrade, including reduction of downtime, increased productivity, and improved customer services and satisfaction.

Write a Java program named Problem 3 that prompts the user to enter two integers, a start value and end value ( you may assume that the start value is less than the end value). As output, the program is to display the odd values from the start value to the end value. For example, if the user enters 2 and 14, the output would be 3, 5, 7, 9, 11, 13 and if the user enters 14 and 3, the output would be 3, 5, 7, 9, 11, 13.

Answers

Answer:

hope this helps

Explanation:

import java.util.Scanner;

public class Problem3 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter start value: ");

       int start = in.nextInt();

       System.out.print("Enter end value: ");

       int end = in.nextInt();

       if (start > end) {

           int temp = start;

           start = end;

           end = temp;

       }

       for (int i = start; i <= end; i++) {

           if (i % 2 == 1) {

               System.out.print(i);

               if (i == end || i + 1 == end) {

                   System.out.println();

               } else {

                   System.out.print(", ");

               }

           }

       }

   }

}

What is an access review?

Answers

Answer:

System Access Review (previously known as Identity Management) is the organizational process for ensuring that individuals have the appropriate access to technology resources.

PLEASE HELP ME ASAP!!!!

Answers

First party insurance: Loss due to laptop theft, loss due to interruption in business activities due to website failure

Third party insurance: cost of lawsuits filed against the policyholder, fees of a special programmer investigating a cyber fraud, expenses of providing notifications of the cyber attack to clients and employees

Write a recursive method named hanoi that prints a solution to the classic Towers of Hanoi puzzle. Your method should accept three integer parameters representing the number of disks, the starting page number, and ending peg number. Your method should print the solution to the game to move from the given start peg to the given end peg. For example, the call of hanoi(3, 1, 3); should print the following output to move the three pegs from peg

Answers

Answer:

Explanation:

The following recursive method is written in Java. It creates a simulation of the towers of Hanoi and outputs every step-by-step instruction on how to solve it. The output for the code can be seen in the attached picture below.

class Brainly {

   public static String hanoi(int numOfDisks, int startPeg, int endPeg) {

       int helpPeg;

       String sol1, sol2, MyStep, mysol;   // Contains moves

       if (numOfDisks == 1) {

           return "Move from " + startPeg + " to " + endPeg + "\n";

       } else {

           helpPeg = 6 - startPeg - endPeg;    // Because startPeg + helpPeg + endPeg = 6

           sol1 = hanoi(numOfDisks - 1, startPeg, helpPeg);

           MyStep = "Move from " + startPeg + " to " + endPeg + "\n";

           sol2 = hanoi(numOfDisks - 1, helpPeg, endPeg);

           mysol = sol1 + MyStep + sol2;     // + = String concatenation !

           return mysol;

       }

   }

   public static void main(String[] args) {

      String output = hanoi(3, 1, 3);

       System.out.println(output);

   }

}

Describing the One-to-Many Relationship
What is another name for the one-to-many relationship?
child-to-parent
O parent-to-child
O student-to-teacher
O teacher-to-student
Ve

Answers

Answer: B) Parent-to-child

Answer:

What is another name for the one-to-many relationship?

child-to-parent

Correct Answer: parent-to-child( B)

student-to-teacher

teacher-to-student

Explanation:

Which option ensures that page break is automatically inserted ahead of a specific paragraph or heading?

Answers

Answer:

the Keep with next option in the Paragraph dialog box. the Keep lines together option in the Paragraph dialog box.

Determining Uses for Outer Joins
Which situation would most benefit from an outer join?
a query that shows only customers who placed orders
a query that shows all duplicate customers from both tables
O a query that shows only the orders that have customers attached
a query that shows all customers, whether or not they placed an order
ve

Answers

Answer:

a query that shows all customers, whether or not they placed an order

Explanation:

EDG 21

Suppose we wanted to make change for purchases and wanted to use the least number of coins possible. Here is a greedy algorithm: for the change amount due, we always use the largest-face-value coin first. Assume we have only coins of quarters ($.25), twenties ($.20), and pennies ($.01). Assume the change is $.40: a. what would be the coins and their numbers obtained by the greedy algorithm above

Answers

Answer:

Explanation:

The following code is a Python function that takes in the amount of change. Then it uses division and the modulo operator to calculate the number of coins that make up the changes, using the greatest coin values first.

import math

def amountOfCoins(change):

   print("Change: " + str(change))

   quarters = math.floor(change / 0.25)

   change = change % 0.25

   dimes = math.floor(change / 0.20)

   change = change % 0.20

   pennies = math.floor(change / 0.01)

   print("Quarters: " + str(quarters) + "\nDimes: " + str(dimes) + "\nPennies: " + str(pennies))

You work at a computer repair store. A customer is having trouble with their hard drives. The computer is not recognizing all the drives in the machine. In this lab, your task is to diagnose and correct the problem. In the computer, the top hard drive contains the operating system files. Troubleshoot the hard drives to see why they are not all being recognized. Verify that all drives are detected in the BIOS.

Answers

Answer:

Explanation:

The first thing that you would need to do is verify that the drives are being detected within the BIOS. You need to first enter the BIOS by clicking the correct keyboard key on startup. If the BIOS detects the drives correctly, then the most likely problem is that the drive's letter is not assigned. To fix this you need to search for Disk Management within the OS, find the drive, and assign a letter to it. If this does not solve the issue then the cable or drive itself may be damaged and may need replacing.

I WILL GIVE MOST BRAINLY



Which factor most contributed to the rise of globalization beginning in the 20th century?
A.Consumers preferring to buy local goods
B.Governments breaking up corporate monopolies
C.Economist promoting barriers to trade
D.Internet access becoming widespread


Plz help I need this ASAP

Answers

i say C, i’m srry if i’m wrong

The factor that contributed to the rise of globalization beginning in the 20th century is economist promoting barriers to trade. Thus, option C is correct.

What is globalization?

Globalization has made communication between the countries easier to share information openly. This has also helped to increase the speed of transportation of products. Globalization brings nations together, breaking down cultural barriers and turning the world into a global village.

Technology not only changes the way we produce and connect, but also enables more humans to create and test new objects and ideas, reducing the costs and risks of innovation. Product development, even in developing countries.

Globalization has positive effects such as increase in national income, access to global capital, emergence of new business opportunities, increase in loans and investments, transfer of technology, development of energy and communication infrastructures. Improvement of labor quality and working conditions

Thus, option C is correct.

Learn more about Globalization on:

https://brainly.com/question/15283031

#SPJ7

URGENTTTTTTTTTTTT
You want to find a random decimal between 0 and 1, with 0 included. Choose the correct lines of code, in the order they should appear in IDLE. Sample Output: 0.3570702149467504
>>>_________
>>>_________

from math import *
randint(0,1)
from random import *
random( )​

Answers

Answer:

from random import *

print(random())

Explanation:

You can try this in any online python ide quicker than putting the question here!

Design an algorithm to find the weighted average of four test scores. The four test scores and their respective weights are given in the following format: testscore1 weight1 ... For example, the sample data is as follows: 75 0.20 95 0.35 85 0.15 65 0.30 The user is supposed to enter the data and press a Calculate button. The program must display the weighted average.

Answers

Answer:

data = [75, 0.2, 95, 0.35, 85, 0.15]

print (f'Average weight: {sum(data) / len(data)}')

Explanation:

This is python algorithm for finding average weight. To get average weight, you sum up all data involved and divide that amount by the number of data provided.

why do we install doorbells in our house

Answers

Explanation:

It's placed near the door. When a visitor presses the button, the bell rings inside alerting you that someone is at the door.

So when people are at the door they can use the doorbell to inform the people in the house that they are outside.

Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character.Ex: If the input is:4 hello zoo sleep drizzle zthen the output is:zoodrizzle

Answers

Answer:

try this.

Explanation:

#include <iostream>

#include <vector>

using namespace std;

int main() {

       int n;

       cin>>n;

       

       vector<string> v;

       string s;

       for(int i = 0;i<n;i++){

               cin>>s;

               v.push_back(s);

       }

       

       char ch;

       cin>>ch;

       for(int i = 0;i<v.size();i++){

               for(int j = 0;j<v[i].length();j++){

                       if(v[i][j]==ch){

                               cout<<v[i]<<endl;

                               break;

                       }

               }

       }

       return 0;

}

Complete the divisible_by(list1, int1) function below. As input, it takes a list of integers list1 and an integer int1. It should return a list with all the integers in list1 where the integer is divisible by int1. For example, divisible_by([2, 9, 4, 19, 20, -3, -15], 3) should return the list [9, -3, -15].
1 def divisible_by(listi, n):
2 # code goes here
3 pass
4
5 if _name == "__main__":
6 # use this to test your function
7 test_list = [2, 9, 4, 19, 20, -3, -15]
8 print(divisible_by(test_list, 3))

Answers

Answer:

The function is as follows:

def divisible_by(listi, n):

   mylist = []

   for i in listi:

       if i%n == 0:

           mylist.append(i)

   return mylist

   pass

Explanation:

This defines the function

def divisible_by(listi, n):

This creates an empty list

   mylist = []

This iterates through the list

   for i in listi:

This checks if the elements of the list is divisible by n

       if i%n == 0:

If yes, the number is appended to the list

           mylist.append(i)

This returns the list

   return mylist

   pass

PLEASE HELP ME ASAP

Answers

The answer is B; network security. If there is an issue with the software corruption, there is an issue with the security and validity of the website. A website encryption could prevent this from happening or even a simple virus cleaner.

(01)²

what is 2 in this number ​

Answers

Answer and Explanation:

It's an exponent (2 is squared I believe)

When you have an exponent, multiply the big number by the exponent

Ex: [tex]10^2[/tex]= 10x2=20

Ex: [tex]10^3\\[/tex]= 10x3=30

what is the Is option that prints to the author of a file?​

Answers

Answer:

We need to use Option - 'author' along with option- 'l'

The Internet is written in a "language" called
O Usenet
O package switching
O HTTP
O ARPANET​

Answers

Answer:

HTTP

Explanation:

I hope it helps u.

Mark Me as brainlist answer

HTTP

Have a great day! I hope this helped!

The biggest limitation of a network operating system (NOS) is _____ in terms of memory, process, device, and file management.

Answers

Answer:

Lack of global control.

Explanation:

An operating system is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes.

This ultimately implies that, an operating system acts as an interface or intermediary between the computer end user and the hardware portion of the computer system (computer hardware) in the processing and execution of instructions.

Some examples of an operating system on computers are QNX, Linux, OpenVMS, MacOS, Microsoft windows, IBM, Solaris, VM etc.

There are different types of operating systems (OS) used for specific purposes and these are;

1. Batch Operating System.

2. Multitasking/Time Sharing OS.

3. Multiprocessing OS.

4. Single User OS.

5. Mobile OS.

6. Real Time OS .

7. Distributed OS.

8. Network OS.

A network operating system (NOS) can be defined as specialized computer operating system that are designed primarily for use on network devices such as routers, switches, workstations, which are mainly connected to a local area network.

Generally, the biggest limitation of a network operating system (NOS) is lack of global in terms of memory, process, device, and file management.

free pass if you want it.

Answers

Answer:

yuh

Explanation:

Answer:

thank youuuu!

Explanation:

have a great day!!

The technology dealing with robots is called

Answers

Robotics

Robotics is a field of engineering that deal with design and application of robots and the use of computer for their manipulation and processing. ... Robotics requires the application of computer integrated manufacturing, mechanical engineering, electrical engineering, biological mechanics, software engineering.

Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the user to enter a string which is subsequently displayed in uppercase. It is important to first ensure that string to be converted is in the a-z range. The program does not recognize any space, symbols or any kind of punctuation marks. Any time the user enters any of this character the program is going to repeatedly ask for the valid string.

An example execution of your program could be:
Please enter your string: 1winter
Invalid Entry!
Please enter your string: summer
Your capitalized string:SUMMER

Answers

Answer:

try this

Explanation:

MSG1 DB 10,13,'enter any string:-$'

MSG2 DB 10,13,'converted string is:-$'

P1 LABEL BYTE

M1 DB 0FFH

L1 DB?

P11 DB 0FFH DUP<'$'>

DATA ENDS

DISPLAY MARCO MSG

MOV AH,9

LEA DX,MSG

INT 21H

ENDM

CODE SEGMENT

ASSUME CS: CODE,DS:DATA

START:

MOV AX,DATA

MOV DS,AX

DISPLAY MSG1

LEA DX,P1

MOV AH,0AH

INT 21H

DISPLAY MSG2

LEA SI,P1

MOV CL,L1

MOV CH,0

CHECK:

CMP[SI],61H

JB DONE

CMP[SI],5BH

UPR: SUB[SI],20H

DONE: INC SI

LOOP CHECK

DISPLAY P11

MOV AH,4CH

INT 21H

CODE ENDS

END START

Ill give alot of points if you answer: How do I get a 100 dollar ps4

Answers

uh how do you get a little blue box in a sandwich
You can try to set up a go found me or if you post a Venmo or cash thing in your profile people might give you money. Good luck!

Select the correct answer from each drop-down menu.

As a technical writer, you should state your purpose in the 1. ________ of your summary. In addition, you must _
2.______ the words used in the original document while writing a summary.

1. Last sentence
1. First sentence

2. Paraphrase
2. Copy
2. Quote

Answers

Answer:

1. First sentence

2. Paraphrase

Explanation:

Just took it

Other Questions
Need help asapp!! Question: What are some ways in which china was isolated from the rest of the world and how did this impact its overall development? the probability of an event happening is 5/9 what are the odds in favor of the event happening 7 students study Biology, Chemistry and Physics.12 students study Biology and Chemistry.15 students study Biology and Physics.20 students study Chemistry and Physics.35 students study Biology.32 students study Physics.Complete the Venn diagram. 6For a movie scene, a stuntman will slide down a wire that is connected from the top of a building to the ground. The wire,the side of the building, and the ground can be represented as the sides of a right triangle, as shown in the figure below.Building600Wire70 feetx feetThe height of the building where the wire is attached is 70 feet. Based on the angle measure in the figure, which of thefollowing is closest to the value of x?A-140.0B-70.0C-121.2D-40.4 Look too muck stress lol no links 2hat is 9/41 as decimal In 2021, internal auditors discovered that Fay, Inc., had debited an expense account for the $2,635,000 cost of a machine purchased on January 1, 2018. The machine's useful life was expected to be 17 years with no residual value. Straight-line depreciation is used by Fay. The journal entry to correct the error will include a credit to accumulated depreciation of: Multiple Choice $155,000. $2,635,000. $465,000. $310,000. Which is closest to the surface area of a cone with dimensions as shown?A. 113 mm2B. 75 mm2C. 66 mm2D. 207 mm2 4.{hghghghghghghghghg} True or false: If a nuclear chain reaction is uncontrolled, it produces a lot of energy all at once. This iswhat happens in an atomic bomb. Which statement about the economy is true?A. it is a social institution, B. It deals with how people earn money, C. it deals with how people spend money, D. All of the above are true NEED HELP ASAP!!! Kennedys quote Ask not what your country can do for you. Ask what you can do for your country and his own personal style highlighted a call for... A. Civil suits B. Civil service C. Civil obedience D. Civil disobedience Suppose you roll a 6-sided number cube twice, and each time yourolled a 4. a) Is the rolling of the number cube twice independent ordependent events? b) What is the probability of rolling two fours? c)Explain the difference between independent and dependent events. Write the name of the property shown by each equation. ( Commutative, Associative, Identity, Properties of Zero.a. 3 x (2 x r)=(3 x 2 ) x rb. 15 x 1=15c. 12 x p=p x 12d. 35 x 0=0e. 0 divided by 76=0f. (8 x9) x 12= 8 x (9x12) PLEASE I NEED THE ANDWER IN THE BEXT MINUTE who is the richest artist in the Gambia 2020 -59 Points!-Below, the two-way table is given for a class of students.^^^^^ (photo attached)If a student is selected at random, find theprobability the student is a senior given that it'sfemale. Round to the nearest whole percent.[?]% hi! please help ill give brainliest Read the passage from Edgar Allan Poe. In speaking of my mother you have touched a string to which my heart fully responds. To have known her is to be an object of great interest in my eyes. I myself never knew herand never knew the affection of a father. Both died (as you may remember) within a few weeks of each other. I have many occasional dealings with Adversitybut the want of parental affection has been the heaviest of my trials. In this passage, the author quotes Poe to definea cause of his dark themes. an effect of his dark themes. the central idea of his dark themes. the relationships in his dark themes. PLEASE HELP ASAP!! will mark brainlest! HEY CAN ANYONE PLS ANSWER DIS SPANISH WORK!