diff --git a/your-code/main.ipynb b/your-code/main.ipynb index b8b7a9c..479fb99 100644 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -19,13 +19,70 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ - "\"\"\"\n", - "your solution here\n", - "\"\"\"" + "# P(A and B) = P(A) * P(B) # if A and B are independent\n", + "# P(A and B) = 0.01\n", + "\n", + "#P(A) * P(B)= 0.60*0.30\n", + "\n", + "## with this we can say that A and B are not independent!!! :D" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "1.\n", + "\n", + "- P(A U B)= P(A) + P(B) - P(A and B)\n", + "- P(A U B)= 0.30 + 0.60 -0.10\n", + "- P(A U B)= 0.80 \n", + "The statement are **False**\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "2. \n", + "- P(A)- P(Aβ©B)\n", + "- 0.3 - 0.1 = 0.2 \n", + "The statement are **true**\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "3. \n", + "- π(π΄β©(π΅βͺπ΅πΆ))=0.4 \n", + "\n", + "- P(Aβ©B) + P(A) - P(Aβ©B)\n", + "- 0.1 + 0.3 -0.1 = 0.3 \n", + "The statement are **False**\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "4.\n", + "- π(π΄πΆβ©π΅πΆ) = 1 - π(π΄βͺπ΅) \n", + "- = 1 - 0.8 = 0.2 \n", + "The statement are **False**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "5.\n", + "- π((π΄β©π΅)πΆ) = 1 - π(π΄β©π΅) \n", + "- = 1 - 0.1 = 0.9 \n", + "The statement are **True**" ] }, { @@ -43,14 +100,23 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "\"\"\"\n", - "your solution here\n", - "\"\"\"" + "w = 10 \n", + "r = 12 \n", + "b = 8 \n", + "\n", + "1. P(w)= 10/30 = 0,33\n", + "2. P(w) = 10/29= 0,34\n", + "3. P(r)= 12/28= 0,42\n", + "\n", + "4. P = P(b) * P(r) * P(r2)\n", + "\n", + "P= (8/30) * (12/30) * (12/30)\n", + "P = 0.042\n", + "\n", + "**P(r2)= probability of taking the red ball again**\n" ] }, { @@ -68,15 +134,38 @@ "What is the probability of rain, given the day started cloudy?" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "ca= 0.50\n", + "rb=0.40\n", + "m=0.1\n", + "\n", + "**P(A|B) = (P(B|A) * P (A))/P (B)**\n", + "\n", + "P= (0,1 * 0,50) / 0,40\n", + "P= 0.125 * 100 = 12,5" + ] + }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "12.5" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "\"\"\"\n", - "your solution here\n", - "\"\"\"" + "((0.1*0.50)/0.40)*100" ] }, { @@ -102,28 +191,129 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
| \n", + " | Gender | \n", + "Yes | \n", + "No | \n", + "total | \n", + "
|---|---|---|---|---|
| 0 | \n", + "male | \n", + "324 | \n", + "156 | \n", + "480 | \n", + "
| 1 | \n", + "female | \n", + "351 | \n", + "169 | \n", + "520 | \n", + "