I have mac osx and tried installing scilab and octave for the past 2 hours and hasn't worked... here are the programs, thanks..
1.
nsamples=100;
n = 225;
a = 1;
b = 2;
data = -3+9*rand(nsamples, n);
cMean = mean(data, 2);
answer_1a = sum(cMean > a & cMean < b)/nsamples
answer_1b = mean(cMean)
answer_1c = std(cMean, 1)
hist(cMean);
title('Generating 100 Samples of Size 225 Simulated U(-3,6) Random Numbers Histogram Question 1 Part d)');
xlabel('Z');
ylabel('Frequency');
2.
nsamples=400;
n = 625;
a = 3;
b = 5;
lambda = 0.2;
data = -log(rand(nsamples, n)) / lambda;
cMean = mean(data, 2);
answer_2a = sum(cMean > a & cMean < b)/nsamples
answer_2b = mean(cMean)
answer_2c = std(cMean, 1)
hist(cMean);
title('Generating 400 Samples of Size 625 Simulated Lambda = 0.2 Random Numbers Histogram Question 2 Part d)');
xlabel('Z');
ylabel('Frequency');