diff --git a/your-code/main.ipynb b/your-code/main.ipynb index b8b7a9c..4050046 100644 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -10,11 +10,24 @@ "A and B are events of a probability space with $(\\omega, \\sigma, P)$ such that $P(A) = 0.3$, $P(B) = 0.6$ and $P(A \\cap B) = 0.1$\n", "\n", "Which of the following statements are false?\n", - "* $P(A \\cup B) = 0.6$\n", - "* $P(A \\cap B^{C}) = 0.2$\n", - "* $P(A \\cap (B \\cup B^{C})) = 0.4$\n", - "* $P(A^{C} \\cap B^{C}) = 0.3$\n", - "* $P((A \\cap B)^{C}) = 0.9$" + "* 1. $P(A \\cup B) = 0.6$\n", + "* 2. $P(A \\cap B^{C}) = 0.2$\n", + "* 3. $P(A \\cap (B \\cup B^{C})) = 0.4$\n", + "* 4. $P(A^{C} \\cap B^{C}) = 0.3$\n", + "* 5. $P((A \\cap B)^{C}) = 0.9$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# P(A) = 0.3\n", + "# P(B) = 0.6\n", + "\n", + "# P(A and B) = 0.1\n", + "\n" ] }, { @@ -24,7 +37,11 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "1. Wrong (0.8)\n", + "2. correct\n", + "3. Wrong (0.3)\n", + "4. Wrong (0.2)\n", + "5. Correct\n", "\"\"\"" ] }, @@ -32,7 +49,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Challenge 2\n", + "# Challenge 2\n", "There is a box with 10 white balls, 12 red balls and 8 black balls. Calculate the probability of:\n", "* Taking a white ball out.\n", "* Taking a white ball out after taking a black ball out.\n", @@ -49,7 +66,17 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "w = 10\n", + "r = 12\n", + "b = 8\n", + "\n", + "total = 30\n", + "\n", + "Task:\n", + "1. 8/30\n", + "2. 8/29\n", + "3. 11/28\n", + "4. 12/30\n", "\"\"\"" ] }, @@ -75,7 +102,16 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "P(C|R) = 0.5\n", + "P(C) = 0.4\n", + "P(R) = 0.3\n", + "\n", + "\n", + "\n", + "P(R|C) = P(C and R) / P(C)\n", + "P(R|C) = 0.4*0.3 / 0.4\n", + "P(R|C) = 0.12 / 0.4\n", + "P(R|C) = 0.3\n", "\"\"\"" ] }, @@ -102,11 +138,94 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "total = 1000\n", + "\n", + "m = 480\n", + "nm = 520\n", + "\n", + "m_y = 324\n", + "nm_y = 351\n", + "\n", + "m_n = 156\n", + "nm_y = 169\n", + "\n", + "y = m_y + nm_y\n", + "n = m_n + nm_y" + ] + }, + { + "cell_type": "code", + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ - "# your code here" + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
| \n", + " | Yes | \n", + "No | \n", + "
|---|---|---|
| men | \n", + "0.675 | \n", + "0.325 | \n", + "
| women | \n", + "0.675 | \n", + "0.325 | \n", + "