Sort by

recency

|

82 Discussions

|

  • + 0 comments

    I think the central question here is how do we know that the daily costs depend on the expected value of lambda squared? How did they come up with that formula? How realistic is it to face this scenario in real life?

  • + 0 comments
    lambda_A,lambda_B =map(float,input().split())
    
    E_X2_A = lambda_A + (lambda_A ** 2)
    e_cost_A = 160 + 40 * E_X2_A
    
    E_X2_B = lambda_B + (lambda_B ** 2)
    e_cost_B = 128 + 40 * E_X2_B
    
    print(round(e_cost_A,3))
    print(round(e_cost_B,3))
    
  • + 0 comments

    x=0.88 y=1.55 Ca=160+40*(x+x**2) Cb=128+40*(y+y**2) print(round(Ca,3)) print(round(Cb,3))

  • + 1 comment
    from math import exp,factorial
    
    def thnks_for_the_fish(machine, cost):
        return sum((exp(-machine) * machine**k) / factorial(k) * (cost + 40 * k**2) for k in range(20))
    
    A,B = map(float,input().split(" "))
    
    print(round(thnks_for_the_fish(A, 160), 3))
    print(round(thnks_for_the_fish(B, 128), 3))
    
  • + 0 comments

    In R could be:

    stdin <- file('stdin')
    open(stdin)
    
    line <- as.numeric(strsplit(trimws(readLines(stdin, n = 1, warn = FALSE), which = "right"), " ")[[1]])
    cat(format(round(160 + 40*(line[1]+line[1]^2),3), nsmall=3), fill=TRUE)
    cat(format(round(128 + 40*(line[2]+line[2]^2),3), nsmall=3), fill=TRUE)