Winner Guy Shechter (j11)

Finish 2003-11-11 10:00:00 UTC

paradox

by gord drewitt

Status: Failed
Results: []

Comments
gord drewitt
04 Nov 2003

% According to the wording of the question, one only needs
% b(max(b)) number of a(max(b)) to satisfy the first criterion.
% Its is very easy to suggest vectors where not removing
% excess points results in the impossibility of meeting the
%
gord drewitt
04 Nov 2003
second criterion. For example, the following a and b.
% This code corrects the problem.
% a = [1 2 3 1];
% b = [1 2 1 4];
Please login or create a profile.
Code
    q = sortrows([a', b'],[1 2]);
[x r] = unique(q(:,1));
    a = q(r,1);
    b = q(r,2);    
    
    c = [];    

 for i=1:length(b)
    c = [c a(i)*ones(1,b(i))];
 end

 while any(~(diff(c)))
     c=c(randperm(sum(d(:,2))));
 end