TODO 1: To construct an array of 120 values between -4 and 4, use the NumPy method np.linspace() (docs). To do so, pass the parameters -4, 4, and 120. Put the results in the variable x_values.   mu = 0 # mean sig = 1 # std # TODO 1 x_values = display(x_values) todo_check([ (x_values.shape == (120,),'x_values does not have the correct shape of (120,)'), (np.all(np.isclose(x_values, np.array([-4. ,-3.93277311,-3.86554622,-3.79831933,-3.73109244,-3.66386555,-3.59663866,-3.52941176,-3.46218487,-3.39495798,-3.32773109,-3.2605042,-3.19327731,-3.12605042,-3.05882353,-2.99159664,-2.92436975,-2.85714286,-2.78991597,-2.72268908,-2.65546218,-2.58823529,-2.5210084,-2.45378151,-2.38655462,-2.31932773,-2.25210084,-2.18487395,-2.11764706,-2.05042017,-1.98319328,-1.91596639,-1.8487395,-1.78151261,-1.71428571,-1.64705882,-1.57983193,-1.51260504,-1.44537815,-1.37815126,-1.31092437,-1.24369748,-1.17647059,-1.1092437,-1.04201681,-0.97478992,-0.90756303,-0.84033613,-0.77310924,-0.70588235,-0.63865546,-0.57142857,-0.50420168,-0.43697479,-0.3697479,-0.30252101,-0.23529412,-0.16806723,-0.10084034,-0.03361345,0.03361345,0.10084034,0.16806723,0.23529412,0.30252101,0.3697479,0.43697479,0.50420168,0.57142857,0.63865546,0.70588235,0.77310924,0.84033613,0.90756303,0.97478992,1.04201681,1.1092437,1.17647059,1.24369748,1.31092437,1.37815126,1.44537815,1.51260504,1.57983193,1.64705882,1.71428571,1.78151261,1.8487395,1.91596639,1.98319328,2.05042017,2.11764706,2.18487395,2.25210084,2.31932773,2.38655462,2.45378151,2.5210084,2.58823529,2.65546218,2.72268908,2.78991597,2.85714286,2.92436975,2.99159664,3.05882353,3.12605042,3.19327731,3.2605042,3.32773109,3.39495798,3.46218487,3.52941176,3.59663866,3.66386555,3.73109244,3.79831933,3.86554622,3.93277311,4. ]), rtol=.001)),'x_values does not have the correct values') ])   Expected output:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

TODO 1: To construct an array of 120 values between -4 and 4, use the NumPy method np.linspace() (docs). To do so, pass the parameters -4, 4, and 120. Put the results in the variable x_values.

 

mu = 0 # mean
sig = 1 # std

# TODO 1
x_values =

display(x_values)

todo_check([
(x_values.shape == (120,),'x_values does not have the correct shape of (120,)'),
(np.all(np.isclose(x_values, np.array([-4. ,-3.93277311,-3.86554622,-3.79831933,-3.73109244,-3.66386555,-3.59663866,-3.52941176,-3.46218487,-3.39495798,-3.32773109,-3.2605042,-3.19327731,-3.12605042,-3.05882353,-2.99159664,-2.92436975,-2.85714286,-2.78991597,-2.72268908,-2.65546218,-2.58823529,-2.5210084,-2.45378151,-2.38655462,-2.31932773,-2.25210084,-2.18487395,-2.11764706,-2.05042017,-1.98319328,-1.91596639,-1.8487395,-1.78151261,-1.71428571,-1.64705882,-1.57983193,-1.51260504,-1.44537815,-1.37815126,-1.31092437,-1.24369748,-1.17647059,-1.1092437,-1.04201681,-0.97478992,-0.90756303,-0.84033613,-0.77310924,-0.70588235,-0.63865546,-0.57142857,-0.50420168,-0.43697479,-0.3697479,-0.30252101,-0.23529412,-0.16806723,-0.10084034,-0.03361345,0.03361345,0.10084034,0.16806723,0.23529412,0.30252101,0.3697479,0.43697479,0.50420168,0.57142857,0.63865546,0.70588235,0.77310924,0.84033613,0.90756303,0.97478992,1.04201681,1.1092437,1.17647059,1.24369748,1.31092437,1.37815126,1.44537815,1.51260504,1.57983193,1.64705882,1.71428571,1.78151261,1.8487395,1.91596639,1.98319328,2.05042017,2.11764706,2.18487395,2.25210084,2.31932773,2.38655462,2.45378151,2.5210084,2.58823529,2.65546218,2.72268908,2.78991597,2.85714286,2.92436975,2.99159664,3.05882353,3.12605042,3.19327731,3.2605042,3.32773109,3.39495798,3.46218487,3.52941176,3.59663866,3.66386555,3.73109244,3.79831933,3.86554622,3.93277311,4. ]), rtol=.001)),'x_values does not have the correct values')
])
 
