Cody

Solution 1073322

Submitted on 4 Dec 2016 by Gyoung Deuk Kim
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
x = 1; n=1; y_correct = 1; assert((nroot(n,x)-y_correct)<0.001)

x = 1

2   Pass
x = 1; n=2; y_correct = 1; assert((nroot(n,x)-y_correct)<0.001)

x = 1 x = 1

3   Pass
x = 1; n=2; y_correct = 1; assert((nroot(n,x)-y_correct)<0.001)

x = 1 x = 1

4   Pass
x = 10; n=2; y_correct = 3.1623; assert((nroot(n,x)-y_correct)<0.001)

x = 3.1623 x = 1.7783

5   Pass
x = 10; n=10; y_correct = 1.2589; assert((nroot(n,x)-y_correct)<0.001)

x = 3.1623 x = 1.7783 x = 1.3335 x = 1.1548 x = 1.0746 x = 1.0366 x = 1.0182 x = 1.0090 x = 1.0045 x = 1.0023

6   Pass
x = 100; n=100; y_correct = 1.0471; assert((nroot(n,x)-y_correct)<0.001)

x = 10 x = 3.1623 x = 1.7783 x = 1.3335 x = 1.1548 x = 1.0746 x = 1.0366 x = 1.0182 x = 1.0090 x = 1.0045 x = 1.0023 x = 1.0011 x = 1.0006 x = 1.0003 x = 1.0001 x = 1.0001 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1.0000 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1

Suggested Problems

More from this Author9