Ask Your Question

nespinoza's profile - activity

2020-04-03 18:39:43 +0200 received badge  Famous Question (source)
2016-07-18 12:08:21 +0200 received badge  Notable Question (source)
2016-07-18 12:08:21 +0200 received badge  Popular Question (source)
2014-12-15 19:49:04 +0200 commented answer Problem evaluating limit: assume doesn't work!

Ok, solution works with new version, but still think that imposing $k$ to be an integer is too much...

2014-12-15 17:28:16 +0200 commented answer Problem evaluating limit: assume doesn't work!

I'm trying to update my Sage version to try this but it won't let me; do you know if there's something going on with the trac server? I try: sage -upgrade, and it gives me:

Upgrading to the latest development version fatal: unable to connect to trac.sagemath.org: trac.sagemath.org[0: 128.208.178.249]: errno=Connection refused

2014-12-15 13:44:04 +0200 commented answer Problem evaluating limit: assume doesn't work!

Hi @tmonteil; thanks for your anwer. I understand that assuming that k is real is much weaker than assuming that k is an integer, but, as I implicitly showed, I'm using this for non-integers inclusive.

Also, I'm using Sage Version 6.1.1 (Release Date: 2014-02-04) and this doesn't work; it gives me the same error I showed, and asks me: "Is k-1 positive, negative, or zero?" (which is strange since I already defined it to be positive).

2014-12-15 04:22:50 +0200 asked a question Problem evaluating limit: assume doesn't work!

Hi everyone,

I'm trying to evaluate the following limit in sage:

$$\lim_{N\to \infty}\frac{6N^k(N-1)^{1-k}}{(2N-1)(k+1)},$$

where $k\neq \pm1$. From Wolfram-Alpha I know this is equal to $3/(1+k)$, but I was trying to get to that answer with sage with no progress. What I did to do it was the following:

sage: N = var('N')
sage: k = var('k')
sage: assume(k!=1)
sage: assume(k!=-1)
sage: limit((6*N^k*(N-1)^(1-k))/((2*N-1)*(k+1)),N=oo)

But I get the following error:

ValueError                                Traceback (most recent call last)
<ipython-input-7-bb63a0377d1b> in <module>()
----> 1 limit((Integer(6)*N**k*(N-Integer(1))**(Integer(1)-k))/((Integer(2)*N-Integer(1))*(k+Integer(1))),N=oo)

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/calculus/calculus.pyc in limit(ex, dir, taylor, algorithm, **argv)
   1198     if algorithm == 'maxima':
   1199         if dir is None:
-> 1200             l = maxima.sr_limit(ex, v, a)
   1201         elif dir in ['plus', '+', 'right', 'above']:
   1202             if dir == 'above':

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py in sr_limit(self, expr, v, a, dir)
    855                 j = s.find('Is ')
    856                 s = s[j:]
--> 857                 raise ValueError, "Computation failed since Maxima requested additional constraints; using the 'assume' command before limit evaluation *may* help (see `assume?` for more details)\n" + s
    858             else:
    859                 raise error

ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before limit evaluation *may* help (see `assume?` for more details)
Is  k-1.0  positive or negative?

In general it doesn't matter if $k$ is positive or negative, they converge to the same value. However, for the sake of completeness, let's first try to restrict $k$ to values between 0 and 1. So, I opened other sage session and did:

sage: N = var('N')
sage: k = var('k')
sage: assume(k>0,k<1)
sage: limit((6*N^k*(N-1)^(1-k))/((2*N-1)*(k+1)),N=oo)

But I got:

ValueError                                Traceback (most recent call last)
<ipython-input-4-bb63a0377d1b> in <module>()
----> 1 limit((Integer(6)*N**k*(N-Integer(1))**(Integer(1)-k))/((Integer(2)*N-Integer(1))*(k+Integer(1))),N=oo)

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/calculus/calculus.pyc in limit(ex, dir, taylor, algorithm, **argv)
   1198     if algorithm == 'maxima':
   1199         if dir is None:
-> 1200             l = maxima.sr_limit(ex, v, a)
   1201         elif dir in ['plus', '+', 'right', 'above']:
   1202             if dir == 'above':

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py in sr_limit(self, expr, v, a, dir)
    855                 j = s.find('Is ')
    856                 s = s[j:]
--> 857                 raise ValueError, "Computation failed since Maxima requested additional constraints; using the 'assume' command before limit evaluation *may* help (see `assume?` for more details)\n" + s
    858             else:
    859                 raise error

ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before limit evaluation *may* help (see `assume?` for more details)
Is k an integer?

Trying to do sage: assume(k ... (more)

2014-11-04 17:57:39 +0200 received badge  Scholar (source)
2014-11-03 20:29:44 +0200 commented answer Sage doesn't show limit of ratio of sums

I see...well, I'll have to wait then. Simulations are good enough anyways to actually see the limiting value!

2014-11-02 23:23:58 +0200 asked a question Sage doesn't show limit of ratio of sums

Hi everyone,

I'm new to Sage and I'm trying to obtain the following limit: $$\lim_{N\to \infty}\frac{\sum_{i=1}^{N} x_i^{5/2}}{\sum_{i=1}^N x_i^2}$$ with $x_i=(N-i)/(N-1)$. What I tried was:

i = var('i')
assume(i>0,'integer')
N = var('N')
assume(N>0,'integer')
x_i = (N-i)/(N-1)
numerator = sum(x_i^(5./2.),i,1,N)
denominator = sum(x_i^(2.),i,1,N)
limit(numerator/denominator,N=oo)

However, this just gives me:

6*limit((N - 1)*sum(((N - i)/(N - 1))^2.5, i, 1, N)/(2*N^2 - N), N, +Infinity)

From what I can see, Sage has no problems with the denominator, the general formula of which was obtained easily. However, apparently it has problems obtaining the general formula for the numerator due to the fact that the exponent in the sum is not an integer. Is there a way to cope with this? How can I obtain the limit?

Thanks in advance for all the help!