Cody

Solution 1683508

Submitted on 30 Nov 2018 by Binbin Qi
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
% Random, short faults = 0; isRandom_C = true; for i = 1 : 10 x = 1000 * rand(1, 20+randi(10)); isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

2   Pass
% Bimodal, short faults = 0; isRandom_C = false; for i = 1 : 10 x = [rand(1, 10+randi(5)), 999 + rand(1, 10+randi(5))]; isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

3   Pass
% Random, medium faults = 0; isRandom_C = true; for i = 1 : 10 x = randi(1000) + 1000 * rand(1, 100+randi(10)); isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

4   Pass
% Bimodal, medium faults = 0; isRandom_C = false; for i = 1 : 10 x = randi(1000) + [rand(1, 50+randi(5)), 999 + rand(1, 50+randi(5))]; isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

5   Pass
% Skewed, medium faults = 0; isRandom_C = false; for i = 1 : 10 x = 10 ./ rand(1, 100+randi(10)); isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

6   Pass
% Random, long faults = 0; isRandom_C = true; for i = 1 : 10 x = 1000 * rand(1, 500+randi(10)); isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

7   Pass
% Skewed (1), long faults = 0; isRandom_C = false; for i = 1 : 10 x = 10 ./ rand(1, 500+randi(5)) - randi(1000); isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

8   Pass
% Skewed (2), long faults = 0; isRandom_C = false; for i = 1 : 10 x = randi(1000) - 10 ./ rand(1, 500+randi(5)); isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

9   Pass
% Bimodal, long faults = 0; isRandom_C = false; for i = 1 : 10 x = [rand(1, 250+randi(5)), 999 + rand(1, 250+randi(5))]; isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;

10   Pass
% 'Normal' (a.k.a. 'Gaussian'), long faults = 0; isRandom_C = false; for i = 1 : 10 x = 250 * randn(1, 500+randi(5)); isRandom = isItRandom(x); if ~isequal(isRandom, isRandom_C), faults = faults + 1; warning('*** CAUTION: %u faults recorded so far. ***', faults); end; assert(faults <= 2, 'Too many wrong assessments.'); end;