I am trying to solve for lamda in an equation that the sum of the probabilities of a Poisson random variable, P(X < 20), equals 0.05.
In my code, I uses a as lamda.
syms aeqn = 0for i = 0:19 eqn = eqn + exp(-a)*(a^i)/factorial(i)endeqn == 0.05s = solve(eqn, a)
I was expecting s to be a single value, but instead I got this:
root(z^19 + 19*z^18 + 342*z^17 + 5814*z^16 + 93024*z^15 + 1395360*z^14 + ...root(z^19 + 19*z^18 + 342*z^17 + 5814*z^16 + 93024*z^15 + 1395360*z^14......
the full output is not displayed here.
I wonder if anyone knows where my code is wrong. Thank you!
Best Answer