281 questions
2
votes
2
answers
114
views
What formula does Gini() from ineq package use to get the Gini coefficient in R?
I'm writing a paper and I want to declare how I obtained some Gini coefficients using the Gini() function from the ineq package, but when looking for what formula Gini() from ineq uses, I do not find ...
0
votes
1
answer
100
views
Proving non-linear equations and inequalities involving rational numbers in Coq
I'm trying to formalize a stable-coin protocol using the Coq Interactive Theorem Prover. The proofs I have involve a lot of manipulation of linear and non-linear equations involving rational numbers. ...
0
votes
0
answers
23
views
Is there a compact formula for the number of natural solutions of a linear inequality with real coefficients?
I have an inequality in integer nonnegative x,y
x+a*y<=c
where a,c - real positive.
The number of solutions equals
sum (int(c-i*a)+1 for i in range(int(c/a)+1)
Is there a compact (O(1)) formula ...
0
votes
1
answer
76
views
How to solve an inequality that contains standard deviation in python?
I have the past 19 days of stock price stored in the pd.dataframe and I am trying to find out the price P that is smaller than (mean - 2.5*standard deviation), where mean and standard deviation are ...
0
votes
0
answers
29
views
What is the correct way to compare static immutable strings and mutable strings in Rust? [duplicate]
I am new to Rust & I am having trouble to compare mutable strings and immutable strings.
Please find below a code block which should exit if "exit" is entered.
But I am having problem ...
1
vote
0
answers
72
views
How do you get the Simplify function to completely simplify an inequality in Mathematica?
I am working on testing whether a function lies in a given range. Somehow, the function Simplify does not provide the correct (obvious) answer. Why is that ?
The main function corresponds to the ...
0
votes
1
answer
283
views
Solve inequality in Sympy
I'm trying to solve a simple linear inequality in Sympy but can't seem to get it to work.
Basically, I want to be able to calculate the optimal values of a when the inequality happens to be false.
...
1
vote
1
answer
66
views
Sympy.solve is not isolating desired variable in inequality
I want to use nypy.solve to convert a formular to a certain variable. In my example I want to convert the formular a >= ((b-c)/2)*sy.tan(d) to the variable b. But somehow the result of Sympy is not ...
1
vote
1
answer
46
views
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]...
0
votes
1
answer
180
views
Estimating set cardinality by querying
I have the following problem for homework and I was wondering if you could provide some hints.
Your friend has in mind a set of numbers S ⊆ {1, ... , n}. If you ask him about a set Q ⊆ {1, ..., n} he ...
0
votes
1
answer
558
views
Python inequality comparison dealing with floating point precision
I need to compare floating point numbers with inequalities:
if x >= y:
However, due to floating point precision issues, sometimes this fails when it should succeed (x = 0.21 and y= 0....
1
vote
1
answer
179
views
How to prove strict inequality holds for no in Agda
I am currently working on one of the recommended question from the chapter Negation in plfa
Here is the question description:
Using negation, show that strict inequality is irreflexive, that is, n <...
0
votes
0
answers
412
views
Getting any feasible point from a system of linear inequalities in Python
I have a problem with solving a system of linear inequalities in Python.
What I need is basically draw n random feasible points from the inequality system. You could also call it a constraint system ...
3
votes
1
answer
69
views
How can I limit the possible integers used in my solutions in prolog?
I have been trying to learn prolog but I am having issues with limiting the possible integers that can be used in my solutions. For example, In my SWI terminal, I ran
[X,Y,Z] ins 0..1,X #\= Y, Y #\= Z,...
-1
votes
4
answers
1k
views
empty char array, the ways I check it are the same?
I have a char array and I want to check if it is null.
if(_char_array[0] != '\0') {...}
is the same as
if(_char_array != '\0') {...}
thanks
0
votes
1
answer
252
views
Variation without the cost of foods using the Diet Problem(Maximization Problem)
I've been looking for an algorithm that helps me to create the best possible diet based on a certain amount of nutrients. After a lot of research and attempts, it didn't succeed. But I found something ...
2
votes
1
answer
424
views
Fast way to solve system of non-linear equations and linear inequalities?
I have a set of polynomial equations and linear inequalities for real numbers.
How can I determine whether a solution exists?
I need no symbolic solution or a guarantee that the answer is correct, but ...
1
vote
0
answers
386
views
Plotting Inequalities in Sympy Python [duplicate]
I have this code that shows the area that satisfies inequalities but I need the lines (x=3 and y=x) to be shown on the graph as well.
Any help is appreciated!
My Code:
from sympy import *
x, y, z, t = ...
0
votes
1
answer
40
views
How <> works when compared with multiple values?
I have a table and sample data as below.
create table MyTable
(
Col1 NUMBER,
Col2 VARCHAR2(30)
)
MyTable
Col1 Col2
1 | Val1
2 | Val2
3 | Val3
4 | Val4
Below is the query which is ...
1
vote
1
answer
874
views
How to use correctly SLSQP algoritm with non-linear constraints?
I need to find the rectangle with max area inside an ellipse (which may be tilted).
The goal is to gerealize this problem to N dimension, so when we set N=2 we find our rectangle iside an ellipse.
...
-1
votes
1
answer
677
views
Failed assertion: line 677 pos 11: 'field == orders[0][0]'
I don't know why I can not access the data from flutter while using two "where". can any help me to solve this? what I want is to get all the documents between a period of time
Error
The ...
1
vote
0
answers
247
views
Concentration index in Python
I am estimating successful Concentration Index into programming language R with IC2 package. Below you can see function and results
library(IC2)
data(hhbudgets)
calcSConc(hhbudgets[, "transporte&...
0
votes
1
answer
198
views
Inequality Constraint for a PYMC3 Model
I want to define an inequality constraint for a PYMC3 model. I found this post about defining an equality constraint (i.e., a+b1+b2=1) using pm.Potential. Does anyone know how to change that equality ...
-1
votes
3
answers
75
views
Seperate array into three new arrays using inequalities in Python
I am trying to split an array into three new arrays using inequalities.
This will give you an idea of what I am trying to achieve:
measurement = [1, 5, 10, 13, 40, 43, 60]
for x in measurement:
...
-3
votes
1
answer
2k
views
Comparing inequalities for Go bigInt? [closed]
I am trying to compare two big ints. I'm looking at the docs: https://pkg.go.dev/math/big#Int and I don't see an inequality operator, but I do see an equality one (Cmp).
How am I meant to compare a ...