Problem Set Stats Bootcamp - class 11

Distributions and probabilities

Author

Neelanjan Mukherjee

Published

October 21, 2024

-- Attaching core tidyverse packages ------------------------ tidyverse 2.0.0 --
v dplyr     1.1.3     v readr     2.1.4
v forcats   1.0.0     v stringr   1.5.0
v ggplot2   3.4.3     v tibble    3.2.1
v lubridate 1.9.2     v tidyr     1.3.0
v purrr     1.0.2     
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()
i Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

Attaching package: 'rstatix'


The following object is masked from 'package:stats':

    filter



Attaching package: 'cowplot'


The following object is masked from 'package:lubridate':

    stamp

Problem # 1

Assume that the height jackalopes fit a normal distribution. Through careful field research measuring 1000 wild jackalopes, we have determined the mean height is 97 cm and the standard deviation is 10 cm. Your was camping and found a jackalope. Being a great friend and knowing your interest in jackalopes, they (harmlessly) subdued and measured the wild jackalope and found that it was 75 cm.

  1. Simulate a normal distribution of 1000 jackalope heights using the mean and sd you painstakingly measured.
  1. Plot the density of the jackalope height distribution. Indicate with a vertical line the height of the jackalope your friend measured.
  1. Calculate the probability of a jackalope being 75 cm or shorter.
  1. Are jackalope heights normally distributed?

Explore coin flip distribution characteristics

When we flip a fair coin multiple times (numFlips) in a row, we expect to get heads (or tails) 50% of the time on average. This is not always the case for a single round of flipping, but if we do multiple rounds with (numRounds) that average should be 50%.

Problem # 2

In class, we simulated coin flip experiments using two different coins that were either fair (0.5 prob of head) or unfair (0.9 prob of head). We varied the number of flips in a single round (numFlips) and the number of rounds of flipping (numRounds). For this assignment, use the same to coins and use all possible combinations of numFlips and numRounds from the table below.

parameters to explore
numFlips numRounds
5 10
500 100
  1. Create a tibble has all the combinations of numFlips, numRounds, and prob of getting heads.
# hint for 8 flips and 12 rounds of a fair coin you could do
# rbinom(n = 8, size = 12, prob = .5)/12
  1. Plot your result using faceting. I recommend faceting by numFlips (like in class describing both the number and fair v unfair) . Include the observed mean as a black diamond and the true mean as a dashed line.

3. Report the means and sd of each pair of numFlips and numRounds

4. Describe in a few sentences how increasing numFlips and numRounds alters:

The estimation of and spread around the true mean.