library(gradethis) library(learnr) library(qsslearnr) tutorial_options(exercise.checker = gradethis::grade_learnr) knitr::opts_chunk$set(echo = FALSE) tut_reptitle <- "QSS Tutorial 7: Output Report"
quiz( caption = "", question( "I roll a fair 6-sided die 3,000,000 times. The number 1 turns up approximately 500,000 times, so I conclude that the probability of a 1 is 1/6. What approach to probability does this ", answer("Frequentist", correct = TRUE), answer("Bayesian")) )
Suppose that P(A)=0.4 and P(B)=0.3. What is the minimum value of P(A and not B)?
question_text( "Answer:", answer("0.1", correct = TRUE), answer(".1", correct = TRUE), allow_retry = TRUE )
question("Out of all possible anagrams for the word CHAIR (including the original word), what is the probability that the letter I comes first?", answer("0.1"), answer("0.2", correct = TRUE), answer("0.3"), answer("0.4"))
Let A and B be two independent variables that take on only the values 0 and 1. If P(A=1, B=1)=0.12, P(A=0, B=1)=0.28, and P(A=1)=0.3, what is P(A=0, B=0)? Use this code block to perform calculations and enter the probability below.
question_text( "Answer:", answer("0.42", correct = TRUE), answer(".42", correct = TRUE), allow_retry = TRUE )
A disease affects 1% of the population. The only test for the disease returns positive 99% of the time the disease is actually there, though it returns positive 20% of the time if the disease is not actually there. You take this test and it returns positive. What is the probability you have the disease? Use the following code block to do calculations and then enter the probability rounded to the nearest 0.01 below.
p_d <- 0.01 ## P(disease) p_nd <- 1 - p_d ## P(no disease) p_pos_d <- 0.99 ## P(Pos | disease) p_pos_nd <- 0.2 ## P(Pos | no disease)
question_text( "Probability (to the nearest 0.01)", answer("0.05", correct = TRUE), answer(".05", correct = TRUE), allow_retry = TRUE )
There are three prisoners: A, B, & C. One prisoner, selected uniformly at random, will be pardoned while the other two will be executed. Prisoner A asks the jailer (who knows) to tell him one of the prisoners who will be executed: "If I will be pardoned, just flip a coin and tell me B or C; if C will be pardoned, tell me B; and if B will be pardoned, tell me C." The jailer says B will be executed.
question( "Using Bayes Rule, what is the numerator of the expression evaluating the probability that C is pardoned given what has happened?", answer("P(jailer says B executed | C is pardoned) * P(C is pardoned)", correct = TRUE), answer("P(B is executed | C is pardoned) * P(B is executed)"), answer("P(C is pardoned | jailer says B is executed) * P(B is executed)") )
Based on the previous question, what is the probability of C being pardoned? Use this code block to perform calculations and enter the probability below (expressed to the nearest 0.01).
question_text( "Probability (to the nearest 0.01):", answer("0.67", correct = TRUE), answer("0.66", correct = TRUE), answer(".67", correct = TRUE), answer(".66", correct = TRUE), allow_retry = TRUE )
You have a bucket with 2 coins: one is a regular coin, while the other has heads on both sides. You pick a coin at random and flip it: it turns up heads. What is the probability you chose the fair coin? Use this code block to perform calculations and enter the probability below (expressed to the nearest 0.01).
question_text( "Probability (to the nearest 0.01)", answer("0.33", correct = TRUE), answer(".33", correct = TRUE), allow_retry = TRUE )
submission_ui
submission_server()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.