Cody

# Problem 1159. Coin Tossing: Probability of Same Heads for N tosses

Solution 1355124

Submitted on 23 Nov 2017 by David Verrelli
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

vec = 1 1 P = 0.5000 P = 0.5000

2   Pass

vec = 1 2 1 P = 0.3750 P = 0.3750

3   Pass

vec = 1 3 3 1 P = 0.3125 P = 0.3125

4   Pass

vec = 1 4 6 4 1 P = 0.2734 P = 0.2734

5   Pass

vec = 1 5 10 10 5 1 P = 0.2461 P = 0.2461

6   Pass

vec = 1 6 15 20 15 6 1 P = 0.2256 P = 0.2256

7   Pass

vec = Columns 1 through 14 1 16 120 560 1820 4368 8008 11440 12870 11440 8008 4368 1820 560 Columns 15 through 17 120 16 1 P = 0.1399 P = 0.1399

8   Pass

vec = Columns 1 through 14 1 20 190 1140 4845 15504 38760 77520 125970 167960 184756 167960 125970 77520 Columns 15 through 21 38760 15504 4845 1140 190 20 1 P = 0.1254 P = 0.1254

9   Pass

vec = 1.0e+06 * Columns 1 through 17 0.0000 0.0000 0.0003 0.0020 0.0106 0.0425 0.1346 0.3461 0.7355 1.3075 1.9613 2.4961 2.7042 2.4961 1.9613 1.3075 0.7355 Columns 18 through 25 0.3461 0.1346 0.0425 0.0106 0.0020 0.0003 0.0000 0.0000 P = 0.1146 P = 0.1146

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

11   Pass