Sort by

recency

|

3 Discussions

|

  • + 1 comment

    from math import factorial as fact

    Permutation

    def permutation(n, r): return fact(n)/(fact(n-r))

    Combinations

    def combination(n, r): return permutation(n,r)/fact(r)

    BINOMIAL DISTRIBUTION

    def binomial_dist(n, x, p):

    q = 1-p

    return combination(n, x)*(p**x)(q*(n-x))

    you do the rest. :)

  • + 0 comments

    If submitting R code, use something like cat(round(answer1 ,3),round(answer2,3),sep = "\n"). Using two cat() calls like: cat(round(answer1 ,3)) cat(round(answer2 ,3)) will cause submission to fail.

  • + 1 comment
    0.8913
    0.3417
    

    My ans is perfectly right!Why is it giving error? I found the same ques on this website http://www.intmath.com/counting-probability/12-binomial-probability-distributions.php

No more comments