Question: Problem 4: (10 pts each) (a) Write an R function runifmax () that has three arguments, n, a, and b, and returns the maximum of

Problem 4: (10 pts each) (a) Write an R function runifmax () that has three arguments, n, a, and b, and returns the maximum of a vector of n random numbers from the uniform distribution Unif(a, b). Make the arguments a and b optional with default values of 0 and 1, respectively. (b) Write an R code that replicates runifmax() hundred thousand times with input parameters n = 30, a = 0, and b = 2, and saves it to a vector v. Plot a histogram of vector v. (c) Write an R code that plots the empirical density of a vector v over a histogram obtained in part (b). (see Session 4 for empirical density function in R)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
