I am Joshua M. I am a Statistics Assignment Expert at statisticsassignmenthelp.com. I hold a master's in Statistics from, Michigan State University, USA. I have been helping students with their assignments for the past 6 years. I solve assignments related to Statistics. Visit statisticsassignmenthelp.com or email info@statisticsassignmenthelp.com.
You can also call on +1 678 648 4277 for any assistance with Statistics Assignments.
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Statistics Assignment Help
1. Mechanical Engineering Assignment Help
statisticsassignmenthelp.com
For any help regarding Mechanical Engineering Assignment Help visit :
https://www.statisticsassignmenthelp.com/
Email - support@statisticsassignmenthelp.com or call us at - +1 678 648 4277
2. Quiz 1 will take place on Wednesday, September 26, at 7:30 PM, in Rooms 1-190 and 3-270. Students with last
names beginning “A” through “L” should report to Room 1-190; students with last names beginning “M”
through “Z” should report to Room 3-270.
Quiz 1 is “open book”: you may refer to the text and other class materials as well as your own notes and
scripts; we would also advise you to prepare a short cheat sheet so that you have quick access to key material. In
Quiz 1 you may not use any computers, tablets, calculators, or smartphones. The quiz will consist exclusively of
multiple-choice questions.
Quiz 1 is on the material of Unit I. In preparation for Quiz 1 you might find the study guide below useful.
You should also review the textbook reading for Unit I, your notes from lecture, the MATLAB Exercises
Recitation 1 and Recitation 2, as well as the questions in the Unit I Quiz Question Sampler.
·
MATLAB:
Data types (in particular, logical and floating point (double)).
Basic operations on scalars: assignment, arithmetic, relational and logical, flow control (if, for, while).
Standard constructs such as (incremented) counter variables, (incremented) summation/ac cumulation
variables, and shuffled recurrence variables.
Single-index arrays: assignment, indexing, indirect indexing (in which the index is itself a single-index array of
integers), concatenation, the colon; dotted arithmetic operators; rela tional and logical operators.
Key MATLAB built-in functions: basic mathematical functions such as the trigonometric and exponential
functions; “data” creation and manipulation functions such as length, find, sum, max, min, ones, zeros.
·
statisticsassignmenthelp.com
statisticsassignmenthelp.com
Numerical Computation For Mechanical Engineers
3. Math and Numerics:
Interpolation, univariate: piecewise-constant, left (endpoint); piecewise-constant, right (end
point); piecewise-linear.
Understand the “piecewise” part in which you find the segment in which the point of interest
x resides; understand the “constant left, constant right, and linear” part which determines (i )
the functional form of the interpolant within the segment, and (ii ) the interpolation points at
which the interpolant and the function (to be interpolated) must agree.
Integration, univariate: rectangle rule, left; rectangle rule, right; rectangle rule, midpoint;
trapezoidal.
Understand the decomposition over segments as well as the “rule” within each segment; appreciate the
geometric/area picture which corresponds to each rule. Also understand the integration formulas in terms
of a sum of [quadrature weights × function values at quadrature points].
Differentiation, univariate: first derivative (forward difference, backward difference, cen tered
difference); second derivative (centered difference).
Understand the points at which the function is evaluated, the point at which the derivative is
approximated, and the specific “finite difference” formula.
Basic Concepts and Attributes: accuracy, convergence, convergence rate and order, smoothness,
resolution, computational cost, memory. These concepts are applicable to inter polation, integration, and
differentiation.
statisticsassignmenthelp.com
statisticsassignmenthelp.com
4. Question 1. Consider the integral of a linear function,
�1
I = (α + βx) dx (1)
0
in which α and β are any non-zero constants (e.g., α = 2, β = 4.5). We approximate this integral
by first breaking up the full interval into N − 1 segments of equal length h and then applying an integration rule.
Which of the following integration rules will yield the exact result for the integral of equation (1) for any value of
h?
(a) rectangle, left
(b) rectangle, right
(c) trapezoid
(d) rectangle, midpoint
Please circle all answers that apply. You will get full credit for circling all the correct answers and no incorrect
answers, proportional partial credit for circling some of the correct answer(s) and no incorrect answers, and zero
credit if you circle any incorrect answers. (Hint: Draw a simple picture.)
statisticsassignmenthelp.com
Question 2. The function f (x) is defined over the interval 0 ≤ x ≤ 1 by
⎧
⎨ x for 0 ≤ x ≤ 1/2
f (x) = .
⎩ 1 − x for 1/2 < x ≤ 1
i i−1
We also introduce a set of points x = , 1 ≤ i ≤ 6, which define segments S = [x , x
i i i+1 ],
5
statisticsassignmenthelp.com
5. 1 ≤ i ≤ 5 (for example, the first segment, S1, is given by 0 ≤ x ≤ 0.20). The function f (x), points
xi, 1 ≤ i ≤ 6, and segments Si, 1 ≤ i ≤ 5, are depicted in Figure 1.
In the below we consider two different interpolation procedures, “piecewise-constant, left endpoint” and
“piecewise-linear,” based on the segments Si, 1 ≤ i ≤ 5. In each case we evaluate the interpolant of f (x) for any
given value of x by first finding the segment which contains x and then within that segment applying the
particular interpolation procedure indicated. Note your interpolants should not involve evaluations of the
function f (x) at points other than the xi, 1 ≤ i ≤ 6, defined above.
(i) Let (I0 f )(x) be the “piecewise-constant, left endpoint” interpolant of f based on the segments Si, 1 ≤ i ≤
5. The error in this “piecewise-constant, left, endpoint” interpolant at x = 0.3, defined as |f (x = 0.3) −
(I0 f )(x = 0.3)|, is
(a) 0
(b) 0.05
(c) 0.02
(d) 0.1
(e) 0.2
(iii)Let (I 1f )(x) be the “piecewise-linear” interpolant of f based on the segments Si , 1 ≤ i ≤ 5. The error in
this “piecewise-linear” interpolant at x = 0.3, defined as |f (x = 0.3)− (I1 f )(x = 0.3)|, is
(a) 0
(b) 0.05
(c) 0.02
(d) 0.10
(e) 0.2 statisticsassignmenthelp.com
statisticsassignmenthelp.com
6. 1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
x6 = 1
x 1 − x
0.2
S1 S2 S3 S4 S5
x3 = 0.4 x4 = 0.6 x5 = 0.8
x1 = 0 x2 = 0.2
Figure 1: A plot of the function ⎧
⎨ x for 0 ≤ x ≤ 1/2
1 − x for 1/2 < x ≤ 1
f (x) =
⎩
,
as well as the points xi, 1 ≤ i ≤ 6, and associated segments Si, 1 ≤ i ≤ 5. Note the points xi, 1 ≤ i ≤ 6, are equidistant,
and hence the segments Si, 1 ≤ i ≤ 5, are all the same length 0.2.
statisticsassignmenthelp.com
statisticsassignmenthelp.com
7. Question 3. The function f (x) is defined over the interval 0 ≤ x ≤ 1 by
⎧
⎨ x for 0 ≤ x ≤ 1/2
f (x) = .
⎩ 1 − x for 1/2 < x ≤ 1
i
i− 1
We also introduce a set of points x = , 1 ≤ i ≤ 6, which define segments S = [x , x i i i+ 1 ],
5
1 ≤ i ≤ 5 (for example, the first segment, S1, is given by 0 ≤ x ≤ 0.20). The function f (x), points
xi, 1 ≤ i ≤ 6, and segments Si, 1 ≤ i ≤ 5, are depicted in Figure 1.
We further define the definite integral
1 I = f (x) dx .
0
In the below we shall consider two different numerical approximations to this integral , “rectangle rule, left” and “trapezoidal rule,” based on the
particular segments Si, 1 ≤ i ≤ 5. Note your numerical approximations should not involve evaluations of the function f (x) at points other than the
xi, 1 ≤ i ≤ 6, defined above.
h
(i) Let I 0, left
be the “rectangle rule, left” approximation to the integral I. The error in this
0, left
“rectangle rule, left” approximation, defined as |I − I |, is
h
(a) 0
(b) 0.01
(c) 0.06
(d) 0.09
(e) 0.2
(ii) Let I1 be the “trapezoidal rule” approximation to the integral I. The error in this “trapezoidal
h
1
rule” approximation, defined as |I − I |, is h
(a) 0
(b) 0.01
(c) 0.06
(d) 0.09
(e) 0.2
∫
statisticsassignmenthelp.com
statisticsassignmenthelp.com
8. Question 4. We consider the differentiation of a very smooth function f (x) by finite differences. (The function
is very smooth, but not constant — for example, f (x) might be x2ex.) You are given the values of f (x) at three
points x˜1, x˜2, and x˜3 which are equi-spaced in the sense that x˜2 − x˜1 = h
and x˜3 − x˜2 = h; you wish to approximate the first derivative of f at the particular point x = x˜2,
f'(x˜2).
The following finite difference formulas are proposed to approximate f'(x˜2):
f (x
˜2) − f (x
˜1)
(a)
h
f (x
˜3) − f (x
˜1)
(b)
2h
f (x
˜3) − f (x
˜2)
(c)
2h
f (x
˜3) − f (x
˜2)
(d)
h/2
(i) Circle all answers which converge to f'(x˜2) as h tends to zero.
You will get full credit for circling all the correct answers and no incorrect answers, propor tional partial
credit for circling some of the correct answer(s) and no incorrect answers, and zero credit if you circle any
incorrect answers. (Hint: If the formula gives the wrong result for a linear function f (x) then certainly
the formula can not converge to the correct result in general.)
(ii) Mark “BEST” next to the answer above which will give the most accurate approximation to
f'(x˜2) (for h sufficiently small).
statisticsassignmenthelp.com
statisticsassignmenthelp.com
9. Question 5. Consider the MATLAB script
clear
y = [5,-3,2,7];
val = y(1);
for i = 2:length(y)
%either &&or &will work in the statement below i f ( (y (i )
<= val) &&(y (i ) >= 0) )
val = y ( i ) ;
end end
val_save = val
(i) The first time through the loop, when i = 2, the expression (y (i ) <= val) will evaluate to
(a) (logical) 0
(b) (logical) 1
(c) 5
(d)-3
where logical here refers to the logical data type or class.
(iii)Upon running the script above (to completion) val_save will have the value
(a) 5
(b)-3
(c) 2
(d) 7 statisticsassignmenthelp.com
statisticsassignmenthelp.com
10. Question 6. Consider the MATLAB script
clear
x = [1,0,0,2];
y = [0,2,4,5];
z = (x.^2) + y;
ind_vec = find( z > 3 ) ; r =
z(ind_vec);
(i) This
(a)
script will calculate z to be
[1,2,4,7]
(b) [1,2,4,9]
(c) [2,2,4,9]
(d) [1,0,0]
(ii) This
(a)
script will calculate ind_vec to be
[0,0,1,1]
(b) [0,1,1,0]
(c) [2,3]
(d) [3,4]
(iii) This
(a)
script will calculate r to be
[4,7]
(b) [4,9]
(c) [3,4]
(d) [25] statisticsassignmenthelp.com
statisticsassignmenthelp.com
11. Question 7. We wish to approximate the integral
1
x
I = xe dx
0
by two different approaches (A and B) in the script
% begin script
clear
numpts = 21; % number of points in x
h = 1/(numpts-1);
xpts = h*[0:numpts-1];
% distance between points in x
%points in x
fval_at_xpts = xpts.*exp(xpts);
weight_vecA = [0,h*ones(1,numpts-1)]; weight_vecB =
[0.5*h,h*ones(1,numpts-2),0.5*h];
IA = sum(weight_vecA.*fval_at_xpts); IB =
sum(weight_vecB.*fval_at_xpts);
%end script
The first approach (A) yields IA; the second approach (B) yields IB. integration by
parts) that the exact result is I = 1.
We can readily derive (by
Hint: Run the script “by hand” for numpts = 3 and draw a picture representing the areas associated with IA and IB. The graph in
Figure 2 may prove helpful.
3
2.5
2
0 0.2 0.4 0.6 0.8 1
0
0.5
1
1.5
x
Figure 2: A graph of the integrand xex. Note that the second derivative of xex is positive for all
x, 0 ≤ x ≤ 1.
We now run the script (for numpts = 21).
xe
xe
x
x
∫
statisticsassignmenthelp.com
12. (i) We will obtain
(a)IA greater than 1
(b)IA less than 1
(c) IA exactly equal to 1
where we recall that the exact result is I = 1.
(ii) We will obtain
(a)IB greater than 1
(b)IB less than 1
(c) IB exactly equal to 1 (iii) We will find
(a) abs(IA - 1) less than abs(IB - 1)
(b)abs(IA - 1) greater than abs(IB - 1)
(c) abs(IA - 1) equal to abs(IB - 1)
Note that abs is the MATLAB built-in absolute value function: abs(z) returns the absolute value of
z. Hence in (iii) we are comparing the absolute value of error in the two approaches.
statisticsassignmenthelp.com
statisticsassignmenthelp.com
13. Answer Key
Q1 (c), (d)
Q2 (i) (d)
(ii) (a)
Q3 (i) (b)
(ii) (b)
Q4 (i) (a), (b)
(ii) (b) is BEST
Q5 (i) (b)
(ii) (c)
Q6 (i) (b)
(ii) (d)
(iii)(b)
Q7 (i) (a)
(ii) (a)
(iii)(b)
statisticsassignmenthelp.com
statisticsassignmenthelp.com