Expected output: 
I -3.93277311, -3.86554622, -3.79831933, -3.73109244,
-3.66386555, -3.59663866, -3.52941176, -3.46218487, -3.39495798,
-3.32773109, -3.2605042 -3.19327731, -3.12605042, -3.05882353,
-2.99159664, -2.92436975, -2.85714286, -2.78991597, -2.72268908,
-2.65546218, -2.58823529, -2.5210084 -2.45378151, -2.38655462,
-2.31932773, -2.25210084, -2.18487395, -2.11764706, -2.05042017,
-1.98319328, -1.91596639, -1.8487395 -1.78151261, -1.71428571,
-1.64705882, -1.57983193, -1.51260504, -1.44537815, -1.37815126,
-1.31092437, -1.24369748, -1.17647059, -1.1092437 -1.04201681,
-0.97478992, -0.90756303, -0.84033613, -0.77310924, -0.70588235,
-0.63865546, -0.57142857, -0.50420168, -0.43697479, -0.3697479
-0.30252101, -0.23529412, -0.16806723, -0.10084034, -0.03361345,
0.03361345, 0.10084034, 0.16806723, 0.23529412, 0.30252101,
0.43697479, 0.50420168, 0.57142857, 0.63865546,
0.70588235, 0.77310924, 0.84033613, 0.90756303, 0.97478992,
0.3697479
1.04201681, 1.1092437
1.31092437,
1.17647059, 1.24369748,
1.37815126, 1.44537815, 1.51260504, 1.57983193, 1.64705882,
1.71428571, 1.78151261, 1.8487395 1.91596639, 1.98319328,
2.05042017, 2.11764706, 2.18487395, 2.25210084, 2.31932773,
2.38655462, 2.45378151, 2.5210084
2.72268908, 2.78991597, 2.85714286,
3.05882353, 3.12605042, 3.19327731,
3.39495798, 3.46218487, 3.52941176,
3.73109244, 3.79831933, 3.86554622,
2.58823529, 2.65546218,
2.92436975, 2.99159664,
3.2605042
3.32773109,
3.59663866, 3.66386555,
3.93277311, 4.
array([-4.
I
I
I
I
I
I
"
1)
Transcribed Image Text:I -3.93277311, -3.86554622, -3.79831933, -3.73109244, -3.66386555, -3.59663866, -3.52941176, -3.46218487, -3.39495798, -3.32773109, -3.2605042 -3.19327731, -3.12605042, -3.05882353, -2.99159664, -2.92436975, -2.85714286, -2.78991597, -2.72268908, -2.65546218, -2.58823529, -2.5210084 -2.45378151, -2.38655462, -2.31932773, -2.25210084, -2.18487395, -2.11764706, -2.05042017, -1.98319328, -1.91596639, -1.8487395 -1.78151261, -1.71428571, -1.64705882, -1.57983193, -1.51260504, -1.44537815, -1.37815126, -1.31092437, -1.24369748, -1.17647059, -1.1092437 -1.04201681, -0.97478992, -0.90756303, -0.84033613, -0.77310924, -0.70588235, -0.63865546, -0.57142857, -0.50420168, -0.43697479, -0.3697479 -0.30252101, -0.23529412, -0.16806723, -0.10084034, -0.03361345, 0.03361345, 0.10084034, 0.16806723, 0.23529412, 0.30252101, 0.43697479, 0.50420168, 0.57142857, 0.63865546, 0.70588235, 0.77310924, 0.84033613, 0.90756303, 0.97478992, 0.3697479 1.04201681, 1.1092437 1.31092437, 1.17647059, 1.24369748, 1.37815126, 1.44537815, 1.51260504, 1.57983193, 1.64705882, 1.71428571, 1.78151261, 1.8487395 1.91596639, 1.98319328, 2.05042017, 2.11764706, 2.18487395, 2.25210084, 2.31932773, 2.38655462, 2.45378151, 2.5210084 2.72268908, 2.78991597, 2.85714286, 3.05882353, 3.12605042, 3.19327731, 3.39495798, 3.46218487, 3.52941176, 3.73109244, 3.79831933, 3.86554622, 2.58823529, 2.65546218, 2.92436975, 2.99159664, 3.2605042 3.32773109, 3.59663866, 3.66386555, 3.93277311, 4. array([-4. I I I I I I " 1)
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education