0% found this document useful (0 votes)
13 views5 pages

Lab Workshop Week 3 Paper

The document outlines a lab and workshop for the MAST90105 course, focusing on various statistical methods and probability calculations. It includes exercises on defective items in samples, matching probabilities in urns, and various probability distributions related to games and random experiments. Additionally, it covers simulations in R, calculations of means and variances, and conditional probabilities.

Uploaded by

Vishwa D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

Lab Workshop Week 3 Paper

The document outlines a lab and workshop for the MAST90105 course, focusing on various statistical methods and probability calculations. It includes exercises on defective items in samples, matching probabilities in urns, and various probability distributions related to games and random experiments. Additionally, it covers simulations in R, calculations of means and variances, and conditional probabilities.

Uploaded by

Vishwa D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

MAST90105: Methods of Mathematical Statistics

MAST90105: Lab and Workshop 3

1 Lab
1. Suppose in a lot of 100 fuses there are 20 defective ones. A sample of 5 fuses are
randomly selected from the lot without replacement. Let X be the number of defective
fuses found in the sample.

a. Find the probability P (X = 0),


b. The cumulative probability P (X ≤ 3),
c. The mean or expectation of X, E(X),
d. The second moment of X, E(X 2 ),
e. The variance of X, V ar(X),
f. A probability bargraph for the pmf of X.

2. An urn contains n balls numbered from 1 to n. A random sample of n balls is selected


from the urn, one at a time. A match occurs if ball numbered i is selected on the ith
draw.

ˆ If the draws are done with replacement, it can be shown that


 n
1
P (at least one match) = 1 − 1 − .
n

ˆ If the draws are done without replacement, it can be shown that


n
(−1)n (−1)k
 
1 1 1 X
P (at least one match) = 1 − 1 − + − + · · · + = 1− .
1! 2! 3! n! k=0
k!

a. For each value of n given in the following table, find P (at least one match) and
write down the results at appropriate places of the table. What is the limiting
value when n → ∞?
b. We can also use R to simulate the processes of drawing n balls with or without
replacement from a set of n balls numbered from 1 to n. We can then simulate
the probability of at least one match using the relevant relative frequencies.
ˆ Create a function match.f in R-Studio by writing a script and executing it
as follows.
match.f <- function(n, simsize, rep = TRUE) {
freq = 0
for (i in 1:simsize) {
sam = sample(1:n, size = n, replace = rep)
freq = freq + (sum(sam == 1:n) >= 1)

1
MAST90105: Methods of Mathematical Statistics

}
freq/simsize
}

ˆ Note that (sum(sam==1:n)>=1) in match.f is for checking whether or not


there is at least 1 match in sam.
ˆ Simulate the drawing process 10000 times (simsize=10000) for each given
n and rep (rep=TRUE indicates the “with replacement” procedure is used.)
Execute the following and write down the results at appropriate places in the
table that follows.
set.seed(2025)
match.f(n = 1, simsize = 10000, rep = TRUE)
match.f(n = 3, simsize = 10000, rep = TRUE)
match.f(n = 10, simsize = 10000, rep = TRUE)
match.f(n = 15, simsize = 10000, rep = TRUE)
match.f(n = 100, simsize = 10000, rep = TRUE)
match.f(n = 10000, simsize = 10000, rep = TRUE)
match.f(n = 1, simsize = 10000, rep = FALSE)
match.f(n = 3, simsize = 10000, rep = FALSE)
match.f(n = 10, simsize = 10000, rep = FALSE)
match.f(n = 15, simsize = 10000, rep = FALSE)
match.f(n = 100, simsize = 10000, rep = FALSE)
match.f(n = 10000, simsize = 10000, rep = FALSE)

c. Modify the function match.f to estimate the probability pk (n) of exactly k


matches for k = 0, . . . , n. Repeat the steps from part (b) for n = 3, 10, 25, 100, ∞
and obtain approximate probabilities of k = 0, 1, 2, 3.
d. (Bonus) What are the limiting probabilities pk (n) when n → ∞?

2
MAST90105: Methods of Mathematical Statistics

n P (at least one match)

with replacement without replacement

by Calculation by R simulation by Calculation by R simulation

10

15

100

2 Workshop
1. An urn contains 17 balls marked LOSE and 3 balls marked WIN. You and an opponent
take turns selecting at random a single ball from the urn without replacement. The
person who selects the third WIN ball wins the game. It does not matter who selected
the first two WIN balls.
a. If you draw first, find the probability that you win the game on your second draw.
b. If you draw first, find the probability that your opponent wins the game on his
second draw.
c. If you draw first, the probability that you win can be found from
9 3
 17 
X 2 2k−2 1
P (You win if you draw first) = 20
 × (Why?)
k=1 2k
20 − 2k

Note: You could win on your second, third, fourth, . . ., or tenth draw, not on
your first.
d. If you draw second, the probability that you win can be found from
9 3
 17 
X 2 2k−1 1
P (You win if you draw second) = 20
 × . (Why?)
k=1 2k+1
19 − 2k

e. Based on your results in (c) and (d), would you prefer to draw first or second?
Why?

3
MAST90105: Methods of Mathematical Statistics

2. Assume we flip a strange coin with


k 1
Pr(Tail) = , Pr(Head) = on the kth flip, k = 1, 2, . . .
k+1 k+1

Let X be the number of flips of this coin until the first tail is observed. Assuming the
coin flips are independent,

a. Find the probability mass function of X.

b. Find the mean E(X) and variance V ar(X). Hint: You can use this result without
proof:

X 1
= e.
k=0
k!

3. Let a random experiment be the cast of a pair of unbiased 6-sided dice and let X equal
the smaller of the outcomes if they are different and the common value if they are
equal.

a. With reasonable assumptions, find the pmf of X.


b. Let Y equal the range of the two outcomes (i.e., the absolute value of the difference
of the largest and smallest outcomes). Determine the pmf of Y .

4. In a lot of 100 light bulbs, there are 5 bad bulbs. An inspector inspects 10 bulbs
selected at random. Let X be the number of bad bulbs in the sample.

a. What probability distribution does X have?


b. Calculate the probability that at least one defective bulb will be found in the
sample.
c. Find the mean of X, i.e. E(X).
d. Find the variance of X, i.e. Var(X). (Note that variance for Hypergeometric has
not yet been discussed in class — it will be discussed in Module 4. The formula
is given in the table in the textbook.)
e. Find the second moment of X, i.e. E(X 2 ).

5. A box contains 4 coloured balls: 2 black and 2 white. Balls are randomly drawn
successively without replacement. If X is the number of draws until the last black ball
is obtained, what are the possible values of X? Find the pmf f (x) for X. (Hint: Define
events Bi = {the i-th draw is a black ball} and Wj = {the j-th draw is a white ball}.
Then find how each outcome of X is related to Bi and Wj .)

6. Let X be the number of accidents in a factory per week having pmf


1
f (x) = , x = 0, 1, 2, · · · .
(x + 1)(x + 2)

4
MAST90105: Methods of Mathematical Statistics

a. Find the conditional probability of X ≥ 4, given that X ≥ 1. (Hint: Write


1 1
f (x) = x+1 − x+2 .)
b. Does E(X) exist? If yes, find it; if not, why?

7. Let X equal the number of people selected at random that you must ask in order
to find someone with the same birthday as yours. Assuming each day of the year is
equally likely (and ignoring February 29).

a. What probability distribution does X have? Namely, what is the pmf of X?


b. Give the mean and variance of X.
c. Find P (X > 400) and P (X < 300).

You might also like