Cody

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

Solution 216974

Submitted on 14 Mar 2013 by Paul Berglund
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

``` ```

2   Pass

``` ```

3   Pass

``` ```

4   Pass

``` ```

5   Pass

``` ```

6   Pass

``` ```

7   Pass

``` ```

8   Pass

``` ```

9   Pass

``` ```

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

``` ```

11   Pass
``` ```
```[Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] [Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits] [> In nchoosek at 78 In coin_head_match>@(x)(nchoosek(n,x)/2^n)^2 at 2 In coin_head_match at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14] ```