Questions tagged [inequalities]

69 questions
2
votes
2 answers

Number Comparisons in Batch Code

I'm having difficulty with number comparisons like <, >, and == in my Batch code. What Im doing is generating a random number and using that answer to do something, this is what I've written: set rand=%random% set rand=%rand:~1,1% If %rand%==9 goto…
Maikeru Konare
  • 21
  • 1
  • 1
  • 5
2
votes
4 answers

Double variable if statement not working

I'm making a double variable if statement and it keeps returning an error. I don't know what's wrong: variable = float(0) for index in range(10): variable = variable + float(2) if x <= float(variable/3) and > float(variable-2.0/3): …
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
  • 2,242
  • 2
  • 25
  • 42
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
vote
1 answer

Fitting 16 variables in 17 inequalities in Python

I have 17 inequalities: 1: (x[0] + x[1] + x[2] + x[4] + x[6] + x[7])/(x[0] + x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7]) >= 0.4 2: (x[3] + x[5])/(x[0] + x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7]) <= 0.6 3: x[0]/(x[0] + x[1] + x[2] + x[3]…
1
vote
1 answer

Trouble plotting inequalities and controlling linetype and color/pattern of fill

As part of a larger project in which VBA creates worksheets using excel data and a word template I am learning gnuplot which VBA will also control. I am trying to plot 2 functions in the same graph and shade a side. I would like for the function…
Mark Barry
  • 13
  • 4
1
vote
1 answer

clicker game images not updating

It seems that everything is working and even the images are working but instead of disappearing after the (price) or (popularity) gets too high for the image, the image seems to stay there and the images stack on each other. Another thing that seems…
RoRo
  • 47
  • 4
1
vote
1 answer

How do one solve linear programming problems with ojAlgo?

I am trying to learn how to solve a linear programming problem and I want to use ojAlgo LinearSolver. I solve the equality constraints using a SolverTask and get a single feasible point. Nice! Then I solve what I believe is an identical problem…
Magnus
  • 35
  • 5
1
vote
1 answer

Replace inequalities with values in dataframe in R

I have a dataframe that involves several columns, in which there are many instances where inequalities are present. What I would like to have, is an R script that will identify these inequalities and replace them with actual values. More specific,…
1
vote
3 answers

Solve linear Inequalities

I want to solve a system of inequalities A x <= b, namely to visualize the set of solutions of this system. Are there any ways to do this in Python? The solutions I've found using the scipy library give only one vertex. A = np.array([[-1, 1], …
ZanoAl
  • 13
  • 4
1
vote
1 answer

How can i sort a list from specifik criteria

I have this list and I want to sort the list. This is just a smaller example of what I want to do, but I get the same error. I dont understand why I can't make this work. I have tried using google to solve the problem but without luck. lst = [3, 4,…
1
vote
2 answers

Using matplotlib, is there a way to create simple 2d plots of basic inequalities

How can one creat a simple, 2 dimensional plot of a basic inequality. The result is a numbered line with one or two lines overlaid. The line or lines would begin or end with an arrow, a filled-in circle, or an open circle.
sophware
  • 23
  • 3
1
vote
2 answers

Multiple Inequalities in Ruby

Complete ruby noob. I have a value which I want to check against several numbers (1,4,7) and if it equals any of them, return false. right now I'm using: if $my_variable_class[1] != 1 && $my_variable_class[1] != 4 && $my_variable_class[1] != 7 …
1
vote
1 answer

Frechet Bounds inequality

In the Frechet Bounds inequality equation, max(0, P(A) + P(B) − 1) ≤ P(A & B) ≤ min(P(A), P(B)) I can totally understand the intuition behind the minimum value of P(A & B) to be "0" and maximum value to be minimum of "P(A) and P(B)" but in what…