function cdf = florida_cdf_pop ( pop )

%*****************************************************************************80
%
%% florida_cdf_pop() constructs a CDF for the Florida population census data.
%
%  Discussion:
%
%    Given the population counts for sites indexed 1 through N,
%    CDF(I) will be the sum of populations 0 through I-1, divided
%    by the total population.
%
%    Then a random number 0 <= R <= 1 can be used to randomly sample
%    the population, by finding I such that CDF(I) <= R < CDF(I+1).
%
%    This, in turn, can be used to identify a particular location
%    in Florida, using the index I to reference its longitude and latitude.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 June 2016
%
%  Author:
%
%    John Burkardt
%
%  Output:
%
%    int POP(N), the population of the city.
%
%    real CDF(N+1), the CDF for the population.
%
  pop = pop ( : );
%
%  Oh, the MORONIC SENSITIVITY OF MATLAB TO SPACES IN [] OPERATORS!!!
%
% cdf = [ 0.0; cumsum ( pop ) ];
%
  cdf = cumsum ( pop );
  cdf = [ 0.0; cdf ];
%
%  Normalize.
%
  cdf = cdf / sum ( pop );

  return
end
