Cody

Problem 45248. Aquiles y la tortuga

Solution 2114660

Submitted on 2 Feb 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
n = 3; suma = [1/2 (1/2+1/4) (1/2+1/4+1/8)]; assert(isequal(mi_funcion(n),suma));

S = 0.5000 S = 0.5000 0.7500 S = 0.5000 0.7500 0.8750

Output argument "suma" (and maybe others) not assigned during call to "mi_funcion". Error in Test1 (line 3) assert(isequal(mi_funcion(n),suma));

2   Fail
n = 4; suma = [1/2 (1/2+1/4) (1/2+1/4+1/8) (1/2+1/4+1/8+1/16)]; assert(isequal(mi_funcion(n),suma))

S = 0.5000 S = 0.5000 0.7500 S = 0.5000 0.7500 0.8750 S = 0.5000 0.7500 0.8750 0.9375

Output argument "suma" (and maybe others) not assigned during call to "mi_funcion". Error in Test2 (line 3) assert(isequal(mi_funcion(n),suma))

3   Fail
n = 6; suma = [1/2 (1/2+1/4) (1/2+1/4+1/8) (1/2+1/4+1/8+1/16) (1/2+1/4+1/8+1/16+1/32) (1/2+1/4+1/8+1/16+1/32+1/64)]; assert(isequal(mi_funcion(n),suma))

S = 0.5000 S = 0.5000 0.7500 S = 0.5000 0.7500 0.8750 S = 0.5000 0.7500 0.8750 0.9375 S = 0.5000 0.7500 0.8750 0.9375 0.9688 S = 0.5000 0.7500 0.8750 0.9375 0.9688 0.9844

Output argument "suma" (and maybe others) not assigned during call to "mi_funcion". Error in Test3 (line 3) assert(isequal(mi_funcion(n),suma))

4   Fail
n = 10; suma = [1/2 (1/2+1/4) (1/2+1/4+1/8) (1/2+1/4+1/8+1/16) (1/2+1/4+1/8+1/16+1/32) (1/2+1/4+1/8+1/16+1/32+1/64) (1/2+1/4+1/8+1/16+1/32+1/64+1/2^7) (1/2+1/4+1/8+1/16+1/32+1/64+1/2^7+1/2^8) (1/2+1/4+1/8+1/16+1/32+1/64+1/2^7+1/2^8+1/2^9) (1/2+1/4+1/8+1/16+1/32+1/64+1/2^7+1/2^8+1/2^9+1/2^10)]; assert(isequal(mi_funcion(n),suma))

S = 0.5000 S = 0.5000 0.7500 S = 0.5000 0.7500 0.8750 S = 0.5000 0.7500 0.8750 0.9375 S = 0.5000 0.7500 0.8750 0.9375 0.9688 S = 0.5000 0.7500 0.8750 0.9375 0.9688 0.9844 S = 0.5000 0.7500 0.8750 0.9375 0.9688 0.9844 0.9922 S = 0.5000 0.7500 0.8750 0.9375 0.9688 0.9844 0.9922 0.9961 S = 0.5000 0.7500 0.8750 0.9375 0.9688 0.9844 0.9922 0.9961 0.9980 S = 0.5000 0.7500 0.8750 0.9375 0.9688 0.9844 0.9922 0.9961 0.9980 0.9990

Output argument "suma" (and maybe others) not assigned during call to "mi_funcion". Error in Test4 (line 3) assert(isequal(mi_funcion(n),suma))

Suggested Problems

More from this Author1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!