Recall & Review
beginner
What does the
numpy.random.normal() function do?It generates random numbers that follow a normal (bell-shaped) distribution, centered around a mean value with a given spread (standard deviation).
Click to reveal answer
beginner
What are the main parameters of
numpy.random.normal()?The main parameters are
loc (mean), scale (standard deviation), and size (number of values to generate).Click to reveal answer
beginner
Why is the standard deviation important in a normal distribution?
Standard deviation controls how spread out the numbers are around the mean. A small value means numbers are close to the mean; a large value means they are more spread out.
Click to reveal answer
beginner
How can you generate 1000 random numbers with mean 10 and standard deviation 2 using numpy?
Use
numpy.random.normal(loc=10, scale=2, size=1000) to get 1000 numbers centered at 10 with spread 2.Click to reveal answer
intermediate
What shape of data does
numpy.random.normal() return when size is a tuple?It returns a NumPy array with the shape given by the tuple, filled with random numbers from the normal distribution.
Click to reveal answer
What does the
loc parameter in numpy.random.normal() specify?✗ Incorrect
loc sets the center (mean) of the normal distribution.
If you want to generate 500 random numbers from a normal distribution, which parameter controls this?
✗ Incorrect
size controls how many random numbers are generated.
What happens if you set
scale=0 in numpy.random.normal()?✗ Incorrect
With zero standard deviation, all values equal the mean.
Which shape will the output have if you use
size=(3,4)?✗ Incorrect
The output shape matches the size tuple, so 3 rows and 4 columns.
Which of these is true about the normal distribution?
✗ Incorrect
The normal distribution is symmetric around its mean.
Explain how to use
numpy.random.normal() to simulate real-world data like heights or test scores.Think about how average and spread describe real data.
You got /5 concepts.
Describe the effect of changing the
scale parameter on the shape of the data generated by numpy.random.normal().Consider what happens when spread increases or decreases.
You got /4 concepts.