The Gaussian distribution is considered a normal distribution of random numbers, so why is it being tested as false in the final test? Logically it should return as true shouldn't it ? My code works on all but the final test which seems reversed to me unless you know something I don't ?
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;
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1

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;
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0

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;
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1

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;
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0

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;
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0

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;
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1
y =
logical
1

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;
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0

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;
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0

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;
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0
y =
logical
0

10  Fail 
% '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;
y =
logical
1
[Warning: *** CAUTION: 1 faults recorded so far. ***]
[> In ScoringEngineTestPoint10 (line 9)
In solutionTest (line 23)]
y =
logical
1
[Warning: *** CAUTION: 2 faults recorded so far. ***]
[> In ScoringEngineTestPoint10 (line 9)
In solutionTest (line 23)]
y =
logical
1
[Warning: *** CAUTION: 3 faults recorded so far. ***]
[> In ScoringEngineTestPoint10 (line 9)
In solutionTest (line 23)]

71 Solvers
229 Solvers
1859 Solvers
40 Solvers
673 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!