function xpowery ( )

%*****************************************************************************80
%
%% xpowery() plots the PDF of X^Y.
%
%  Discussion:
%
%    This code plots the probability density function of X^Y,
%    where X and Y are independent, and both uniform from 0 to 1.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  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, '  Plot 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 = 0.0001 : 0.01 : 1.0;
%
%  expint(t) evaluates the exponential integral function.
%
  pdf = expint ( - log ( z ) ) ./ z;
%
%  Graphics.
%
  clf ( );
  plot ( z, pdf, 'linewidth', 3 );
  grid ( 'on' );
  title ( 'PDF of Z = X^Y, with X and Y uniform from 0 to 1' );
  ylabel ( 'Probability Density' );
  xlabel ( 'z' );
  filename = 'xpowery.png';
  print ( '-dpng', filename );
  fprintf ( '  Graphics saved as "%s"\n', filename );

  return
end
