function sv=simple_game(w_coal,n)
% M_SIMPLE_GAME computes from a list of winning coalitions the 
% corresponding simple game.  Converts
% a logical array sv into double to be useable within
% a running Mathematica session using MATLink.
%
% http://matlink.org/  
% 
%
% Usage: sv=simple_game(w_coal,n)
% Example:
% Let w_coal=[10 12 7 11 13 14 15] be a set of winning coalitions, then
% sv=simple_game(w_coal,4);
% computes the corresponding simple game.
%
% Or from a running Mathematica session define
% 
% msv = MFunction["m_simple_game"];
%
% Write the set of winning coalitions in Mathematica as 
% mcl={10,12,7,11,13,14,15}
% and compute the simple game through
% sv=msv[mcl,4]
%
%
% Define variables:
%  output:
%  sv       -- A simple game.
%  input:
%  w_coal   -- A list/vector of winning coalitions
%  n        -- The number of players involved (positive number).
%

%  Author:        Holger I. Meinhardt (hme)
%  E-Mail:        Holger.Meinhardt@wiwi.uni-karlsruhe.de
%  Institution:   University of Karlsruhe (KIT)  
%
%  Record of revisions:
%   Date              Version         Programmer
%   ====================================================
%   10/18/2013        0.5             hme
%                


S=1:2^n-1;
w_coal=sort(w_coal);
sv=ismember(S,w_coal);
sv=double(sv);
