all,
I wrote the following function for Q1(a), and got the obviously wrong answer.
any idea as to what I did wrong?
sims<-1000
people<-5
pool<-seq(1,100,1)
same<-0
for(i in 1:sims){
+ comm<-sample(pool, people, replace=FALSE)
+ if(length(unique(comm))<people)
+ same<-same+1}
cat("probability of =5 people being in the same
committee:", same/sims, "\n")
probability of >=5 people being in
the same committee: 0
yongwook
-----------------------------
Yongwook Ryu
PhD Candidate
Department of Government
Harvard University
Tel:617-493-3397
Email: yryu(a)fas.harvard.edu
-----------------------------