Question: Implement a function that returns an mn matrix whose entries are uniformly randomly distributed in the interval, [0,] for a given value of . Hint:
Implement a function that returns an mn matrix whose entries are uniformly randomly distributed in the interval, [0,] for a given value of .
Hint: Check out Numpy's module for generating (pseudo)random numbers: numpy.random

![randomly distributed in the interval, [0,] for a given value of .](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f0081dc5f9a_74966f0081d6001b.jpg)
Use random_mat() function to write another function, perturb_system(X, y, eps), that creates two "perturbations" to the system defined by X and y.
- Let X be the first perturbation. It should have the same dimensions as X, and its entries should lie in the interval [,]. The value of is given by eps.
- The second is y, a small perturbation to the response variable, y. Its entries should also lie in the same interval, [,]
The function should return a perturbed system, X+X and y+y, as a pair.


def random mat (m, n, eps): ### YOUR CODE HERE print(random mat (3, 2, 1e-3)) # Test cell: randepstest - - Z - random mat (5, 3, le-2) assert Z.shape(5, 3) assert ((Z >- 0) & (Z ]".format (EPSILON, EPSI - assert Delta y.shapey.shape, elta y has shape instead of .".format (Delta y.shape, y.shape) assert (np.abs (Delta_y) ]".format (EPSILON, EPSI print ("n(Passed.)") 007 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
