function [ indx, seed ] = florida_sample_pop ( n, cdf, seed )

%*****************************************************************************80
%
%% FLORIDA_SAMPLE_POP randomly samples the Florida population data.
%
%  Discussion:
%
%    M census districts have been given, and for each district,
%    a total population was listed.
%
%    A CDF vector CDF(1:M+1) was created, such that CDF(I) is the probability
%    that a person resides in a district of index less than or equal to I.
%
%    We now ask for N random samples of the population, which means we will
%    return N values I between 1 and M, selected randomly and weighted by
%    population.
%
%    We will make use of MATLAB's discretize() function:
%      r = rand ( n )
%      indx = discretize ( r, cdf )
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    01 July 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the number of random samples requested.
%
%    Input, real CDF(M+1), the CDF for the population.
%
%    Input, integer SEED, a seed for the random number generator.
%
%    Output, integer INDX(N), a sequence of indices between 1 and N.
%
%    Output, integer SEED, a seed for the random number generator.
%
  [ r, seed ] = r8vec_uniform_01 ( n, seed );

  indx = discretize ( r, cdf );

  return
end

