Cody

# Problem 42765. Maximize Non-Co-Planar Points in an N-Cube

Solution 846884

Submitted on 8 Mar 2016 by LY Cao
• Size: 86
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
N=2; Q=5; m=MaxNonCoplanarPts(N,Q); m=floor(abs(m)) % Perform m check valid=1; if size(m,1)<Q,valid=0;end % Must be Q pts or more if max(m(:))>N-1,valid=0;end pset=nchoosek(1:size(m,1),4); for i=1:length(pset) m4=m(pset(i,:),:); % Coplanar check method courtesy of Tim if ~det([m4 ones(4,1)]) % coplanar det=0 valid=0; break end end assert(isequal(1,valid))

m = 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1

2   Pass
N=3; Q=8; m=MaxNonCoplanarPts(N,Q); m=floor(abs(m)) % Perform m check valid=1; if size(m,1)<Q,valid=0;end % Must be Q pts or more if max(m(:))>N-1,valid=0;end pset=nchoosek(1:size(m,1),4); for i=1:length(pset) m4=m(pset(i,:),:); % Coplanar check method courtesy of Tim if ~det([m4 ones(4,1)]) % coplanar det=0 valid=0; break end end assert(isequal(1,valid))

m = 0 0 0 1 1 0 2 1 0 1 0 1 0 1 1 0 2 1 1 0 2 2 2 2

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!