hw06_master.pdf - hw06_master March 2 2021 1 Homework 6...

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

hw06_master March 2, 2021 1 Homework 6: Probability, Simulation, Estimation, and Assess- ing Models 1.0.1 Note: do not worry if a “notebook validation failed” window pops up. Just press ‘ok’ and proceed normally. 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. Make sure to explain your answer for written questions. 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, March 4 at 11:59 P.M. PST. You will receive an early submission bonus point if you turn in your final submission by Wednesday, March 3 at 11:59 P.M. PST. Late work will not be accepted as per the policies page. 1.0.2 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. Offce hours are held Monday-Friday. The schedule appears on . [1]: # Don't change this cell; just run it. import numpy as np 1
from datascience import * # These lines do some fancy plotting magic.\n", 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="docmanager: , save"] \' ).click();' )) print ( 'Saving notebook...' , end = ' ' ) ipynbs = [path for path in self . assignment . src if os . path . splitext(path)[ 1 ] == '.ipynb' ] # Wait for first .ipynb to save if ipynbs: if wait_for_save(ipynbs[ 0 ]): print ( "Saved ' {} '." . format(ipynbs[ 0 ])) else : log . warning( "Timed out waiting for IPython save" ) print ( "Could not automatically save \' {} \' " . format(ipynbs[ 0 ]))

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture