Reading Questions Answer Checker
To check your answers put them in the appropriate box and click the ‘Check’ button. Every checker box can do arithmetic and calculate standard functions (see calculator help). If you give decimal answers, give them to at least 3 decimal places.
As you work you should have pencil and paper handy for calculations and thinking!
Note: some questions ask for a formula. For the checker we ask you to plug a value into the formula. For your pset you still need to give the whole formula.
//DEBUG PARAMETERS //Because we don’t show solutions for pset checkers we use //this to give a showanswer button during the debugging phase var debugans = undefined; //release //var debugans = kDebugAnswer; //debug problemNumber = 0; wl(“Calculator”); writecalculator(“psetcheckcalcid”, “Calculate”); whr(kdivcol,kdivwid);
s = ‘For these problems the geometric distribution geom$(θ)$ represents the number of successes until the first failure in a sequence of independent Bernoulli trials, where $θ$ is the probability of success for each trial.'; wl(s); wl(kp) s = “In all three problems let $X ∼$ geom$(θ)$ where the parameter $θ$ is in the range $[0,1]$."; wl(s); wl(kbr); //whr(kdivcol,kdivwid); NO DIV LINE
//Problem 1 problemNumber++; wl(problemheader(problemNumber)); var s; var partName, problemName, buttonLabel, answerArray, correct; s = [“Suppose we don’t know the value of $θ$”, “but have good information that it is most likely to be near 0.5.", kp, “Which of the following possible priors most closely matches our information?"]; wl(s.join(’ ‘)); wl(kp); wl(kbr); wl(‘’); wl(ksp+ksp); wl(‘’); wl(ksp+ksp); wl(‘’); wl(kbr); partName = problemNumber; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; correct = “C”; var answerArray = [“A”,“B”,“C”]; writeMultipleChoiceRadioGroup(answerArray, problemName, correct, buttonLabel); wl(kp); whr(kdivcol,kdivwid);
//Problem 2 problemNumber++; wl(problemheader(problemNumber)); var s; var partName, problemName, buttonLabel, answerArray, correct; s = [‘Suppose we take one draw from the draw from the random variable $X$’, ‘and get the data $x=3$.', kp, ‘For a fixed hypothesis $θ$ what is the likelihood function $p(x| θ )$?'] wl(s.join(’ ‘)); wl(kp); partName = problemNumber; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; correct = “$θ^3(1-θ)$”; var answerArray = [correct,“$(\\table 3; 1)$ $θ^3(1-θ)$”,“$p^3(1-p)$”]; writeMultipleChoiceRadioGroup(answerArray, problemName, correct, buttonLabel); wl(kp); whr(kdivcol,kdivwid);
//Problem 3 problemNumber++; wl(problemheader(problemNumber)); var s; var partName, problemName, buttonLabel, answerArray, correct; s = [“Assume your prior probability for $θ$ is”, “$2θ$.", kp, “What is the prior predictive probability that $x = 3$?"]; wl(s.join(’ ‘)); wl(kp); partName = problemNumber; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.0666667, buttonLabel, 0.001, kuseCorrectVal); wl(kp); whr(kdivcol,kdivwid);