MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Sign Query

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19755] Re: Sign Query
  • From: Adam Strzebonski <adams at wolfram.com>
  • Date: Wed, 15 Sep 1999 03:53:05 -0400
  • Organization: Wolfram Research, Inc.
  • References: <7ri5nq$8ih@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

David Ridley wrote:

> Hello,
>
> Please excuse my ignorance.  I'm trying to sign a function and wonder
> how
> to go about making some assumptions.
>
> In general, my problem is as follows:
> a=b-c
> Sign[a]
> I know that b<0 and c>0.  How do I tell Mathematica?

In Mathematica 4 you can use Simplify with assumptions.

In[1]:= Simplify[Sign[b-c], b<0 && c>0]

Out[1]= -1

> -------
>
> More specifically, my problem is the following:
>
> focp=(-(1+r)Q1[P]-(1+g)Q2[(1+g)P]+c(1+r)Q1'[P]+c(1+g)Q2'[(1+g)P])
> /((1+r)Q1'[P]+(1+g)^2Q2'[(1+g)P])
>
> dpdg=Simplify[D[focp,g]]
>
> Sign[dpdg]
>
> where:
> c,g,r,P,Q1,Q2 >0
> Q1',Q2'<0
> Q1", Q2" ???
>

If these assumptions were sufficient to determine the sign of dpdg
Simplify[Sign[dpdg], assumptions] would give 1 or -1. (The assumptions
would need to be written in terms of Variables[dpdg], i.e. Q2[(1+g)P]>0,

rather than Q2>0 etc.)

However, Sign[dpdg] depends on the value of Q2''. We can prove it
using Developer`InequalityInstance.

In[2]:= focp=(-(1+r)Q1[P]-(1+g)Q2[(1+g)P]+c(1+r)Q1'[P]+
        c(1+g)Q2'[(1+g)P])/((1+r)Q1'[P]+(1+g)^2Q2'[(1+g)P]);

In[3]:= dpdg=Simplify[D[focp,g]];

In[4]:= vars=Variables[dpdg]

Out[4]= {c, g, P, r, Q1[P], Q2[(1 + g) P], Q1'[P], Q2'[(1 + g) P],
>    Q2''[(1 + g) P]}

In[5]:= ineqs=And@@(#>0&/@Take[vars, 6]) && vars[[7]]<0 && vars[[8]]<0

Out[5]= c > 0 && g > 0 && P > 0 && r > 0 && Q1[P] > 0 &&
>    Q2[(1 + g) P] > 0 && Q1'[P] < 0 && Q2'[(1 + g) P] < 0

In[6]:= <<Developer`

This finds a point satisfying the assumptions ineqs, for which dpdg>0.

In[7]:= InequalityInstance[ineqs && dpdg>0, vars]

Out[7]= {r -> 1, g -> 1, Q2[(1 + g) P] -> 1, Q1[P] -> 1,
>    Q2'[(1 + g) P] -> -1, Q1'[P] -> -1, c -> 1, P -> 1,
>    Q2''[(1 + g) P] -> 2}

This finds a point satisfying the assumptions ineqs, for which dpdg<0.

In[8]:= InequalityInstance[ineqs && dpdg<0, vars]

Out[8]= {r -> 1, g -> 1, Q2[(1 + g) P] -> 1, Q1[P] -> 1,
>    Q2'[(1 + g) P] -> -1, Q1'[P] -> -1, c -> 1, P -> 1,
>    Q2''[(1 + g) P] -> 0}


Best Regards,

Adam Strzebonski
Wolfram Research



  • Prev by Date: SUMMARY: NIntegrate: <XXX> should be a machine-size complex...
  • Next by Date: Image-Sequence analyse with M4
  • Previous by thread: Sign Query
  • Next by thread: 3DPlots... Also, generalizations to nDPlots, n>3