Recall & Review
beginner
What is a random variable in data science?
A random variable is a value that can change randomly, like rolling a dice. It represents outcomes of a random process.
Click to reveal answer
beginner
Which scipy module is used to generate random variables?
The
scipy.stats module provides many functions to generate random variables from different distributions.Click to reveal answer
beginner
How do you generate 5 random numbers from a normal distribution with mean 0 and std 1 using scipy?
Use
scipy.stats.norm.rvs(loc=0, scale=1, size=5) to get 5 random numbers from a normal distribution.Click to reveal answer
beginner
What does the
rvs() function do in scipy.stats?The
rvs() function generates random samples from the specified probability distribution.Click to reveal answer
beginner
Why is random variable generation useful in data science?
It helps simulate real-world randomness, test models, and understand probabilities by creating sample data.
Click to reveal answer
Which scipy function generates random samples from a distribution?
✗ Incorrect
rvs() generates random samples; cdf() and pdf() relate to probabilities.How to generate 10 random values from a uniform distribution between 0 and 1 using scipy?
✗ Incorrect
The uniform distribution in scipy is
scipy.stats.uniform. Calling rvs(size=10) generates 10 samples.What parameter controls the mean in
scipy.stats.norm.rvs()?✗ Incorrect
The
loc parameter sets the mean (center) of the normal distribution.Which distribution is NOT typically generated by scipy.stats?
✗ Incorrect
HTML is not a probability distribution; scipy.stats supports many distributions like Normal, Poisson, and Exponential.
What does the
size parameter specify in random variable generation?✗ Incorrect
size tells how many random values to create.Explain how to generate random numbers from a normal distribution using scipy.
Think about the function name and its key parameters.
You got /4 concepts.
Why do data scientists use random variable generation in their work?
Consider how randomness helps in experiments and learning.
You got /4 concepts.