function [sX,vx] = fContestEquilibriumLinear(vN,sAlpha)
  % This function computes the equilibria in sequential contests in case of 
  % linear g function (or large contests), as described in 
  % "Optimal sequential contests" by Toomas Hinnosaar, avalable at 
  % http://toomas.hinnosaar.net/contests.pdf
  % Matlab code written by Toomas Hinnosaar (toomas@hinnosaar.net)
  % Inputs: vN     = [n_1,...,n_T]
  %         sAlpha = -g'(1)
  sT     = max(size(vN));
  sProd  = 1;
  sPrevN = 0;
  vx     = zeros(sum(vN),1);
  for t=1:sT
    sProd = sProd*(1+sAlpha*vN(t));  
    vx(sPrevN+[1:vN(t)]) = sAlpha/sProd;
    sPrevN = sPrevN + vN(t);
  end
  sX   = 1-1/sProd;
end