Cody

Problem 44310. Digit concentration in Champernowne's constant

Solution 2623132

Submitted on 28 Jun 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
d = 1; x = 1; y_correct = 1; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 1 ans = 1

Output argument "concentration" (and maybe others) not assigned during call to "digitCon". Error in Test1 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

2   Fail
d = 10; x = 5; y_correct = 0.1000; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 10 ans = 1

Output argument "concentration" (and maybe others) not assigned during call to "digitCon". Error in Test2 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

3   Fail
d = 10; x = 1; y_correct = 0.2000; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 10 ans = 2

Output argument "concentration" (and maybe others) not assigned during call to "digitCon". Error in Test3 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

4   Fail
d = 20; x = 9; y_correct = 0.0500; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 20 ans = 1

Output argument "concentration" (and maybe others) not assigned during call to "digitCon". Error in Test4 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

5   Fail
d = 50; x = 0; y_correct = 0.0400; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 50 ans = 2

Output argument "concentration" (and maybe others) not assigned during call to "digitCon". Error in Test5 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

6   Fail
d = 50; x = 2; y_correct = 0.2600; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 50 ans = 13

Output argument "concentration" (and maybe others) not assigned during call to "digitCon". Error in Test6 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

7   Fail
d = 1000; x = 9; y_correct = 0.0670; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 1000 ans = 67

Output argument "concentration" (and maybe others) not assigned during call to "digitCon". Error in Test7 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

8   Fail
d = 1e4; x = 8; y_correct = 0.0747; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 10000 ans = 747

Output argument "concentration" (and maybe others) not assigned during call to "digitCon". Error in Test8 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

9   Fail
d = 1e5; x = 7; y_correct = 0.0864; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 10000

Index exceeds the number of array elements (38894). Error in digitCon (line 11) s=s(1:d); Error in Test9 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

10   Fail
d = 1e6; x = 6; y_correct = 0.0935; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 10000

Index exceeds the number of array elements (38894). Error in digitCon (line 11) s=s(1:d); Error in Test10 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

11   Fail
d = 1e6; x = 5; y_correct = 0.0937; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 10000

Index exceeds the number of array elements (38894). Error in digitCon (line 11) s=s(1:d); Error in Test11 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

12   Fail
d = 2e6; x = 4; y_correct = 0.0903; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 10000

Index exceeds the number of array elements (38894). Error in digitCon (line 11) s=s(1:d); Error in Test12 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)

13   Fail
d = 2000124; x = 3; y_correct = 0.1162; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

s = 0×0 empty char array m = 10000

Index exceeds the number of array elements (38894). Error in digitCon (line 11) s=s(1:d); Error in Test13 (line 4) assert(abs(digitCon(d,x)-y_correct) < 1e-4)