282 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
3
answers
241
views
R - Subset rows in data.table using the columns named in a variable with inequalities (< 0, > 0)
Here is an example data.table which is similar to my real table:
library(data.table)
dttest <- data.table(Name = c("Stream 1", "Stream 2", "Stream 3", "Stream 4&...
2
votes
2
answers
152
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
41
views
Execution time of inequality with numpy array
Getting two widely different execution times in the below
import numpy as np
import time
array = np.arange(0, 750000)
param = 20000
t1 = time.time()
for _ in range(param):
array <= 120
print(...
0
votes
1
answer
106
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
41
views
Sympy is struggling to evaluate an inequality relational Kronecker delta function after subbing in values to a numerical value
I'm trying to evaluate this function after subbing in all the respective values. For some reason, this function ends up stopping here and can't be evaluated further into a numerical value.
I've tried ...
0
votes
0
answers
27
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 ...
1
vote
1
answer
66
views
Using sympy to solve an inequality with two variables
I'm trying to use Sympy to solve 0 < x + y <= 4 in the case where both x and y are positive integers or 0, in the hopes to have it return a list of tuples that solves the inequality.
import ...
0
votes
1
answer
80
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 ...
2
votes
1
answer
58
views
Why does sympy.solve produce empty array for certain inequalities
sympy's solve seems to generally work for inequalities. For example:
from sympy import symbols, solve;
x = symbols('x');
print(solve('x^2 > 4', x)); # ((-oo < x) & (x < -2)) | ((2 < ...
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 ...
0
votes
1
answer
80
views
Using sympy to solve a two-sided inequality with absolute value
Relatively simple math problem, find the range over which 3 <= Abs[6 - x] <= 5. Not hard to solve by hand, and Mathematica nails it, with the answer 1 <= x <= 3 || 9 <= x <= 11.
The ...
1
vote
0
answers
73
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
72
views
when x >= 0 , y >= 0, and y must exceed x by at most 200, does it imply y > x?
The statement below:
y must exceed x by at most 200
can be written as
y - x <= 200
Does the statement imply y must exceed x? y > x ?
For my understanding:
y must exceed x by at most 200
this ...
0
votes
1
answer
288
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.
...
0
votes
0
answers
139
views
Convert all kinds of mathematical equations to a given variable with Python
I want to convert all kinds of mathematical equations to any given variable within that quation using Python. I want this to work with equations with multiple variables and with all kinds of ...