hw06_solutions.pdf - In Initialize OK from...

This preview shows page 1 - 3 out of 15 pages.

In [ ]: # Initialize OK from client.api.notebook import Notebook ok = Notebook( 'hw06.ok' ) Homework 6: Probability, Simulation, Estimation, and Assessing Models Helpful Resource: Python Reference () : Cheat sheet of helpful array & table methods used in Data 8! Reading : Randomness () Sampling and Empirical Distributions () Testing Hypotheses () Please complete this notebook by filling in the cells provided. Before you begin, execute the following cell to load the provided tests. Each time you start your server, you will need to execute this cell again to load the tests. For all problems that you must write explanations and sentences for, you must provide your answer in the designated space. Moreover, throughout this homework and all future ones, please be sure to not re- assign variables throughout the notebook! For example, if you use max_temperature in your answer to one question, do not reassign it later on. Otherwise, you will fail tests that you thought you were passing previously! Deadline: This assignment is due Thursday, October 8 at 11:59 P.M. PST. You will receive an early submission bonus point if you turn in your final submission by Wednesday, October 7 at 11:59 P.M. PST. Late work will not be accepted as per the policies () page. Note: This homework has hidden tests on it. That means even though tests may say 100% passed, doesn't mean your final grade will be 100%. We will be running more tests for correctness once everyone turns in the homework. Directly sharing answers is not okay, but discussing problems with the course staff or with other students is encouraged. Refer to the policies page to learn more about how to learn cooperatively. You should start early so that you have time to get help if you're stuck. Office hours are held Monday-Friday. The schedule appears on ffice-hours.html (ffice-hours.html) .
In [1]: # Don't change this cell; just run it. import numpy as np from datascience import * # These lines do some fancy plotting magic.", import matplotlib % matplotlib inline import matplotlib.pyplot as plt plt . style . use( 'fivethirtyeight' ) import warnings warnings . simplefilter( 'ignore' , FutureWarning ) from client.api.notebook import * def new_save_notebook ( self ): """ Saves the current notebook by injecting JavaScript to save to .ipynb file. """ try : from IPython.display import display, Javascript except ImportError : log . warning( "Could not import IPython Display Function" ) print ( "Make sure to save your notebook before sending it to OK!" ) return if self . mode == "jupyter" : display(Javascript( 'IPython.notebook.save_checkpoint();' )) display(Javascript( 'IPython.notebook.save_notebook();' )) elif self . mode == "jupyterlab" : display(Javascript( 'document.querySelector( \' [data-command="docm anager:save"] \' ).click();' )) print ( 'Saving notebook...' , end = ' ' ) ipynbs = [path for path in self . assignment . src if os . path .

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture