diff --git a/your-code/main.ipynb b/your-code/main.ipynb
index b8b7a9c..4ba2cc6 100644
--- a/your-code/main.ipynb
+++ b/your-code/main.ipynb
@@ -19,12 +19,38 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 21,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'\\nChecking if events are independent:\\nFor independent events, P(A∩B) = P(A) * P(B). 0.1 is not equal to 0.3 multiplied by 0.6, so these events are dependent\\n\\n1) P(A U B) = P(A) + P(B) - P(A∩B) = 0.8, not 0.6, so statement is false\\n2) P(A∩Bcompl) is all of A minus intersection of B and A => P(A) - P(A∩B) = 0.3 - 0.1 = 0.2, so statement is true\\n3) B U Bcompl is full sample, so A ∩ with full sample is just A. P(A) = 0.3, so statement is false\\n4) A compl intersect with B compl is all of sample minus A joined with B => 1 - P(A U B) => 1 - 0.8 = 0.2, so statement is false\\n5) P(not(A∩B)) = 1 - P(A∩B) = 0.9, so statement is true\\n\\n\\n1st statement is false\\n2nd statement is true\\n3rd statement is false\\n4th statement is false\\n5th statement is true\\n\\n'"
+ ]
+ },
+ "execution_count": 21,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"\"\"\"\n",
- "your solution here\n",
+ "Checking if events are independent:\n",
+ "For independent events, P(A∩B) = P(A) * P(B). 0.1 is not equal to 0.3 multiplied by 0.6, so these events are dependent\n",
+ "\n",
+ "1) P(A U B) = P(A) + P(B) - P(A∩B) = 0.8, not 0.6, so statement is false\n",
+ "2) P(A∩Bcompl) is all of A minus intersection of B and A => P(A) - P(A∩B) = 0.3 - 0.1 = 0.2, so statement is true\n",
+ "3) B U Bcompl is full sample, so A ∩ with full sample is just A. P(A) = 0.3, so statement is false\n",
+ "4) A compl intersect with B compl is all of sample minus A joined with B => 1 - P(A U B) => 1 - 0.8 = 0.2, so statement is false\n",
+ "5) P(not(A∩B)) = 1 - P(A∩B) = 0.9, so statement is true\n",
+ "\n",
+ "\n",
+ "1st statement is false\n",
+ "2nd statement is true\n",
+ "3rd statement is false\n",
+ "4th statement is false\n",
+ "5th statement is true\n",
+ "\n",
"\"\"\""
]
},
@@ -43,14 +69,17 @@
]
},
{
- "cell_type": "code",
- "execution_count": null,
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [],
"source": [
- "\"\"\"\n",
- "your solution here\n",
- "\"\"\""
+ "*1) Taking white ball out
\n",
+ "P(W) = 10 / 30 = 1/3=0.33
\n",
+ "2) Taking white ball out after taking a black ball out
\n",
+ "P(W) = 10/29 =0.345
\n",
+ "3) Taking red ball out after taking a black ball and a red ball out
\n",
+ "P(R) = 11/28 =0.393
\n",
+ "4) Taking red ball out after taking a black ball and a red ball out with reposition
\n",
+ "P(R) = 12/30 =0.4
*"
]
},
{
@@ -69,14 +98,18 @@
]
},
{
- "cell_type": "code",
- "execution_count": null,
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [],
"source": [
- "\"\"\"\n",
- "your solution here\n",
- "\"\"\""
+ "R - rainy
\n",
+ "C - cloudy
\n",
+ "P(C|R) = 0.5
\n",
+ "P(C) = 0.4
\n",
+ "P(R) = 3/30 = 0.1
\n",
+ "P(C|R) != P(C), so events are dependent
\n",
+ "**Find**: P(R|C).\n",
+ "
\n",
+ "P(R|C) = P(C|R) * P(R) / P(C) = 0.5 * 0.1 / 0.4 = 0.125\n"
]
},
{
@@ -102,22 +135,155 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 6,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
| \n", + " | yes | \n", + "no | \n", + "total | \n", + "
|---|---|---|---|
| men | \n", + "324 | \n", + "156 | \n", + "480 | \n", + "
| women | \n", + "351 | \n", + "169 | \n", + "520 | \n", + "