From a10eb16bea41a83c2c7f87e58f8b06bad815ae11 Mon Sep 17 00:00:00 2001 From: Pedro Carneiro Marques Date: Wed, 15 Nov 2023 16:24:41 +0000 Subject: [PATCH] Lab done --- your-code/main.ipynb | 57 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/your-code/main.ipynb b/your-code/main.ipynb index b8b7a9c..32fe32e 100644 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -24,7 +24,15 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "P(A∪B) = 0.3 + 0.6 − 0.1 = 0.8 -> False\n", + "\n", + "P(A∩BC) = 0.3 − 0.1 = 0.2 -> True\n", + "\n", + "P(A∩(B∪BC)) = P(A) = 0.3 -> False\n", + "\n", + "P(AC∩BC) = 1 − 0.8 = 0.2 -> False\n", + "\n", + "P((A∩B)C) = 1 − 0.1 = 0.9 -> True\n", "\"\"\"" ] }, @@ -49,7 +57,13 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "Taking the white ball out: 10 white balls / 30 balls in total which translates into -> 1/3\n", + "\n", + "Taking a white ball out after taking a black ball out: 10 white / 29 remaning balls -> 10/29\n", + "\n", + "Taking a red ball out after taking a black and a red ball out: 11 red balls / 28 remaining balls -> 11/28\n", + "\n", + "Taking a red ball out after taking a black and a red ball out with reposition: 12 red balls / 30 remaining balls -> 12/30\n", "\"\"\"" ] }, @@ -75,7 +89,13 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "P(Cloud|Rain) = 0,5 (50%)\n", + "P(Rain) = 0,1 (10%)\n", + "P(Cloudy) = 0,4 (40%)\n", + "\n", + "P(Rain|Cloudy) -> 0,5 * 0,1 = 0,05 / 0,4 = 0,125\n", + "\n", + "Given the day starting cloudy the probability of rain is 12,5%\n", "\"\"\"" ] }, @@ -102,11 +122,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.675\n", + "0.48\n", + "0.324\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "survey = 480 + 520\n", + "yes = 324 + 351\n", + "no = 156 + 169\n", + "\n", + "positive = yes/survey\n", + "men = 480 / survey\n", + "positive_men = 324 / survey\n", + "\n", + "print(positive)\n", + "print(men)\n", + "print(positive_men)" ] }, { @@ -116,7 +157,7 @@ "outputs": [], "source": [ "\"\"\"\n", - "your solution here\n", + "Indeed both events are independent because be it men or women the request to have more street light is common to both genders.\n", "\"\"\"" ] } @@ -137,7 +178,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.2" + "version": "3.11.4" } }, "nbformat": 4,