diff --git a/your-code/main.ipynb b/your-code/main.ipynb index b8b7a9c..f8cada0 100644 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -24,10 +24,29 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "1,3,4\n", "\"\"\"" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "P(A) = 0.3\n", + "P(B) = 0.6\n", + "P(A int B) = 0.1\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -49,7 +68,21 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "- white = 10/30 = 1/3\n", + "\n", + "- white after black\n", + "P(B|A) = P(A int B)/P(A) = 0,333\n", + "\n", + "P(W) = 10/29\n", + "\n", + "\n", + "- red ball after black and red ball\n", + "P(R)= 11/28\n", + "\n", + "\n", + "- red after black and red\n", + "P(R) = 12/30\n", + "\n", "\"\"\"" ] }, @@ -75,7 +108,9 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "\n", + "P(R|C) = (P(C|R)*P(R))/P(C)= 0.5*0.1/0.4 = 0.125\n", + "\n", "\"\"\"" ] }, @@ -102,11 +137,91 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "67.5 67.5\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "\n", + "woman_yes = (351/520)*100\n", + "man_yes = (324/480)*100\n", + "\n", + "print(woman_yes, man_yes)\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
manwoman
0480520
1324351
2156169
\n", + "
" + ], + "text/plain": [ + " man woman\n", + "0 480 520\n", + "1 324 351\n", + "2 156 169" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# your code here" + "pd.DataFrame({\"man\" : [480, 324, 156], \"woman\" : [520, 351, 169]})" ] }, { @@ -116,14 +231,15 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "man and woman have the same opinion about lighting. \n", + "it seems that the gender is irrelevant\n", "\"\"\"" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -137,7 +253,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.2" + "version": "3.10.9" } }, "nbformat": 4,