function x = geometric_sample ( a )

%*****************************************************************************80
%
%% geometric_sample() samples the Geometric PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A, the probability of success on one trial.
%    0.0 <= A <= 1.0.
%
%  Output:
%
%    integer X, a sample of the PDF.
%
  cdf = rand ( 1, 1 );

  x = geometric_cdf_inv ( cdf, a );

  return
end
