Escolar Documentos
Profissional Documentos
Cultura Documentos
3-76 Let the random variable X have a discrete uniform distribution on the
integers 0X99. Determine the mean and variance of X
x=seq(0,99,1)
mean(x)
sd(x)
----------------
mean(x) = 49.5
sd (x)=29.01149
3-77 Let the random X have a discrete uniform distribution on the integers
1X3. Determine the mean and variance of X
x=seq(1,3,1)
mean(x)
sd(x)
----------
mean(x)= 2
sd(x)= 1
x=seq(0.15,0.19,1)
mean(x)
sd(x)
----------------
mean(x)= 0.15
sd(x)= NA
1
DISTRIBUCIN BINOMIAL
3-92 Let X be a binomial random variable with p=0.2 and n=20. Use the
binomial table in Appendix A to determine the following probabilities.
a) P(X3)
prob1<-sum(dbinom(0:3,20,0.2))
prob1
-------------
prob1= 0.4114489
b) P(X>10)
prob2<-sum(dbinom(0:9,20,0.2))
1-prob2
-----------------------
1-prob2= 0.002594827
c) P(X=6)
dbinom(6,20,0.2)
----------------
0.1090997
d) P(6x11)
prob3=pbinom(11,20,0.2)-pbinom(5,20,0.2)
prob3
--------------------
prob3= 0.1956905
3-93 Let X be a binomial random variable with p=0.1 and n=10. Calculate the
following probabilities from the binomial probability mass function and from the
binomial table in Appendix A and compare results.
a) P(X2)
prob1<-sum(dbinom(0:2,10,0.1))
prob1
------------------
prob1= 0.9298092
b) P(X>8)
prob2<-sum(dbinom(0:7,10,0.1))
1-prob2
-----------------------
1-prob2= 3.736e-07
2
c) P(X=4)
dbinom(4,10,0.1)
----------------
0.01116026
d) P(5x7)
prob3=pbinom(7,10,0.1)-pbinom(4,10,0.1)
prob3
--------------------
prob3= 0.001634564
3
DISTRIBUCIN GEOMTRICA Y BINOMIAL NEGATIVA
3-120 Suppose that the random variable X has a geometric distribution with a
mean of 2.5. Determine the following probabilities:
a) P(X=1)
dgeom(0,(1/2.5))
----------------------
0.4
b) P(X=4)
dgeom(3,(1/2.5))
-------------------------
0.0864
c) P(X=5)
dgeom(4,(1/2.5))
---------------------------
0.05184
d) P(X3)
e) P(X>3)
other form
1- (dgeom(0, (1/2.5))+dgeom(1, (1/2.5))+dgeom(2, (1/2.5)))
----------------------------------------------
0.216
3-122 Suppose that X is a negative binomial random variable with p=0.2 and
r=4. Determine the following:
a) E(X)
(4/0.2)
----------------
20
b) P(X=20)
dnbinom(20-4,4,prob=0.2)
--------------
4
0.04363988
c) P(X=19)
dnbinom(19-4,4,prob=0.2)
--------------------------
0.04593672
d) P(X=21)
dnbinom(21-4,4,prob=0.2)
-----------------
0.04107283
5
DISTRIBUCIN POISSON
a) P(X=0)
dpois(0,4)
------------------------
0.01831564
b) P(X2)
prob<-ppois(2,4)
prob
-------------------------
0.2381033
c) P(X=4)
dpois(4,4)
----------------------
0.1953668
d) P(X=8)
dpois(8,4)
------------------------
0.02977018
6
Poisson Distribution: Mean=4
0.20
0.15
Probability Mass
0.10
0.05
0.00
0 2 4 6 8 10 12
3-158 Suppose that X has a Poisson distribution with a mean of 0.4. Determine
the following probabilities, ms grfica:
a) P(X=0)
dpois(0,0.4)
------------------------
0.67032
b) P(X2)
prob<-ppois(2,0.4)
prob
---------------------------
0.9920737
c) P(X=4)
dpois(4,0.4)
---------------------
0.000715008
7
d) P(X=8)
dpois(8,0.4)
-----------------------------
1.089536e-08
0.4
0.3
0.2
0.1
0.0
0 1 2 3 4
3-160 The number of telephone calls that arrive at pone exchange is often
modeled as a Poisson random variable. Assume that on the average there are
10 calls per hour.
a) What is the probability that there are exactly 5 calls in one hour?
dpois(5,10)
----------------------
0.03783327
b) What is the probability that there are 3 or fewer calls in one hour?
dpois(3,10)
8
---------------------
0.007566655
c) What is the probability that there are exactly 15 calls in two hours?
dpois(15,20)
-----------------------
0.05164885
9
CASO 2 DISTRIBUCIN POISSON
a) Menos de 4 huracanes
ppois(3,6)
------------------
0.1512039
b) Entre 6 y 8 huracanes
p=ppois(8,6)-ppois(5,6)
p
------------------------------
0.4015579
0.10
0.05
0.00
0 5 10 15
10
CASO 3 DISTRIBUCIN HIPERGEOMTRICA
dhyper(0:2,11,4,2)
------------------------
0.05714286 0.41904762 0.52380952
data.frame(prob=dhyper(0:2,11,4,2))
-------------------------------
prob
1 0.05714286
2 0.41904762
3 0.52380952
0.3
0.2
0.1
11
dhyper(0:1,10,3,2)
--------------------------------
0.03846154 0.38461538
12
DISTRIBUCIN DE FUNCIONES ACUMULATIVAS (FALTA RESOLVER NO
SE ENTENDIO)
4-35 Suppose that f(x)=0.25 for 0<x<4. Determine the mean and variance of X.
4-36 Suppose that f(x)=0.125 for 0<x<4. Determine the mean and variance of
X.
4-50 Suppose that X has a continuous uniform distribution over the interval
[1..5,5.5]. Determine the following:
13
VARIABLE ALEATORIA CONTINUA-DISTRIBUCIN NORMAL
4-72 The time until recharge for a battery in a laptop computer under common
conditions is normally distributed with a mean of 260 minutes and a standard
deviation of 50 minutes.
a) What is the probability that a battery lasts more than four hours?
prob<-pnorm(4,260,50)
1-prob
----------------------------
0.9999998
b) What are the quartiles (the 25% and 75% values) of battery life?
qnorm(0.25,260,50)
qnorm(0.75,260,50)
-----------------------------
226.2755
293.7245
qnorm(0.96,260,50)
-----------------------
347.5343
14
INFERENCIA CLSICA EN POBLACIONES NORMALES
15
c) Para un nivel de confianza del 99% contraste si la media de la altura de las
mujeres es mayor o igual a 173 cms y la de los hombres menor o igual a 175
cms. Puede indicar la razn de este aparente contrasentido?
Cadiz<-scan ()
Malaga<-scan()
16
var.test (Cadiz, Malaga)
antes<-scan()
despus<-scan()
t.test(antes,despues,var.equal=T,conf.level=0.90)
------------------------------------------
Two Sample t-test
17
mean of x mean of y
217.1 206.5
5.4 Una fbrica produce barras de hierro cuya longitud sigue una distribucin
Normal. A partir de la muestra:
prodbarr<-scan()
t.test(prodbarr,var.equal=T,conf.level=0.90)
----------------------------------
One Sample t-test
data: prodbarr
t = 435.44, df = 9, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
90 percent confidence interval:
100.1466 100.9934
sample estimates:
mean of x
100.57
prodbarr2<-scan()
t.test(prodbarr2,var.equal=T,conf.level=0.90)
-----------------------------------------------
One Sample t-test
data: prodbarr2
t = 276.11, df = 9, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
90 percent confidence interval:
99.07782 100.40218
sample estimates:
mean of x
99.74
Si existe cambio en la longitud media de la barra una diferencia de 0.83 con
respecto a la anterior
18
5.5 Una empresa de transporte de mercancas tiene dos oficinas en una
determinada ciudad. Al objeto de asignar un nuevo trabajador a una de las dos
oficinas, la direccin de la empresa decide analizar la productividad de cada
una de ellas, contabilizndose las facturaciones en los ltimos doce meses
(miles de euros).
ofi1<-scan()
of2<-scan()
t.test(of1,of2,alternative="g",conf.level=0.95, paired=T)
-------------------------------------------
Paired t-test
5.6 Una empresa le propone al director de una fbrica un nuevo mtodo que,
supuestamente, reduce el tiempo empleado en el montaje de uno de sus
productos. Con el propsito de comparar tal mtodo con el empleado
habitualmente, seleccion aleatoriamente a siete de sus empleados para que
llevasen a cabo el montaje con los dos sistemas y anoto los tiempos
empleados en el montaje, obteniendo los siguientes resultados:
19
methab<-scan()
metnuev<-scan()
t.test(methab,metnuev,alternative="g",conf.level=0.95, paired=T)
t.test(methab,metnuev,alternative="g",conf.level=0.85, paired=T,mu=2)
---------------------------------------------------
Paired t-test
Paired t-test
20
INFERENCIA NO PARAMTRICA.
shapiro.test(Datasetcaracol$Separ)
------------------------------------
Shapiro-Wilk normality test
data: Datasetcaracol$Separ
W = 0.84025, p-value = 0.003675
aleord<-scan()
shapiro.test(aleord)
------------------------------
Shapiro-Wilk normality test
data: aleord
W = 0.31281, p-value = 5.178e-07
21
22