Homework is Up!

Follow the usual Fork, Go onto Colab, and bring it down there to work on it. We will go over it on Saturday.

Any questions, put them in this thread

3 Likes

It’s a warning. 2 packages used have some minor incompatibility. Please ignore!

I haven’t really understood the 4th question, I tried working on it multiple times…

Sir, I completed the homework but in question 5, i didn’t understand how to implement the zip and dict so I tried another method and got the results sine the data size was limited and the sample size was already known.

SIr where am I going wrong here:
def replicate_throws(number_of_samples, sample_size):

 for i in range(number_of_samples):

    throws = np.random.choice(['H', 'T'],sample_size)  

    heads = np.sum(throws == 'H')

    return heads/sample_size

I need 20 outcomes. Each outcome is of sample size 10. I am getting only one output

Sir I got it. This is what I have done:

def replicate_throws(number_of_samples, sample_size):

 ss = []

 for i in range(number_of_samples):

    throws = np.random.choice(['H', 'T'],sample_size)  

    heads = np.sum(throws == 'H')

    ss.append(heads/sample_size)

 return ss