Cody

Solution 1919104

Submitted on 2 Sep 2019 by Gergely Patay
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
in = [1 0.6 0.8 1 1; 1 1.1 1.2 1.3 1.4; 10 0 0 0 0]; rho = 1.0; out = [1 0.6 0.8 1 1; 1 1.1 1.2 1.3 1.4; 10 9.339 8.218 7.057 6.0760]; eps = 1e-3; assert(sum(sum(abs(Bernoulli_eq(in,rho)-out))) < eps)

2   Pass
in = [1 0.6 0.8 1 1; 0 0 1 0 0; 10 12 10 14 8]; rho = 1.5; out = [1 0.6 0.8 1 1; 0.9817 0.8784 1 0.7098 1.1176; 10 12 10 14 8]; eps = 1e-3; assert(sum(sum(abs(Bernoulli_eq(in,rho)-out))) < eps)

3   Pass
in = [0 0 0 1 0; 1 1.1 1.2 1.3 1.4; 10 12 10 14 8]; rho = 0.75; out = [4.1896 3.2027 3.6917 1 3.8779; 1 1.1 1.2 1.3 1.4; 10 12 10 14 8]; eps = 1e-3; assert(sum(sum(abs(Bernoulli_eq(in,rho)-out))) < eps)

4   Pass
in = [1 1.6 0.8 1 1 0 0 1 1 1.2; 1 1.6 0 1.3 0 1.9 1.8 1.7 0 1.8; 0 12 5 0 8 7.5 7.7 0 11.1 0]; rho = 0.97; out = [1 1.6 0.8 1 1 2.4397 2.7390 1 1 1.2; 1 1.6 2.4335 1.3 2.0999 1.9 1.8 1.7 1.7741 1.8; 18.466 12 5 15.6113 8 7.5 7.7 11.805 11.1 10.6401]; eps = 1e-3; assert(sum(sum(abs(Bernoulli_eq(in,rho)-out))) < eps)

Suggested Problems

More from this Author139