Você está na página 1de 2

8.

3
Write a program to implement the following SOLUTION:
algorithm.
1. Let A = 1 and N = 6 a=1;
2. 2. Repeat 10 times, say: n=6;
a. Replace N by 2N for i=1:10
b. Replace A by n=2*n;
c. Let L = NA / 2 a = sqrt(2 sqrt(4a*a));
d. Let U = L / l=n*a/2;
e. Let P = (U+L) / 2 (estimate of ) u=l/ sqrt(1a*a/2);
f. Let E = (U-L) / 2 p=(u+l)/2;
g. Display N, P, E e=(ul)/2;
3. Stop disp ( [n, p, e] );
end

8.10-Exercise 3.2
Consider the following structure plan and write a Solution
program to implement it, where M and N m = 44;
represent MATLAB variables: n = 28;
1. Set M = 44 and N = 28 while m ~= n
2. While M not equal to N repeat: while m>n
While M > N repeat: m=mn;
Replace Value of M by M - end
N while n>m
While N > M repeat: n=nm;
Replace value of N by N - end
M end
3. Display M disp(m);
4. Stop
Exercise 10.6
Standard normal function of a random Solution:
variable X to obtain its probability may be
% Function file phi.m
approximated as follows: function y = phi(x)
a = 0.4362;
where a = 0.4361836, b =0.1201676, c = b = -0.12017;
c = 0.9373;
0.937298, , and . r = exp(-0.5*x*x)/ sqrt(2 * pi);
Write a function to compute , and use it in t=1/(1+ 0.3326 * x);
a program to write out its values for y=0.5-r*(a*t+b*t*t+c*t^3);
end
in steps of 0.1. Check .
And write command window:
% Script file
for i = 0: 0.1 : 4
disp ([i, phi(i)];
end

Você também pode gostar