|
113 | 113 | "source": [ |
114 | 114 | "# Computed how many people click\n", |
115 | 115 | "clicks = x <= 0.5\n", |
116 | | - "n_clicks = sum(pop)\n", |
| 116 | + "n_clicks = sum(clicks)\n", |
117 | 117 | "f\"Number of clicks = {n_clicks}\"" |
118 | 118 | ] |
119 | 119 | }, |
|
411 | 411 | "cell_type": "markdown", |
412 | 412 | "metadata": {}, |
413 | 413 | "source": [ |
414 | | - "**Note:** you may have noticed that the _binomial distribution_ can take on only a finite number of values, whereas the _uniform distribution_ above can take on any number between $0$ and $1$. These are different enough cases to warrant special mention of this & two different names: the former is called a _probability mass function_ (PMF) and the latter a _probability distribution function_ (PDF). Time permitting, we may discuss some of the subtleties here. If not, all good texts will cover this. I like (Sivia & Skilling, 2006), among many others.\n", |
415 | | - "\n", |
416 | | - "**HBA: should this note ^ have come earlier?** " |
| 414 | + "**Note:** you may have noticed that the _binomial distribution_ can take on only a finite number of values, whereas the _uniform distribution_ above can take on any number between $0$ and $1$. These are different enough cases to warrant special mention of this & two different names: the former is called a _probability mass function_ (PMF) and the latter a _probability distribution function_ (PDF). Time permitting, we may discuss some of the subtleties here. If not, all good texts will cover this. I like (Sivia & Skilling, 2006), among many others.\n" |
417 | 415 | ] |
418 | 416 | }, |
419 | 417 | { |
|
437 | 435 | "We have already encountered joint probabilities above, perhaps without knowing it: $P(A,B)$ is the probability two events $A$ and $B$ _both_ occurring.\n", |
438 | 436 | "* For example, getting two heads in a row.\n", |
439 | 437 | "\n", |
440 | | - "If $A$ and $B$ are independent, then $P(A,B)=P(A)P(B)$ but be warned: this is not always (or often) the case." |
| 438 | + "If $A$ and $B$ are independent, then $P(A,B)=P(A)P(B)$ but be warned: this is not always (or often) the case.\n", |
| 439 | + "\n", |
| 440 | + "One way to think of this is considering \"AND\" as multiplication: the probability of A **and** B is the probability of A **multiplied** by the probability of B." |
441 | 441 | ] |
442 | 442 | }, |
443 | 443 | { |
|
652 | 652 | "**Homework exercise for the avid learner:** verify the above relationship using simulation/resampling techniques in one of the cases above." |
653 | 653 | ] |
654 | 654 | }, |
655 | | - { |
656 | | - "cell_type": "markdown", |
657 | | - "metadata": {}, |
658 | | - "source": [ |
659 | | - "**TO-DO HBA: include Venn Diagram? Include mention earlier of probability AND being multiplication.**" |
660 | | - ] |
661 | | - }, |
662 | 655 | { |
663 | 656 | "cell_type": "markdown", |
664 | 657 | "metadata": {}, |
|
829 | 822 | "name": "python", |
830 | 823 | "nbconvert_exporter": "python", |
831 | 824 | "pygments_lexer": "ipython3", |
832 | | - "version": "3.6.1" |
| 825 | + "version": "3.6.6" |
833 | 826 | } |
834 | 827 | }, |
835 | 828 | "nbformat": 4, |
|
0 commit comments