# Why do I get Floor and Ceiling in my output despite my assumptions

I am trying to simplify the following expression.

Sum[
Binomial[2 k, m] (1 + (-1)^m)/2 Beta[(1 + m)/2, (n - 2)/2]
(Gamma[(1 + m)/2] Gamma[1/2 (-1 + 2 k - m + n)])^2 ,
{m, 0, 2 k}]


Before doing it, I first set the $Assumptions = {n ∈ Integers, k ∈ Integers}; since I know n and k are integers. The answer I got from Mathematica v10 was rather complicated. However, one thing I found strange was that the solution contains Floor[k] and Ceiling[-k] that are clearly just k and -k since they are integers. What is more strange thing is I get an error if I try to further simplify it. What is the precise way to achieve this goal? • Add Assumptions ->$Assumptions to your Sum[] – Dr. belisarius Sep 7 '14 at 0:05
• Or encase the Sum in the Assumptions: Assuming[$Assumptions, Sum[Binomial[2 k, m] (1 + (-1)^m)/2 Beta[(1 + m)/2, (n - 2)/2] (Gamma[(1 + m)/2] Gamma[1/2 (-1 + 2 k - m + n)])^2, {m, 0, 2 k}]] gives a simpler answer. – bill s Sep 7 '14 at 0:16 • @belisarius Oh know, I thought I did't know I have to put such assumptions in each expression that I later evaluate. Then, what is the reason we set $Assumptions if we still have to put Assumptions to the expression? (PS. I tried your solution but I still habe a problem). – Sungmin Sep 7 '14 at 5:31
• @bills Yes your suggestion really simplified my expression. Thank you. But I'm still quite confused. Why should I put such additional Assuming function even though I have already set $Assumptions? I've oberseved that $Assumptions worked quite well in my experience. Do you have a criteria that I should additionally put Assumption? – Sungmin Sep 7 '14 at 5:37
• @bills This is strange. Surely using the Assumptions option to Sum, setting the global $Assumptions and using Assuming should all have the same effect? – Simon Woods Sep 7 '14 at 10:40 ## 1 Answer From the documentation, $Assumptions is the default setting for the Assumptions option used in such functions as Simplify, Refine, and Integrate.

It expects statements such as $Assumptions = a < 0 && b < 0}, using the wrong syntax $Assumptions = {n ∈ Integers, k ∈ Integers} actually breaks the use of Simplify.

The correct approach should have been

$Assumptions =$Assumptions && n ∈ Integers && k ∈ Integers


and then use FullSimplify.

As pointed out in the comments, there is no need to change the global definitions and you are better off by using

Assuming[
{n, k} ∈ Integers
,FullSimplify[
Sum[
Binomial[2 k, m] (1 + (-1)^m) 2 Beta[(1 + m)/2, (n - 2) 2] (Gamma[(1 + m)/2] Gamma[1/2 (-1 + 2 k - m + n)])^2
, {m, 0, 2 k}
]]]

• +1, but I would say that the use of FullSimplify is optional. It simplifies only a little, while the main point is the syntax of $Assumptions. Also note that Assuming[{n ∈ Integers, k ∈ Integers},$Assumptions] shows Assuming rewrites the assumptions by replacing List with And`. – Michael E2 Dec 7 '14 at 13:30