Sort by

recency

|

8 Discussions

|

  • + 0 comments
    import math
    
    lambd = 1.2
    
    # 1.p(X = 2 ) 
    k = 2
    q_1 = (math.e ** (-lambd) * lambd ** k) / math.factorial(k)
    print(round(q_1,2))
    
    # 2.p (x < 3)
    #  sum(x: 1-> 2)(possion(x, 1.2))
    q_2 = sum([(math.e ** (-lambd) * lambd ** k) / math.factorial(k) for k in [0,1,2]])
    
    print(round(q_2,2))
    
    # 3p(x = 5) for /10 pages
    lamdbd_ = lambd * 10
    k = 5
    q_3 = (math.e ** (-lamdbd_) * lamdbd_ ** k) / math.factorial(k)
    print(round(q_3,2))
    
    
    lamdbd_ = lambd * 40
    q_4 = sum([(math.e ** (-lamdbd_) * lamdbd_ ** k) / math.factorial(k) for k in [0,1,2,3]])
    print(1 -round(q_4,2))
    
  • + 1 comment
    import math
    def fact(n):
        return 1 if n == 0 else n*fact(n-1)
    def poi(k,lam):
        return ((lam**k)*(math.exp(-lam)))/(fact(k))
    
    #1
    lam = 1.2
    print(round(poi(2,1.2),3))
    
    #2
    print(round(poi(0,1.2) + poi(1,1.2) + poi(2,1.2),3))
    #or
    k = 2; lam = 1.2
    round(sum([poi(x,lam) for x in range(0,k+1)]),3)
    
    #3
    lam = 12; k = 5 
    print(round(poi(k,lam),3))
    
    #4
    k = 40; lam = 1.2
    print(round(sum([poi(x,lam) for x in range(0,k+1)]),3))
    
  • + 0 comments

    key is to set up the probability function with the right mean: f(x) = (mean*#page)^x*e^(-mean*#page)/x!

  • [deleted]
    + 1 comment

    0.216 0.879 0.012 1.000

  • + 1 comment

    0.217 0.879 0.040 1.000 is this the answer