2
$\begingroup$

When evaluating the following

(Factorial[n + 1]/Factorial[(n + 1) - (k + 1)])

with Mathematica 9, the result is sent to output as

(1 + n)!/((n + 1) - (k + 1))!

I would like to show the expanded (if that's the correct term) form of the result , if possible, to show for example

(n + 1)n(n - 1)...(n+1-k)

Is there a function like Expand to accomplish this?

$\endgroup$
  • 1
    $\begingroup$ Think again about what do you want as a result. ... isn't valid syntax in Mathematica $\endgroup$ – Dr. belisarius Sep 23 '13 at 1:34
  • $\begingroup$ How would you know the bounds for the expansion? What exactly do you want for output? $\endgroup$ – Mr.Wizard Sep 23 '13 at 3:16
  • $\begingroup$ Your indeterminate product can be represented Product[i, {i, n + 1 - k, n + 1}], but Product evaluates to Pochhammer[1 - k + n, 1 + k]. One could perhaps format Pochhammer to display as you wish. Would that be what you're after? $\endgroup$ – Michael E2 Sep 23 '13 at 12:44
3
$\begingroup$

It is a nonstandard syntax but it can be easily implemented with UpValues

FactorialExpand[expr_] := 
   expr /. Binomial[n_, k_] :> n!/k!/(n - k)! /. Factorial[x_] :> ProductSequence[1, x];

ProductSequence /: ProductSequence[a_, b1_]/ProductSequence[a_, b2_] :=
   ProductSequence[b2 + 1, b1];

MakeBoxes[ProductSequence[a_, b_], StandardForm] ^:= 
 RowBox[{MakeBoxes[#1 #2], "...", MakeBoxes[#3 #4]}] &[a, a + 1, b - 1, b];

(1 + n)!/((n + 1) - (k + 1))! // FactorialExpand
(1 - k + n) (2 - k + n) ... n (1 + n)

I also add Binomial expansion

Binomial[n, k] // FactorialExpand
((1 + k) (2 + k) ... (-1 + n) n)/(1 2 ... (-1 - k + n) (-k + n))
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.