C Code:
#include <stdio.h>
#include <math.h>
double func(double x)
{
return exp((-1.0) * x * x);
}
main()
{
double h = 0.5;
double x = 1.5;
double double_derivative = (func(x - h) - 2 * func(x)
+ func(x + h)) / (h*h);
printf("f''(1.5) = %lf\n", double_derivative);
}
Output:
f''(1.5) = 0.701587
Please Solve in C programming. Please Use “ f(x) = e^(-x^2) “ for thus question. Thank You
Please Write in C programming Language For Questions below. write computer code in any programming language or mathematical software to estimate dz using the given method. Then calculate the absolute and relative errors for each. Use exact value p 0.6044 戰,omposite Trapezoidal Rule with N = 6. For Questions below. write computer code in any programming language or mathematical software to estimate dz using the given method. Then calculate the absolute and relative errors for each. Use exact value p...
Discrete Math and Computer Science I need help with #2 the programming part is in C++ Thank you! Main topic and problems for the final project The main purpose of the project is to introduce you how to use a computer as a research tool in an Introductory Discrete Mathematics. In this project you will be asked to show how the Fibonacci sequence (F,) is related to Pascal's triangle using the following identities by hand for small n and then...
Please solve for part (b) and (c) thank you! 1. Consider the function f(x) = e-x defined on the interval 0 < x < 1. (a) Give an odd and an even extension of this function onto the interval -1 < x < 1. Your answer can be in the form of an expression, or as a clearly labelled graph. [2 marks] (b) Obtain the Fourier sine and cosine representation for the functions found above. Hint: use integration by parts....
This problem demonstrates the use of import module. The Python programming language has many strengths, but one of its best is the availability to use many existing modules for various tasks, and you do not need to be an experienced computer programmer to start using these modules. We have given you some incomplete code; note that the very first line of that code contains an import statement as follows: import math This statement enables your program to use a math...
Python If it is possible, please do not use hand writing form, thank you. Question 2: What do you know about the sorting algorithms? Explain Merge sort with example and write a Program or merge sort in any programming language.
Please help me solve this question, thank you! If the function z -f(x,y) has continuous second order partial derivatives f(x, y), fry (x,y)- fyr(r, ), fw(x, y), and if co 0, y sin 0, show that ух んyy
Use R language. question 7 Q6. Hasting's approximation: For 2 > 0, "(z), the cdf of standard normal r.v., can be approximated by the function h(x) = 1 -0.5(1 +212 +2222 +2323 +2424) - 4 with a1 = 0.196854, a2 = 0.115194, az = 0.000344, and a4 = 0.019527. The approxima- tion error may be upper bounded by 2.5 x 10-4. Use a for loop to evaluate h(1.645) and compare the result of pnorm(1.645). Round all your answers to 5...
PLEASE ASSIST WITH BOTH OF THEM Question 2 2.1 Derive the following O(h) three-point formula (including the error term): f'(x) = f(x, +h)-f(xo – h))"f" where xo - h<$<xo +h. [4] 2.2 If f(x) = x In(x), calculate f'(8.3) using the formula above in 2.1 with h = 0.5 and h = 0.25 and compare these results with the exact value of f'(8.3). [3]
Please show your work. Thank you Q4. Use the semi-annually compounded yield curve in the following table to price the some fixed income securities: 0.50 1.00 1.5 6.49% (a) 1.5-year zero coupon bond (b) 2-year coupon bond paying 15% semiannually (d) 1.5-year coupon bond paying 9% annually (e) 2-year floating rate bond with zero spread and semiannual payments (f) 1.5-year floating rate bond with zero spread and annual payments. For this question, assume ri (-0.5, 0.5)-6%. (h) 1.5-year floating rate...
how to do question 3? "normal equations" for the line's coefficients from the Error Function E. 3. Le (x) = VX + 1 . Use Adaptive Quadrature Simpson's Rule with n = 4 to 2 and n estimate J f Cr)dx and find the Absolute and Estimated Errors. 2 20p 0 in initial value probler "normal equations" for the line's coefficients from the Error Function E. 3. Le (x) = VX + 1 . Use Adaptive Quadrature Simpson's Rule with...