Ask Your Question

Lauri's profile - activity

2020-01-29 15:52:33 +0200 received badge  Famous Question (source)
2016-04-29 22:31:52 +0200 received badge  Notable Question (source)
2013-08-20 08:38:13 +0200 received badge  Popular Question (source)
2012-01-07 03:57:27 +0200 received badge  Scholar (source)
2012-01-07 03:57:27 +0200 marked best answer Min and functions

Well, min is not what we call a symbolic function. Since x is earlier in the lexicographic order than y:

sage: var('y')
y
sage: min(x,y)
x

We work around that like this.

sage: f(x,y) = 2*min_symbolic(x,y)
sage: f(3,2)
4
sage: f(2,3)
4

This should probably be easier to find...

2012-01-07 03:57:14 +0200 received badge  Supporter (source)
2012-01-06 17:53:46 +0200 received badge  Nice Question (source)
2012-01-06 15:37:34 +0200 received badge  Student (source)
2012-01-06 12:06:02 +0200 asked a question Min and functions

Hi,

I'm wondering why the next code doesn't work as intended:

myMin(x,y) = min(x,y)
print myMin(3,2)

3

However:

print min(3,2)

2

In fact, Sage says that the function myMin is (x, y) |--> x. Why is this? Is there a way I could use min in a symbolic expression?