function xpowery ( )

%*****************************************************************************80
%
%% XPOWERY plots the PDF of X^Y.
%
%  Discussion:
%
%    This m-file plots the probability density function of X^Y,
%    where X and Y are independent, and both uniform from 0 to 1.
%
%  Modified:
%
%    29 January 2018
%
%  Author:
%
%    Paul Nahin
%
%  Reference:
%
%    Paul Nahin,
%    Dueling Idiots and Other Probability Puzzlers,
%    Princeton, 2012,
%    ISBN: 978-0691155005.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'XPOWERY\n' );
  fprintf ( 1, '  This m-file plots the probability density function of X^Y,\n' );
  fprintf ( 1, '  where X and Y are independent, and both uniform from 0 to 1.\n' );

  z = .0001 : .01 : 1;
  Z = expint ( - log ( z ) ) ./ z;
%
%  Graphics.
%
  clf
  plot ( z, Z )
  grid
  title('Fig.13.2 - PDF of Z = X^Y, with X and Y uniform from 0 to 1')
  ylabel('Probability Density')
  xlabel('z')
  print ( '-dpng', 'xpowery.png' )

  return
end
