Sort by

recency

|

111 Discussions

|

  • + 0 comments
    a,b=map(int,input().split())
    p=a/b
    q=1-p
    n=int(input())
    r=(q**(n-1))*p
    print(round(r,3))
    
  • + 0 comments
    import math
    
    p = 1/3
    q = 1-p
    n = 5
    
    
    def geometricDistribution(successProb, failureProb, position):
        result = (failureProb)**(position-1) * successProb
        print(round(result, 3) )
        
        
    geometricDistribution(p, q, n)
    
  • + 0 comments

    Your Output 0.066 Expected Output 0.066

    Seriously?

  • + 0 comments
    def Geometric(n,p):
        return (1-p)**(n-1) * p
    
    nume,deno = list(map(int,input().split()))
    n = int(input())
    print(f"{Geometric(n,nume/deno):.3f}")
    
  • + 0 comments

    numerator, denominator = map(int, input().split())

    n = int(input())

    p = numerator/denominator

    q = 1-p

    answer = q**(n-1) * p

    print(round(answer,3))