Ask Your Question
1

why sagemath returns 2 solution instead of one

asked 2020-07-04 12:49:23 -0500

lolora gravatar image

when I run the expression

solve([x>=3, x >=5, x < 8],x)

It returns

[[5 < x, x < 8], [x == 5]]

But I'm hoping that it would return

[[5 <= x, x < 8]]

How do I get my expected value?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2020-07-05 01:41:12 -0500

Emmanuel Charpentier gravatar image

A possible alternative :

sage: solve([x>=3, x >=5, x < 8],x, algorithm="sympy")
[[5 <= x, x < 8]]

HTH,

edit flag offensive delete link more
1

answered 2020-07-04 13:32:07 -0500

Cyrille gravatar image

updated 2020-07-04 13:36:11 -0500

Sage gives the hand to Maxima to solve a Fourier-Motzkin list of inequalities. And if there is an explicit solution in equality terms Maxima gives it. Because if $x= 5$ necessarily $x<8$. There is no more to say. Try successively

solve([x <= 5, x<8],x)

solve([x < 5, x<8],x)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-07-04 12:49:23 -0500

Seen: 117 times

Last updated: Jul 05