Compute a sequence of approximations of e

Assignment Help Computer Engineering
Reference no: EM131097542

E19: Numerical Methods for Engineering Applications Spring 2016 - HOMEWORK 1

Q1. Approximation of e to 4 digits of accuracy

The Maclaurin expansion of ex is given by

ex = 1 + x + x2/2! + x3/3! + x4/4! + . . .

Compute a sequence of approximations of e (using x = 1) until the approximate relative error εa is small enough to guarantee at least four significant digits of precision. Submit a table showing each estimate along with the approximate relative errors (for all but the first estimate).

Q2. Programming exercises

This question is to get you thinking about programming in Python in case you're just starting out, or it's been a while. If you're feeling comfortable with Python and you want to try something different you may work out solutions to any two Project Euler problems (see https://projecteuler.net/) you have not yet completed instead of doing the exercises below.

On the course website, I've posted two Python programs, guess1.py and guess2.py. Your goal is to modify the programs to obey these guidelines:

  • Modify both programs so that the guesser is limited to a maximum of 7 guesses, and have the program print out which guess is being made (i.e. 1 to 7). Use a for loop to limit the guesses, and use a break statement to exit the loop when the number has been guessed correctly.
  • Modify guess1.py so that the computer tells the user whether their guess is too high or too low, instead of whether it is correct or incorrect.
  • Modify guess2.py so that the user can tell the computer whether its guess is too high, too low, or correct by entering the letters h, l, or c, and have the computer implement an intelligent strategy for guessing based on the feedback. If you need strategy help, read this: https://en.wikipedia.org/wiki/Binary_search_algorithm.
  • Optional: make your modified guess2.py program print out an angry message if the user is found to be cheating.

Attachment:- Assignments.zip

Reference no: EM131097542

Questions Cloud

How could the u.s. apply the selected concepts : How could the U.S. apply the selected concepts to improve their own homeland security systems? Explain and be specific - How could these concepts have been applied to recent terrorist attacks or natural disasters?
Alphabetical order of firstname : You are creating a list of Customers (from the Customer table in Workshop 02) and you wish for that list to be in reverse alphabetical order of LastName, and alphabetical order of FirstName such at Jones, Ben will appear in the list before Jones, ..
Data recording murdoch students : A relation that contains data recording Murdoch students' performance in units, has the following attributes:  (StudentNumber, StudentName, UnitCode, Year, Semester, Grade, Mark).
Evaluation of smucker business : What is your evaluation of Smucker's business lineup and its acquisitions since 2002? How attractive is the processed foods industry? How strongly positioned are the company's brands in each segment of the industry?
Compute a sequence of approximations of e : E19: Numerical Methods for Engineering Applications Spring 2016 - HOMEWORK 1. Compute a sequence of approximations of e (using x = 1) until the approximate relative error εa is small enough to guarantee at least four significant digits of precision
Smucker company corporate strategy : What is J. M. Smucker Company's corporate strategy? What common strategy elements are shared across its brands? Did it make sense for Smuckers to expand its business lineup beyond jams, jellies, and preserves? Why or why not?
What is the total number of host ip addresses required : How many "subnet bits" are required? How many hosts/subnet are useable? What is the total number of HOST IP Addresses required? What is the total number of SUBNET IP Addresses required? What is the required SUBNET MASK (Show work)?
Number with the appropriate month : Write a program that prompts & accepts a number between 1 and 12. After getting the input, display the number with the appropriate month, show a short description of the month sought Example:
Questionnaire and interview skills : For this exercise, place yourself in the shoes of someone who has been tasked to improve the workstation of an administrative assistant, like Beth. To practice your questionnaire and interview skills, develop a set of 10 questions that will allow ..

Reviews

Write a Review

Computer Engineering Questions & Answers

  Most interesting part of dhs cyber security page and why

Go to the following website and review it. Write a one page paper (double spaced) on what you think is the most interesting part of the DHS Cyber Security page and why

  Stop-and-wait arq

Assume that each router utilizes the stop-and-wait ARQ and offer one buffer (large enough for one packet) for every VC in every direction of traffic.

  This longer written project is designed to give you the

this longer written project is designed to give you the opportunity to select an electronic health record identifying

  Implement a semaphore by using monitor

implement a semaphore by using monitor. Write the code to implement a semaphore with two main operations of semaphore _increment() and semaphore_decrement().

  What circumstances will you use flash over an html editor

Flash is a popular tool to enhance site interactivity. I require recommendations for how to integrate Flash into a website effectively. Under what circumstances would you use Flash over an HTML editor?

  Use the techniques to do some black-box testing

how to Download a shareware version of some commercial software.

  Explain this in your current place of employment or an

write a 700-1050 word paper identifying and describing how information is used and how it flows in an

  Define difference between any two of these n citie

design a file dist.dat for storing pairwise distances represented as an NxN table of numbers. The number at the intersection of the i-th column and j-th row is the distance from city i to city j. So the table is symmetric.

  Make a java application that accepts a positive integer

make a Java application that accepts a positive integer n > 1 as a command line parameter and outputs all strictly increasing integer sequences starting with 1 and ending with n.

  Convert an nfa to a dfa

Comments should be included in the program to explain your calculations and program.

  Describe how you would develop an addressing and naming

discuss how you would develop an addressing and naming model in an environment that has 10 departments in a 1000

  Questioncreate a set of in third normal form 3nf from

questioncreate a set of in third normal form 3nf from following un-normalised relation. you must use finkelstein

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd