Ask Your Question
1

why sagemath returns 2 solution instead of one

asked 2020-07-04 19:49:23 +0200

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 08:41:12 +0200

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 20:32:07 +0200

Cyrille gravatar image

updated 2020-07-04 20:36:11 +0200

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 19:49:23 +0200

Seen: 384 times

Last updated: Jul 05 '20