Problem Set 7 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.i)} Give the exact (binomial) one-sided $p$-value for the data."; wl(s); wl(kp); partName = problemNumber + " (a.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.03321, buttonLabel, 0.001, debugans); wl(kp); s = “(a.ii) Give the exact (binomial) two-sided $p$-value for the data."; wl(s); wl(kp); partName = problemNumber + " (a.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.06642, buttonLabel, 0.001, debugans); wl(kp); s = “(b) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = emphtext(“For parts c-e use a two-sided rejection region."); wl(s); wl(kp); s = “(c) How many heads would you need to reject at $α = 0.01$?"; wl(s); wl(kp); s = “(c.i) Less than or equal to:"; wl(s); wl(kp); partName = problemNumber + " (c.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 104, buttonLabel, 0.001, debugans); wl(kp); s = “(c.ii) More than or equal to:"; wl(s); wl(kp); partName = problemNumber + " (c.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 146, buttonLabel, 0.001, debugans); wl(kp); s = “(d.i) What’s the power when $α = 0.05$ for $θ = 0.55$?"; wl(s); wl(kp); partName = problemNumber + " (d.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .35237, buttonLabel, 0.001, debugans); wl(kp); s = “(d.ii) What’s the power when $α = 0.05$ for $θ = 0.6$?"; wl(s); wl(kp); partName = problemNumber + " (d.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .88963, buttonLabel, 0.001, debugans); wl(kp); s = “(e) How many spins with $α = 0.05$ to have power $0.9$ when $θ = 0.55$?"; wl(s); wl(kp); partName = problemNumber + " (e)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 1055, buttonLabel, 0.1, debugans); wl(kp); s = “(f) What’s the posterior probability of $θ = 0.55$?"; wl(s); wl(kp); partName = problemNumber + " (f)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .85243, buttonLabel, 0.001, debugans); wl(kp); s = “(g) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); whr(kdivcol,kdivwid);
//Problem 2 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a.i) Estimate the probability of type I error."; wl(s); wl(kp); partName = problemNumber + " (a.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .064286, buttonLabel, 0.001, debugans); wl(kp); s = “(a.ii) Estimate the probability of type II error."; wl(s); wl(kp); partName = problemNumber + " (a.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .10714, 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) Give the $p$-value of the test for this data."; wl(s); wl(kp); partName = problemNumber + " (a)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .063945, buttonLabel, 0.001, debugans); wl(kp); s = “(b) Give the $p$-value of the test for this data."; wl(s); wl(kp); partName = problemNumber + " (b)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .031973, buttonLabel, 0.001, debugans); wl(kp); whr(kdivcol,kdivwid);
//Problem 4 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(b.i) Give the threshhold for $\\ov{x}$ for which they should use issue a ticket."; wl(s); wl(kp); partName = problemNumber + " (b.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 45.054, buttonLabel, 0.1, debugans); wl(kp); s = “(b.ii) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(c.i) What is the power of this test?"; wl(s); wl(kp); partName = problemNumber + " (c.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .49257, buttonLabel, 0.001, debugans); wl(kp); s = “(c.ii) How many cameras are needed to insure a power of 0.9?"; wl(s); wl(kp); partName = problemNumber + " (c.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 10, 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) What is the probability of a type I error?"; wl(s); wl(kp); partName = problemNumber + " (a)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.1, buttonLabel, 0.001, debugans); wl(kp); s = “(b) What is the probability of a type II error?” wl(s); wl(kp); partName = problemNumber + " (b)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.72, buttonLabel, 0.001, 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);