Cody

Solution 1678342

Submitted on 21 Nov 2018 by Martin C.
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
assert(isequal(.5, round(1e6*coin_head_match(1))/1e6))

P = 0 a = 0.5000 P = 0.2500 a = 0.5000 P = 0.5000

2   Pass
assert(isequal(.375, round(1e6*coin_head_match(2))/1e6))

P = 0 a = 0.2500 P = 0.0625 a = 0.5000 P = 0.3125 a = 0.2500 P = 0.3750

3   Pass
assert(isequal(.3125, round(1e6*coin_head_match(3))/1e6))

P = 0 a = 0.1250 P = 0.0156 a = 0.3750 P = 0.1562 a = 0.3750 P = 0.2969 a = 0.1250 P = 0.3125

4   Pass
assert(isequal(.273438, round(1e6*coin_head_match(4))/1e6))

P = 0 a = 0.0625 P = 0.0039 a = 0.2500 P = 0.0664 a = 0.3750 P = 0.2070 a = 0.2500 P = 0.2695 a = 0.0625 P = 0.2734

5   Pass
assert(isequal(.246094, round(1e6*coin_head_match(5))/1e6))

P = 0 a = 0.0312 P = 9.7656e-04 a = 0.1562 P = 0.0254 a = 0.3125 P = 0.1230 a = 0.3125 P = 0.2207 a = 0.1562 P = 0.2451 a = 0.0312 P = 0.2461

6   Pass
assert(isequal(.225586, round(1e6*coin_head_match(6))/1e6))

P = 0 a = 0.0156 P = 2.4414e-04 a = 0.0938 P = 0.0090 a = 0.2344 P = 0.0640 a = 0.3125 P = 0.1616 a = 0.2344 P = 0.2166 a = 0.0938 P = 0.2253 a = 0.0156 P = 0.2256

7   Pass
assert(isequal(.139950, round(1e6*coin_head_match(16))/1e6))

P = 0 a = 1.5259e-05 P = 2.3283e-10 a = 2.4414e-04 P = 5.9837e-08 a = 0.0018 P = 3.4126e-06 a = 0.0085 P = 7.6428e-05 a = 0.0278 P = 8.4766e-04 a = 0.0667 P = 0.0053 a = 0.1222 P = 0.0202 a = 0.1746 P = 0.0507 a = 0.1964 P = 0.0893 a = 0.1746 P = 0.1197 a = 0.1222 P = 0.1347 a = 0.0667 P = 0.1391 a = 0.0278 P = 0.1399 a = 0.0085 P = 0.1399 a = 0.0018 P = 0.1399 a = 2.4414e-04 P = 0.1399 a = 1.5259e-05 P = 0.1399

8   Pass
assert(isequal(.125371, round(1e6*coin_head_match(20))/1e6))

P = 0 a = 9.5367e-07 P = 9.0949e-13 a = 1.9073e-05 P = 3.6471e-10 a = 1.8120e-04 P = 3.3197e-08 a = 0.0011 P = 1.2152e-06 a = 0.0046 P = 2.2565e-05 a = 0.0148 P = 2.4118e-04 a = 0.0370 P = 0.0016 a = 0.0739 P = 0.0071 a = 0.1201 P = 0.0215 a = 0.1602 P = 0.0472 a = 0.1762 P = 0.0782 a = 0.1602 P = 0.1039 a = 0.1201 P = 0.1183 a = 0.0739 P = 0.1238 a = 0.0370 P = 0.1251 a = 0.0148 P = 0.1253 a = 0.0046 P = 0.1254 a = 0.0011 P = 0.1254 a = 1.8120e-04 P = 0.1254 a = 1.9073e-05 P = 0.1254 a = 9.5367e-07 P = 0.1254

9   Pass
assert(isequal(.114567, round(1e6*coin_head_match(24))/1e6))

P = 0 a = 5.9605e-08 P = 3.5527e-15 a = 1.4305e-06 P = 2.0499e-12 a = 1.6451e-05 P = 2.7268e-10 a = 1.2064e-04 P = 1.4827e-08 a = 6.3336e-04 P = 4.1597e-07 a = 0.0025 P = 6.8343e-06 a = 0.0080 P = 7.1196e-05 a = 0.0206 P = 4.9677e-04 a = 0.0438 P = 0.0024 a = 0.0779 P = 0.0085 a = 0.1169 P = 0.0222 a = 0.1488 P = 0.0443 a = 0.1612 P = 0.0703 a = 0.1488 P = 0.0924 a = 0.1169 P = 0.1061 a = 0.0779 P = 0.1121 a = 0.0438 P = 0.1141 a = 0.0206 P = 0.1145 a = 0.0080 P = 0.1146 a = 0.0025 P = 0.1146 a = 6.3336e-04 P = 0.1146 a = 1.2064e-04 P = 0.1146 a = 1.6451e-05 P = 0.1146 a = 1.4305e-06 P = 0.1146 a = 5.9605e-08 P = 0.1146

