Central Limit Theorem
The central limit theorem (CLT) states that, for a large enough sample (), the distribution of the sample mean will approach normal distribution. This holds for a sample of independent random variables from any distribution with a finite standard deviation.
Let be a random data set of size , that is, a sequence of independent and identically distributed random variables drawn from distributions of expected values given by and finite variances given by . The sample average is:
For large , the distribution of sample sums is close to normal distribution where:
Task A large elevator can transport a maximum of pounds. Suppose a load of cargo containing boxes must be transported via the elevator. The box weight of this type of cargo follows a distribution with a mean of pounds and a standard deviation of pounds. Based on this information, what is the probability that all boxes can be safely loaded into the freight elevator and transported?
import math
def less_than_boundary_cdf(x, mean, std):
return round(0.5 * (1 + math.erf((x - mean)/ (std * math.sqrt(2)))), 4)
m = int(input())
n = int(input())
mean = int(input())
devi = int(input())
print(less_than_boundary_cdf(m, n * mean, math.sqrt(n) * devi))
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 and a standard deviation of .
A few hours before the game starts, eager students line up to purchase last-minute tickets. If there are only tickets left, what is the probability that all students will be able to purchase tickets?
import math
def less_than_boundary_cdf(x, mean, std):
return round(0.5 * (1 + math.erf((x - mean)/ (std * math.sqrt(2)))), 4)
m = int(input())
n = int(input())
mean = float(input())
devi = float(input())
print(less_than_boundary_cdf(m, n * mean, math.sqrt(n) * devi))
Task You have a sample of values from a population with mean and with standard deviation . Compute the interval that covers the middle of the distribution of the sample mean; in other words, compute and such that . Use the value of . Note that is the z-score.
import math
zScore = 1.96
std = 80
n = 100
mean = 500
marginOfError = zScore * (std / math.sqrt(n));
print(mean - marginOfError)
print(mean + marginOfError)
The marginOfError formula can be found here.
Last updated