Create problem_4.r

Code for Math 504 Problem #4