Cody

Solution 2091782

Submitted on 13 Jan 2020
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   Fail
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)

ans = Columns 1 through 30 25 24 11 14 18 4 4 6 23 4 15 19 1 23 15 22 19 1 20 7 24 1 23 25 26 3 9 20 2 5 Columns 31 through 60 19 24 2 2 19 15 18 13 2 1 10 11 5 20 25 6 13 21 6 16 15 23 18 19 20 3 2 5 15 14 Columns 61 through 90 10 9 16 20 12 21 19 25 2 5 16 9 18 10 19 23 16 6 19 12 20 21 14 9 4 22 26 7 23 10 Columns 91 through 120 14 3 2 12 11 17 15 22 5 9 12 16 3 7 14 6 2 12 14 18 10 15 8 12 1 16 1 16 12 6 Columns 121 through 150 10 7 18 15 11 18 17 14 16 26 2 1 9 17 22 15 14 14 12 12 3 3 26 26 15 22 6 4 4 4 Columns 151 through 180 8 20 10 4 18 5 25 3 10 18 7 25 25 3 17 24 4 8 9 14 15 16 6 15 14 5 21 5 22 20 Columns 181 through 210 18 21 13 2 26 24 7 5 17 20 22 19 21 19 2 8 16 16 26 6 3 11 6 25 20 7 5 15 21 17 Columns 211 through 240 3 4 25 26 13 3 6 23 15 18 16 20 23 23 20 6 4 8 1 4 8 23 7 24 18 7 1 18 5 22 Columns 241 through 263 2 15 17 3 15 19 22 3 4 16 26 10 14 24 25 19 10 13 7 24 23 20 24

Output argument "y" (and maybe others) not assigned during call to "random_sequence". Error in Test1 (line 4) y = random_sequence(m,s);

2   Fail
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)

ans = Columns 1 through 30 1 2 2 1 2 1 1 2 2 2 1 1 1 1 2 2 1 2 1 1 2 1 2 1 2 2 2 2 2 1 Columns 31 through 60 1 2 2 2 2 1 2 2 2 2 2 2 1 1 2 1 1 1 2 2 2 1 1 1 1 2 1 2 2 2 Columns 61 through 90 2 2 1 2 2 2 1 2 2 1 2 1 2 2 2 2 1 1 2 1 1 2 2 2 2 2 1 1 2 2 Columns 91 through 120 1 2 1 2 1 2 1 1 2 1 1 2 1 2 2 1 1 2 1 1 1 2 1 2 2 1 2 1 2 2 Columns 121 through 150 2 1 1 2 2 1 1 1 1 2 1 2 1 1 2 2 2 2 1 2 2 2 1 2 1 1 2 1 2 2 Columns 151 through 180 2 1 1 1 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 2 1 2 2 2 2 1 2 1 1 Columns 181 through 210 1 1 1 1 1 2 2 1 2 1 1 2 1 1 1 1 1 1 2 1 2 2 1 2 2 2 1 1 1 2 Columns 211 through 240 1 2 1 1 2 1 1 1 2 1 1 1 2 1 2 1 1 1 2 2 2 1 1 2 1 1 1 2 1 2 Columns 241 through 270 2 2 1 2 2 1 2 2 2 2 1 1 2 2 1 1 2 1 1 2 2 2 2 1 2 1 2 2 2 2 Columns 271 through 300 1 2 1 1 1 2 1 1 1 2 2 1 1 2 2 1 1 1 2 1 1 2 1 2 2 2 1 2 2 1 Columns 301 through 330 2 2 2 2 2 2 2 1 1 1 2 2 1 2 2 2 2 1 2 2 2 1 2 2 1 2 1 1 2 1 Columns 331 through 360 1 2 1 2 1 1 2 1 1 2 1 2 1 2 1 2 1 1 2 2 2 1 2 2 2 1 1 1 1 1 Columns 361 through 390 1 1 1 2 2 1 1 1 2 2 1 1 2 2 2 2 1 1 1 2 2 1 1 2 1 1 2 2 2 1 Columns 391 through 420 1 1 2 1 2 2 1 1 1 2 1 2 1 1 2 2 2 2 2 2 1 2 1 2 2 1 2 2 2 2 Columns 421 through 450 2 2 2 1 2 1 2 1 1 1 2 2 2 2 1 1 1 1 2 1 2 1 1 2 1 1 1 1 1 1 Columns 451 through 480 2 2 2 1 1 2 1 1 1 1 1 1 2 2 2 2 2 1 1 1 1 2 1 1 1 2 1 2 1 1 Columns 481 through 510 1 2 2 1 2 1 2 2 2 2 1 1 2 1 2 1 1 2 2 1 1 1 2 2 1 1 1 1 1 1 Columns 511 through 540 1 2 2 2 1 2 1 2 2 2 1 2 2 1 1 1 2 1 1 1 1 1 1 1 2 1 2 2 1 2 Columns 541 through 570 1 2 2 1 2 1 2 1 1 2 2 1 2 2 2 2 1 1 1 1 2 1 2 2 2 1 2 2 1 2 Columns 571 through 600 1 2 1 2 2 1 1 2 2 2 1 2 2 1 1 1 2 2 1 2 1 1 2 2 2 2 2 1 1 1 Columns 601 through 630 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 2 2 2 1 1 1 1 2 2 Columns 631 through 660 1 2 2 2 1 2 1 2 2 2 2 1 2 2 1 1 1 2 2 2 1 1 1 1 1 1 1 2 1 2 Columns 661 through 685 2 1 2 1 1 2 1 1 1 1 2 2 1 2 1 2 2 1 1 2 2 2 1 1 2

Output argument "y" (and maybe others) not assigned during call to "random_sequence". Error in Test2 (line 4) y = random_sequence(m,s);

3   Fail
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)

ans = Columns 1 through 30 28 449 974 804 795 429 990 776 436 222 374 866 574 858 55 403 759 676 717 998 188 513 5 830 748 938 277 239 858 906 Columns 31 through 60 531 499 163 66 807 147 866 399 631 729 307 90 953 186 660 404 807 708 768 271 135 921 226 242 787 210 9 125 424 173 Columns 61 through 90 377 154 299 188 95 311 829 634 266 850 248 973 480 195 403 207 727 929 615 688 670 397 264 116 6 401 75 800 954 574 Columns 91 through 120 365 393 375 55 524 164 377 553 748 897 846 541 783 125 422 714 399 546 538 905 771 999 377 878 727 343 801 70 860 363 Columns 121 through 137 203 794 366 197 580 23 145 798 486 434 518 640 162 914 217 323 685

Output argument "y" (and maybe others) not assigned during call to "random_sequence". Error in Test3 (line 4) y = random_sequence(m,s);