Questions tagged [inequalities]
69 questions
77
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
- 50,282
- 110
- 242
- 312
17
votes
4 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
- 74,674
- 34
- 147
- 228
11
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
- 319
- 1
- 3
- 9
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
- 3,124
- 2
- 26
- 26
6
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
- 73
- 1
- 3
6
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
- 520
- 6
- 17
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
- 7,644
- 7
- 42
- 53
4
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
- 41
- 1
- 3
3
votes
1 answer
How do I solve inequalities with Sympy?
Objective: I want to implement a Fourier-Motzkin Elimination using Sympy. The first step for this would be to solve a number of inequalities.
Problem: The tools for solving inequalities with Sympy like solveset, solve_poly_inequality or…

R.Deilke
- 65
- 8
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
- 21,021
- 5
- 43
- 58
2
votes
1 answer
Detecting inconsistency in a set of non-strict inequalities
Given a set of variables and a set of strict inequalities, it's straightforward enough to detect whether there is an inconsistency: make a directed graph whose nodes are variables; for each assertion a > b add an edge from a to b and vice versa for…

rwallace
- 31,405
- 40
- 123
- 242
2
votes
1 answer
How do I apply conditional statements to multiple columns on Pandas Dataframe using iloc?
Assuming I have a dataframe like this:
# importing pandas and numpy
import pandas as pd
import numpy as np
# create a sample dataframe
data = pd.DataFrame({
'A' : [ 1, 2, 3, -1, -2, 3],
'B' : [ -1, -2, -3, 12, -12, -3],
'C' : [ 1, -2,…

Kai
- 43
- 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,265
- 12
- 12
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…

user3212686
- 21
- 4
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));…

AwesomeBen1
- 75
- 10