Sort by

recency

|

11 Discussions

|

  • + 0 comments

    I don't get why these questions are marked as hard.

    import math
    lambda_ = 3
    
    q1 = (math.e ** -(lambda_) * lambda_ ** 0) / 1 
    print(f"{round(q1,3):.3f}")
    
    lambda_2 = lambda_ * 2
    q2 = sum([(math.e ** -(lambda_2) * lambda_2 ** k) / math.factorial(k) for k in [0,1]])
    print(1 - round(q2,3))
    
  • + 1 comment

    print("0.050") instead of print("0.05")

  • + 1 comment

    R code: write (A, stdout) is printing either 0.05 or 4 digits after decimal for 1st part. Please help.

  • + 0 comments

    Don't round the value you want to print. Use:

    print("%.xf" % *Value you want to print*)
    x is the number of digits after the decimal point
    
  • + 2 comments

    For these kinds of questions the submission should be a form where we can just enter the dumb answer instead of trying to figure out what the hell the grader expects.

    I submitted several answers: hard-coded plain text: 0.050 0.983 which I manually computed AND matches to the expected output but I am still getting it incorrect. I sumbitted the following R solution sprintf("%.3f",dpois(0,3)) sprintf("%.3f",round(1-(dpois(0,6) + dpois(1,6)),5))

    And STILL getting it as wrong.

    Is this question supposed to be about Poisson distributions or about R/Python formatting functions???