Nicer display from binomials: fricas (1) -> --)set output tex off --)set output algebra on binomial(n,
Type: Expression(Integer)
fricas opbinom := operator(operator 'binomial)$CombinatorialFunction(INT,
Type: BasicOperator?
fricas setProperty(opbinom,
Type: BasicOperator?
fricas binomial(n,
Type: Expression(Integer)
Tests from GouldBk?.pdf --rrogers, Fri, 07 Apr 2017 16:22:25 +0000 reply http://www.dsi.unifi.it/~resp/GouldBK.pdf
fricas binomial(5,
Type: NonNegativeInteger?
fricas binomial(a,
Type: Expression(Integer) Ah well no joy in Mudville I guess I need a special function of some sort, any comments? The simplifications provided by Combfunc apply only to specific integer values of the 2nd argument of a single kernel. What you want to do usually involves combinations of more than one kernel. For this you might expect something likesimplify or expand to work but these commands are not aware of binomial . The next best thing might be to use some custom rules. E.g.
fricas BS := rule binomial(a,
then we have fricas Is(binomial(3,
Type: List(Equation(Expression(Integer)))
fricas BS( binomial(3,
Type: Expression(Integer)
This rule is already built-in fricas BN := rule binomial(-n+k-1,
Type: Ruleset(Integer,
fricas binomial(-n+1,
Type: Expression(Integer)
fricas binomial(-n+2,
Type: Expression(Integer)
Cross product. Note that because pattern matching is syntactic we need to take care about the lexical ordering of the variables. fricas BX := rule binomial(k,
Type: Ruleset(Integer,
fricas ex1 := binomial(x+y,
Type: Expression(Integer)
fricas ex2 := BX ex1
Type: Expression(Integer)
fricas eval(ex1-ex2,
Type: Expression(Integer)
|