Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
C=1; N=6; K=2;
[P,XK,M] = test_suite_prob(N,C,K);
Pc=0.166666; XKc=0.138888; Mc=6;
tol=1e-6;
assert( (abs(P-Pc)<tol)&(abs(XK-XKc)<tol)&(abs(M-Mc)<tol) );
|
2 | Pass |
C=3; N=6; K=2;
[P,XK,M] = test_suite_prob(N,C,K);
Pc=0.004629; XKc=0.004608; Mc=216;
tol=1e-6;
assert( (abs(P-Pc)<tol)&(abs(XK-XKc)<tol)&(abs(M-Mc)<tol) );
|
3 | Pass |
C=2; N=6; K=6;
[P,XK,M] = test_suite_prob(N,C,K);
Pc=0.027777; XKc=0.024128; Mc=36;
tol=1e-6;
assert( (abs(P-Pc)<tol)&(abs(XK-XKc)<tol)&(abs(M-Mc)<tol) );
|
4 | Pass |
C=8; N=2; K=20;
[P,XK,M] = test_suite_prob(N,C,K);
Pc=0.003906; XKc=0.003626; Mc=256;
tol=1e-6;
assert( (abs(P-Pc)<tol)&(abs(XK-XKc)<tol)&(abs(M-Mc)<tol) );
|
5 | Pass |
C=4; N=5; K=7;
[P,XK,M] = test_suite_prob(N,C,K);
Pc=0.001600; XKc=0.001584; Mc=625;
tol=1e-6;
assert( (abs(P-Pc)<tol)&(abs(XK-XKc)<tol)&(abs(M-Mc)<tol) );
|
6 | Pass |
C=5; N=1; K=2;
[P,XK,M] = test_suite_prob(N,C,K);
Pc=1; XKc=0; Mc=1;
tol=1e-6;
assert( (abs(P-Pc)<tol)&(abs(XK-XKc)<tol)&(abs(M-Mc)<tol) );
|
Back to basics 12 - Input Arguments
525 Solvers
Make a random, non-repeating vector.
2795 Solvers
641 Solvers
Find the maximum two numbers of every column of a matrix
137 Solvers
Calculate cosine without cos(x)
50 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!