
Old Dominion University
Mathematics-Statistics Department
Norou Diawara
Fall 2008 Semester
Stat 405-505
Due date: September 10th
Explain your answers.
Questions
1. Suppose x is a vector. Write a code that return the position in x that are positive i.e
if x= (−1,0,1,2,−3), it should return 2,3,4
2. Suppose x and y are two vectors of names of same length which are separated with a
space.
Write a code that finds the name that are common to both
3. Write a code that return the square root of a number if that number is positive. If that
number is not positive, ask the program to return a statement that “the computation
cannot be completed.”
4. Generate a random sample of size 30 from a standard normal. Plot its empirical
distribution function.
Let me know if you have any questions.