a<-c(10, 2, 19, 24, 6, 23, 47, 24, 54, 77) n<-length(a) # now n is equal to the number of elements in a mean(a) 1/mean(1/a) # compute the harmonic mean prod(a)^(1/n) # compute the geometric mean b<-c(30,60) mean(b) 1/mean(1/b) c<-c(120,130,118) m<-length(c) round(mean(c),digits=2) round(prod(c)^(1/m),digits=2) g<-((9204/5000)^(1/3)-1)*100 round(g, digits=2)