%prob1
clear all

T_1 = [1, 0.1, 0.01, 0.001];
n1=size(T_1);

for j=1:4;
	alpha_1 = 1.0;
	T = T_1(j);
	s_1 = sqrt(T)*alpha_1;
	n=10/T;
	t_1 = (0:s_1:n*s_1);
	
	
	random_u = random('uniform',0,1,1,n+1);
	score = zeros(1,n+1);
	
	for k=1:n+1;
		if random_u(k) <=0.5;
			score(k) = -1;
		else
			score(k) = 1;
		end;
	end;


sum_1 = score(1,n+1);

for m=2:n+1;
	sum_1(m) = sum(score(1:m))*s_1;
end;

figure(j);
stairs(t_1,sum_1);
xlabel('time')
ylabel('x_t')
title(['Total ' int2str(n) ' Step random walk']);
hold off;
saveas(figure(j),['Total Step random walk ' int2str(n) '.png'])
end;
