Question: Question 26 (Programming) The Gaussian error function. Erfly) is defined as Question 27 (Programming) The Catalan numbers form a sequence of natural numbers that occur

 Question 26 (Programming) The Gaussian error function. Erfly) is defined as

Question 26 (Programming) The Gaussian error function. Erfly) is defined as Question 27 (Programming) The Catalan numbers form a sequence of natural numbers that occur in various counting problems The Catalan sequence can be defined as follows: Your goal is to write a C program to compute Erf(y for various values of y. Please follow the following steps: (a 3marks) Write a function to compute the integrand of the above function (e). The zeroth element of the series is: Co = 1 Subsequent elements are defined as: The function should have the following prototype: double Antegrand tdoublo x) Cn+1 = 2 * (2 * n + 1) * Cn / (n + 2) (b) (3 marks) Write a general-purpose implementation of any integration algorithm you've seen in this elass (midpoint, trapezoidal, Simpson, or Monte Carlo). It should have the following prototype: The first few numbers in the sequence are double integral(DED fp, double a, double b, int n 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, . Where DED is defined as: typedet double DED(double) Write a C program which computes and prints the Catalan sequence from the zeroth number up to the nth number in the sequence, where n is a value input by the user fp is a pointer to the function you would like to integrate, a is the left bound, b is the right bound, and n is the number of panels. (c 3 marks) Write a function that uses the integral function to evaluate Erf(y) It should Bonus (5 marks): If you define a recursive function to compute the nth Catalan number you can get 5 bonus points. I would suggest first doing it directly and then defining this function if you still have time. have the following prototype double BrE (double y Use n-500 panels. (d) (4marks) Write a perogram to read a value, y and evaluate the erroe function at that value. It should output the value read and the value of the error function

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!