function [random_sample_space,random_distribution] = generate_random_experiment( experiment_bound )
%GENERATE_RANDOM_EXPERIMENT makes a type of bounded random experiment
%   experiment_bound is a bound on the sample space.

%the sample space is created to be the integers between 1 and the bound of
%the experiment.
random_sample_space=1:experiment_bound;

%we then create a distribution on this sample space. The following
%initializes a distribution to all zeros. As we go along,
%random_distribution(i) will be the distribution function at the element of
%the sample space random_distribution(i)
random_distribution=zeros(size(random_sample_space));

%this the actual experiment. It's not entirely random (a "more" random
%experiment is possible. This is sufficient for demonstration purposes
%however. The general idea is that we create an array the same size as
%random_sample_space, and assigne to each of it's entry a random number
%between 1 and experiment_bound. This is the experiment
experiment=randi(experiment_bound,experiment_bound,1);

%this now creates a distribution. In general random_distribution(i) is the
%proprotion of times that i appeared in experiment.
for i=1:experiment_bound
    random_distribution(i)=numel(find(experiment==i))/length(random_sample_space);
end


end

