GIVE NOW about ocw help & faqs contact us
18.05 | Spring 2014 | Undergraduate

# Introduction to Probability and Statistics

### Problem Set 6 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("<h3>Calculator</h3>"); writecalculator(“psetcheckcalcid”, “Calculate”); whr(kdivcol,kdivwid);

//Problem 1 problemNumber++; wl(problemheader(problemNumber)); wl(’’); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a) Give the Bayes’ factor for $H_0$ vs. $H_1$”; wl(s); wl(kp); partName = problemNumber + " (a)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.16458, buttonLabel, 0.005, debugans); wl(kp); s = “(b) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(c) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(d) For each of the priors give the value of the posterior pdf at $θ = 0.6$”; wl(s); wl(kp); s = “Prior (d.i):”; wl(s); wl(kbr); partName = problemNumber + " (d.i)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 5.584787, buttonLabel, 0.005, debugans); wl(kp); s = “Prior (d.ii):”; wl(s); wl(kp); partName = problemNumber + " (d.ii)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 4.517611, buttonLabel, 0.005, debugans); wl(kp); s = “Prior (d.iii):”; wl(s); wl(kp); partName = problemNumber + " (d.iii)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 1.477606, buttonLabel, 0.005, debugans); wl(kp); s = “Prior (d.iv):”; wl(s); wl(kp); partName = problemNumber + " (d.iv)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.0, buttonLabel, 0.0005, debugans); wl(kp); s = “Prior (d.v):”; wl(s); wl(kp); partName = problemNumber + " (d.v)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.001400, buttonLabel, 0.0005, debugans); wl(kp); s = “(e) Give the posterior probability of heads for each prior.”; wl(s); wl(kp); s = “Prior (e.i):”; wl(s); wl(kp); partName = problemNumber + " (e.i)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.97097, buttonLabel, 0.005, debugans); wl(kp); s = “Prior (e.ii):”; wl(s); wl(kp); partName = problemNumber + " (e.ii)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.96641, buttonLabel, 0.005, debugans); wl(kp); s = “Prior (e.iii):”; wl(s); wl(kp); partName = problemNumber + " (e.iii)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.94591, buttonLabel, 0.005, debugans); wl(kp); s = “Prior (e.iv):”; wl(s); wl(kp); partName = problemNumber + " (e.iv)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.80202, buttonLabel, 0.005, debugans); wl(kp); s = “Prior (e.v):”; wl(s); wl(kp); partName = problemNumber + " (e.v)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.29626, buttonLabel, 0.005, debugans); wl(kp); s = “(f) Give the posterior odds of $H_1$ vs. $H_0$ for each prior.”; wl(s); wl(kp); s = “Prior (f.i):”; wl(s); wl(kp); partName = problemNumber + " (f.i)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 6.076, buttonLabel, 0.005, debugans); wl(kp); s = “Prior (f.iv):”; wl(s); wl(kp); partName = problemNumber + " (f.iv)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.00437, buttonLabel, 0.001, debugans); wl(kp); whr(kdivcol,kdivwid);

//Problem 2 problemNumber++; wl(problemheader(problemNumber)); wl(’’); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “Give the posterior odds that Alice filled in for Bob.”; wl(s); wl(kp); partName = problemNumber; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 25.409, buttonLabel, 0.005, debugans); wl(kp); whr(kdivcol,kdivwid);

