• + 0 comments
    import math
    # Read input from STDIN
    input_line = input()
    
    # Split the input into a list of values
    values = input_line.split()
    
    # Convert the values to the appropriate data types
    p = float(values[0])/(float(values[0])+float(values[1]))
    q = float(values[1])/(float(values[0])+float(values[1]))
    n = 6
    
    
    def binomial():
        result = 0
        for i in range(1,7):
            pdf = (math.factorial(n)/(math.factorial(i)*((math.factorial(n-i)))))*(p**i)*(q**(n-i))
            if i >= 3:
                result = result + pdf
                
        print(round(result, 3)) 
            
            
    binomial()