This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library(MASS) | |
| Ybar=72 | |
| yrvec<-c() | |
| ratvec<-c() | |
| for(i in 1:500) | |
| { | |
| df<-data.frame(mvrnorm(n=50,mu=c(60,71),Sigma=matrix(c(186,142,142,117),2,2),empirical=TRUE)) | |
| xnbar<-mean(df[,1]) | |
| a<-sample.int(50,10) | |
| df=df[-a,] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library(combinat) | |
| library(readxl) | |
| bookdata <- read_excel("Math notemos/Rstudio/bookdata.xlsx", | |
| + col_names = FALSE) | |
| data<-data.frame(matrix(unlist(bookdata),nrow=9,byrow=F)) | |
| combinations <- combn(nrow(data), 3, function(x,data) data[x,], | |
| simplify = FALSE, data =data) | |
| Ybar<-mean(data[,2]) | |
| n1<-ncol(combn(nrow(data),3)) | |
| yrvec<-c() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #we use in-built data-set faithful for this example | |
| s<-sample(1:nrow(faithful),30) | |
| sampled.x<-faithful$eruptions[s] | |
| sampled.y<-faithful$waiting[s] | |
| sample<-cbind(sampled.x,sampled.y) | |
| sample | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #generating population data | |
| library(MASS) | |
| data1<-data.frame(mvrnorm(n=10,mu=c(20,25), | |
| Sigma=matrix(c(1,0.94,0.94,1),2,2),empirical=TRUE)) | |
| colnames(data1)=c("X","Y") | |
| scatter.smooth(data1$X,data1$Y, xlab="X", ylab="Y",main="X vs Y graph") | |
| #finding population values | |
| pmeans<-colMeans(data1) | |
| Xbar<-pmeans[1] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library(MASS) | |
| data1<-data.frame(mvrnorm(n=10,mu=c(20,25),Sigma=matrix(c(2.5,0.94,0.94,2.3),2,2),empirical=TRUE)) | |
| colnames(data1)=c("X","Y") | |
| pmeans<-colMeans(data1) | |
| Xbar<-pmeans[1] | |
| Ybar<-pmeans[2] | |
| xvec<-c() | |
| yvec<-c() | |
| xstarvec<-c() | |
| ydrvec<-c() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<stdio.h> | |
| #include<math.h> | |
| int main() | |
| { | |
| int n,i,j,k,m=65,to[15],tp[15],tm[15],ver,sn[15],en[15],task[20][20], a[20][20],fp[15],bp[15],ca[15],nca,ef[15],lf[15]; | |
| char tname[20]; | |
| float te[15],pv=0.0,psd,u,v[15],ct,gt,zo,gp,prob; | |
| printf("\nEnter no. of tasks: "); | |
| scanf("%d",&n); | |
| printf("\nEnter optimistic time, pessimistic time and most likely time for each task:\n"); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<stdio.h> | |
| #include<stdlib.h> | |
| int main() | |
| { | |
| int i,x[100],a[100],m,N,n,u,v; | |
| printf("\nEnter the number of units in population: "); | |
| scanf("%d",&N); | |
| printf("\nEnter the number of units to be selected in the sample: "); | |
| scanf("%d",&n); | |
| printf("\nEnter the sizes of units: "); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<stdio.h> | |
| #include<stdlib.h> | |
| int main() | |
| { | |
| int i,x[100],m,N,n,u,v; | |
| printf("\nEnter the number of units in population: "); | |
| scanf("%d",&N); | |
| printf("\nEnter the number of units to be selected in the sample: "); | |
| scanf("%d",&n); | |
| printf("\nEnter the sizes of units: "); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<stdio.h> | |
| #include<stdlib.h> | |
| int main() | |
| { | |
| int i,x[100],c[100],a[100],X=0,N,n,r; | |
| printf("\nEnter the number of units in population: "); | |
| scanf("%d",&N); | |
| printf("\nEnter the number of units to be selected in the sample: "); | |
| scanf("%d",&n); | |
| printf("\nEnter the sizes of units: "); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<stdio.h> | |
| #include<stdlib.h> | |
| int main() | |
| { | |
| int i,x[100],c[100],X=0,N,n,r; | |
| printf("\nEnter the number of units in population: "); | |
| scanf("%d",&N); | |
| printf("\nEnter the number of units to be selected in the sample: "); | |
| scanf("%d",&n); | |
| printf("\nEnter the sizes of units: "); | 
NewerOlder