function p_death = die_this_span ( index, span )

%*****************************************************************************80
%
%% die_this_span() returns probability a given judge will die in a given span.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 January 2025
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer index: the index of the judge.  1 <= index <= 9.
%
%    integer span: the number of years in the future.
%
%  Output:
%
%    real p_death: the probability that this judge will die
%    within the next span years.
%
  age = judge_age ( index );
  sex = judge_sex ( index );

  p_survive = 1.0;
  for years = age : age + span - 1
    p_die = die_this_year ( age, sex );
    p_survive = p_survive * ( 1.0 - p_die );  
  end

  p_death = 1.0 - p_survive;

  return
end

