close all;
clear all;

% this code check basic Random Number Generators (RNGs)

% number of points (random numbers) to be created
n = 10000;

% uniform in [0,1]
y = rand(1,n);
figure(1);
hist(y);
title('"n" Random Numbers: Uniform');

% normal distribution
y1 = randn(1,n);
figure(2);
hist(y1);
title('"n" Random Numbers: Normal');

% The following code demonstrates a method for generating
% random numbers between (a) and (b). 
% The round function is used to round the number to the closest
% whole number.
a = 0;
b = 20;
y2 = round(a + (b-a) * rand(1,n));
figure(3);
hist(y2);
title('"n" Random Numbers: Normal between "a" and "b"');
