ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 11 Dec 2019 23:21:21 +0100Solve set of equations with all unique values in sagehttps://ask.sagemath.org/question/48966/solve-set-of-equations-with-all-unique-values-in-sage/ 0
I have defined a set of 20 equations, consisting of 22 variables.
Now I want to implement that each variable needs to have a unique value.
I've tried via assumptions: assume(A!=B) assume(B!=C)...and so on. But this does not seam to solve the equation. I've also tried to add these unequalities to the set of equations, which also still have 2 parameters in my solutionset.
ps. I also know that each value is an integer. And that the difference between the highest and the lowest value is smaller than a certain number (e.g. 40). But I believe I have implemented this correctly via:
assume(A, 'integer')
assume(B, 'integer')
assume(C, 'integer')
...
and
assume((max_symbolic(A,B,C,...)-min_symbolic(A,B,C,...)) < 40)
0
I have defined a set of 20 equations, consisting of 22 variables.
Now I want to implement that each variable needs to have a unique value.
I've tried via assumptions: assume(A!=B) assume(B!=C)...and so on. But this does not seam to solve the equation. I've also tried to add these unequalities to the set of equations, which also still have 2 parameters in my solutionset.
ps. I also know that each value is an integer. And that the difference between the highest and the lowest value is smaller than a certain number (e.g. 40). But I believe I have implemented this correctly via:
assume(A, 'integer')
assume(B, 'integer')
assume(C, 'integer')
...
and
assume((max_symbolic(A,B,C,...)-min_symbolic(A,B,C,...)) < 40)Fri, 06 Dec 2019 15:59:13 +0100https://ask.sagemath.org/question/48966/solve-set-of-equations-with-all-unique-values-in-sage/Comment by rburing for <p>0</p>
<p>I have defined a set of 20 equations, consisting of 22 variables.</p>
<p>Now I want to implement that each variable needs to have a unique value.</p>
<p>I've tried via assumptions: assume(A!=B) assume(B!=C)...and so on. But this does not seam to solve the equation. I've also tried to add these unequalities to the set of equations, which also still have 2 parameters in my solutionset.</p>
<p>ps. I also know that each value is an integer. And that the difference between the highest and the lowest value is smaller than a certain number (e.g. 40). But I believe I have implemented this correctly via:</p>
<p>assume(A, 'integer')</p>
<p>assume(B, 'integer')</p>
<p>assume(C, 'integer')</p>
<p>...
and</p>
<p>assume((max_symbolic(A,B,C,...)-min_symbolic(A,B,C,...)) < 40)</p>
<p>0</p>
<p>I have defined a set of 20 equations, consisting of 22 variables.</p>
<p>Now I want to implement that each variable needs to have a unique value.</p>
<p>I've tried via assumptions: assume(A!=B) assume(B!=C)...and so on. But this does not seam to solve the equation. I've also tried to add these unequalities to the set of equations, which also still have 2 parameters in my solutionset.</p>
<p>ps. I also know that each value is an integer. And that the difference between the highest and the lowest value is smaller than a certain number (e.g. 40). But I believe I have implemented this correctly via:</p>
<p>assume(A, 'integer')</p>
<p>assume(B, 'integer')</p>
<p>assume(C, 'integer')</p>
<p>...
and</p>
<p>assume((max_symbolic(A,B,C,...)-min_symbolic(A,B,C,...)) < 40)</p>
https://ask.sagemath.org/question/48966/solve-set-of-equations-with-all-unique-values-in-sage/?comment=48968#post-id-48968Can you add the set of equations? Select your code and press the '101010' button to format it correctly.Fri, 06 Dec 2019 22:51:39 +0100https://ask.sagemath.org/question/48966/solve-set-of-equations-with-all-unique-values-in-sage/?comment=48968#post-id-48968Comment by ablmf for <p>0</p>
<p>I have defined a set of 20 equations, consisting of 22 variables.</p>
<p>Now I want to implement that each variable needs to have a unique value.</p>
<p>I've tried via assumptions: assume(A!=B) assume(B!=C)...and so on. But this does not seam to solve the equation. I've also tried to add these unequalities to the set of equations, which also still have 2 parameters in my solutionset.</p>
<p>ps. I also know that each value is an integer. And that the difference between the highest and the lowest value is smaller than a certain number (e.g. 40). But I believe I have implemented this correctly via:</p>
<p>assume(A, 'integer')</p>
<p>assume(B, 'integer')</p>
<p>assume(C, 'integer')</p>
<p>...
and</p>
<p>assume((max_symbolic(A,B,C,...)-min_symbolic(A,B,C,...)) < 40)</p>
<p>0</p>
<p>I have defined a set of 20 equations, consisting of 22 variables.</p>
<p>Now I want to implement that each variable needs to have a unique value.</p>
<p>I've tried via assumptions: assume(A!=B) assume(B!=C)...and so on. But this does not seam to solve the equation. I've also tried to add these unequalities to the set of equations, which also still have 2 parameters in my solutionset.</p>
<p>ps. I also know that each value is an integer. And that the difference between the highest and the lowest value is smaller than a certain number (e.g. 40). But I believe I have implemented this correctly via:</p>
<p>assume(A, 'integer')</p>
<p>assume(B, 'integer')</p>
<p>assume(C, 'integer')</p>
<p>...
and</p>
<p>assume((max_symbolic(A,B,C,...)-min_symbolic(A,B,C,...)) < 40)</p>
https://ask.sagemath.org/question/48966/solve-set-of-equations-with-all-unique-values-in-sage/?comment=49002#post-id-49002You probably should use a SMT solver like z3.Wed, 11 Dec 2019 23:21:21 +0100https://ask.sagemath.org/question/48966/solve-set-of-equations-with-all-unique-values-in-sage/?comment=49002#post-id-49002