Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
nocheat = isempty(regexp(evalc('type random_sequence'),'([^f]eval|regexprep|inline|str2func)'));
m = 26;
s = 5000;
y = random_sequence(m,s);
assert(isequal(sum(y),s) && abs(mean(y)-m/2)<m*sqrt(m/s)+1/2 && isequal(y,round(y)) && abs(std(y)-m/sqrt(12))*sqrt(s)/m<2.5 && nocheat)
|
2 | Pass |
%%
nocheat = isempty(regexp(evalc('type random_sequence'),'([^f]eval|regexprep|inline|str2func)'));
m = 2;
s = 1000;
y = random_sequence(m,s);
assert(isequal(sum(y),s) && abs(mean(y)-m/2)<m*sqrt(m/s)+1/2 && isequal(y,round(y)) && abs(std(y)-m/sqrt(12))*sqrt(s)/m<2.5 && nocheat)
|
3 | Pass |
%%
nocheat = isempty(regexp(evalc('type random_sequence'),'([^f]eval|regexprep|inline|str2func)'));
m = 1000;
s = 100000;
y = random_sequence(m,s);
assert(isequal(sum(y),s) && abs(mean(y)-m/2)<m*sqrt(m/s)+1/2 && isequal(y,round(y)) && abs(std(y)-m/sqrt(12))*sqrt(s^1/m^3)<1 && nocheat)
|
Find the longest sequence of 1's in a binary sequence.
3369 Solvers
1309 Solvers
185 Solvers
Split a string into chunks of specified length
475 Solvers
The Answer to Life, the Universe, and Everything
383 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!