AllenDowney / ThinkStats2

Text and supporting code for Think Stats, 2nd Edition
http://allendowney.github.io/ThinkStats2/
GNU General Public License v3.0
4.03k stars 11.31k forks source link

Chapter 3. Excercise 3.2 #112

Closed mlsmall closed 2 years ago

mlsmall commented 6 years ago

The exercise states: "Write functions called PmfMean and PmfVar that take a Pmf object and compute the mean and variance"

What is the solution? How do we write these functions?

AllenDowney commented 6 years ago

I should have put solutions in chap03soln.ipynb, but it looks like I didn't. I'll do that when I have a chance.

In the meantime, check out: https://github.com/AllenDowney/ThinkStats2/blob/master/code/thinkstats2.py#L546

On Fri, Jun 1, 2018 at 3:33 PM, Mauro Small notifications@github.com wrote:

The exercise states: "Write functions called PmfMean and PmfVar that take a Pmf object and compute the mean and variance"

What is the solution? How do we write these functions?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/112, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy37QaVnyXtHHP8AmpdQlySW3ddaRMtks5t4ZchgaJpZM4UXNPi .

mlsmall commented 6 years ago

Thanks!

AllenDowney commented 2 years ago

This should be resolved with bf87d3e