FindInstance[expr,vars]
expr がTrueとなる vars の例を求める.
FindInstance[expr,vars,dom]
領域 dom における例を求める.通常 dom はComplexes,Reals,Integers,Booleansのいずれかである.
FindInstance[expr,vars,dom,n]
n 個の例を求める.
FindInstance
FindInstance[expr,vars]
expr がTrueとなる vars の例を求める.
FindInstance[expr,vars,dom]
領域 dom における例を求める.通常 dom はComplexes,Reals,Integers,Booleansのいずれかである.
FindInstance[expr,vars,dom,n]
n 個の例を求める.
詳細とオプション
- FindInstance[expr,{x1,x2,…}]はSolveにおけるのと同形式の結果を返す.例が存在する場合は{{x1->val1,x2->val2,…}},存在しない場合は{}である.
- expr は方程式,不等式,領域指定および量限定子をReduceにおけるのと同じ形で持つことができる.
- 文 expr は,以下の任意の論理結合でよい.
-
lhs==rhs 等しい lhs!=rhs 等しくない lhs>rhs または lhs>=rhs 不等式 expr∈dom 領域指定 {x,y,…}∈reg 領域指定 ForAll[x,cond,expr] 全称記号 Exists[x,cond,expr] 存在記号 - 厳密な記号入力を与えると,FindInstanceは厳密な結果を返す.
- たとえ2つの入力が同じ数学的な集合を定義しても,FindInstanceは別々の例を選んで返すことがある.
- FindInstanceが返す例は通常集合中の特殊なあるいは興味深い点に対応する.
- FindInstance[expr,vars]はデフォルトにより不等式に代数的に現れる数量は実数であり,その他の数量は複素数であると推定する.
- FindInstance[expr,vars,Integers]はディオファントス(Diophantus)方程式の解を求める.
- FindInstance[expr,vars,Booleans]は expr に対するBooleanの充足可能性を求める.
- FindInstance[expr,vars,Reals]は,vars だけでなく,expr におけるすべての関数の値も実数であると推定する.FindInstance[expr&&vars∈Reals,vars]は vars のみが実数であると推定する.
- FindInstance[…,x∈reg,Reals]は,領域 reg 内になるような x を含んでいる.x についての異なる座標はIndexed[x,i]で言及することができる.
- FindInstanceはReduceが完全に簡約できなくても例を見付けられる可能性がある.
- デフォルトで,指定された入力でFindInstanceを実行するたびに同じ出力が返される.
- FindInstance[expr,vars,dom,n]は,例の総数が n よりも小さいときは短いリストを返す.
- 次は使用可能なオプションである.
-
Method Automatic 使用するメソッド Modulus 0 整数に仮定するモジュラス RandomSeeding 1234 ランダム性をどのようにシードするか WorkingPrecision Infinity 内部計算で使用する精度
例題
すべて開く すべて閉じる例 (6)
FindInstance[x ^ 2 + y ^ 2 + z ^ 2 == -1 && z ^ 2 == 2x - 5 y, {x, y, z}]FindInstance[x ^ 2 + y ^ 2 + z ^ 2 ≤ 1 && 9z ^ 3 == 2x - 5 y - 7, {x, y, z}, Reals]FindInstance[x ^ 2 - 3y ^ 2 == 1 && 10 < x < 100, {x, y}, Integers]FindInstance[Xor[a, b, c, d] && (a || b) && !(c || d), {a, b, c, d}, Booleans]FindInstance[x ^ 2 - 3y ^ 2 == 1 && 10 < x < 1000, {x, y}, Integers, 3]FindInstance[{x, y}∈InfiniteLine[{{0, 0}, {2, 1}}] && {x, y}∈Circle[], {x, y}]Graphics[{{Blue, InfiniteLine[{{0, 0}, {2, 1}}], Circle[]}, {Red, Point[{x, y}] /. %}}]スコープ (57)
複素数の領域 (11)
FindInstance[2 x + 3y - 5z == 1 && 3x - 4y + 7z == 3, {x, y, z}]FindInstance[x ^ 3 - 2x + 1 == 0, x]FindInstance[x ^ 1234567 + 9x ^ 2 + 7x - 1 == 0, x, 5]FindInstance[x ^ 2 - y z == 1, {x, y, z}]FindInstance[x ^ 2 + y ^ 3 == z && x + 2y == 3z + 1 && x y z ≠ 0, {x, y, z}]FindInstance[x ^ 2 + y ^ 3 == z && x + 2y == 3z + 1 && x y z ≠ 0, {x, y, z}, 3]解が存在しない場合には,FindInstanceは空リストを返す:
FindInstance[x ^ 2 + y ^ 3 == 3 && x + 2y == 4 && x y == 5, {x, y}]要求した数よりも存在する解の数が少ない場合,FindInstanceはすべての解を返す:
FindInstance[x ^ 2 + y ^ 2 == 1 && x == 2y + 1, {x, y}, 5]FindInstance[x ^ 10000 == y ^ 2 + 3y + 2 && y ^ 10000 == z ^ 2 + 3z + 2 && z ^ 10000 == x ^ 2 + 3x + 2, {x, y, z}, 5]FindInstance[ForAll[x, Exists[y, a x ^ 2 + b y ^ 2 - 3y == 1 && a y ≠ 0]], {a, b}]FindInstance[Sqrt[x + 2y] - 3x + 4y == 5 && x + y ^ (1 / 3) == 1, {x, y}]FindInstance[Sin[x] == 1 / 3, x]FindInstance[ 4 ^ (x ^ 2)2 ^ x == 8, x]FindInstance[Log[x] == 75 / 11 I Pi + 17, x]超越Rootオブジェクトによる解:
FindInstance[Sin[Cos[x ^ 2 - 1]] - x == 1 && Abs[x] < 3, x]FindInstance[Sin[FresnelS[x] + BesselJ[3, x ^ 2 - 1]] == 2 ^ Cos[x] - 3, x, 5]FindInstance[Sin[x + y] == 1 / 2 && E ^ x - y == 1, {x, y}]{{x -> Root[{-1 - 2*Sin[1 - E^#1 - #1] & , 0.24542910765918454774059398459939984605`15.15051499783199}], y -> -1 + E^Root[{-1 - 2*Sin[1 - E^#1 - #1] & , 0.24542910765918454774059398459939984605`15.15051499783199}]}}FindInstance[Gamma[x + y + 1] - Sin[x y] == 1 && Erf[x ^ 2 - y] - E ^ y - x + 4 == 0, {x, y}]FindInstance[Sin[x + y] == x y + 1 && Cos[x - y] == AiryAi[x y] + 2, {x, y}, 3]実領域 (13)
FindInstance[2 x + 3y - 5z == 1 && 3x - 4y + 7z == 3, {x, y, z}, Reals]FindInstance[x ^ 5 - 2x + 1 == 0, x, Reals]FindInstance[x ^ 5 - 2x + 1 < 0, x, Reals]FindInstance[x ^ 2 - y z == 1, {x, y, z}, Reals]FindInstance[x ^ 2 - 2y + z ^ 2 ≥ 1, {x, y, z}, Reals]FindInstance[x ^ 2 + y z == 1 && x + 2y ≤ 3z + 1 && x y z > 7, {x, y, z}, Reals]FindInstance[x ^ 2 + y z == 1 && x + 2y ≤ 3z + 1 && x y z > 7, {x, y, z}, Reals, 4]解が存在しない場合,FindInstanceは空リストを返す:
FindInstance[x ^ 2 + y ^ 3 == 3 && x + 2y ≥ 4 && x y == 5, {x, y}, Reals]要求された数よりも存在する解の数の方が小さい場合,FindInstanceはすべての解を返す:
FindInstance[x ^ 2 + y ^ 2 == 1 && x == 2y + 1, {x, y}, Reals, 5]FindInstance[ForAll[x, Exists[y, a x ^ 2 + b y ^ 2 - 3y == 1 && y < 0]], {a, b}, Reals]FindInstance[Sqrt[x + 2y] - 3x + 4y ≥ 5 && x + y ^ (1 / 3) == 1, {x, y}, Reals]FindInstance[Abs[(x + Abs[x + 2]) ^ 2 - 1] ^ 2 == 9 && x ≠ 0, x, Reals]FindInstance[Max[x, y] == Min[y ^ 2 - x, x] && x > 0, {x, y}, Reals]FindInstance[Abs[3x ^ 2 - 7x - 6] < Abs[x ^ 2 + x], x, Reals]FindInstance[1 < Floor[x ^ 2 + Ceiling[x ^ 2]] < 10, x, Reals]FindInstance[E ^ x - x == 7, x, Reals]FindInstance[ 27^2x - 1^(1/(x)) == Sqrt[9^2x - 1], x, Reals]超越Rootオブジェクトによる解:
FindInstance[E ^ x - Log[x] + x ^ 2 == 1, x]FindInstance[1 / 4 < Sin[x] < 1 / 3, x, Reals]FindInstance[ (1/2^x - 1) > (1/1 - 2^x - 1), x, Reals]FindInstance[Sin[x + y] == 1 / 2 && E ^ x - y ≤ 1, {x, y}, Reals]FindInstance[ 3^x - 2^2y == 77 && Sqrt[3^x] - 2^y == 7, {x, y}, Reals]FindInstance[2 ^ z Sin[x + y] == z - 1 && x Gamma[y + z] == Sin[x y] + 1 && z > E ^ x, {x, y, z}, Reals]整数領域 (12)
FindInstance[2 x + 3y - 5z == 1 && 3x - 4y + 7z == 3, {x, y, z}, Integers]FindInstance[2 x + 3y == 4 && 3x - 4y ≤ 5 && x - 2y > -21, {x, y, z}, Integers]FindInstance[2 x + 3y == 4 && 3x - 4y ≤ 5 && x - 2y > -21, {x, y, z}, Integers, 5]FindInstance[x ^ 1000 - 2x ^ 777 + 1 == 0, x, Integers]FindInstance[x ^ 5 - 2x + 1 < 0, x, Integers]FindInstance[x ^ 2 + x y + y ^ 2 == 109, {x, y}, Integers]FindInstance[x ^ 2 - 3y ^ 2 == 22 && x > 0 && y > 0, {x, y}, Integers]FindInstance[x ^ 2 - 6 x y + 9y ^ 2 - x + 2y == 1, {x, y}, Integers]FindInstance[x ^ 3 - 2x ^ 2 y + y ^ 3 == 2, {x, y}, Integers]要求された数よりも存在する解の数の方が小さい場合,FindInstanceは空リストを返す:
FindInstance[x ^ 3 - 2x ^ 2 y + y ^ 3 == 2, {x, y}, Integers, 3]FindInstance[x ^ 2 + y ^ 2 + z ^ 2 + t ^ 2 == 123456789, {x, y, z, t}, Integers]FindInstance[x ^ 2 + y ^ 2 == z ^ 2 && 100 < x < y < z, {x, y, z}, Integers]FindInstance[x ^ 4 + y ^ 4 + z ^ 4 ≤ 500 && x + y ^ 2 + z ^ 3 == 32, {x, y, z}, Integers]FindInstance[2x ^ 7 + 8y ^ 15 + 14 x y z == 3, {x, y, z}, Integers]FindInstance[Exp[y ^ 2] < x && Abs[x] < 5 && Abs[y] < 5, {x, y}, Integers]FindInstance[Exp[x ^ 2 - 5y ^ 2 + 1] + x ^ 2 - 5y ^ 2 == 0 && x > 0 && y > 0, {x, y}, Integers]FindInstance[Mod[x ^ 2 + y ^ 2, 2] == 1 && Mod[x - 2y, 3] == 2, {x, y}, Integers]モジュール領域 (5)
FindInstance[2 x + 3y - 5z == 1 && 3x - 4y + 7z == 3, {x, y, z}, Modulus -> 12]FindInstance[x ^ 3 - 2x + 1 == 0, x, Modulus -> 5]FindInstance[x ^ 2 - y z == 1, {x, y, z}, Modulus -> 4]FindInstance[x ^ 2 - y z == 1, {x, y, z}, 7, Modulus -> 4]FindInstance[x ^ 2 + y ^ 3 == z && x + 2y == 3z + 1 && x y z ≠ 0, {x, y, z}, Modulus -> 7]FindInstance[ForAll[x, Exists[y, a x ^ 2 + b y ^ 2 - 3y == 1 && y ≠ 0]], {a, b}, Modulus -> 3]有限体領域 (4)
ℱ = FiniteField[53, 4];
FindInstance[x ^ 5 + ℱ[123]x == ℱ[234], x]FindInstance[x ^ 7 + 2 x + 3 == 0, x, ℱ]ℱ = FiniteField[71, 2];
FindInstance[ℱ[123]x + ℱ[234]y == ℱ[345] && ℱ[321]x + ℱ[432]y == ℱ[543], {x, y}]FindInstance[ℱ[1234]x + ℱ[2345]y + ℱ[3456]z == ℱ[4567] && ℱ[1]x + ℱ[2]y + ℱ[3]z == ℱ[4], {x, y, z}]ℱ = FiniteField[7, 5];
FindInstance[x ^ 2 + y ^ 2 + z ^ 2 == 21, {x, y, z}, ℱ]FindInstance[ℱ[321]x ^ 3 + ℱ[432]y ^ 3 + ℱ[543]z ^ 3 == ℱ[654] && x ^ 2 == ℱ[333]y z + ℱ[111], {x, y, z}, 3]ℱ = FiniteField[2, 5];
FindInstance[Exists[z, ℱ[1]x + ℱ[3]y + ℱ[5]z == ℱ[7] && ℱ[21]x + ℱ[23]y + ℱ[25]z == ℱ[27]], {x, y}]FindInstance[Exists[{y, z}, ℱ[1]x ^ 2 + ℱ[2]y ^ 3 + ℱ[3]z ^ 4 == ℱ[4] && ℱ[5]x ^ 4 + ℱ[6]y ^ 3 + ℱ[7]z ^ 2 == ℱ[8] && x y z != ℱ[0]], x]混合領域 (3)
FindInstance[x ^ 2 + y ^ 2 == -1 && Element[x, Reals], {x, y}]FindInstance[x ^ 2 + y ^ 2 < -1 && Element[x, Reals], {x, y}, Complexes]Abs[z]を含む不等式:
pts = {Re[z], Im[z]} /. FindInstance[1 < Abs[ (z - 2/2z - 1)] < 2, z, 7]Block[{z = u + I v}, RegionPlot[1 < Abs[ (z - 2/2z - 1)] < 2, {u, -1, 1}, {v, -1, 1}, Epilog -> {Blue, PointSize[Large], Point[pts]}]]幾何学領域 (9)
Subscript[ℛ, 1] = Circle[];
Subscript[ℛ, 2] = Line[{{-2, 1}, {1, -2}}];FindInstance[{x, y}∈Subscript[ℛ, 1], {x, y}∈Subscript[ℛ, 2]]Graphics[{{Blue, Subscript[ℛ, 1], Subscript[ℛ, 2]}, {Red, Point[{x, y}] /. %}}]Subscript[ℛ, 1] = Sphere[];
Subscript[ℛ, 2] = InfinitePlane[{{0, 0, 0}, {0, 1, 0}, {1, 0, 1}}];FindInstance[2 x y ≤ z^2 && {x, y, z}∈Subscript[ℛ, 1] && {x, y, z}∈Subscript[ℛ, 2], {x, y, z}, Reals]Show[{ContourPlot3D[2 x y == z^2, {x, -1.2, 1.2}, {y, -1.2, 1.2}, {z, -1.2, 1.2}, Mesh -> None, ContourStyle -> Opacity[0.5]], Graphics3D[{{Opacity[0.5], Green, Subscript[ℛ, 1]}, {Opacity[0.5], Yellow, Subscript[ℛ, 2]}, {PointSize[Large], Red, Point[{x, y, z} /. %]}}]}]ℛ = Cone[{{1, 2, 3}, {3, 2, 1}}, 1];FindInstance[Subscript[∃, z]{x, y, z}∈ℛ, {x, y}, Reals, 100];Graphics3D[{{Green, ℛ}, {Red, Point[{x, y, 0} /. %]}}]ℛ = ImplicitRegion[a + 2 b - 3 c ≥ 1 && a b c == 7, {a, b, c}];FindInstance[{x, y, z}∈ℛ, {x, y, z}, Reals]ℛ = ParametricRegion[{s + t, s - t, s t}, {s, t}];FindInstance[x y > z && {x, y, z}∈ℛ, {x, y, z}, Reals]Subscript[ℛ, 1] = Disk[{0, 0}, 2];
Subscript[ℛ, 2] = Circle[{1, 1}, 2];
Subscript[ℛ, 3] = RegionIntersection[Subscript[ℛ, 1], Subscript[ℛ, 2]];FindInstance[x^2 ≥ x y + 1, {x, y}∈Subscript[ℛ, 3]]Show[{RegionPlot[x^2 ≥ x y + 1, {x, -2, 3}, {y, -2, 3}], Graphics[{{Opacity[0.5], Yellow, Subscript[ℛ, 1]}, {Green, Subscript[ℛ, 2]}, {Red, Point[{x, y} /. %]}}]}]Subscript[ℛ, 1] = InfiniteLine[{{2, 0}, {0, t}}];
Subscript[ℛ, 2] = Circle[];FindInstance[Subscript[∃, {x, y}]({x, y}∈Subscript[ℛ, 1] && {x, y}∈Subscript[ℛ, 2]), t, Reals]円が指定された点を含むような,パラメータ
,
,
の値を求める:
Subscript[ℛ, 1] = Circle[{a, b}, r];
Subscript[ℛ, 2] = Circle[{a + 1, b}, r];
Subscript[ℛ, 3] = RegionIntersection[Subscript[ℛ, 1], Subscript[ℛ, 2]];FindInstance[({0, 1} | {0, -1})∈Subscript[ℛ, 3], {a, b, r}, Reals]Show[{Graphics[{{Blue, Subscript[ℛ, 1]}, {Green, Subscript[ℛ, 2]}, {Red, Point[{{0, 1}, {0, -1}}]}} /. %]}]ℛ = RegionIntersection[Circle[], Line[{{-2, -1}, {1, 2}}]];FindInstance[x∈ℛ, x]ℛ = Sphere[];FindInstance[x.{1, 2, 3} == 0 && x.{-3, -2, -1} < 0, x∈ℛ]オプション (4)
Method (1)
以下は,"InequalitySolvingOptions"および"ReduceOptions"の各グループのシステムオプションローカルに設定する:
FindInstance[2 x + 3 y z + 4 z^2 t ≤ 1 && 5 t^3 y + 7 z^4 - 4 t^3 + 4 z^2 t^2 ≤ 3 && 3 x - 5 t z^2 - 3 t^2 - y z t ≥ 2 && t^2 + z^2 ≤ z y, {x, y, z, t}, Method -> {"LWPreprocessor" -> False}]//AbsoluteTimingデフォルトメソッドは,
を消去するために Loos–Weispfenningアルゴリzむを用いるため,この場合はやや遅くなる:
FindInstance[2 x + 3 y z + 4 z^2 t ≤ 1 && 5 t^3 y + 7 z^4 - 4 t^3 + 4 z^2 t^2 ≤ 3 && 3 x - 5 t z^2 - 3 t^2 - y z t ≥ 2 && t^2 + z^2 ≤ z y, {x, y, z, t}]//AbsoluteTimingModulus (1)
RandomSeeding (1)
例題を求めると,多数の解集合からランダムに選ばれることがしばしばある:
FindInstance[x ^ 2 + y ^ 2 ≤ 1, {x, y}, 3]デフォルトで,FindInstanceはいつも同じ例題を選ぶ:
FindInstance[x ^ 2 + y ^ 2 ≤ 1, {x, y}, 3]RandomSeedingAutomaticを使って毎回新しい可能性がある例を生成する:
FindInstance[x ^ 2 + y ^ 2 ≤ 1, {x, y}, 3, RandomSeeding -> Automatic]WorkingPrecision (1)
TimeConstrained[FindInstance[x ^ 77 + 3x - 11 == E && y ^ 5 - x ^ 2 y + 21 == Pi && x ^ 2y ^ 3 + z ^ 4 == E ^ Pi, {x, y, z}, Reals], 60]WorkingPrecisionを有限にすると,FindInstanceは近似解を求めることができる:
FindInstance[x ^ 77 + 3x - 11 == E && y ^ 5 - x ^ 2 y + 21 == Pi && x ^ 2y ^ 3 + z ^ 4 == E ^ Pi, {x, y, z}, Reals, WorkingPrecision -> 100]//Timingアプリケーション (11)
幾何学問題 (6)
が空のとき,ℛ は, の部分集合である.Disk[{0,0},{2,1}]がRectangle[{-2,-1},{2,1}]の部分集合であることを証明する:
ℛ = Disk[{0, 0}, {2, 1}];
𝒮 = Rectangle[{-2, -1}, {2, 1}];FindInstance[{x, y}∈RegionDifference[ℛ, 𝒮], {x, y}, Reals]Graphics[{{LightRed, EdgeForm[Gray], 𝒮}, {LightBlue, EdgeForm[Gray], ℛ}}]Rectangle[]がDisk[{0,0},7/5]の部分集合ではないことを証明する:
ℛ = Rectangle[];
𝒮 = Disk[{0, 0}, 7 / 5];FindInstance[{x, y}∈RegionDifference[ℛ, 𝒮], {x, y}, Reals]Graphics[{{LightRed, EdgeForm[Gray], 𝒮}, {LightBlue, EdgeForm[Gray], ℛ}, {Red, Point[{x, y} /. %]}}]Cylinder[]⊆Ball[{0,0,0},2]であることを示す:
ℛ = Cylinder[];
𝒮 = Ball[{0, 0, 0}, 2];FindInstance[{x, y, z}∈RegionDifference[ℛ, 𝒮], {x, y, z}, Reals]Graphics3D[{{Opacity[0.3], 𝒮}, {LightBlue, EdgeForm[Gray], ℛ}}]Cylinder[]⊈Ball[{0,0,0},7/5]であることを示す:
ℛ = Cylinder[];
𝒮 = Ball[{0, 0, 0}, 7 / 5];FindInstance[{x, y, z}∈RegionDifference[ℛ, 𝒮], {x, y, z}, Reals]Graphics3D[{{Opacity[0.3], 𝒮}, {LightBlue, Opacity[0.3], EdgeForm[Gray], ℛ}, {Red, PointSize[Large], Point[{x, y, z} /. %]}}]p = {x, y} /. FindInstance[x ^ 2 - y ^ 3 ≤ 2 && x ^ 2 + (y + 2) ^ 2 ≤ 1, {x, y}]r1 = RegionPlot[x ^ 2 - y ^ 3 ≤ 2, {x, -3, 3}, {y, -3, 3}, PlotStyle -> Directive[Opacity[0.5], Hue[0.3]]];
r2 = RegionPlot[x ^ 2 + (y + 2) ^ 2 ≤ 1, {x, -3, 3}, {y, -3, 3}, PlotStyle -> Directive[Opacity[0.5], Hue[0.7]]];Show[{r1, r2, Graphics[{Red, PointSize[Large], Point[p]}]}]triangle = a > 0 && b > 0 && c > 0 && a + b > c && a + c > b && b + c > a;
s = 1 / 2(a + b + c);
F = Sqrt[s(s - a)(s - b)(s - c)];
conjecture = 27(b ^ 2 + c ^ 2 - a ^ 2) ^ 2(a ^ 2 + c ^ 2 - b ^ 2) ^ 2(a ^ 2 + b ^ 2 - c ^ 2) ^ 2 ≤ (4F) ^ 6;FindInstance[triangle && !conjecture, {a, b, c}, Reals]acute = a ^ 2 + b ^ 2 > c ^ 2 && a ^ 2 + c ^ 2 > b ^ 2 && b ^ 2 + c ^ 2 > a ^ 2;FindInstance[triangle && acute && !conjecture, {a, b, c}, Reals]ブール問題 (2)
statement = (a && ((a && !(b || (a && c))) || b || (a && c))) || !a || !((a && !(b || (a && c))) || b || (a && c));FindInstance[!statement, {a, b, c}, Booleans]これはTautologyQを使って証明することもできる:
TautologyQ[statement]statement = (b && ((a && !(b || (a && c))) || b || (a && c))) || !a || !((a && !(b || (a && c))) || b || (a && c));FindInstance[!statement, {a, b, c}, Booleans]これはSatisfiabilityInstancesを使っても行うことができる:
SatisfiabilityInstances[!statement, {a, b, c}]整数問題 (3)
FindInstance[x ^ 2 + y ^ 2 == 5 ^ 2 && y > x > 0, {x, y}, Integers]Table[z -> FindInstance[x ^ 2 + y ^ 2 == z ^ 2 && y > x > 0, {x, y}, Integers], {z, 30}]Table[z -> FindInstance[x ^ 2 + y ^ 2 == z ^ 2 && y > x > 0, {x, y}, Integers, 10], {z, 30}]FindInstance[x ^ 2 + y ^ 2 + z ^ 2 == 1 ^ 2, {x, y, z}, Integers, 1000]sol = Table[FindInstance[x ^ 2 + y ^ 2 + z ^ 2 == d ^ 2, {x, y, z}, Integers, 1000], {d, 20}];Graphics3D[Point[{x, y, z}] /. sol]FindInstance[a + c == b + d == a + b == c + d && a ≠ b ≠ c ≠ d, {a, b, c, d}, Integers]特性と関係 (10)
system = x ^ 2 + y ^ 2 + z ^ 2 ≤ 1 && x ^ 2 - y ^ 3 + 2z ≤ 3;system /. FindInstance[system, {x, y, z}, 7]RootReduceを使って代数的数が方程式を満足することを証明する:
system = x ^ 2 + y ^ 3 + 2x y == 1;system /. FindInstance[system, {x, y}, 2]RootReduce[%]解が存在しない場合,FindInstanceは空リストを返す:
FindInstance[x ^ 2 + y ^ 2 < 0, {x, y}, Reals]要求した数よりも存在する解の方が少ない場合,FindInstanceはすべての解を返す:
FindInstance[x ^ 2 - 1 == 0, x, 3]解集合の完全な記述を所望の場合にはReduceを使う:
Reduce[x ^ 2 + y ^ 2 + z ^ 2 ≤ 1 && x ^ 2 - y ^ 3 + 2z ≤ 3, {x, y, z}, Reals]Reduce[a x ^ 2 + b x + c == 0, x]複雑な方程式系の一般的な解を得たい場合にはSolveを用いる:
Solve[a x ^ 2 + b x + c == 0, x]FindInstance[x ^ 2 + y ^ 2 + z ^ 2 == 12345678, {x, y, z}, Integers]SquaresRを使って二乗和問題の解の数を求める:
SquaresR[3, 12345678]FindInstance[x ^ 3 + y ^ 3 + z ^ 3 == 1234567 && x > 0 && y > 0 && z > 0, {x, y, z}, Integers]PowersRepresentationsを使ってすべての解を列挙する:
PowersRepresentations[1234567, 3, 3]statement = (a || b || c) && (!a || !b || !c);FindInstance[statement, {a, b, c}, 2]SatisfiabilityInstancesを使ってブールベクトルとして表される解を求める:
SatisfiabilityInstances[statement, {a, b, c}, 2]FindInstanceは多項式
が非負であることを示す:
f = x ^ 2 + 2y ^ 2 + 3 z ^ 2 - x y - x z - y z;FindInstance[f < 0, {x, y, z}]PolynomialSumOfSquaresListを使って
を二乗和として表す:
PolynomialSumOfSquaresList[f, {x, y, z}]f - %.%//Expandm = x ^ 4 y ^ 2 + x ^ 2 y ^ 4 - 3 x ^ 2 y ^ 2 + 1;FindInstance[m < 0, {x, y}]PolynomialSumOfSquaresList[m, {x, y}]おもしろい例題 (1)
pts = {x, y} /. FindInstance[x ^ 4 - 4 x ^ 3 y - x ^ 2 y ^ 2 + 4 x y ^ 3 + y ^ 4 == 1, {x, y}, Integers, 100]ContourPlot[x ^ 4 - 4 x ^ 3 y - x ^ 2 y ^ 2 + 4 x y ^ 3 + y ^ 4 == 1, {x, -10, 10}, {y, -10, 10}, Epilog -> {PointSize[Large], Red, Point[pts]}]テクニカルノート
-
▪
- 不等式 ▪
- 領域上の等式と不等式 ▪
- 複素多項式系 ▪
- 実多項式系 ▪
- ディオファントス多項式系
関連するガイド
-
▪
- 方程式の解法 ▪
- 平面幾何学 ▪
- 立体幾何学 ▪
- 不等式 ▪
- 整数論 ▪
- ディオファントス(Diophantine)方程式 ▪
- 素数 ▪
- 定理証明 ▪
- 有限体 ▪
- 領域におけるソルバ ▪
- 論理演算とブール代数 ▪
- 多項式系 ▪
- 記号的なベクトル,行列,配列
履歴
2003 で導入 (5.0) | 2014 で更新 (10.0) ▪ 2017 (11.2) ▪ 2024 (14.0)
テキスト
Wolfram Research (2003), FindInstance, Wolfram言語関数, https://reference.wolfram.com/language/ref/FindInstance.html (2024年に更新).
CMS
Wolfram Language. 2003. "FindInstance." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/FindInstance.html.
APA
Wolfram Language. (2003). FindInstance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindInstance.html
BibTeX
@misc{reference.wolfram_2026_findinstance, author="Wolfram Research", title="{FindInstance}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/FindInstance.html}", note=[Accessed: 12-October-2026]}
BibLaTeX
@online{reference.wolfram_2026_findinstance, organization={Wolfram Research}, title={FindInstance}, year={2024}, url={https://reference.wolfram.com/language/ref/FindInstance.html}, note=[Accessed: 12-October-2026]}