Question: In Java, Here, you will use Ramanujan's series, discovered in 1910. It converges much faster than Gregory's, and has been used to calculate pi to

In Java, Here, you will use Ramanujan's series, discovered in 1910. It converges much faster than Gregory's, and has been used to calculate pi to billions of digits. Implement Ramanujan.java taking a number n specified by the user on the command line and calculating pi using the first n terms of the Ramanujan series. The program should print this approximate value of Pi , as well as the percentage error between this value and the one provided by Java in the constant Math.PI. Notice that this formula makes use of the factorial function. Call your Factorial.calculate method from Problem 1.

I can't get the eqation to work I tired going step by step and still can't figure it out. This is one of the many things i tired.

answer = (2*Math.sqrt(2))/Math.pow(99,2);

holder1 = Factorial.calculate(4*decimal);

holder2 = holder1*(26390 * decimal) + 1103;

System.out.println(holder2);

holder3 = (Factorial.calculate(decimal))*(Math.pow(396,(4*decimal)));

System.out.println(holder3);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!