Ask Your Question

DrNick's profile - activity

2021-12-22 14:31:24 +0100 received badge  Famous Question (source)
2021-03-13 21:57:56 +0100 received badge  Popular Question (source)
2019-10-17 22:06:03 +0100 received badge  Notable Question (source)
2018-02-15 03:01:02 +0100 received badge  Popular Question (source)
2018-02-12 12:14:15 +0100 received badge  Popular Question (source)
2017-10-04 22:29:16 +0100 commented answer symbolic ring comparisons return strange results

Yeah, I sort of understood the issue of returning False in case it can't really verify truth. But this is returning True when the statement is in fact False.

2017-10-04 18:51:20 +0100 received badge  Student (source)
2017-10-04 18:48:52 +0100 asked a question symbolic ring comparisons return strange results

Greetings,

bool(abs(-1+sqrt(2)) != abs(1-sqrt(2)))

erroneously returns True (I'm running SageMath-8.0 on a mac laptop, for what it's worth).

Is this a bug?

Thanks

2015-08-21 20:32:15 +0100 commented answer (Unexpanded) symbolic inequalities yield erroneous results

It looks like I need to update, and probably should have done so first. That said, with something so basic going wrong, I just assumed that I was doing something wrong. Thanks!

2015-08-21 02:26:41 +0100 commented question (Unexpanded) symbolic inequalities yield erroneous results

For what it's worth, I appear to be running version 6.2. Someone has commented on the ticket kcrisman started that they cannot reproduce this on 6.9beta. I'll update and check.

2015-08-20 18:39:48 +0100 asked a question (Unexpanded) symbolic inequalities yield erroneous results

I'm a SAGE novice, but have at least looked around this forum a bit on this matter. Apologies if this is a FAQ that I missed.

I am working with pretty simple symbolic expressions (type 'sage.symbolic.expression.Expression') involving rational numbers and some square roots. I have encountered several instances in which SAGE returns incorrect booleans when asking about inequalities between these things. For what it's worth, SAGE seems to get the answer right when I expand the expressions (simply by appending a .expand() to the end of them).

In particular, SAGE sometimes returns True when given "A < B" where A and B are symbolic expressions that are (not-obviously) equal. Here's an example that actually came up.

bool((1/8*sqrt(2)*(sqrt(2)*(sqrt(2) - 2) + 4*sqrt(2)) + 1/4*sqrt(2)*(sqrt(2) - 2) + 3/4*sqrt(2) - 1/2) < (1/8*sqrt(2)*(sqrt(2) + 2) + 1/4*sqrt(2) + 1/4))

SAGE returns True to this strict inequality. It also returns True when < is replaced by ==, as it should since these are equal. As mentioned, appending an .expand() to each side causes SAGE to return False to the strict inequality, which it should.

Any idea what's going wrong here?

2013-03-31 10:41:32 +0100 commented answer region_plot with "or" expressions

I noticed that in the documentation, and I got the former to work for one function. I have a large family of "or"'s indexed, by say p in P and somehow this broke it. Should region_plot([lambda x,y: A(x,y,p) or B(x,y,p) for p in P], (x,0,1), (y,0,1)] work?

2013-03-29 22:59:49 +0100 asked a question region_plot with "or" expressions

I'm trying to do a region_plot of a bunch of things that involve an "or" and getting behavior I don't understand.

Here's an example (not so relevant to mine) of the kind of thing I'm encountering:

region_plot([x < y or x < -y], (x,-1,1), (y, -1,1))

If you run this, clearly the output is messed up. It also changes when you switch the order of the two conditions, so it seems to pay attention to just one of them.

I tried carious things like making a function of (x,y) that returns the relevant boolean that works correctly when you just feed it numbers, but exhibits the same odd behavior when you put it in region_plot.

Any idea what's going on here?

Thanks.

2013-03-29 15:36:10 +0100 received badge  Supporter (source)
2013-03-27 15:48:53 +0100 asked a question Translating a polygon into a fundamental domain

Hello.

I have a polygon (defined, say, via polygon()) that I'm thinking of as filled in with some color. I'd like to understand its image on the quotient of $\mathbb{R}^2$ mod $\mathbb{Z}^2$ by seeing this image in a fundamental domain like the unit square with corners (0,0), (1,0), (0,1), (1,1).

Put differently, I want to translate (by a lattice point) each point in and on the polygon into this square and see what the result looks like.

Is there a reasonable way to do this in SAGE?