10   Pass
assert(~isequal(1,2))

11   Pass
assert(isequal(.099347, round(1e6*coin_head_match(32))/1e6))

P = 0 a = 2.3283e-10 P = 5.4210e-20 a = 7.4506e-09 P = 5.5565e-17 a = 1.1548e-07 P = 1.3392e-14 a = 1.1548e-06 P = 1.3470e-12 a = 8.3726e-06 P = 7.1447e-11 a = 4.6887e-05 P = 2.2698e-09 a = 2.1099e-04 P = 4.6786e-08 a = 7.8367e-04 P = 6.6093e-07 a = 0.0024 P = 6.6584e-06 a = 0.0065 P = 4.9307e-05 a = 0.0150 P = 2.7492e-04 a = 0.0300 P = 0.0012 a = 0.0526 P = 0.0039 a = 0.0809 P = 0.0105 a = 0.1098 P = 0.0225 a = 0.1317 P = 0.0399 a = 0.1399 P = 0.0595 a = 0.1317 P = 0.0768 a = 0.1098 P = 0.0889 a = 0.0809 P = 0.0954 a = 0.0526 P = 0.0982 a = 0.0300 P = 0.0991 a = 0.0150 P = 0.0993 a = 0.0065 P = 0.0993 a = 0.0024 P = 0.0993 a = 7.8367e-04 P = 0.0993 a = 2.1099e-04 P = 0.0993 a = 4.6887e-05 P = 0.0993 a = 8.3726e-06 P = 0.0993 a = 1.1548e-06 P = 0.0993 a = 1.1548e-07 P = 0.0993 a = 7.4506e-09 P = 0.0993 a = 2.3283e-10 P = 0.0993

12   Pass
assert(isequal(.070386, round(1e6*coin_head_match(64))/1e6))

P = 0 a = 5.4210e-20 P = 2.9387e-39 a = 3.4694e-18 P = 1.2040e-35 a = 1.0929e-16 P = 1.1956e-32 a = 2.2586e-15 P = 5.1133e-30 a = 3.4444e-14 P = 1.1915e-27 a = 4.1333e-13 P = 1.7203e-25 a = 4.0644e-12 P = 1.6691e-23 a = 3.3676e-11 P = 1.1508e-21 a = 2.3994e-10 P = 5.8723e-20 a = 1.4930e-09 P = 2.2877e-18 a = 8.2114e-09 P = 6.9714e-17 a = 4.0310e-08 P = 1.6946e-15 a = 1.7804e-07 P = 3.3392e-14 a = 7.1215e-07 P = 5.4055e-13 a = 2.5943e-06 P = 7.2707e-12 a = 8.6475e-06 P = 8.2051e-11 a = 2.6483e-05 P = 7.8341e-10 a = 7.4776e-05 P = 6.3748e-09 a = 1.9525e-04 P = 4.4497e-08 a = 4.7271e-04 P = 2.6795e-07 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0011 P = 1.3992e-06 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0022 P = 6.3652e-06 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0044 P = 2.5337e-05 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0080 P = 8.8600e-05 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0136 P = 2.7323e-04 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0217 P = 7.4587e-04 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0326 P = 0.0018 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0459 P = 0.0039 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0606 P = 0.0076 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0753 P = 0.0133 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0878 P = 0.0210 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0963 P = 0.0303 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0993 P = 0.0401 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0963 P = 0.0494 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0878 P = 0.0571 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0753 P = 0.0628 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0606 P = 0.0665 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0459 P = 0.0686 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0326 P = 0.0696 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0217 P = 0.0701 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0136 P = 0.0703 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0080 P = 0.0704 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0044 P = 0.0704 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0022 P = 0.0704 [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek (line 92) In coin_head_match (line 5) In ScoringEngineTestPoint12 (line 1) In solutionTest (line 25)] a = 0.0011 P = 0.0704 a = 4.7271e-04 P = 0.0704 a = 1.9525e-04 P = 0.0704 a = 7.4776e-05 P = 0.0704 a = 2.6483e-05 P = 0.0704 a = 8.6475e-06 P = 0.0704 a = 2.5943e-06 P = 0.0704 a = 7.1215e-07 P = 0.0704 a = 1.7804e-07 P = 0.0704 a = 4.0310e-08 P = 0.0704 a = 8.2114e-09 P = 0.0704 a = 1.4930e-09 P = 0.0704 a = 2.3994e-10 P = 0.0704 a = 3.3676e-11 P = 0.0704 a = 4.0644e-12 P = 0.0704 a = 4.1333e-13 P = 0.0704 a = 3.4444e-14 P = 0.0704 a = 2.2586e-15 P = 0.0704 a = 1.0929e-16 P = 0.0704 a = 3.4694e-18 P = 0.0704 a = 5.4210e-20 P = 0.0704