Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

The following input

Assuming[
   (n ∈ Integers) && (n > 0) && (k ∈ Integers) && (k >= 0) && (k <= n), 
   FullSimplify[Binomial[n, k]/Binomial[n, k + 1]]
]

returns

Binomial[n,k]/Binomial[n,k+1]

Why does it not give

(k+1)/(n-k)

and how do I make it do this?

share|improve this question
add comment

2 Answers 2

up vote 11 down vote accepted

Try using FunctionExpand:

FunctionExpand[Binomial[n, k]/Binomial[n, 1 + k]]    
  (1 + k)/(-k + n)

Mathematica's understanding of what is simple is based on leaf count and can be unintuitive at times.

share|improve this answer
    
perfect, thanks Searke –  Lucas Nov 29 '12 at 0:24
1  
LeafCount indeed gets you a complexity of 11 for both terms. Using the written size of the expression with ComplexityFunction -> (StringLength@ToString[#] &)] still yields the same result, though FullSimplify now delivers the version that the OP wants. –  Sjoerd C. de Vries Nov 29 '12 at 16:05
    
Somehow, I have never considered StringLength as a ComplexityFunction until now. –  Searke Nov 29 '12 at 16:06
add comment

Another way to proceed would be to make Binomial more expensive (or less simple) using a ComplexityFunction:

f[e_] := 100 Count[e, _Binomial, {0, Infinity}] + LeafCount[e]

FullSimplify[Binomial[n, k]/Binomial[n, k + 1], ComplexityFunction -> f]

gives

(1 + k)/(-k + n)
share|improve this answer
1  
Sounds, erm, complex. But it is interesting and good to know. –  Lucas Nov 29 '12 at 0:32
    
It is interesting, that Simplify[Binomial[n, k]/Binomial[n, 1 + k], ComplexityFunction -> f] with your definition for f gives Binomial[n, k]/Binomial[n, 1 + k]. It looks like Simplify does not try enough transformations of Binomial. –  au700 Nov 29 '12 at 0:34
1  
Probably. You could perhaps find out using another recent Q+A of mine mathematica.stackexchange.com/questions/15321/… –  WalkingRandomly Nov 29 '12 at 0:39
    
@WalkingRandomly It is overkill 100 Count..., 1 Count... is good enough, +1. –  Artes Nov 30 '12 at 0:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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