Assignment 1
• You must answer this series of questions, some implicating the analysis
of synthetic datasets.
• Together with the answers, you must submit your code (and/or
detailed manual calculations) and any requested figures.
• Assignments must be submitted on MyCourses by 4pm on the posted
due date (Jan 29th, see course outline for the others).
• For each question, you will need to determine the best mathematical
approach or statistical test to apply and justify your reasoning.
• To simplify grading, submit all answers, including code and figures in a
single PDF file, with answers to each question on separate pages,
starting with answers/explanations, followed by figures and then code
(when applicable). Also include code as separate .py or .ipynb files and
submit your assignments as a single zip file on MyCourses.
• Assignments should be performed individually. You can ask questions
to me or the TA, but don’t expect us to leak solutions.
Q1 (0.5 points)
• In a room with 53 people, what is the
probability that two of more of these people
will share a birthday?
Q2 (0.5 points)
• What is the probability of drawing a straight at
the game of poker (5 cards in sequential rank,
regardless of suit), assuming you draw exactly
5 cards?
Q3 (1 point)
• When you place a bet on a number at the game
of roulette, there is a 1/38 chance of winning and
thus retrieving 36 times your bet (including your
bet).
• A) If you repeat this process 35 times, what is the
probability that you would have more money
than you started with?
• B) Explain in 20 words or less why this figure
could seem misleading.
• C) Calculate the mean return on the dollar of
each bet.
Q4 (0.75 points)
• You have two buckets, each with 10 balls, one
in which 7 are black and 3 white, and the
other with 3 black and 7 white.
• You can only sample 10 times with
replacement from a single bucket.
• 6 out of the 10 times, you picked a black ball.
• Given this evidence, what is the probability
that you have sampled from the bucket with 7
black balls?
Q5 (1 point)
• A) If you roll a dice many times, write out the series of
results and then select a random point along this
series, what is the mean distance observed between
the last 6 and the next 6 (if you fall on a 6, then the
distance is zero)?
• B) Over the entire series, what is the mean number of
rolls between sixes?
• C) Are the answers to A and B approximately the same?
Why so, or why not?
• You can print out the series on a screen or paper,
sample randomly by throwing an object or using
numpy, and/or systematically count the distances.
• Automating the calculations is also possible.
Q6 (0.75 points)
• You accuse your board game opponent of cheating by
using a weighted die.
• Specifically, you suspect that it is more likely to
produce sixes
• You decide to test the dice by throwing it 30 times in a
row.
• The results are 5x1, 3x2, 4x3, 5x5 and 13x6.
• A) What is the probability of seeing this many 6’s over
that many rolls?
• B) Can you conclude from these results that your
opponent is cheating?
Q7 (1 points)
• You are analyzing the results of a placebo-controlled
randomized intervention trial. One group was given garlic
extract and the measured outcome was the self-reported
number of days with flu-like symptoms over a 3-month
period.
• The data is in a csv file entitled garlic.csv
• A) Assuming that the two distributions are approximately
normal, what is the probability that the means of the two
groups are different from each other?
• B) How does this probability relate to the p-value which
should be reported?
• C) Which group faired better?
• D) Plot the two distributions as histograms on the same
graph (see example on next page).
e.g.
Use the parameter alpha=0.5 when generating each (or the second) histogram to make
them transparent.
Don’t forget to add relevant labels to each axis and each histogram.
Q8 (1 points)
• You are analyzing the results of a second randomized intervention
trial. One group was given green tea extract, the other a placebo
pill, and the measured outcome was the self-reported number of
days with flu-like symptoms over a 6-month period.
• The data is in a csv file entitled tea.csv.
• A) Assuming that the two distributions are approximately normal,
what is the probability that the results are consistent with the null
model?
• B) How does this probability relate to the p-value which should be
reported?
• C) Which group faired better?
• D) Which of the two trials (garlic or tea extract) showed the most
statistically significant results?
• E) Which of the two trials showed the largest effect size?
• F) List two reasons why statistical significance does not always
follow effect size?
• G) Plot the two distributions as histograms on the same graph.
Q9 (0.5 points)
• You work for a television show and decide to
investigate claims that a particular brand of chips
consistently contains less than the amount stated
on the label.
• You buy 20 bags of chips, each purportedly
containing 200 grams, and you weight the
contents of each (data: chips.csv).
• Given this evidence, how confidently can you
conclude that there are systematically less
contents than claimed on the label?
Q10 (1 point)
• Different teams of mechanical engineering students
have built bipedal robots and the instructor decides to
assign grades proportionally to the robots’
performance in a race.
• To gather sufficient data to make a fair assessment,
each robot repeated the race 10 times and each trial
time was measured in seconds.
• A) Assuming that all of the distributions are
approximately normal and of equal variance, what is
the probability that the mean of at least one the
groups is different from the others?
• B) Which groups specifically are significantly different
and in which direction relative to the global average?
• C) Plot all 5 distributions as a histogram on the same
graph.
Q11 (0.5 points)
• The grade of each team was meant to be 1 over
the mean time taken.
• The instructor realizes that assigning grades in
direct inverse proportion to the mean time taken
would result in failing one or more teams.
• They therefore decide to curve the grades so that
they fit a normal distribution with a mean of 80%
and a standard deviation of 10%.
• What would be each team’s final grade for this
assignment?
Q12 (1 point)
• To demonstrate the benefits of micro-needling on wrinkles,
a beauty product company conducts the following study:
• They recruit 20 volunteers which they instruct to treat only
one side of their face (randomly chosen by the scientists)
over a 6-week period.
• The scientists counted the number of wrinkles on each side
of each participant’s face, before and after the
intervention.
• The data is found in the file wrinkles.csv
• A) Given this data, determine whether you can conclude
that the treatment worked and if so, with what level of
confidence can you make this claim? (assuming normal
distributions)
• B) Plot the data that you used as input to the statistical test.
Q13 (0.5 points)
• You want to demonstrate that a particular trait bears a
genetic component.
• You poll 100 pairs of identical twins and 200 pairs of
non-identical twins, each where one of the twins has
the trait.
• Identical twins share twice as much DNA as nonidentical twins.
• 70 of the identical twins pairs both share the trait as
compared to 80 of the non-identical twin pairs.
• Assuming n is sufficiently large to apply a non-exact
test, estimate the probability that the trait is at least
partially genetically inherited.