function [ dmu, dvar ] = cube_surface_distance_stats ( n )

%*****************************************************************************80
%
%% cube_surface_distance_stats() estimates cube surface distance statistics.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 January 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of sample points to use.
%
%  Output:
%
%    real DMU, DVAR, the estimated mean and variance of the
%    distance between two random points on the surface of the unit cube.
%
  p1 = cube_surface_sample ( n );
  p2 = cube_surface_sample ( n );
  t = zeros ( n, 1 );
  for i = 1 : n
    t(i) = norm ( p1(i,:) - p2(i,:) );
  end

  dmu = mean ( t );
  dvar = var ( t );

  return
end
