This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

FindInstance

FindInstance
finds an instance of vars that makes the statement expr be True.
FindInstance
finds an instance over the domain dom. Common choices of dom are Complexes, Reals, Integers, and Booleans.
FindInstance
finds n instances.
  • FindInstance gives results in the same form as Solve: if an instance exists, and if it does not.
  • expr can contain equations, inequalities, domain specifications and quantifiers, in the same form as in Reduce.
  • With exact symbolic input, FindInstance gives exact results.
  • Even if two inputs define the same mathematical set, FindInstance may still pick different instances to return.
  • The instances returned by FindInstance typically correspond to special or interesting points in the set.
  • FindInstance assumes by default that quantities appearing algebraically in inequalities are real, while all other quantities are complex.
  • FindInstance[expr, vars, Reals] assumes that not only vars but also all function values in expr are real. FindInstance[expr&&varsReals, vars] assumes only that the vars are real.
  • FindInstance may be able to find instances even if Reduce cannot give a complete reduction.
  • Every time you run FindInstance with a given input, it will return the same output.
  • Different settings for the option RandomSeed->s may yield different collections of instances.
  • FindInstance will return a shorter list if the total number of instances is less than n.
Find a solution instance of a system of equations:
Find a real solution instance of a system of equations and inequalities:
Find an integer solution instance:
Find Boolean values of variables that satisfy a formula:
Find several instances:
Find a solution instance of a system of equations:
In[1]:=
Click for copyable input
Out[1]=
 
Find a real solution instance of a system of equations and inequalities:
In[1]:=
Click for copyable input
Out[1]=
 
Find an integer solution instance:
In[1]:=
Click for copyable input
Out[1]=
 
Find Boolean values of variables that satisfy a formula:
In[1]:=
Click for copyable input
Out[1]=
 
Find several instances:
In[1]:=
Click for copyable input
Out[1]=
A linear system:
A univariate polynomial equation:
A multivariate polynomial equation:
Systems of polynomial equations and inequations:
This gives three solution instances:
If there are no solutions FindInstance returns an empty list:
If there are fewer solutions than the requested number, FindInstance returns all solutions:
Quantified polynomial system:
An algebraic system:
Transcendental equations:
In this case there is no solution:
A solution in terms of transcendental Root objects:
A system of transcendental equations:
A linear system:
A univariate polynomial equation:
A univariate polynomial inequality:
A multivariate polynomial equation:
A multivariate polynomial inequality:
Systems of polynomial equations and inequalities:
Get four solution instances:
If there are no solutions FindInstance returns an empty list:
If there are fewer solutions than the requested number, FindInstance returns all solutions:
A quantified polynomial system:
An algebraic system:
Piecewise equations:
Piecewise inequalities:
Transcendental equations:
A solution in terms of transcendental Root objects:
Transcendental inequalities:
Transcendental systems:
A linear system of equations:
A linear system of equations and inequalities:
Find more than one solution:
A univariate polynomial equation:
A univariate polynomial inequality:
Binary quadratic equations:
A Thue equation:
If there are fewer solutions than the requested number, FindInstance returns all solutions:
A sum of squares equation:
The Pythagorean equation:
A bounded system of equations and inequalities:
A high-degree system with no solution:
Transcendental Diophantine systems:
A polynomial system of congruences:
A linear system:
A univariate polynomial equation:
A multivariate polynomial equation:
Find seven instances:
A system of polynomial equations and inequations:
A quantified polynomial system:
Mixed real and complex variables:
Find a real value of and a complex value of for which is real and less than :
An inequality involving Abs[z]:
Find a solution over the integers modulo 9:
Find three solutions:
Finding instances often involves random choice from large solution sets:
By default, FindInstance chooses the same solutions each time:
With a different , FindInstance may give different solutions:
Finding an exact solution to this problem is hard due to high degrees of algebraic numbers:
With a finite WorkingPrecision, FindInstance is able to find an approximate solution:
Find a point in the intersection of two regions:
Find a counterexample to a geometric conjecture:
Prove the conjecture using stronger assumptions:
Prove that a statement is a tautology:
This can be proven with TautologyQ as well:
Show that a statement is not a tautology; get a counterexample:
This can be done with SatisfiabilityInstances as well:
Find a Pythagorean triple:
Find Pythagorean triples when they exist:
Two instances are now found when :
Show that there are no 2×2 magic squares with all numbers unequal:
Solution instances satisfy the input system:
Use RootReduce to prove that algebraic numbers satisfy equations:
When there are no solutions, FindInstance returns an empty list:
If there are fewer solutions than the requested number, FindInstance returns all solutions:
To get a complete description of the solution set use Reduce:
To get a generic solution of a system of complex equations use Solve:
Solving a sum of squares representation problem:
Use SquaresR to find the number of solutions to sum of squares problems:
Solving a sum of powers representation problem:
Use PowersRepresentations to enumerate all solutions:
Find instances satisfying a Boolean statement:
Use SatisfiabilityInstances to obtain solutions represented as Boolean vectors
Integer solutions for a Thue equation:
New in 5