Ask Your Question

garret's profile - activity

2017-11-06 07:09:08 +0200 received badge  Notable Question (source)
2013-06-13 10:32:34 +0200 received badge  Popular Question (source)
2011-06-27 12:19:08 +0200 received badge  Supporter (source)
2011-06-27 12:19:04 +0200 marked best answer Factorial simplification error

I made this ticket 11539. As a temporary workaround, you can run the following commands which should fix things.

sage.calculus.calculus.maxima.eval(r":lisp (defun msize-factorial (x l r) (setq l (msize (cadr x) (revappend '(#\f #\a #\c #\t #\o #\r #\i #\a #\l #\() l) nil 'mparen 'mparen) r (list 1 #\) ) ) (list (+ (car l) (car r)) l r)) ")
sage.calculus.calculus.maxima.eval(r":lisp (defprop mfactorial msize-factorial grind)")

This changes things in Maxima so that factorial(x) is printed as factorial(x) instead of x!.

2011-06-27 12:19:04 +0200 received badge  Scholar (source)
2011-06-23 20:45:41 +0200 received badge  Good Question (source)
2011-06-23 18:42:39 +0200 received badge  Nice Question (source)
2011-06-23 16:20:26 +0200 received badge  Student (source)
2011-06-23 16:18:31 +0200 received badge  Editor (source)
2011-06-23 16:17:42 +0200 asked a question Factorial simplification error

I've run into an issue when running simplify on an equation containing a factorial:

sage: var('n')
sage: z1 =  (-1)^(1/2*(n - 1))*factorial(n) == 0
sage: z2 = 0 == (-1)^(1/2*(n - 1))*factorial(n)
sage: z1.simplify()
n*(-1)^(1/2*n - 1/2) != 0
sage: z2.simplify()
0 == (-1)^(1/2*n - 1/2)*factorial(n)

My best guess is when sage sends the equation down to maxima for simplification it's interpreting

(-1)^(1/2*(n - 1))*n!  =  0

as

(-1)^(1/2*(n - 1))*n   !=   0

Any ideas on how I can work around this?