Ask Your Question
0

sage cannot get the simplest form on the limit expression with binomial and exponential operations

asked 2014-12-14 12:52:34 +0200

Mr.GanCheng gravatar image

updated 2023-01-09 23:59:35 +0200

tmonteil gravatar image

considering the flowing code:

————————————————————————

from sage.symbolic.assumptions import GenericDeclaration;

var('lamda,n,k,p');

decl1 = GenericDeclaration(k, 'integer');

decl1.assume();

assume(k>0,k>1,n>k,lamda>0,lamda<n);

ep=binomial(n,k)*p^k*(1-p)^(n-k);

ep=ep.subs_expr(p==lamda/n);

ep=ep.subs_expr(binomial(n,k)==factorial(n)/factorial(k)/factorial(n-k));

ep=limit(ep,n=oo);

ep.simplify_full();

————————————————————————

the result is:

lamda^k*limit((-(lamda - n)/n)^n*factorial(n)/((-lamda + n)^k*factorial(-k + n)), n, +Infinity)/factorial(k)

————————————————————————

it is not the simplest form. In fact , sage will give me the simplest form as below when I paste the result above to sage again.

————————————————————————

lamda^k*e^(-lamda)/factorial(k)

  ————————————————————————

the question is how can i get the simplest form directly?

edit retag flag offensive close merge delete

Comments

Probably an analog problem to http://trac.sagemath.org/ticket/15346 where it affects sum expressions.

rws gravatar imagerws ( 2014-12-14 15:21:03 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-11-03 17:11:23 +0200

Emmanuel Charpentier gravatar image

With Sage 8.1.beta9, this seems to be solved. Cutting and pasting the example in a Sage terminal and politely asking :

sage: ep.simplify_full()

gives you :

lamda^k*e^(-lamda)/factorial(k)

which, I suppose, was the searched-for result.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-12-14 12:52:34 +0200

Seen: 1,027 times

Last updated: Nov 03 '17