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

      p = 0.12 n = 10 q1 = sum([binomial_dist(n, x, p) for x in range(0, 3)]) q2 = sum([binomial_dist(n, x, p) for x in range(2, 11)])

      print(round(q1, 3)) print(round(q2, 3))

  • + 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

    • + 1 comment

      read the question more carefully. You're supposed to round it off to 3 decimal places. Answer is:

      0.891
      0.342

      • + 0 comments

        Ohh..I see Thanxx a lot! :-)

No more comments