Question: CS103 Introduction to Computation Johnstone Spring 2018 Lab 11: Statistics and doestrings (3.30.18 and 4.2.18) In this lab, you will write code to compute some

 CS103 Introduction to Computation Johnstone Spring 2018 Lab 11: Statistics and

CS103 Introduction to Computation Johnstone Spring 2018 Lab 11: Statistics and doestrings (3.30.18 and 4.2.18) In this lab, you will write code to compute some statistics of a dataset. Mean and variance are impoetant measures that give valuable information about a dataset Note that today you are creating your own functions and docstrings and test data, which is part of the exercise. Please write docstrings carefully using the 103 style guide, (which are also followed in the code I provide each lecture). Relevant lectures: lecture 19 and 20 1. Write a function to compute the mean of a list of integets L of length n Motivation: we are assuming that each element o L. occurs with equal probability so we are weighting each one by1 2. Write a function to compute the variance V of a list of integers L of length n: This measures the spread or disperslon of the data. 3. Write a function to compute the standard deviation D of a list of integers L; if the varianoe of L is V then the standard devlation is Grading: Code for mean, variance, and standard deviation. If and when you ???plete the above, please proceed with the following experiment. This will prepare you for Monte Carlo slmulations. 1. write a function to toss a fair ooln; it sboald return True if the coin toss yields Heads and False if the coln toss yields Tails 2. write a fanction to toss a fair coin 100 times and count the number of heads; (we will all this an 3, write a functi? to repeat this experiment 1000 times, and compute the mean of the # of heads 4. compute the standard deviation of these experiments Repeat this exercise for a biased coin, with probability po, of heads CS103 Introduction to Computation Johnstone Spring 2018 Lab 11: Statistics and doestrings (3.30.18 and 4.2.18) In this lab, you will write code to compute some statistics of a dataset. Mean and variance are impoetant measures that give valuable information about a dataset Note that today you are creating your own functions and docstrings and test data, which is part of the exercise. Please write docstrings carefully using the 103 style guide, (which are also followed in the code I provide each lecture). Relevant lectures: lecture 19 and 20 1. Write a function to compute the mean of a list of integets L of length n Motivation: we are assuming that each element o L. occurs with equal probability so we are weighting each one by1 2. Write a function to compute the variance V of a list of integers L of length n: This measures the spread or disperslon of the data. 3. Write a function to compute the standard deviation D of a list of integers L; if the varianoe of L is V then the standard devlation is Grading: Code for mean, variance, and standard deviation. If and when you ???plete the above, please proceed with the following experiment. This will prepare you for Monte Carlo slmulations. 1. write a function to toss a fair ooln; it sboald return True if the coin toss yields Heads and False if the coln toss yields Tails 2. write a fanction to toss a fair coin 100 times and count the number of heads; (we will all this an 3, write a functi? to repeat this experiment 1000 times, and compute the mean of the # of heads 4. compute the standard deviation of these experiments Repeat this exercise for a biased coin, with probability po, of heads

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!