Recall & Review
beginner
What is a uniform distribution?
A uniform distribution is a type of probability distribution where all outcomes are equally likely within a certain range. It means every value between the minimum and maximum has the same chance of occurring.
Click to reveal answer
beginner
How do you create a uniform distribution in scipy?
You use
scipy.stats.uniform and specify the loc (start) and scale (width) parameters. For example, uniform(loc=0, scale=1) creates a uniform distribution from 0 to 1.Click to reveal answer
beginner
What does the
pdf function do in a uniform distribution?The
pdf (probability density function) gives the height of the distribution at a specific point. For uniform distribution, it is constant between the start and end, showing equal likelihood.Click to reveal answer
beginner
How do you generate random numbers from a uniform distribution using scipy?
Use the
rvs() method from a uniform distribution object. For example, uniform(loc=0, scale=10).rvs(size=5) generates 5 random numbers between 0 and 10.Click to reveal answer
beginner
What are the parameters
loc and scale in scipy's uniform distribution?loc is the starting point (minimum value) of the distribution. scale is the length of the interval (max - min). The distribution covers values from loc to loc + scale.Click to reveal answer
What is the shape of the probability density function (pdf) for a uniform distribution?
✗ Incorrect
The pdf of a uniform distribution is flat because all values in the range are equally likely.
In scipy, which parameter sets the minimum value of a uniform distribution?
✗ Incorrect
loc sets the starting point (minimum) of the uniform distribution.How do you generate 10 random samples from a uniform distribution between 5 and 15 using scipy?
✗ Incorrect
The distribution starts at 5 with a scale of 10, so it covers 5 to 15.
rvs(size=10) generates 10 samples.What does the
pdf value represent in a uniform distribution?✗ Incorrect
The pdf gives the height of the distribution curve at a specific value.
If a uniform distribution has
loc=2 and scale=3, what is the range of values it covers?✗ Incorrect
The range is from
loc (2) to loc + scale (2 + 3 = 5).Explain how to create and use a uniform distribution in scipy to generate random numbers.
Think about setting the start and length of the distribution, then drawing samples.
You got /5 concepts.
Describe what the probability density function (pdf) of a uniform distribution looks like and what it means.
Imagine a straight line showing equal chance for all values in the range.
You got /4 concepts.