Computing all four joint probabilities (in percent) in a fourfold table based on two randomly-generated conditional probabilities and one marginal probability. The exercise is a cloze with four numeric answers presented in a list.
Verbatim R input/output:
(Note that the HTML output contains mathematical equations in MathML. It is displayed by browsers with MathML support like Firefox or Safari - but not Chrome.)
library("exams") set.seed(1090) exams2html("fourfold.Rnw") set.seed(1090) exams2pdf("fourfold.Rnw") set.seed(1090) exams2html("fourfold.Rmd") set.seed(1090) exams2pdf("fourfold.Rmd")