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

  What is the variety of addresses available in each networks

What is the variety of addresses available in each  networks

  Perform sensitivity analysis by changing one parameter

Perform sensitivity analysis by changing one parameter at a time (leaving all other parameters fixed at the values used in Task 4) and answer the following questions.

  In software engineering one can find out various life cycle

in software engineering one can find various life cycle models. some examples include the waterfall model agile

  Design a dedicated datapath

Design a dedicated datapath

  Question1 write down an sql statement to show tables owned

question1. write down an sql statement to show tables owned by user newyear. 2. write down an sql statement to show the

  Explain how the grammar of a high-level programming

question 1. discuss why binary notation is universally used to store computer data.question 2. discuss why boolean

  Challengeopportunity area for suh choose one of the three

using the case provided propose a technology solution that results from your analysis of the business environment.

  Add items to the arraylist

Add items to the ArrayList, one at a time, based on user typed input. The user will be prompted for the String to be stored in the ArrayList and then hit enter. The user would be able to continue to add items to the ArrayList until they just hit e..

  Write a function playexpert

Write a function playExpert(marbles) that given a number of marbles returns the number of marbles that the computer will take following the expert mode rules.

  Preliminary project plan for an important internal project

You have been hired by the Client to provide a preliminary Project Plan for an important internal project. Client staff support the project and have secured Board approval for MIT Consulting to take the project to the next phase.

  Creating a program with a building as subclass

Assume the existence of the Building class. Describe a subclass, ApartmentBuilding that consists of following instance variables: an integer, a boolean, numFloors, an integer, hasElevator, unitsPerFloor, a boolean, hasCentralAir, and a string, man..

  Find out a java application on the web

Find a Java application on the Web and explain how the program structure functions.

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