# TODO 1.2 x_values = display(x_values) todo_check([ (x_values.shap

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question
mu = 0 # mean
sig = 1 # std

# TODO 1.2
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')
])
Use the NumPy function np.linspace() (docs) to generate an array of 120 numbers between -4 and 4. Pass the arguments -4, 4, and
to do so. Store the output into the variable x_values.
120
Transcribed Image Text:Use the NumPy function np.linspace() (docs) to generate an array of 120 numbers between -4 and 4. Pass the arguments -4, 4, and to do so. Store the output into the variable x_values. 120
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Methods of StringBuilder class
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr