Linear Programming - Absolute value greater than a constant [closed] - constraints

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
How would you convert the constraint |x| >= 2 so that it would work in a Linear Program (in particular, solving using Simplex).
I understand how to convert |x| <= 2 as that would become x <= 2 and -x <= 2
However the same logic does not work when you have a minimum constant.

There is just no way to shoehorn an equation like |x|>=2 into a pure (continuous) LP. You need to formulate x <= -2 OR x >= 2 which is non-convex. This will require a binary variable making the problem a MIP.
One formulation can be:
x >= 2 - delta*M
x <= -2 + (1-delta)*M
delta in {0,1}
where M is judiciously chosen large number. E.g. if -100<=x<=100 then you can choose M=102.

Related

Multiplying fractional exponents [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
I'm doing Tim Roughgarden's Algorithms course and he has a slide with an integer multiplication algorithm.
Whats the rule that makes 10(n/2)a * 10(n/2)c become 10(n)ac ?
What do you do when multiplying fractional exponents like that?
It's based on the First Index Law, where:
am * an = am + n
in your case, the powers add to give n/2 + n/2 = 2n/2 = n
Base is the same so you just add the power of 10 i.e., (n/2) + (n/2) = n. Then it's basic multiplication 10(n)ac= 10(n)ac.

How does using log10 correctly calculate the length of a integer? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
int length = (int) floor( log10 (float) number ) + 1;
My question is essentially a math question: WHY does taking the log10() of a number, flooring that number, adding 1, and then casting it into an int correctly calculate the length of number?
I really want to know the deep mathematical explanation please!
For an integer number that has n digits, it's value is between 10^(n - 1)(included) and 10^n, and so log10(number) is between n - 1(included) and n. Then the function floor cuts down the fractional part, leaves the result as n - 1. Finally, adding 1 to it gives the number of digits.
Consider that a four-digit number x is somewhere between 1000 <= x < 10000. Taking the log base 10 of all three components gives 3.000 <= log(x, 10) < 4.000. Taking the floor (or int) of each component and adding one gives 4 <= int(log(x, 10))+1 <= 4.
Ignoring round-off error, this gives you the number of digits in x.

Stability by multiplication with a matrix? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I am wondering how to prove (or disprove) that
if $A$ is a matrix $n \times n$ and
$b_1....b_k$ are $k$ vectors in $\mathbb{R}^{n}$
so that $Ab_1, ..., Ab_{k}$ is a set of generators in $\mathbb{R}^{n}$
then so is the family of vectors $b_{1},...,b_{k}$.
Thanks.
In essence, this question is asking if rank(A*B)=n implies rank(B)=n. This is a consequence of
rank(A*B) <= min( rank(A), rank(B) )
and the fact that for reasons of dimension of the spaces involved, rank(A) <= n and rank(B) <= min(k, n), so that the combined chain
n = rank(A*B) <= min( rank(A), rank(B) ) <= min(k, n)
leaves not much wiggle space.
As the question, this answer is off-topic for SO and belongs to math.SE.

Differentiation Math Limits [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
limit x-->3 2x^2 + 7x-15/x-3
What i Simplified
Step 1 : 2x^2 + 10x -3x -15 / x-3
Step 2 : 2x( x + 5)-3( x + 5)/x-3
Step 3 : (2x - 3)(x + 5)/x-3
but unable to move further.. im thinking either the question ix wrong or there ix some trick which im unable to understand
thanx in advance
as x -> 3, the numerator goes to 3 * 8 = 24 and the denominator goes to 0, so the limit goes to +infinity if you approach 3 from the right, and -infinity if you approach 3 from the left
since you didn't specify which direction, the limit does not exist.
try graphing it: https://www.desmos.com/calculator

primes and logarithms [theory] [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I know this is not a mathematical forum but given the bright minds that participate here, i am sure that this question is of interest nevertheless. How would you develop and explain the following statement:
"we can convert the product of a set
of primes into a sum of the logarithms
of the primes by applying logarithms
to both parts of this conjecture"
log(a * b) = log(a) + log(b)
thanks for that OrangeDog and John!
re benefit of introducing logs, OrangeDog is right indeed. It is specific to an exercise from an MIT OpenCourse class. Here's the full details:
There is a cute result from number
theory that states that for
sufficiently large n the product of
the primes less than n is less than or
equal to e^n and that as n grows,
this becomes a tight bound (that is,
the ratio of the product of the primes
to e^n gets close to 1 as n grows).
Computing a product of a large number
of prime numbers can result in a very
large number, which can potentially
cause problems with our computation.
[note: this is what John was referring
to] So we can convert the product of a
set of primes into a sum of the
logarithms of the primes by applying
logarithms to both parts of this
conjecture. In this case, the
conjecture above reduces to the claim
that the sum of the logarithms of all
the primes less than n is less than n,
and that as n grows, the ratio of this
sum to n gets close to 1.
EDIT
given these statements i am, however, unsure about how to apply them i.e.
how do we go from here:
2 x 3 x 5 <= e^7
to
"applying
logarithms to both parts of this
conjecture."
EDIT 2
got it...
2 x 3 x 5 <= e^7
knowing that logarithms are the opposite of powers we can say:
log(2x3x5) <= 7
which is also the same as:
log(2)+log(3)+log(5) <= 7
this only starts to show its "value" when n (in this case 7) gets larger i.e. the 1000th prime or higher

Resources