# Lab 2: Summary Statistics#

*For the class on Wednesday, January 17th*

Tip

Looking for hints?

## A. Sample Average and Central Limit Theorem#

### Setup and Steps#

Generate \(n=500\) random variates from the exponential distribution with \(\lambda = 0.5\) (corresponding to

`scale=2`

; see Lab 2A). Calculate the sample average and variance.Repeat [Step 1] \(k=1,000\) times. You will get \(k\) different values of the sample average. Plot a histogram of these \(k\) sample averages.

### Questions#

The Central Limit Theorem (CLT) states that the distribution of the sample averages will approach a normal distribution as \(n\) increases. Does your result agree with CLT? What is the variance of the these \(k\) sample averages?

If you change the value of \(n\), will the variance of the the \(k\) sample averages (from [Step 2]) change? Make a prediction, reason your prediction, and evaluate your prediction.

If you change the value of \(k\), will the variance of the the \(k\) sample averages (from [Step 2]) change? Make a prediction, reason your prediction, and evaluate your prediction.

*// Add your answers here*

```
# Include your implementation for Part A here
```

## B. Propagation of Uncertainty#

### Setup and Steps#

You are measuring the resistance of a resistor with a simple DC circuit. You measure both the voltage across the resistor and the current through the resistor, and then use Ohm’s law \(V=IR\) to calculate the resistance. If your voltage and current measurements both have an uncertainty of 1%, what is the uncertainty of the calculated resistance?

Sample from some probability distribution to

*simulate*repeated voltage measurements, such that the standard deviation of those measurements is about 1%.Repeat Step 1 to

*simulate*repeated current measurements.Calculate the resistance by pairing the simulated voltage and current measurements from Step 1 and 2.

Repeat Steps 1-3 but make the voltage and current measurements positively coorelated.

### Questions#

What is the standard deviation of the calculated resistance values from [Step 3] (i.e., when the voltage and current measurements are independent)? Make a prediction, reason your prediction, and evaluate your prediction.

How does standard deviation of the calculated resistance change when the voltage and current measurements become correlated in [Step 4]? Make a prediction, reason your prediction, and evaluate your prediction.

*// Write your answers here*

```
# Include your implementation for Part B here
```

## Final question#

Roughly how much time did you spend on this lab (*not* including the time you spent in class)?

*// Write your answers here*

Tip

**How to submit this notebook on Canvas?**

Once you complete this lab and have all your code, text answers, and all the desired results after running the notebook properly displayed in this notebook, please convert the notebook into HTML format by running the following:

```
jupyter nbconvert --to html /path/to/labs/02.ipynb
```

Then, upload the resulting HTML file to Canvas for the corresponding assignment.