function v = coins_biased ( m, n, heads, seed )

%*****************************************************************************80
%
%% COINS_BIASED generates M sets of N biased random coin flips.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    26 February 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, the number of repetitions.
%
%    Input, integer N, the number of tosses.
%
%    Input, real HEADS, the probability of heads with this coin.
%    0.0 <= HEADS <= 1.0.
%
%    Input, integer SEED, a seed for the random number generator.
%
%    Output, integer V(M,N), a vector of -1's for tails, and 1's for heads.
%
% rng ( seed );

  v = ( rand ( m, n ) < heads );

  v = 2.0 * v - 1.0;

  return
end
