function steps = randomSteps(numTraj, numSteps, N, prob)

% Create a matrix of steps of 'numTraj' random walkers who make 'numSteps' 
% random steps forward (1) or backwards (-1).
% input:
%	numTraj = number of random walkers
%	numSteps = number of steps
%	N = random 32-bit integer
%	prob = probability of going forward (0.5 means equal probabilities)
% output:
%	steps = matrix [numTraj * numSteps] of steps (values -1 or 1)

% create a set of random numbers to init each trajectory with
% and multiply by N to rescale to 32-bit integers
initTraj = randomGenerator(numTraj,N) * N;

% create the output matrix
steps = zeros(numTraj, numSteps);

% fill the matrix with values -1 or 1 randomly 
for i=1:numTraj,
	steps(i,:) = randomGenerator(numSteps,initTraj(i));
	steps(i,:) = (steps(i,:) & (steps(i,:) < prob)) * 2 - 1;
end
