You are on page 1of 1

QUESTIONS

1) Write a program to implement the following algorithm.


1. Let A = 1 and N = 6
2. 2. Repeat 10 times, say:
Replace N by 2N
Replace A by
Let L = NA / 2
Let U = L /
Let P = (U+L) / 2
Let E = (U-L) / 2
Display N, P, E
3. Stop

2) Consider the following structure plan and write a program to implement it, where M and N
represent MATLAB variables:
1. Set M = 44 and N = 28
2. While M not equal to N repeat:
While M > N repeat:
Replace Value of M by M - N
While N > M repeat:
Replace value of N by N - M
3. Display M
4. Stop

3) Standard normal function of a random variable X to obtain its probability may be


approximated as follows:

where a = 0.4361836, b =0.1201676, c = 0.937298, , and .


Write a function to compute , and use it in a program to write out its values for in
steps of 0.1. Check .

You might also like