• + 0 comments
    p_defect_product = 1/3
    
    n = 5
    p_first_defect = 0
    for i in range(1, n+1):
        p_first_defect += pow((1 - p_defect_product), i-1)*p_defect_product
    
    print(round(p_first_defect, 3))