Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write a Java Program to compute the value of e.

e is the base of the Natural Logarithms. The first few digits of e are: 2.7182818284590452353602874713527

There are many ways of calculating the value of e, but none of them ever give an exact answer, because eis irrational (not the ratio of two integers).

But it is known to over 1 trillion digits of accuracy!

Method 1:

For example, the value of (1 + 1/n)n approaches e as n gets bigger and bigger:

n

(1 + 1/n)n

1

2.00000

2

2.25000

5

2.48832

10

2.59374

100

2.70481

1,000

2.71692

10,000

2.71815

100,000

2.71827

In the equations that follow, "!" means factorial.

0! = 1, 1! =1, 2! = 2?1 = 2, 3! = 3?2?1 = 6, 4! = 4?3?2?1 = 24, 5! = 5?4?3?2?1 = 120, etc.

Method 2:

The Taylor series for the exponential function ex at a = 0 is

If x is zero, the value of e is equal to 1 + 1/1! + 1/2! + 1/3! + 1/4! + 1/5! + 1/6! + 1/7! + ... (etc)

Another way of expressing this series is the formula:   

The first few terms add up to: 1 + 1 + 1/2 + 1/6 + 1/24 + 1/120 = 2.718055556

Method 3:

Recently, new formulae have been developed by Brothers (2004) which make the calculation of e very efficient.

Your assignment is write a program that computes the value of e using all three of the methods described above for the values of n = 1,2,3,4,5,6,7,8,9,10, and 20. Your program must print out the value of e and the difference with the value of in Math. Make certain that the outputs are labeled as to which method is being used and what value of n was used.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92043874
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Why is scenario manager useful to a manager wanting to use

Why is Scenario Manager useful to a manager wanting to use a model developed with Excel to help make a business decision such as whether to expand his business? When should a manager use the Excel Solver?

Searching algorithm - which to use for this problemthe

Searching Algorithm - Which to use for this problem? The original problem was: You get a job with a small e-commerce company. b) The customer base has grown to 8,000,000 customers. Jorge now insists that the sorting algo ...

Explain that this threat represents a well-known and broad

Explain that this threat represents a well-known and broad category of electronic and human activities that breach the confidentiality of information.

Question draw a map labeling every aspect which represents

Question: Draw a map, labeling every aspect, which represents how IP addressing works with DNS servers to process a request for a web page from your computer that returns the web page.Using tracert from your terminal ent ...

Under the trade model with external economies of scale is

Under the trade model with external economies of scale, is it possible for a country to be worse off with trade than it would have been without trade? Justify your answer.

Are there manufacturers and retailers who have taken steps

Are there manufacturers and retailers who have taken steps to reduce their pollution impact, both air quality and industrial pollution, while maintaining a viable place in the market?

Explain how amazon and walmart companies use information

Explain how Amazon and Walmart companies use Information and Communication Technologies (ICT) in their competitive strategies. Highlight the differences in their use of ICT.

Question based upon your company profile install and

Question: Based upon your company profile, install and configure Windows Server within the virtual environment. 1. Ensure that the server name is appropriate for your corporation. 2. Create a complex password for the Adm ...

Taylor found that 8 of the recipients of loans form a

Taylor found that 8% of the recipients of loans form a particular mortgage lender default within 3 years. If he takes a random sample of 736 customers who received loans 3 years ago, what is the average number of custome ...

Which sentence would work better as a thesis statement for

Which sentence would work better as a thesis statement for a three-to-five-page college paper? Remember that a thesis should be a central idea that requires supporting evidence; it should be of adequate scope for essay's ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As