[adsense:responsibe:9545213979]
Tendremos que utilizar el package prob del R-Project
Simulacion:
> library(prob) > L <- c("P1","P2","P3","P4","P5"); > M <- urnsamples(L, size=3, replace = FALSE, ordered = FALSE); > N <- probspace(M);
> N X1 X2 X3 probs 1 P1 P2 P3 0.1 2 P1 P2 P4 0.1 3 P1 P2 P5 0.1 4 P1 P3 P4 0.1 5 P1 P3 P5 0.1 6 P1 P4 P5 0.1 7 P2 P3 P4 0.1 8 P2 P3 P5 0.1 9 P2 P4 P5 0.1 10 P3 P4 P5 0.1 > A <- subset(N,(X1=="P1")|(X2=="P1")|(X3=="P1")) > B <- subset(N,(X1=="P2")|(X2=="P2")|(X3=="P3")) > C <- subset(N,(X1=="P3")|(X2=="P3")|(X3=="P3") > #Probabilidad de que esten las tres personas en el jurado. > prob(intersect(A,intersect(B,C))) [1] 0.1 > #Probabilidad de que este una persona en el jurado. > prob(A) [1] 0.6
Comentarios recientes