n=100
p<-0.5
x<-0:n
y<-dbinom(x,n,p)
plot(x,y,type = "l")# Theoreme de la limite centrale
# Probabilites avec la Loi Uniforme
punif(0.7,0,1)
## [1] 0.7
punif(13,10,20) # pour calculer le Probabilite r
## [1] 0.3
x=seq(0,1,0.01) # Loi uniform de la 0 a 1
y=dunif(x,0,1) # pour calculer la Densite d
plot(x,y,type = "l")
x=seq(0,30,0.01) # Loi uniform de la 0 a 1
y=dunif(x,10,20)
plot(x,y,type = "l")
Suppose that the daily demand for regular gasoline at another gas station is normally distributed with a mean of 1,000 gallons and a standard deviation of 100 gallons. The station manager has just opened the station for business and notes that there is exactly 1,100 gallons of regular gasoline in storage. The next delivery is scheduled later today at the close of business. The manager would like to know the probability that he will have enough regular gasoline to satisfy today’s demands.
library(magrittr) ## Utiliser des pipes %>% C est tres pratique
pnorm(1100,1000,100) %>%
round(4) ## Le calcul avec la loi Z, loi normale centree (mu=0) reduite (sigma=1)
## [1] 0.8413
pnorm(1,0,1) %>%
round(4)
## [1] 0.8413
pnorm(1,0,1) %>% ## Si on ne met pas les arguments , se serra Z.
round(4)
## [1] 0.8413
Consider an investment whose return is normally distributed with a mean of 10% and a standard deviation of 5%.
\(X\sim \mathcal {N} (.1,0.05)\). On veut calculer \(\Pr(X<0)\).
pnorm(0,0.1,0.05) %>%
round(4)
## [1] 0.0228
pnorm(0,10,5) %>%
round(4)
## [1] 0.0228
pnorm((0-0.1)/0.05) %>%
round(4)
## [1] 0.0228
pnorm(0,10,10) %>%
round(4)
## [1] 0.1587
qnorm(0.9750)
## [1] 1.959964
Find the value of a standard normal random variable such that the probability that the random variable is greater than it is 5%.
*On veut calculer \(z_{0.05}\)
qnorm(0.05, lower.tail = FALSE) %>%
round(3)
## [1] 1.645
qnorm(0.05, lower.tail = TRUE) %>%
round(3)
## [1] -1.645
Find the value of a standard normal random variable such that the probability that the random variable is less than it is 5%.
qnorm(0.95, lower.tail = FALSE) %>%
round(3)
## [1] -1.645
qnorm(0.95, lower.tail = TRUE) %>%
round(3)
## [1] 1.645
A university has just approved a new Executive MBA Program. The new director believes that to maintain the prestigious image of the business school, the new program must be seen as having high standards.
Accordingly, the Faculty Council decides that one of the entrance requirements will be that applicants must score in the top 1% of Graduate Management Admission Test (GMAT) scores. The director knows that GMAT scores are normally distributed with a mean of 490 and a standard deviation of 61. The only thing she doesn’t know is what the minimum GMAT score for admission should be.
qnorm(0.01,490,61, lower.tail = FALSE) %>%
round(0)
## [1] 632
490+(qnorm(0.01,lower.tail = FALSE)*61)
## [1] 631.9072
During the spring, the demand for electric fans at a large home-improvement store is quite strong. The company tracks inventory using a computer system so that it know show many fans are in the inventory at any time. The policy is to order a new shipment of 250 fans when the inventory level falls to the reorder point, which is 150. However, this policy has resulted in frequent shortages and thus lost sales because both lead timeand demand are highly variable.
The manager would like to reduce the incidence of shortages so that only 5% of orders will arrive after inventory drops to 0 (resulting in a shortage). This policy is expressed as a 95% service level. From previous periods, the company has determined that demand during lead time is normally distributed with a mean of 200 and a standard deviation of 50. Find the reorder point.
qnorm(5000,5100,200,lower.tail = FALSE)
## Warning in qnorm(5000, 5100, 200, lower.tail = FALSE): NaNs produced
## [1] NaN
The lifetimes of lightbulbs that are advertised to last for 5,000 hours are normally distributed with a mean of 5,100 hours and a standard deviation of 200 hours. What is the probability that a bulb lasts longer than the advertised figure?
pnorm(5000,5100,200,lower.tail = FALSE)
## [1] 0.6914625
Because of the relatively high interest rates, most consumers attempt to pay off their credit card bills promptly. However, this is not always possible. An analysis of the amount of interest paid monthly by a bank’s Visa cardholders reveals that the amount is normally distributed with a mean of $27 and a standard deviation of $7.
*a. What proportion of the bank’s Visa cardholders pay more than $30 in interest?
pnorm(30,27,7,lower.tail = FALSE)
## [1] 0.3341176
*b. What proportion of the bank’s Visa cardholders pay more than $40 in interest?
pnorm(40,27,7,lower.tail = FALSE)
## [1] 0.03164542
*c. What proportion of the bank’s Visa cardholders pay less than $15 in interest?
pnorm(15,27,7,lower.tail = TRUE)
## [1] 0.04323813
*d. What interest payment is exceeded by only 20% of the bank’s Visa cardholders?
(30-27)/7
## [1] 0.4285714
qnorm(0.4285,27,7,lower.tail = FALSE)
## [1] 28.26136