In [22]:
# #Python Library Imports
import numpy as np
from scipy import stats

Day 4: Normal Distribution #1

Objective

In this challenge, we practice solving problems with normally distributed variables.

Task

XX is a normally distributed variable with a mean of μ=30 and a standard deviation of σ=4. Find:

P(x<40)

P(x>21)

P(30<x<35)


In [24]:
# #Distribution
scipy.stats.norm(30, 4)


Out[24]:
<scipy.stats._distn_infrastructure.rv_frozen at 0x147ab668>

In [38]:
scipy.stats.norm(30, 4).cdf(40)


Out[38]:
0.99379033467422384

In [47]:
1 - scipy.stats.norm(30, 4).cdf(21)


Out[47]:
0.98777552734495533

In [48]:
scipy.stats.norm(30, 4).cdf(35) - scipy.stats.norm(30, 4).cdf(30)


Out[48]:
0.39435022633314465

Day 4: Normal Distribution #2

Objective

In this challenge, we practice solving problems with normally distributed variables.

Task

In a certain plant, the time taken to assemble a car is a random variable having a normal distribution with a mean of 20 hours and a standard deviation of 2 hours. What is the probability that a car can be assembled at this plant in:

Less than 19.5 hours?

Between 20 and 22 hours?


In [52]:
scipy.stats.norm(20, 2).cdf(19.5)


Out[52]:
0.4012936743170763

In [53]:
scipy.stats.norm(20, 2).cdf(22) - scipy.stats.norm(20, 2).cdf(20)


Out[53]:
0.34134474606854293

Day 4: The Central Limit Theorem #1

Objective

In this challenge, we practice solving problems based on the Central Limit Theorem.

Task

A large elevator can transport a maximum of 9800 pounds. Suppose a load of cargo containing 49 boxes must be transported via the elevator. The box weight of this type of cargo follows a distribution with a mean of µ=205 pounds and a standard deviation of σ=15 pounds. Based on this information, what is the probability that all 49 boxes can be safely loaded onto the freight elevator and transported?


In [54]:
# #Distribution
scipy.stats.norm(205, 15)


Out[54]:
<scipy.stats._distn_infrastructure.rv_frozen at 0x15956b70>

Normal Distribution with mean=0 and std. dev=1 x ~ N(0, 1)

Normal Distribution with mean=205 and std. dev=15 x ~ N(205, 15)

Normal Distribution with mean=205 and std. dev=15, multiplied by n samples nx ~ N(205n, 15*sqrt(n))


In [64]:
scipy.stats.norm(205*49, 15*7).cdf(9800)


Out[64]:
0.0098153286286453336

Day 4: The Central Limit Theorem #2

Objective

In this challenge, we practice solving problems based on the Central Limit Theorem.

Task

The number of tickets purchased by each student for the University X vs. University Y football game follows a distribution that has a mean of µ=2.4 and a standard deviation of σ=2.0.

Suppose that a few hours before the game starts, there are 100 eager students standing in line to purchase tickets. If there are only 250 tickets left, what is the probability that all 100 students will be able to purchase the tickets they want?


In [66]:
scipy.stats.norm(2.4*100, 2*10).cdf(250)


Out[66]:
0.69146246127401312

In [ ]: