Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(n) 1. (10 points) First of all, generate N 1000 randoailesX(» - (X\". x\") repr

ID: 3074733 • Letter: #

Question

(n) 1. (10 points) First of all, generate N 1000 randoailesX(» - (X". x") representing 1000 -cn random coordinates in the uni square S[0, 1]2. In your report, state clearly how you did it in Python numpy.random. rand ( ) # a vector of N two-dimensional coordinates in the range [0,12. 2" (10 points) Next, construct the set using the h(x) given in (2). Write a function my-h-function that takes a vector of N coordinates x and outputs a vector output of N values of h(x) def my_h function(x) output- .. - return output Similarly, for the function g(z) given in (2), write a function my_g_function that takes a vector of N coordinates x and outputs a vector output of N values of g() def my g.function (x) output = return output Highlight the region of g(z) where h(z) 2 0 by h my_h_function(x) g -my_g.function(x) fig - plt.figure () ax -fig.add_subplot (111, projection3d) ax" scatter (x[:,0], x[:, 1], g, c h>=0) Submit your plot

Explanation / Answer

1.

rand(1000,2), this is the command that will generte 1000 random numbers in [0,1].