Questions tagged [inequalities]

54 questions
76
votes
4 answers

jQuery: Selecting all elements where attribute is greater than a value

I know that to filter an element with an atttribute called attrName which has value attrValue I do: filter("[attrName='attrValue']") but looking at the docs http://api.jquery.com/category/selectors/ I can't see an option to select all elements s.t.…
Ankur
  • 47,089
  • 107
  • 237
  • 309
13
votes
3 answers

What is the operator precedence when writing a double inequality in Python (explicitly in the code, and how can this be overridden for arrays?)

What is the specific code, in order, being executed when I ask for something like >>> 1 <= 3 >= 2 True If both have equal precedence and it's just the order of their evaluation, why does the second inequality function as (3 >= 2) instead of (True…
ely
  • 63,678
  • 30
  • 130
  • 206
8
votes
2 answers

How to solve multivariate inequalities with python and sympy?

I'm quite new using python and Sympy... And got a problem to solve multivariate inequalities using sympy. Let's say I have a lot of functions in a file which look like this : cst**(sqrt(x)/2)/cst exp(sqrt(cst*x**(1/4))) log(log(sqrt(cst…
sloan
  • 179
  • 2
  • 6
7
votes
4 answers

First circle of R hell. 0.1 != 0.3/3

Possible Duplicate: Numeric comparison difficulty in R Hello All, According to "R Inferno" paper. I'm right now in the first circle of R hell. This is where pagans expect 0.1 == 0.3/3. Paper recommends using all.equal function for such cases,…
ilya
  • 2,774
  • 1
  • 23
  • 25
5
votes
3 answers

Python inequality operators; comparing lists

Having trouble understanding Python behavior when using inequality operators to compare lists. Here's a snippet using the python3 command line interpreter: >>> [8] < [7] False >>> [8] < [9] True >>> [8, 6] < [9] True >>> [8, 6] < [9, 7] True …
StayCool
  • 448
  • 6
  • 14
4
votes
1 answer

Performance problems: Solving an inequality with several assumptions in Mathematica

I need to prove an inequality (or find a counter example) given several assumptions (also inequalities). Unfortunately the inequality to prove is a quite long and complicated expression. There are about 15 variables and FullSimplify's output fills…
lumbric
  • 4,739
  • 4
  • 36
  • 44
3
votes
3 answers

Solve a system of linear equations and linear inequalities

I have to get the min and max y for a linear expression, restricted by some linear inequalities in python. You can see the equation and inequalities here that I have entered into Desmos: 3x+12y = 1000 x > 30 x < 160 y < 60 y > 10 x + y > 180 I can…
random12231
  • 43
  • 1
  • 3
3
votes
1 answer

Solving a system of (more than two) linear inequalities

If I use diophantine(2*x+3*y-5*z-77) I receive this result. {(t_0, -9*t_0 - 5*t_1 + 154, -5*t_0 - 3*t_1 + 77)} Fine so far. However, on occasion one might like to constrain x, y and z to be (say) non-negative. When I use an approach like…
Bill Bell
  • 19,309
  • 5
  • 39
  • 53
3
votes
3 answers

how to plot 3d inequalities on matlab

I want to plot a 3d region in MATLAB bounded from a set of inequalities. For example: 0 <= x <= 1 sqrt(x) <= y <= 1 0 <= z <= 1 - y I found a 2d example that someone has done on this site but I'm not sure how to convert that to 3d. How to plot…
user1680079
  • 31
  • 1
  • 3
2
votes
6 answers

Multiple inequality (a < b < c...) with potentially missing value

I would like to test multiple inequalities at once, i.e. if (a < b < c < ...) which is fine when all the values are present. However sometimes the numeric value of one or more of the variables to be compared may be missing/unknown; the correct…
ChrisW
  • 1,115
  • 8
  • 11
2
votes
1 answer

How to solve inequalities with Symja?

Does anyone know how to solve one simple inequalities in Symja? I try like this: EvalUtilities solver = new EvalUtilities(); myExpresion = "Solve[Less[{2*x + 4},{10}],{x}]"; IExpr result = solver.evaluate(myExpresion); But this doesn't work. How…
2
votes
2 answers

What's the correct syntax for variable inequalities in bash?

I'm a bit new to bash so please excuse any naive questions or nooby stuff I do. So I wrote a quick script that lists all tput colors, and it works pretty well. It looks like this: unset x; for i in {1..256}; do tput setab $x; echo $x; x=$((x+1));…
2
votes
1 answer

Solving integer constrained optimization problems

I'm new to these problems both mathematically and programmatically. If anyone could suggest a c++ library to use that could solve the following problem I would really appreciate it. Given constants: {x_1, ..., x_n}, {y_1, ..., y_n}, {z_1, ..., z_n},…
Dan
  • 96
  • 3
1
vote
3 answers

JavaScript operator for "within x of"

is there a JavaScript operator that will check proximity, kind of like a soft equals? For example, instead of if (a == b) it would read if (a is within 5 of b). There is probably no such thing but it would be a big help if there was. thank you
QuinnFreedman
  • 1,664
  • 2
  • 19
  • 34
1
vote
0 answers

Plotting constraints in 3D

I would like to be able to visualise a volume (or the surface representing its bound) defined by constraints in 3D. More precisely, I have some constraints, for example f0(x,y,z)=(( not ((157.0/1.0) < (((-20.0/1.0) * (y)) + ((-380.0/1.0) * (x)))) )…
1
2 3 4