function variance = full_deck_variance ( card_num )

%*****************************************************************************80
%
%% full_deck_variance() returns the variance of the full deck problem.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 May 2022
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Herbert Wilf,
%    Some New Aspects of the Coupon Collector's Problem,
%    SIAM Review,
%    Volume 48, Number 3, September 2006, pages 549-565.
%
%  Input:
%
%    integer card_num: the number of cards in the deck.
%
%  Output:
%
%    real variance: the variance in the number of cards that must be 
%    collected in order to acquire at least one of every kind.
%
  variance = 0.0;
  for i = 2 : card_num
    variance = variance + ( i - 1 ) / ( card_num - i + 1 )^2;
  end
  variance = card_num * variance;

  return
end

