function x = erlang_sample ( a, b, c )

%*****************************************************************************80
%
%% erlang_sample() samples the Erlang PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 September 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A, B, integer C, the parameters of the PDF.
%    0.0 < B.
%    0 < C.
%
%  Output:
%
%    real X, a sample of the PDF.
%
  a2 = 0.0;
  b2 = b;
  x = a;
  for i = 1 : c
    x2 = exponential_sample ( a2, b2 );
    x = x + x2;
  end

  return
end