//Problem 3 problemNumber++; wl(problemheader(problemNumber)); wl(’’); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a.i) Evaluate the posterior pdf for the data $x= 0.2$ at $θ = 0.3$.”; wl(s); wl(kp); partName = problemNumber + " (a.i)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 2.071116, buttonLabel, 0.002, debugans); wl(kp); s = “(a.ii) Evaluate the posterior pdf for the data $x = 0.2$ at $θ = 0.1$.”; wl(s); wl(kp); partName = problemNumber + " (a.ii)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.0, buttonLabel, 0.0001, debugans); wl(kp); s = “(b.i) Evaluate the posterior pdf for the data $(0.1,0.5)$ at $θ = 0.7$.”; wl(s); wl(kp); partName = problemNumber + " (b.i)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 2.040816, buttonLabel, 0.002, debugans); wl(kp); s = “(b.ii) Evaluate the posterior pdf for the data $(0.5, 0.5)$ at $θ = 0.7$.”; wl(s); wl(kp); partName = problemNumber + " (b.ii)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 2.040816, buttonLabel, 0.002, debugans); wl(kp); s = “(b.iii) Evaluate the posterior pdf for the data $(0.1, 0.2, 0.3, 0.4, 0.5)$ at $θ = 0.7$.”; wl(s); wl(kp); partName = problemNumber + " (b.iii)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 1.586640, buttonLabel, 0.002, debugans); wl(kp); s = “(c) Give the posterior predictive probability that Jane is less than 30 minutes late to the next class”; wl(s); wl(kp); partName = problemNumber + " (c)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.82667, buttonLabel, 0.002, debugans); wl(kp); s = “(d) Give the MAP when $x = 0.6”; wl(s); wl(kp); partName = problemNumber + " (d)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 0.6, buttonLabel, 0.0001, debugans); wl(kp); s = “(e) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); 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) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(c) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(d.i) Give the expected value (mean) for Randall’s posterior pdf.”; wl(s); wl(kp); partName = problemNumber + " (d.i)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 86.154, buttonLabel, 0.01, debugans); wl(kp); s = “(d.ii) Give the expected value (mean) for Mary’s posterior pdf.”; wl(s); wl(kp); partName = problemNumber + " (d.ii)”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 134.62, buttonLabel, 0.01, debugans); wl(kp); whr(kdivcol,kdivwid);

//Problem 5 problemNumber++; wl(problemheader(problemNumber)); wl(’’); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(5.i) Give the prior odds the chosen die is 4-sided.”; wl(s); wl(kp); partName = problemNumber + “.i”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 1, buttonLabel, 0.0001, debugans); wl(kp); s = “(5.ii) Give the posterior odds that the chosen die is 4-sided after roll 1.”; wl(s); wl(kp); partName = problemNumber + “.ii”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 1.5, buttonLabel, 0.001, debugans); wl(kp); s = “(5.iii) Give the posterior odds that the chosen die is 4-sided after roll 2.”; wl(s); wl(kp); partName = problemNumber + “.iii”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 1.35, buttonLabel, 0.001, debugans); wl(kp); s = “(5.iv) Give the posterior odds that the chosen die is 4-sided after roll 3.”; wl(s); wl(kp); partName = problemNumber + “.iv”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 2.025, buttonLabel, 0.002, debugans); wl(kp); s = “(5.v) Give the posterior odds that the chosen die is 4-sided after roll 4.”; wl(s); wl(kp); partName = problemNumber + “.v”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 3.0375, buttonLabel, 0.001, debugans); wl(kp); s = “(5.vi) Give the posterior odds that the chosen die is 4-sided after roll 5.”; wl(s); wl(kp); partName = problemNumber + “.vi”; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+“id”, 4.5562, buttonLabel, 0.001, debugans); wl(kp); whr(kdivcol,kdivwid);

## Course Info

##### Instructors

- Dr. Jeremy Orloff
- Jonathan Bloom

##### Departments

- Mathematics

##### As Taught In

Spring 2014

##### Level

Undergraduate

##### Topics

- Mathematics
  - Discrete Mathematics
  - Probability and Statistics

##### Learning Resource Types

assignment_turned_in Problem Sets with Solutions
grading Exams with Solutions
notes Lecture Notes
co_present Instructor Insights
theaters Other Video

Browse Resources

# You are leaving MIT OpenCourseWare

Please be advised that external sites may have terms and conditions, including license rights, that differ from ours. MIT OCW is not responsible for any content on third party sites, nor does a link suggest an endorsement of those sites and/or their content.