Questions tagged [inequalities]

69 questions
0
votes
1 answer

How to create a new ndarray after performing a calculation on a slice

I have a 4d numpy array, I want to perform a calculation on several slices of it and then create a new array with all the values in. The main problem is I have fixed slices for 3 dimensions but then several ranges for the fourth axis how do I slice…
0
votes
0 answers

Making high quality overlapping inequality plots in Matlab?

I need to make publication quality plots showing domains in parameter space bounded by various inequalities (f1(x,y)>0, f2(x,y)>0, ...) where some regions will satisfy several inequalities and should have blended flat colours. There are various…
0
votes
0 answers

Dynamically generate constrained solutions that meet multiple criteria

I feel like there is an elegant Python solution for this problem that I've been trying to solve with VBA. Can someone please help? How can I generate a list of numbers that meet the following criteria: Are all integers The total is first split…
Kdog
  • 503
  • 5
  • 20
0
votes
2 answers

Python: automating the generation of a variable number of if statements

I have two numpy arrays similar to these, which represent coordinates: import numpy as np x=np.array([1,3,2,4,6,5,4,1]) y=np.array([4,4,3,2,2,1,3,5]) I also have n squares: s1 -> x=0 to 3, y=0 to 3 s2 -> x=3 to 6, y=3 to 6 s3 -> ... s4 -> ... and…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
0
votes
1 answer

context free grammar with certain inequalities

What could be the correct Context free grammar for the Language L= {a^i b^j a^k | j< i + k} ? I want to know about the correctness of following CFG for this- S-> aaSbA | A | ^ A-> bAa | a Are there any standard rules for getting strings satisfying…
Raj Chauhan
  • 15
  • 1
  • 8
0
votes
1 answer

Plotting inequalities domain comb-style with JSXGraph

I want to draw axis line with comb-styled selection of inequality domain, like in this picture: Is it possible with JSXGraph?
Tigran Saluev
  • 3,351
  • 2
  • 26
  • 40
0
votes
2 answers

How to code check if system of inequalities has a solution

I need to find algorithm that can check if system like this x1 * k + b > y1, x2 * k + b > y2, ..., xn * k + b < yn has solution(s) where i substitute x[i] and y[i] and unknown varialbes are k,b.
Dima Stoyanov
  • 121
  • 1
  • 11
0
votes
1 answer

Returning Conditions on System of Linear INequalities

I am trying to solve linear inequalities for the conditions on the set of solutions. For example: syms p C L D W assume([p, C, W, D, L] >= 0) eqn5 = p*C + L - D < 0; eqn6 = p*C > 0; solp2 = solve([eqn5, eqn6], [p, C, W, D, L], 'ReturnConditions',…
user3859248
  • 97
  • 2
  • 11
0
votes
1 answer

Solving a system of linear inequalities in Matlab and getting the entire set of solutions

I want to solve a system of linear inequalities in Matlab, where the unknowns are x(1), x(2), x(3), x(4). I want the entire set of solutions x(1), x(2), x(3), x(4). Hence, I can't use linprog because it gives me just one feasible point.…
TEX
  • 2,249
  • 20
  • 43
0
votes
1 answer

Trouble with limiting user's input

For the following, Im trying to limit the users input to only Y or y or N or n. Please follow my comments on the codes so I can point out what the problem is. I'm very new to this forum, I have a lot of passion for programming, please help me if…
Robin
  • 1
  • 1
0
votes
1 answer

optimization of a linear system of inequalites

We are given four points, assumed to be ordered: A = sort(randn(1,4)) I want to find the maximum possible number x in the interval 0
0
votes
1 answer

Asymptotic Analysis Inequalities

I have a problem understanding how the following inequalities highlighted in red were derived for this asymptotic analysis problem. Could someone explain the nature of these inequalities and how they came to be. The following picture has the problem…
0
votes
0 answers

Inequality in MIPS

May I ask if I have gotten it right for the following inequality equivalent in MIPS? Or is there any better way to implement with the basic commands of slt and bne and bqe? less than < slt $t0, $s1, $s2 beq $t0, $zero, L .... L: less than equals…
toffee.beanns
  • 435
  • 9
  • 17
0
votes
1 answer

Inequality solving using Prolog

I am working on solving inequality problems using prolog.I have found a code and it solves ax+b>=0 type equations. The code I have used is as follows. :-use_module(library(clpr)). dec_inc(left,right):- …
ict
  • 95
  • 1
  • 5
0
votes
1 answer

simplify a simple inequity with Sympy

Let's say that I know that x is bigger than y and both x and y are bigger than 0. Can someone please help me write a function that takes two linear formulas (+/- only) and returns which one is bigger? For example: foo("x+y","2*x") #should return…
Chiko
  • 606
  • 9
  • 21