(Simulaciones en R Project)
INGENIERIA TELEMATICA
ITSA
Barranquilla
2012
c) desviacin estndar
d) Muestre el histograma.
Solucin:
> rhyper(100,100,100,100)
[1] 54 54 46 52 52 47 55 50 50 54 47 56 52 45 51 54 44 48 45
51 54 50 47 44 54 47 49 48 45 50 49 52 55 53 56 52 52 54 55 54
50 53 51 47 50 52 56 55 46
[50] 46 44 50 54 48 54 48 49 49 48 49 48 53 44 45 49 47 49 45
51 48 55 45 50 51 55 50 49 56 44 48 53 43 51 55 50 50 56 51 54
56 47 44 47 49 53 48 49 46
[99] 50 56
> x<-rhyper(100,100,100,100)
> mean(x)
[1] 49.33
> median(x)
[1] 49
> var(x)
[1] 11.43545
> sd(x)
[1] 3.381635
> hist(x)
15
10
0
Frequency
20
Histogram of x
40
45
50
55
Solucin:
> m5<-dpois(20,0.5)
> m5
[1] 2.377542e-25
> y5<-pbinom(20,1,0.5)
> y5
[1] 1
>
>
> m3<-dpois(20,0.3)
> m3
[1] 1.061725e-29
> y3<-pbinom(20,1,0.3)
> y3
[1] 1
>
>
> m1<-dpois(20,0.1)
> m1
[1] 3.719169e-39
> y1<-pbinom(20,1,0.1)
> y1
[1] 1
>
>
> m01<-dpois(20,0.01)
> m01
[1] 4.069419e-59
> y01<-pbinom(20,1,0.01)
> y01
[1] 1
Solucin:
> dpois(6,3.7)
[1] 0.08810251
> ppois(2,3.7,lower.tail=TRUE)
[1] 0.2854331
> ppois(8,3.7,lower.tail=FALSE)
[1] 0.01370281
> qpois(0.9,3.7)
[1] 6
> rpois(20,3.7)
[1]
7 3
3 11
> b<-rbinom(10000,20,0.3)
> length(b[b<=5])/length(b)
[1] 0.4193
> pbinom(5,20,0.3)
[1] 0.4163708
> sum(b==5)/length(b)
[1] 0.1836
> dbinom(5,20,0.3)
[1] 0.1788631
> mean(b)
[1] 6.0118
> var(b)
[1] 4.218883
Solucin:
Solucin:
> options(width=70)
> valores<-rnorm(100,0,1)
> valores
[1] 1.610834725 -0.120513584
-2.397525625
[6] 0.218823247 0.515475309
-1.296140906
[11] -0.783499093 0.887737649
0.250866614
[16] 0.999535518 0.562681584
-0.938656682
[21] -1.182074363 -1.205409249
-0.086514694
[26] -0.838512473 0.103140618
0.472914552
[31] -0.385427614 -0.804631797
0.315305882
[36] 0.669006429 -0.480776146
-0.144503821
[41] 0.403930177 1.104436419
1.022099576
[46] 2.167428854 0.502238217
-0.823887532
[51] -1.465364302 1.400497343
0.387351990
-0.028883183 -0.529524379
-0.601043795 -0.878162827
0.625801238
0.385770838
-0.526651712
0.112171212
-0.531437134 -0.241513269
-1.371772851
0.653244177
-0.262845774 -0.736978493
-0.708516608 -0.034153701
-0.394638650 -1.433864620
1.684502960 -1.823733366
-0.021012014
1.639587046
-1.656037568 -0.141774240
1.296042071
0.577651961
-1.743209626
1.144473014
1.230889991
1.563780520
-0.398460466 -0.157387758
-0.774596111 -0.754308412
-0.432356456
0.691421225
-0.040685059
0.766139934
-2.084922677
0.167398744
0.2
0.0
0.1
Density
0.3
0.4
Histogram of valores
-2
-1
valores