function j = jaccard_index ( A, B )

%*****************************************************************************80
%
%% jaccard_index() computes the Jaccard index of two sets.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 November 2023
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    John D Cook,
%    Jaccard index and jazz albums,
%    https://www.johndcook.com/blog/2023/07/26/jaccard-jazz/
%    Posted 26 July 2023.
%
%  Input:
%
%    set A(*), B(*): two sets.
%
%  Output:
%
%    real j: the Jaccard index of the two sets.
%
  j = numel ( intersect ( A, B ) ) / numel ( union ( A, B ) );

  return
end

