function a = propa_yes_random_matrix ( prob, n, key )

%*****************************************************************************80
%
%% propa_yes_random_matrix returns a random matrix with property A.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 October 2007
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real PROB, the probability that a link between 
%    two eligible nodes will be made.
%
%    integer N, the order of A.
%
%    integer KEY, a positive value that selects the data.
%
%  Output:
%
%    real A(N,N), the matrix.
%
  rng ( key );

  a = zeros ( n, n );
%
%  Assign each index randomly to one of two sets.
%  SET(I) is 0 if I is in set 0, and 1 if it is in set 1.
%
  [ set, seed ] = sub_random ( n, seed );

  for i = 1 : n
    for j = 1 : n
      if ( set(i) ~= set(j) )
        chance = rand ( 1, 1 );
        if ( chance <= prob )
          a(i,j) = 1.0;
        end
      end
    end
  end

  return
end
