Codes Basic Math

Hello friends, I have been using R for a short time and I am no longer able to calculate it.

1 - (1.5 ^ 0/0!) Exp (-1.5) - (1.5 ^ 1/1!) Exp (-1.5)

Could someone paste here how to spell it in R format

R has exp for the exponential function rather than Exp.
also R had factorial() function rather than relying on !

I suggest being more careful with parentheses too. Your 1.5^0/factorial(0) does produce 1, but it's better to be explicit and avoid order of operations surprises.

(1.5^0) / factorial(0) * exp(-1.5)

I did it like that and got it right:
image

I did like that and got it right:
image

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.