library(gradethis)
library(learnr)
library(qsslearnr)
tutorial_options(exercise.checker = gradethis::grade_learnr)
knitr::opts_chunk$set(echo = FALSE)
tut_reptitle <- "QSS Tutorial 8: Output Report"

Random Variables and Large Samples

Uniform distribution

question_text(
  "What is the probability that a random variable with a uniform distribution in the range [1, 4] takes on a value less than or equal to 2.5?",
  answer("0.5", correct = TRUE),
  answer(".5", correct = TRUE),
  allow_retry = TRUE
)

Variance

quiz(
  caption = "",
  question(
    "Suppose I give you a random variable X, such that its mean is 0 and that the expectation of X^2 is 5. What is the variance of X?",
    answer("2"),
    answer("3"),
    answer("4"),
    answer("5", correct = TRUE)
  ),
  question(
    "If the variance of X is b, what is the variance of 2*X?",
    answer("0.5 * b"),
    answer("b"),
    answer("2 * b"),
    answer("4 * b", correct = TRUE)
  )
)

Voters {data-allow-skip=TRUE}

Suppose there are 10 voters in an election for two candidates A and B. Each voter independently chooses to vote for A with probability 0.1, and for B with probability 0.9. Use the console below to do calculations.


## what is the probability of all votes going to B
p_all_B <- (0.9) ^ 10
question(
  "What is the approximate probability that A gets at least 1 vote?",
  answer("0.65", correct = TRUE),
  answer("0.5"),
  answer("0.75"),
  answer("0.25")
)

Normal distribution

question(
  "Roughly what percentage of data with a standard normal distribution falls within +/- one standard deviation from the mean?",
  answer("33%"),
  answer("50%"),
  answer("66%", correct = TRUE),
  answer("87%")
)

Distribution of the mean

Suppose the standard deviation of a given population is 10. What is the standard deviation of sample mean within a random sample of size 25 from that population?


question_text(
  "Answer:",
  answer("2", correct = TRUE),
  allow_retry = TRUE
)

Submit

submission_ui
submission_server()


mattblackwell/qsslearnr documentation built on Sept. 17, 2022, 6:25 p.m.