a. Answer: 2
b. Answer: 5
c. Answer: 13
d. Answer: 34
e. The function simply adds the given two numbers and return the sum; The addition is done using recursion.
CPP version of the code:
#include <iostream>
using namespace std;
// Driver Program
int function(int i,int j){
if(i==0)
return j;
else
return function(j,i-1) +1;
}
int main(){
int a = function(13,21);
cout<<a;
}
Calculus 4
Let f(x,y) = A)-i-j E) i+j 1. Find the gradient vector Vf (1, 1) at the point (x,y) = (1,1). B) - 1 - 1 D)-i-j 10. . Find the largest value of the directional derivative of the function f(x,y) = ry + 2ya at the point (3,y) = (1,2). A) 53 ' B) V58 C) V63 D) 74 E) 85 y + The function (,y) = 2 + y2 + A) (-3,5), saddle point C) (-1,3), maximum...
Question 18 CLO3 Analyze the following code and answer the questions that follow def F(n): If n <= 1: return n else: return F(n-1)+F(n-2) for i in range (n) print (F(i)) Result: 0 1 1 2 3 5 8 13 a. Write number of operations as a function when the code is execute b If n 7, what is the total number of operations? c. What is the complexity of the algorithm behind the code? (2 Marks) (2 Marks) (1...
I ONLY NEED HELP PARTS E AND F
2. Consider the spin representation with j = 2 (in units of h). The corresponding matrices are 110 1 21 122 0 -i i ols We define J2-J12 + J22 + J32, J+ = J1 + 1J2, and J-= J1-1J2. A) (1 point) Show that 12 equals the identity matrix times jG +1), where- B) (3 points) Show that aJbic Eabe Jc for each combination a, b 1, 2,3 C) (2 points)...
Problem 1: Let F(, y,) be a function given by F(, y, z) (r2+y)e. Let S be the surface in R given by the equation Fr, y, 2) 2. (a) Find an equation of the tangent plane to the surface S at the point p(-1,1,0) (b)Find the directional derivative -1,1,0) of F(,y,2) in the direction of the unit vector u = (ui, t», t's) at the point p(-1,1,0) - In what direction is this derivative maximal? In what direction is...
Problem 2 (hand-calculation): Consider the function f(x) tabulated in table 1. Apply improved trapezoid rule to estimate the integral, If) J ) dz, by using the following number of subintervals, n (a) n-3. Use grid points at i0, 4, 8 and 12 (b) n- 6. Use grid points at i0, 2,4, 6, 8, 10 and 12 (c) n = 12, Use all grid points For each part, compute the integral, T(f) and the corresponding absolute error Er(f), and the error...
(1 point) Taylor's Remainder Theorem: Consider the function 1 f(x) = The third degree Taylor polynomial of f(x) centered at a = 2 is given by 1 3 12 60 P3(x) = -(x-2) + -(x - 2)2 – -(x - 2) 23 22! 263! Given that f (4)(x) = how closely does this polynomial approximate f(x) when x = 2.4. That is, if R3(x) = f(x) – P3(x), how large can |R3 (2.4) be? |R3(2.4) 360 x (1 point) Taylor's...
You may skip parts (e) and (f)- I still need parts (g), (h),
(i), and (j).
(x -R)2 0 4 (a) Complete the entries in the table. Put the sums in the last row. What are the sample means x and y? (b) Calculate bi and b2 using (2.7) and (2.8) and state their interpretation. (c) Compute )vi. Using these numerical values, show that (d) Use the least squares estimates from part (b) to compute the fitted values of y,...
This Question: 4 pts 16 of 26 (0 complete) Use the graph of the function f shown to the right to answer parts (a)-(h). (a) Find f(-14) and f(-6). (-6,6) 8 (12.4) 4 (-12.0) (TO) f(-14) = f(-6)= A (0-2) (8,0) 1-14.-4) (b) is f(4) positive or negative? -8 is Question: 4 pts 16 of 26 (0 complete) Use the graph of the function f shown to the right to answer parts (a)-(h). (-6,6) 8 (12.4) 4 (c) Is f(-4)...
i
need the code for this question please
3. Constler the folloving nitial valse proble dy Take one stop of the modified Euler8 nelloul Un+,-di +습 (J(z",la) + f(m+1 lat)) with h 0.2 o find the approximate value of g/(1.2). (Hint: set up the equation for lh and use the fsolne Matlab fnnetion to solve for ) (working space if required) gSofue (@ (K) γ-1-0.1 (asasteos('.2, 02 e oudit
3. Constler the folloving nitial valse proble dy Take one stop...
Thanks in advance!
1. (5 pts.) Suppose that a function y = () has its tangent line approximation given by La- 3-2-1) at the point where = 1, but we do not know anything else about the functions (a) Compute the values of L(1) and L'(1). (b) What must be the values of f(1) and f'(1)? Why? (c) Do you expect the value of (1.001) to be greater than or less than the value of f(1)? Why? (d) Use the...