function total = galileo ( )

%*****************************************************************************80
%
%% galileo() computes the frequency of various sums of three dice.
%
%  Discussion:
%
%    If three dice are thrown, the sum will be between 3 and 18.
%    How many ways are there to make each sum?
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    30 January 2018
%
%  Author:
%
%    Paul Nahin
%
%  Reference:
%
%    Paul Nahin,
%    Will You Be Alive 10 Years From Now?,
%    Princeton, 2014,
%    ISBN: 978-0691156804,
%    LC: QA273.25.N344
%
%  Output:
%
%    real TOTAL(18): the number of ways of making a sum between 1 and 18.
%
  total = zeros ( 18, 1 );

  for i = 1 : 6
    for j = 1 : 6
      for k = 1 : 6
        s = i + j + k;
        total(s) = total(s) + 1;
      end
    end
  end

  return
end
