Please directly write down your answers after each subproblem in this document, your answers should be in blue color.
Before you send this back to me, change the document name to “Midterm_LASTNAME_Firstname.docx”. You can send your midterm to my email: liugeng.5202004@gmail.com, the subject of your email should be “Midterm_LASTNAME_Firstname”.
a) Write the Matlab command for generating a vector ‘x’ where the elements form a class of arithmetic progression from -5 to 5 with step size 0.1. (3pts)
b) How many elements are there in the vector? In Matlab what command would you use to obtain the length of the vector? (2pts)
c) Is the vector row vector or column vector? (2pts)
d) What are the results for the commands “ x*x’ ” and “ x.*x ”? (If the result is too long, you can describe it with your words.) Why? Give the Matlab command for plotting y=x^2. (3pts)
The following is a Matlab script to solve for the root of
clear all;
close all;
syms x;
f=@(_)_________________;
a=-1;
b=1;
tol=_________________;
error=1;
m=1;
while(__________)
mo=m;
m=(a+b)/2;
if(f(a)*f(m)<0)
b=m;
else
a=m;
end
error=______________;
end
a) What method is used in this code? Is this a bracketing method or an open method? (2pts)
b) Fill in the blanks. (8 significant figures) (9pts)
c) What is the result from this code? (1pts)
Create a hypothetical floating-point number set for a machine that stores information using 15-bit words. Employ the first bit for the sign of the number, the next six for the sign and the magnitude of the exponent, and the last eight for the magnitude of the mantissa. a) Under this definition, what is 101001011010100 in decimal format? Show the details of your calculation. (5pts)
b) What is the smallest possible positive floating-point number under the above definition?
(5pts)
c) What is the machine epsilon? (3pts)
Use 4-digit and 5-digit arithmetic with chopping, evaluate the roots of the expression x^2-100.02x+2 with the following equation employed, compute the relative errors. (20pts)
Give the flowchart for finding the root of the function
f(x)=[tanh(x-2)][sin(x+3)+2]
with the following methods (6 significant figures required):
Modified Regula Falsi (Choose two reasonable integers as your initial upper and lower bounds, 10pts)
Newton’s Method (Choose one reasonable integer as your initial guess for the root, 10pts)
Solve the following equations set
f_1 (x_1,x_2 )=sin(x_1 )+x_2
f_2 (x_1,x_2 )=x_1+e^(x_2 )
Can this equation set be solved by the fixed -point method with the following expressions? And why? Show your analysis with a 2D graph. (15pts)
g_1 (x_1,x_2 )=-e^(x_2 )
g_2 (x_1,x_2 )=-sin(x_1)
Use Newton Raphson Method with initial values x_1=-2,x_2=1.5. (8 significant figures. Please submit the code and results.) (10pts)
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme