Problem Set 5 Answer Checker
Work on the assigned problems in the associated Problem Set PDF file, then use the problem set checker to find out if the answer was correct or incorrect. 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);
//Problem 1 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(b) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(c.1) Give your value for $a$."; wl(s); wl(kp); partName = problemNumber + " (c.1)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, -1.75, buttonLabel, 0.005, debugans); wl(kp); s = “(c.2) Give your value for $b$."; wl(s); wl(kp); partName = problemNumber + " (c.2)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 8.916667, buttonLabel, 0.005, debugans); wl(kp); whr(kdivcol,kdivwid);
//Problem 2 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a.1} Give your value for $a$."; wl(s); wl(kp); partName = problemNumber + " (a.1)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 1.2, buttonLabel, 0.001, debugans); wl(kp) s = “(a.2) Give your value for $b$."; wl(s); wl(kp); partName = problemNumber + " (a.2)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 10.5, buttonLabel, 0.001, debugans); wl(kp); s = “(b) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); whr(kdivcol,kdivwid);
//Problem 3 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a) With sober Monty, what is the posterior probability that Shelby will win if she switches?"; wl(s); wl(kp); partName = problemNumber + " (a)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.666667, buttonLabel, 0.005, debugans); wl(kp) s = “(b) With drunk Monty, what is the posterior probability that Shelby will win if she switches?"; wl(s); wl(kp); partName = problemNumber + " (b)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.5, buttonLabel, 0.005, debugans); wl(kp) s = “(c) With maybe drunk Monty, what is the posterior probability that Shelby will win if she switches?” wl(s); wl(kp); partName = problemNumber + " (c)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.62963, buttonLabel, 0.005, debugans); wl(kp) whr(kdivcol,kdivwid);
//Problem 4 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a.1) Give the posterior probability of the 4-sided die for $n = 5$."; wl(s); wl(kp); partName = problemNumber + " (a.1)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0, buttonLabel, 0.001, debugans); wl(kp) s = “(a.2) Give the posterior probability of the 8-sided die for $n = 5$.” wl(s); wl(kp); partName = problemNumber + " (a.2)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.87571, buttonLabel, 0.001, debugans); wl(kp) s = “(a.3) Give the posterior probability of the 20-sided die for $n = 5$."; wl(s); wl(kp); partName = problemNumber + " (a.3)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.0089673, buttonLabel, 0.001, debugans); wl(kp) s = “(a.4) Give the posterior probability of the 8-sided die as $n → ∞$."; wl(s); wl(kp); partName = problemNumber + " (a.4)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 1, buttonLabel, 0.001, debugans); wl(kp) s = “(b) Some values are equally likely for the 11th roll. How many distinct probabilities are there among the 20 possible outcomes?"; wl(s); wl(kp); partName = problemNumber + " (b)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 3, buttonLabel, 0.001, debugans); wl(kp) s = “(c.1) Give the posterior predictive probability of a 7 for $n=5$, i.e. the probability of a 7 on the 6th roll."; wl(s); wl(kp); partName = problemNumber + " (c.1)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.11952, buttonLabel, 0.001, debugans); wl(kp) s = “(c.2) Give the posterior predictive probability of an 11 for $n=5$."; wl(s); wl(kp); partName = problemNumber + " (c.2)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.010058, buttonLabel, 0.001, debugans); wl(kp) whr(kdivcol,kdivwid);
//Problem 5 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a.1) Give the prior odds you will choose the .3 coin."; wl(s); wl(kp); partName = problemNumber + " (a.1)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.25, buttonLabel, 0.001, debugans); wl(kp) s = “(a.2) The .7 coin."; wl(s); wl(kp); partName = problemNumber + " (a.2)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.25, buttonLabel, 0.001, debugans); wl(kp) s = “(b) What are the prior odds of flipping heads?"; wl(s); wl(kp); partName = problemNumber + " (b)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 1, buttonLabel, 0.001, debugans); wl(kp) s = “(c.1) What are the posterior odds you chose the .3 coin?"; wl(s); wl(kp); partName = problemNumber + " (c.1)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.1363636, buttonLabel, 0.001, debugans); wl(kp) s = “(c.2) What are the posterior odds you chose the .7 coin?"; wl(s); wl(kp); partName = problemNumber + " (c.2)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.3888889, buttonLabel, 0.001, debugans); wl(kp) s = “(d) What are the posteriod predictive odds of heads on the second flip?"; wl(s); wl(kp); partName = problemNumber + " (d)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 1.136752, buttonLabel, 0.002, debugans); wl(kp) whr(kdivcol,kdivwid);
//Problem 6 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = knoonlinecheck; wl(s); wl(kp); wl(kbr); whr(kdivcol,kdivwid);