A probability distribution shows how likely different outcomes are in an experiment. It tells us the chance of each result.
Click to reveal answer
beginner
What is the difference between a discrete and a continuous probability distribution?
Discrete distributions deal with countable outcomes (like rolling dice). Continuous distributions deal with outcomes over a range (like measuring height).
Click to reveal answer
beginner
How do you generate random numbers from a normal distribution in MATLAB?
Use the function randn. It creates random numbers with mean 0 and standard deviation 1.
Click to reveal answer
intermediate
What MATLAB function can you use to calculate the probability density function (PDF) of a normal distribution?
Use normpdf(x, mu, sigma) where x is the value, mu is the mean, and sigma is the standard deviation.
Click to reveal answer
intermediate
How do you plot a probability distribution in MATLAB?
Create a range of values, calculate the PDF or PMF for those values, then use plot or bar to show the distribution graphically.
Click to reveal answer
Which MATLAB function generates random numbers from a uniform distribution between 0 and 1?
Anormpdf
Brandn
Crand
Dpoissrnd
✗ Incorrect
The rand function generates random numbers uniformly between 0 and 1.
What does the function poissrnd(lambda) generate?
ARandom numbers from a Poisson distribution
BRandom numbers from a normal distribution
CProbability density values
DCumulative distribution values
✗ Incorrect
poissrnd(lambda) generates random numbers from a Poisson distribution with mean lambda.
Which of these is a continuous probability distribution?
APoisson
BNormal
CBinomial
DGeometric
✗ Incorrect
The normal distribution is continuous; binomial, Poisson, and geometric are discrete.
What does the MATLAB function cdf represent in probability distributions?
AProbability density function
BMean of distribution
CRandom number generator
DCumulative distribution function
✗ Incorrect
The cumulative distribution function (CDF) gives the probability that a variable is less than or equal to a value.
How do you calculate the mean of a normal distribution in MATLAB?
AIt is the parameter <code>mu</code>
BUsing <code>normpdf(x, mu, sigma)</code>
CUsing <code>randn</code>
DUsing <code>mean(data)</code>
✗ Incorrect
The mean of a normal distribution is the parameter mu.
Explain the difference between discrete and continuous probability distributions and give one MATLAB function example for each.
Think about countable outcomes versus ranges of values.
You got /3 concepts.
Describe how to plot a normal distribution in MATLAB including generating values and plotting the PDF.
Start with x values, then get PDF, then draw.
You got /3 concepts.
Practice
(1/5)
1. Which MATLAB function is used to create a probability distribution object?
easy
A. rand
B. makedist
C. histogram
D. plot
Solution
Step 1: Understand the purpose of each function
makedist creates a probability distribution object, while rand generates random numbers, histogram plots data distribution, and plot creates graphs.
Step 2: Identify the correct function for creating distributions
Only makedist is designed to create probability distribution objects in MATLAB.
Final Answer:
makedist -> Option B
Quick Check:
Function to create distribution = makedist [OK]
Hint: Use makedist to create distributions in MATLAB [OK]
Common Mistakes:
Confusing makedist with rand
Using histogram to create distributions
Trying to use plot for distributions
2. Which of the following is the correct syntax to create a normal distribution with mean 0 and standard deviation 1 in MATLAB?
easy
A. pd = makedist('normal', 0, 1);
B. pd = makedist('Normal', 'mean', 0, 'std', 1);
C. pd = makedist('Normal', 0, 1);
D. pd = makedist('Normal', 'mu', 0, 'sigma', 1);
Solution
Step 1: Recall the correct parameter names for normal distribution
In MATLAB, the normal distribution parameters are specified as 'mu' for mean and 'sigma' for standard deviation.
Step 2: Check the syntax for makedist
The correct syntax uses name-value pairs: makedist('Normal', 'mu', 0, 'sigma', 1). Other options use incorrect parameter names or formats.
Final Answer:
pd = makedist('Normal', 'mu', 0, 'sigma', 1); -> Option D
Quick Check:
Normal dist params = 'mu' and 'sigma' [OK]
Hint: Use 'mu' and 'sigma' as parameter names for normal dist [OK]
Common Mistakes:
Using lowercase 'normal' instead of 'Normal'
Using 'mean' and 'std' instead of 'mu' and 'sigma'
Passing parameters without name-value pairs
3. What is the output of the following MATLAB code?
B. makedist does not support 'Binomial' distribution
C. The cdf input value 11 exceeds the number of trials n
D. The variable name 'prob' is reserved
Solution
Step 1: Understand binomial distribution parameters
Binomial distribution with n=10 means possible outcomes are from 0 to 10.
Step 2: Check the cdf input value
Calling cdf(pd, 11) asks for probability of outcomes ≤ 11, but 11 is outside the valid range (max 10).
Step 3: Identify the error
Input to cdf must be within 0 to n. Using 11 is invalid and causes an error or unexpected result.
Final Answer:
The cdf input value 11 exceeds the number of trials n -> Option C
Quick Check:
cdf input must be ≤ n for binomial [OK]
Hint: cdf input must be within distribution support range [OK]
Common Mistakes:
Using cdf input outside valid range
Thinking p must be integer
Assuming makedist lacks binomial support
5. You want to calculate the probability that a normally distributed variable with mean 5 and standard deviation 2 is less than 7 in MATLAB using a probability distribution object. Which code correctly computes this?
hard
A. pd = makedist('Normal', 'mu', 5, 'sigma', 2); p = cdf(pd, 7);
B. p = normcdf(7, 5, 2);
C. pd = makedist('Normal', 5, 2); p = pdf(pd, 7);
D. p = cdf('Normal', 7, 5, 2);
Solution
Step 1: Understand how to create a normal distribution object
Use makedist('Normal', 'mu', 5, 'sigma', 2) to create the distribution with mean 5 and std 2.
Step 2: Use cdf to find probability less than 7
Calling cdf(pd, 7) returns the cumulative probability up to 7.
Step 3: Check other options
p = normcdf(7, 5, 2); uses normcdf which is valid but not using makedist. pd = makedist('Normal', 5, 2); p = pdf(pd, 7); incorrectly uses pdf instead of cdf. p = cdf('Normal', 7, 5, 2); has wrong syntax for cdf.
Final Answer:
pd = makedist('Normal', 'mu', 5, 'sigma', 2); p = cdf(pd, 7); -> Option A
Quick Check:
Use makedist + cdf for cumulative probability [OK]
Hint: Use cdf with makedist object for cumulative probability [OK]
Common Mistakes:
Using pdf instead of cdf
Wrong syntax for cdf
Ignoring distribution parameters
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.