dplyr
functions and only display what is requested in the exercise.library(tidyverse)
In a study from 1984, Kahneman and Tversky posed the following to 150 students: Imagine that you face the following pair of concurrent decisions. First examine both decisions, then indicate the options you prefer.
Decision 1 - Choose between:
Decision 2 - Choose between:
Kahneman and Tversky were studying how the framing of choices as either a gamble or a sure thing influences decision-making. The choices for 150 students can be accessed using the code below.
<- read_table("http://users.stat.ufl.edu/~winner/data/riskgamble.dat",
gamble col_names = FALSE)
Take a look at gamble
. The Decision 1 response is in column 1, the Decision 2 response is column 2, and the counts are in column 3. The data is coded such that 1 = “A”, 2 = “B” in column 1, and 1 = “C”, 2 = “D” in column 2.
Mutate gamble
so it looks like the tibble below. Overwrite gamble
.
# A tibble: 4 x 3
decision_1 decision_2 count
<chr> <chr> <dbl>
1 A C 16
2 A D 110
3 B C 4
4 B D 20
Based on the study, compute the probability a person chose “A” for Decision 1. Display your result as a tibble with one row and two columns – decision_1
and probability
.
Based on the study, compute the probability a person chose “A” and “D”. Display your result as a tibble with one row and three columns – decision_1
, decision_2
, and probability
.
Given a person chose “B” for Decision 1, what is the probability they chose “D” for Decision 2? Display your result as a tibble with one row and one column – probability
.
Given a person chose “B” for Decision 1, what is the probability they chose “A” for Decision 2? Code is optional here.
Given a person chose “D” for Decision 2, what is the probability they chose “B” for Decision 1? Display your result as a tibble with one row and one column – probability
.
Which pair of options would you choose? Why? Explain your reasoning in less than five sentences.
In this part you will use simulation to compute some more challenging probabilities. Run 10,000 experiments for your simulation. Do not modify the set_seed
code chunk in your Rmd file.
Consider a standard deck of 52 cards and a fair six-sided die. You will draw a card and roll the die. What is the probability that you get matching numbers on the card draw and die roll? Do not treat Aces as one. Display your result as a tibble with one row and one column – probability
.
Consider a standard deck of 52 cards and a fair six-sided die. You will draw a card and roll the die. What is the probability that you get a face card or a six on the die roll? Display your result as a tibble with one row and one column – probability
.
Consider a standard deck of 52 cards. Suppose you draw three cards sequentially but with replacement. What is the probability all three cards are in increasing order from the three sequential draws. Ties do not count. Define the following card rankings: 2 < 3 < ... < 10 < J < Q < K < A
. Display your result as a tibble with one row and one column – probability
.
Knit to PDF to create a PDF document. Stage and commit all remaining changes, and push your work to GitHub. Make sure all files are updated on your GitHub repo.
Only upload your PDF document to Gradescope. Before you submit the uploaded document, mark where each answer is to the exercises. If any answer spans multiple pages, then mark all pages. Associate the “Overall” section with the first page.
D. Kahneman and A. Tversky (1984). “Choices, Values, and Frames”, American Psychologist, Vol.35, #4, pp. 341-350.