Homework3 STAT351 Spr22-1 (1)
Homework3 STAT351 Spr22-1 (1)
STAT351.001
Spring 2022
Due: Sunday, April 24th
Include all work in a neat and well organized presentation. Grading is based on the quality,
thoroughness, and correctness of the work provided.
You do not need to print out this assignment; you may provide your work and answers on your own
separate paper (had written is sufficient).
Upload your solutions as a single PDF file to the “Homework 3” submission folder in our Canvas course.
Your submission should be titled “(your name) STAT351 Homework 3.”
Due Date: This assignment should be submitted by Sunday, April 24th, by 11:59 p.m.
_____________________________________________________________________________________
2. A software consulting firm has submitted bids for 3 jobs, call them A, B, C.
The firm believes there is a 70% chance they win job A, a 50% chance they win job B,
and a 30% chance then win job C. Assume the chance of winning each job is
independent of the outcomes of all the other bids.
Construct the probability associated for each of the values that X could be and
complete the following table. This table is known as a probability distribution.
Note: a tree diagram may help you map out all of the possible outcomes.
X 0 1 2 3
p(x)
b. Use your results from a) to determine the probability of winning at least two of
the three jobs.
3. Computer keyboard failure can be attributed to either electrical defects or mechanical
defects. A repair facility currently has 25 failed keyboards, 10 of which failed due to an
electrical defect and the remaining 15 failed due to a mechanical defect.
Five of the 25 failed keyboards will be randomly selected. Determine each of the
following probabilities:
a. Find the probability that exactly 3 of the 5 keyboards have a mechanical problem.
b. Find the probability that at least one keyboard with a mechanical defect and at
least one keyboard with an electrical defect is selected?
a. Generate two separate random samples of 1,000,000 values from a uniform [0, 1]
distribution (use the rand command (below); Note: you also generated Uniform [0,1] random
variables in Activity #1). Call these two vectors something like X1 and X2.
Matlab:
>>N=1000000;
>>X1=rand([1,N]); % generates a vector of length N with elements generated randomly
from a Uniform [0,1] distribution.
Note 1: the symbol, ;, after the command suppresses output (you don’t want to display all
1000000 values of vector X1.)
Note 2: The symbol, %, allows you to add comments. Characters entered after % are not
considered “code”.
b. Plot the normalized histogram with 20 bins for each of the above sequences.
For a continuous random variable, “normalized” means to rescale so that the area between the
x-axis and the probability density function is 1. Hence, the histogram is a “discrete” estimate of
the continuous pdf.
c. Add these two sequences and produce a normalized histogram of this vector of sums.
i.e. let Y = X1 + X2. Note that since both X1 and X2 range from 0 to 1, Y would range from 0
to 2.
d. Create a third sequence (length 1,000,000) from the same Uniform distribution as X1 and
X2. Call it X3 if you’d like. Add these together (W = X1+X2+X3) and produce a normalized
histogram of this vector
e. Discuss your results. Specifically address the range of values of the histograms and their
shapes as you add more and more sequences.
f. Hand in all graphs, your response to e), and your MatLab code. You might want to copy
and paste all into a Word document.