From 9f4b6120ffa269ea832d7e96a22d487266a2c962 Mon Sep 17 00:00:00 2001 From: XinlyR Date: Sat, 12 Oct 2024 13:45:08 +0200 Subject: [PATCH 1/4] Lab_Solved_Xinly --- lab-intro-probability.ipynb | 174 ++++++++++++++++++++++++++++++------ 1 file changed, 148 insertions(+), 26 deletions(-) diff --git a/lab-intro-probability.ipynb b/lab-intro-probability.ipynb index 5893fc1..bbb19ea 100644 --- a/lab-intro-probability.ipynb +++ b/lab-intro-probability.ipynb @@ -38,11 +38,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ - "#code here" + "from scipy.stats import geom, binom, norm, expon,poisson\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of chance that the company have a seats for all passenger is: 1.0\n" + ] + } + ], + "source": [ + "n=450\n", + "p=0.97\n", + "\n", + "binom_dist=binom(n,p)\n", + "print(f\"The probability of chance that the company have a seats for all passenger is: {binom_dist.cdf(460)}\")" ] }, { @@ -72,11 +95,22 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 33, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of the representative needs to make at least three attempts before successfully resolving a customer complaint is: 0.657\n" + ] + } + ], "source": [ - "#code here" + "p=0.3\n", + "geom_dist=geom(p)\n", + "\n", + "print(f\"The probability of the representative needs to make at least three attempts before successfully resolving a customer complaint is: {geom_dist.cdf(3)}\")" ] }, { @@ -107,11 +141,22 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 43, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of the website server being overwhelmed handle up 550 vists per hour is: 0.01289822084039205\n" + ] + } + ], "source": [ - "#code here" + "mu = 500\n", + "poisson_dist = poisson(mu)\n", + "\n", + "print(f\"The probability of the website server being overwhelmed handling up 550 vists per hour is: {1-poisson_dist.cdf(550)}\")" ] }, { @@ -123,11 +168,23 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 73, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of the website server being overwhelmed after 24hours is: 0.0\n" + ] + } + ], "source": [ - "#code here" + "n=1\n", + "p=0.01289822084039205\n", + "binom_dist=binom(n,p)\n", + "binom_dist.pmf(24)\n", + "print(f\"The probability of the website server being overwhelmed after 24hours is: {1-binom_dist.cdf(24)}\")" ] }, { @@ -157,10 +214,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 49, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "0.3934693402873666" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mean_time=10\n", + "lambda_value = 1/mean_time\n", + "\n", + "lambda_inv = expon(scale = 1/lambda_value)\n", + "\n", + "lambda_inv.cdf(5)\n", + "print(f\"The probability of the next customer will arrive within the next 5 minutes is: {lambda_inv.cdf(5)}\")" + ] }, { "cell_type": "markdown", @@ -173,10 +249,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 54, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of no having any customer in 15 minutes to can take a break is: 0.3721000000000001\n" + ] + } + ], + "source": [ + "n=2\n", + "p=0.39\n", + "binom_dist=binom(n,p)\n", + "print(f\"The probability of no having any customer in 15 minutes to can take a break is: {binom_dist.pmf(0)}\")" + ] }, { "cell_type": "markdown", @@ -196,11 +285,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 79, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability that its weight is between 140 and 160 grams is: 0.6826894921370859\n" + ] + } + ], "source": [ - "#code here" + "\n", + "mean = 150\n", + "std = 10\n", + "\n", + "norm_dist = norm(loc = mean, scale = std)\n", + "print(f\"The probability that its weight is between 140 and 160 grams is: {(norm_dist.cdf(160))-(norm_dist.cdf(140))}\")" ] }, { @@ -219,17 +321,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 85, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability that the component fails within the first 30 hours is: 0.4511883639059735\n" + ] + } + ], "source": [ - "#code here" + "mean_time=50\n", + "lambda_value = 1/mean_time\n", + "\n", + "lambda_inv = expon(scale = 1/lambda_value)\n", + "\n", + "print(f\"The probability that the component fails within the first 30 hours is: {lambda_inv.cdf(30)}\")" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -243,9 +365,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.12.4" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } From a793b621b7cb5f4bcf9fa663a5fa4da70ed49524 Mon Sep 17 00:00:00 2001 From: XinlyR Date: Sat, 12 Oct 2024 13:59:01 +0200 Subject: [PATCH 2/4] Lab_Solved --- .../lab-intro-probability-checkpoint.ipynb | 382 ++++++++++++++++++ lab-intro-probability.ipynb | 41 +- 2 files changed, 407 insertions(+), 16 deletions(-) create mode 100644 .ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb diff --git a/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb b/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb new file mode 100644 index 0000000..820d4b3 --- /dev/null +++ b/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb @@ -0,0 +1,382 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Lab | Intro to Probability" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Objective**\n", + "\n", + "Welcome to this Intro to Probability lab, where we explore decision-making scenarios through the lens of probability and strategic analysis. In the business world, making informed decisions is crucial, especially when faced with uncertainties. This lab focuses on scenarios where probabilistic outcomes play a significant role in shaping strategies and outcomes. Students will engage in exercises that require assessing and choosing optimal paths based on data-driven insights. The goal is to enhance your skills by applying probability concepts to solve real-world problems." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Challenge 1**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Ironhack Airlines \n", + "\n", + "Often Airlines sell more tickets than they have seats available, this is called overbooking. Consider the following:\n", + "- A plane has 450 seats. \n", + "- Based on historical data we conclude that each individual passenger has a 3% chance of missing it's flight. \n", + "\n", + "If the Ironhack Airlines routinely sells 460 tickets, what is the chance that they have a seats for all passenger?" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "from scipy.stats import geom, binom, norm, expon,poisson\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of chance that the company have a seats for all passenger is: 1.0\n" + ] + } + ], + "source": [ + "n=450\n", + "p=0.97\n", + "\n", + "binom_dist=binom(n,p)\n", + "print(f\"The probability of chance that the company have a seats for all passenger is: {binom_dist.cdf(460)}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Challenge 2**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Ironhack Call Center " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Suppose a customer service representative at a call center is handling customer complaints. Consider the following:\n", + "- The probability of successfully resolving a customer complaint on the first attempt is 0.3. \n", + "\n", + "\n", + "What is the probability that the representative needs to make at least three attempts before successfully resolving a customer complaint?" + ] + }, + { + "cell_type": "code", + "execution_count": 87, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of the representative needs to make at least three attempts before successfully resolving a customer complaint is: 0.49\n" + ] + } + ], + "source": [ + "p=0.3\n", + "geom_dist=geom(p)\n", + "\n", + "print(f\"The probability of the representative needs to make at least three attempts before successfully resolving a customer complaint is: {1-geom_dist.cdf(2)}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Challenge 3**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Ironhack Website" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Consider a scenario related to Ironhack website traffic. Where:\n", + "- our website takes on average 500 visits per hour.\n", + "- the website's server is designed to handle up to 550 vists per hour.\n", + "\n", + "\n", + "What is the probability of the website server being overwhelmed?" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of the website server being overwhelmed handle up 550 vists per hour is: 0.01289822084039205\n" + ] + } + ], + "source": [ + "mu = 500\n", + "poisson_dist = poisson(mu)\n", + "\n", + "print(f\"The probability of the website server being overwhelmed handling up 550 vists per hour is: {1-poisson_dist.cdf(550)}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "What is the probability of being overwhelmed at some point during a day? (consider 24hours)" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of the website server being overwhelmed after 24hours is: 0.0\n" + ] + } + ], + "source": [ + "n=1\n", + "p=0.01289822084039205\n", + "binom_dist=binom(n,p)\n", + "binom_dist.pmf(24)\n", + "print(f\"The probability of the website server being overwhelmed after 24hours is: {1-binom_dist.cdf(24)}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of the website server being overwhelmed after 24hours is: 0.0\n" + ] + } + ], + "source": [ + "#Also it could be handle like:\n", + "\n", + "print(f\"The probability of the website server being overwhelmed after 24hours is: {1-(1-(1-poisson_dist.cdf(550)))**24}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Challenge 4**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Ironhack Helpdesk" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Consider a scenario related to the time between arrivals of customers at a service desk.\n", + "\n", + "On average, a customers arrives every 10minutes.\n", + "\n", + "What is the probability that the next customer will arrive within the next 5 minutes?" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.3934693402873666" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mean_time=10\n", + "lambda_value = 1/mean_time\n", + "\n", + "lambda_inv = expon(scale = 1/lambda_value)\n", + "\n", + "lambda_inv.cdf(5)\n", + "print(f\"The probability of the next customer will arrive within the next 5 minutes is: {lambda_inv.cdf(5)}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If there is no customer for 15minutes, employees can that a 5minutes break.\n", + "\n", + "What is the probability an employee taking a break?" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of no having any customer in 15 minutes to can take a break is: 0.7408182206817179\n" + ] + } + ], + "source": [ + "print(f\"The probability of no having any customer in 15 minutes to can take a break is: {1-lambda_inv.cdf(15)}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Challenge 5**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The weights of a certain species of birds follow a normal distribution with a mean weight of 150 grams and a standard deviation of 10 grams. \n", + "\n", + "- If we randomly select a bird, what is the probability that its weight is between 140 and 160 grams?" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability that its weight is between 140 and 160 grams is: 0.6826894921370859\n" + ] + } + ], + "source": [ + "\n", + "mean = 150\n", + "std = 10\n", + "\n", + "norm_dist = norm(loc = mean, scale = std)\n", + "print(f\"The probability that its weight is between 140 and 160 grams is: {(norm_dist.cdf(160))-(norm_dist.cdf(140))}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Challenge 6**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If the lifetime (in hours) of a certain electronic component follows an exponential distribution with a mean lifetime of 50 hours, what is the probability that the component fails within the first 30 hours?" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability that the component fails within the first 30 hours is: 0.4511883639059735\n" + ] + } + ], + "source": [ + "mean_time=50\n", + "lambda_value = 1/mean_time\n", + "\n", + "lambda_inv = expon(scale = 1/lambda_value)\n", + "\n", + "print(f\"The probability that the component fails within the first 30 hours is: {lambda_inv.cdf(30)}\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/lab-intro-probability.ipynb b/lab-intro-probability.ipynb index bbb19ea..820d4b3 100644 --- a/lab-intro-probability.ipynb +++ b/lab-intro-probability.ipynb @@ -95,14 +95,14 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 87, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "The probability of the representative needs to make at least three attempts before successfully resolving a customer complaint is: 0.657\n" + "The probability of the representative needs to make at least three attempts before successfully resolving a customer complaint is: 0.49\n" ] } ], @@ -110,7 +110,7 @@ "p=0.3\n", "geom_dist=geom(p)\n", "\n", - "print(f\"The probability of the representative needs to make at least three attempts before successfully resolving a customer complaint is: {geom_dist.cdf(3)}\")" + "print(f\"The probability of the representative needs to make at least three attempts before successfully resolving a customer complaint is: {1-geom_dist.cdf(2)}\")" ] }, { @@ -187,6 +187,25 @@ "print(f\"The probability of the website server being overwhelmed after 24hours is: {1-binom_dist.cdf(24)}\")" ] }, + { + "cell_type": "code", + "execution_count": 95, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The probability of the website server being overwhelmed after 24hours is: 0.0\n" + ] + } + ], + "source": [ + "#Also it could be handle like:\n", + "\n", + "print(f\"The probability of the website server being overwhelmed after 24hours is: {1-(1-(1-poisson_dist.cdf(550)))**24}\")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -249,22 +268,19 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 97, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "The probability of no having any customer in 15 minutes to can take a break is: 0.3721000000000001\n" + "The probability of no having any customer in 15 minutes to can take a break is: 0.7408182206817179\n" ] } ], "source": [ - "n=2\n", - "p=0.39\n", - "binom_dist=binom(n,p)\n", - "print(f\"The probability of no having any customer in 15 minutes to can take a break is: {binom_dist.pmf(0)}\")" + "print(f\"The probability of no having any customer in 15 minutes to can take a break is: {1-lambda_inv.cdf(15)}\")" ] }, { @@ -340,13 +356,6 @@ "\n", "print(f\"The probability that the component fails within the first 30 hours is: {lambda_inv.cdf(30)}\")" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { From e65775617966ac76b2dbf065e255cb810f111e35 Mon Sep 17 00:00:00 2001 From: XinlyR Date: Sat, 12 Oct 2024 14:02:37 +0200 Subject: [PATCH 3/4] Lab_sol --- .../lab-intro-probability-checkpoint.ipynb | 25 ++++++++++--------- lab-intro-probability.ipynb | 25 ++++++++++--------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb b/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb index 820d4b3..1eea2a0 100644 --- a/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb +++ b/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb @@ -7,6 +7,17 @@ "# Lab | Intro to Probability" ] }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "from scipy.stats import geom, binom, norm, expon,poisson\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -38,18 +49,7 @@ }, { "cell_type": "code", - "execution_count": 26, - "metadata": {}, - "outputs": [], - "source": [ - "from scipy.stats import geom, binom, norm, expon,poisson\n", - "import matplotlib.pyplot as plt\n", - "import numpy as np" - ] - }, - { - "cell_type": "code", - "execution_count": 19, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -61,6 +61,7 @@ } ], "source": [ + "#Challenge 1\n", "n=450\n", "p=0.97\n", "\n", diff --git a/lab-intro-probability.ipynb b/lab-intro-probability.ipynb index 820d4b3..1eea2a0 100644 --- a/lab-intro-probability.ipynb +++ b/lab-intro-probability.ipynb @@ -7,6 +7,17 @@ "# Lab | Intro to Probability" ] }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "from scipy.stats import geom, binom, norm, expon,poisson\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -38,18 +49,7 @@ }, { "cell_type": "code", - "execution_count": 26, - "metadata": {}, - "outputs": [], - "source": [ - "from scipy.stats import geom, binom, norm, expon,poisson\n", - "import matplotlib.pyplot as plt\n", - "import numpy as np" - ] - }, - { - "cell_type": "code", - "execution_count": 19, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -61,6 +61,7 @@ } ], "source": [ + "#Challenge 1\n", "n=450\n", "p=0.97\n", "\n", From 2ee82cc1ef846cca4d22ea39a516632acbbbf686 Mon Sep 17 00:00:00 2001 From: XinlyR Date: Sat, 12 Oct 2024 14:07:46 +0200 Subject: [PATCH 4/4] Lab_solved --- .ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb | 8 ++++---- lab-intro-probability.ipynb | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb b/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb index 1eea2a0..4ed2fd7 100644 --- a/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb +++ b/.ipynb_checkpoints/lab-intro-probability-checkpoint.ipynb @@ -49,24 +49,24 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "The probability of chance that the company have a seats for all passenger is: 1.0\n" + "The probability of chance that the company have a seats for all passenger is: 0.8844772466215431\n" ] } ], "source": [ "#Challenge 1\n", - "n=450\n", + "n=460\n", "p=0.97\n", "\n", "binom_dist=binom(n,p)\n", - "print(f\"The probability of chance that the company have a seats for all passenger is: {binom_dist.cdf(460)}\")" + "print(f\"The probability of chance that the company have a seats for all passenger is: {binom_dist.cdf(450)}\")" ] }, { diff --git a/lab-intro-probability.ipynb b/lab-intro-probability.ipynb index 1eea2a0..4ed2fd7 100644 --- a/lab-intro-probability.ipynb +++ b/lab-intro-probability.ipynb @@ -49,24 +49,24 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "The probability of chance that the company have a seats for all passenger is: 1.0\n" + "The probability of chance that the company have a seats for all passenger is: 0.8844772466215431\n" ] } ], "source": [ "#Challenge 1\n", - "n=450\n", + "n=460\n", "p=0.97\n", "\n", "binom_dist=binom(n,p)\n", - "print(f\"The probability of chance that the company have a seats for all passenger is: {binom_dist.cdf(460)}\")" + "print(f\"The probability of chance that the company have a seats for all passenger is: {binom_dist.cdf(450)}\")" ] }, {