Would you please elaborate? m
is undefined and with the above replacement rule, anytime the term Binomial[-1,h]
is seen that term is replaced by -1.
If m
is defined as a specific value, then that replacement rule won't ever change anything because Binomial[-1,m]
gets evaluated prior to the replacement rule.
h = 4
Binomial[-1, h] /. Binomial[-1, m_] -> -1
(* 1 *)
So if the variable m
is already defined, then you'll need to write your own function:
bin[n_, m_] := If[n == -1 && IntegerQ[m], -1, Binomial[n, m]]
bin[10, 3]
(* 120 *)
bin[-1, 4]
(* -1 *)
bin[-1, 5]
(* -1 *)