Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
0

why is sqrt(factorial(l)*factorial(l))-factorial(l) not 0

asked 0 years ago

AstroG gravatar image

updated 0 years ago

Emmanuel Charpentier gravatar image

I am checking solutions of some field equations. The check requires at some point the calculation of something like sqrt(factorial(l)*factorial(l))-factorial(l) where l is a positive integer . Sage gives |l!| - l! rather than 0. It works for explicit values of l. I have also tried declaring l as a positive integer and using .canonicalize_radical() and .simplify_full() as shown in the code snippet below, which has some of the lines commented out. I'm using Sagemath 10.5 on a MacBook Pro with Sequoia 15.3.1

version()
var('l')
assume(l, 'integer')
assume(l>0)

# l = 273
x = sqrt(factorial(l)*factorial(l))-factorial(l)
#y = x.expand().canonicalize_radical().simplify_full()
#z = x.expand().simplify_full().canonicalize_radical()
pretty_print('x = \t', x)
pretty_print('y = \t' ,y)
pretty_print('z = \t', z)

How might I get round this issue, please?

Preview: (hide)

Comments

Edited for legibility.

If you want to quote code, indent it by four spaces (or ise the "101010" button).

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 0 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 0 years ago

Emmanuel Charpentier gravatar image

updated 0 years ago

x2 is x if and only if x>0. See illustration on Sagecell.

Preview: (hide)
link

Comments

Thank you for your help Emmanuel. That information solved my problem. Much appreciated.

AstroG gravatar imageAstroG ( 0 years ago )

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: 0 years ago

Seen: 46 times

Last updated: Mar 07