hw07.pdf - hw07[11 Initialize OK from client.api.notebook import Notebook ok = Notebook'hw07.ok = Assignment Homework 7 Testing Hypotheses OK version

hw07.pdf - hw07[11 Initialize OK from client.api.notebook...

This preview shows page 1 - 4 out of 14 pages.

hw07 March 12, 2020 [11]: # Initialize OK from client.api.notebook import Notebook ok = Notebook( 'hw07.ok' ) ===================================================================== Assignment: Homework 7: Testing Hypotheses OK, version v1.12.5 ===================================================================== 1 Homework 7: Testing Hypotheses Reading : * 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. Homework 7 is due Thursday, 3/12 at 11:59pm . You will receive an early submission bonus point if you turn in your final submission by Wednesday, 3/11 at 11:59pm . Start early so that you can come to office hours if you’re stuck. Check the website for the office hours schedule. Late work will not be accepted as per the policies of this course. 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. For all problems that you must write our 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. [12]: # Don't change this cell; just run it. import numpy as np from datascience import * # These lines do some fancy plotting magic. import matplotlib 1
Image of page 1
% matplotlib inline import matplotlib.pyplot as plt plt . style . use( 'fivethirtyeight' ) import warnings warnings . simplefilter( 'ignore' , FutureWarning ) from client.api.notebook import Notebook ok = Notebook( 'hw07.ok' ) _ = ok . auth(inline = True ) ===================================================================== Assignment: Homework 7: Testing Hypotheses OK, version v1.12.5 ===================================================================== Successfully logged in as [email protected] 1.1 1. Spam Calls 1.2 Part 1: 781 Fun Yanay gets a lot of spam calls. An area code is defined to be a three digit number from 200-999 inclusive. In reality, many of these area codes are not in use, but for this question we’ll simplify things and assume they all are. Throughout these questions, you should assume that Yanay’s area code is 781. Question 1. Assuming each area code is just as likely as any other, what’s the probability that the area code of two back to back spam calls are 781? [13]: prob_781 = ( 1/800 ) **2 prob_781 [13]: 1.5625e-06 [14]: ok . grade( "q1_1" ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Running tests --------------------------------------------------------------------- Test summary Passed: 1 Failed: 0 [ooooooooook] 100.0% passed Question 2. Rohan already knows that Yanay’s area code is 781. Rohan randomly guesses the last 7 digits (0-9 inclusive) of his phone number. What’s the probability that Rohan correctly guesses 2
Image of page 2
Yanay’s number, assuming he’s equally likely to choose any digit? Note: A phone number contains an area code and 7 additional digits, i.e. xxx-xxx-xxxx [15]: prob_yanay_num = ( 1/9 ) **7 prob_yanay_num [15]: 2.090751581287689e-07 [16]: ok . grade( "q1_2" ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Running tests --------------------------------------------------------------------- Test summary Passed: 1 Failed: 0 [ooooooooook] 100.0% passed Yanay suspects that there’s a higher chance that the spammers are using his area code (781) to trick him into thinking it’s someone from his area calling him. Ashley thinks that this is not the case,
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 14 pages?

  • Fall '17
  • Null hypothesis, Statistical hypothesis testing, area code, Yanay

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors