MathGroup Archive 2006

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

Search the Archive

FindInstance returning incorrect results

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71344] FindInstance returning incorrect results
  • From: Jason Grout <jason-mathematica at creativetrax.com>
  • Date: Wed, 15 Nov 2006 06:44:16 -0500 (EST)

I ran into the following problem with FindInstance today.  Is this a 
known problem?  Am I using FindInstance correctly?  A simple example 
where the problem comes up is in finding values c and d such that c^2=-1 
and c*d=I.

First, let's make sure a solution exists:

Clear[c,d]; Solve[{c*c== -1, c*d== I},{c,d}]

gives

{{c -> -I, d -> -1}, {c -> I, d -> 1}}, which is correct.

FindInstance[c*c== -1 && c*d == I, {c,d}] gives the _incorrect_ answer 
{{c -> 0, d -> 0}}.

FindInstance[c*c == -1 && c*d == I, {c,d}, Complexes]
  also gives {{ c -> 0, d -> 0}}, which again is an incorrect answer.

However, if I ask for more than one solution, FindInstance gives correct 
answers.  For example:

FindInstance[c*c == -1 && c*d == I, {c,d}, 2] gives the answers that 
Solve gave above.

Am I using FindInstance incorrectly?  It seems odd that I get correct 
answers only when I ask for more than one answer.  The documentation 
mentions that FindInstance uses a faster method for generating an 
example if only one example is needed--is that causing a problem here? 
Can I be sure that if I ask for more than one answer, I'll get correct 
answers?  On a related note, if FindInstance returns {}, does that mean 
a solution does not exist, or merely that FindInstance couldn't find a 
solution?

Thanks,

Jason Grout

--
Jason Grout
jason-mathematica at creativetrax.com


  • Prev by Date: Re: Re: Function to solve polynomial
  • Next by Date: Re: List difference using patterns and substitutions.
  • Previous by thread: Re: transcendental equation
  • Next by thread: Re: FindInstance returning incorrect results