clear all
clc
X=[1 2 3.5 4 7 7.3 8.6 12.4 13.8 18.1];
n1 = length(X);
B= [25 50 100 200 500 2000 5000];
m1 = length(B);


for i=1:m1
	for j=1:B(i)
		u1 = randint(1,n1,[1,n1]);	
		for k=1:n1
			x2(k) = X(u1(k));
		end
	x2 = sort(x2);
	x3 = x2(3:n1-2);
	mean_x3(j) = mean(x3);
    end
sd_1(i) = std(mean_x3);
end;
mean_x3(end)
sd_1(end)
figure(1)
plot(sd_1);


B2= [25 50 100 200 500 1000 2000 3000 4000 5000 10000];
m2 = length(B2);
u2 = rand(1,100);

for i=1:m2
	for j=1:B2(i)
		u1 = randint(1,n1,[1,n1]);	
		for k=1:n1
			x2(k) = u2(u1(k));
		end
	x2 = sort(x2);
	x3 = x2(3:n1-2);
	mean_x3(j) = mean(x3);
	end

sd_2(i) = std(mean_x3);
end;

figure(2)
plot(sd_2);

