function ball_distance_pdf ( )

%*****************************************************************************80
%
%% ball_distance_pdf() plots the PDF for the ball distance problem.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 September 2018
%
%  Author:
%
%    John Burkardt
%
  d = linspace ( 0.0, 2.0, 101 );

  pdf = ( 3.0 / 16.0 ) * ( d - 2.0 ).^2 .* d.^2 .* ( d + 4.0 );

  plot ( d, pdf, 'r-', 'linewidth', 2 );
  grid ( 'on' );
  xlabel ( '<-- Distance -->' );
  ylabel ( '<-- Probability -->' );
  title ( 'PDF for distance between pairs of random points in unit ball' );

  return
end

