Soit \(X_A\) (resp. \(X_B\)) le nombre de germinations de la variété A (resp. B).
On a \(X_A\sim\mathcal{B}(20,.2)\) et \(X_B\sim\mathcal{B}(40,.1)\).
\(\Pr(3\leq X_A\leq 5)\)
require(dplyr)
## Loading required package: dplyr
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
(pbinom(5,20,.2)-pbinom(2,20,.2))%>%round(4)
## [1] 0.5981
\(\Pr( X_B\geq 5)=\Pr( X_B> 4)\)
pbinom(4,40,.1,lower.tail = F)%>%round(4)
## [1] 0.371
\(\Pr( X_B= 6)=\) 0.1068.
dbinom(6,40,.1)%>%round(4)
## [1] 0.1068
On veut calculer \[ \Pr(X_A=X_B)=\sum_{x=0}^{20}\Pr(X_A=x)\Pr(X_B=x) \]
dbinom(0:20,20,0.2)%*%dbinom(0:20,40,0.1)%>%round(4)
## [,1]
## [1,] 0.1537
On veut calculer \[ \Pr(X_A>X_B)=\sum_{x=1}^{20}\Pr(X_A=x)\Pr(X_B\leq x-1) \]
dbinom(1:20,20,.2)%*%pbinom(0:19,40,.1)%>%round(4)
## [,1]
## [1,] 0.4266
Seconde méthode \[ \Pr(X_A>X_B)=\sum_{x=0}^{19}\Pr(X_A>x)\Pr(X_B= x) \]
pbinom(0:19,20,0.2,lower.tail = F)%*%dbinom(0:19,40,0.1)%>%round(4)
## [,1]
## [1,] 0.4266
On veut calculer \[ \Pr(X_B>X_A)=\sum_{x=1}^{40}\Pr(X_A\leq x-1)\Pr(X_B= x) \]
pbinom(0:39,20,0.2)%*%dbinom(1:40,40,0.1)%>%round(4)
## [,1]
## [1,] 0.4197
Seconde méthode \[ \Pr(X_B>X_A)=\sum_{x=0}^{20}\Pr(X_A= x)\Pr(X_B>x) \]
dbinom(0:20,20,0.2)%*%pbinom(0:20,40,0.1,lower.tail = F)%>%round(4)
## [,1]
## [1,] 0.4197
\[ \Pr(X_B>10)\geq 0.99 \] On cherche par dichotomie
pbinom(10,197,0.1,lower.tail = F)
## [1] 0.9904094
On trouve \(197\) graines.
\(D\sim \mathcal{N}(10000,600)\).
\(\Pr(D>11000)\)
pnorm(11000,10000,600,lower.tail = F)%>%round(4)
## [1] 0.0478
\(\Pr(9000<D<10400)\)
(pnorm(10400,10000,600)-pnorm(9000,10000,600))%>%round(4)
## [1] 0.6997
Soit \(N\) le nombre de machines qui durent plus longtemps que 10500. Elle suit une loi binomiale de paramètres \(n=10\) et de probabilité \(p=\Pr(D>10500)\). On cherche \(\Pr(N\geq 2)=\Pr(N> 1)\).
p=pnorm(10500,10000,600,lower.tail=F)
pbinom(1,10,p,lower.tail=F)%>%round(4)
## [1] 0.6312
\(\Pr(D>x)=0.1\)
qnorm(0.1,10000,600,lower.tail = F)%>%round()
## [1] 10769
\(\Pr(D<x)=0.1\)
qnorm(0.1,10000,600,lower.tail = T)%>%round()
## [1] 9231
library(readxl)
Exercice3 <- read_excel("Exercice3.xlsx")
Exercice3$Cost=8*Exercice3$Temps
head(Exercice3)
hist(Exercice3$Cost)
Test<-t.test(Exercice3$Cost,conf.level = 0.95)
Test$conf.int
## [1] 54.85957 55.68976
## attr(,"conf.level")
## [1] 0.95
Hyptest<-t.test(Exercice3$Cost,mu=55,alternative = "greater")
Hyptest$p.value
## [1] 0.09570724
Comme la p-value est supérieure à 5%, on ne rejette par l’hypothèse nulle. Il n’y a pas suffisamment de preuve statistique pour conclure qu’en moyenne, le coût d’une livraison est supérieure à 55 euros.