function x = uniform_discrete_sample ( a, b )

%*****************************************************************************80
%
%% uniform_discrete_sample() samples the Uniform discrete PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 September 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer A, B, the parameters of the PDF.
%    A <= B.
%
%  Output:
%
%    integer X, a sample of the PDF.
%
  cdf = rand ( 1, 1 );

  x = uniform_discrete_cdf_inv ( cdf, a, b );

  return
end
