-
参见
- 函 数
- If
- Piecewise
- DiscreteDelta
- UnitStep
- Unitize
- Ramp
- DiscreteIndicator
- Pick
- RegionPlot
- True
-
- 神经网络编码器
- Boolean
-
- 编译类型
- Boolean
- 相关指南
- 技术笔记
Boole
范例
打开所有单元 关闭所有单元基本范例 (3)
应用 (4)
ineq = y ^ 2 - 4x ^ 2 + 4x ^ 4 ≤ 0;Integrate[Boole[ineq], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]NIntegrate[Boole[ineq], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]RegionPlot[ineq, {x, -1, 1}, {y, -1, 1}]ineq = y ^ 2 - 4x ^ 2 + 4x ^ 4 ≤ -z ^ 2;Integrate[Boole[ineq], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}, {z, -Infinity, Infinity}]NIntegrate[Boole[ineq], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}, {z, -Infinity, Infinity}]RegionPlot3D[ineq, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]Integrate[Boole[x ^ 2 + y ^ 2 < a], {x, -1, 1}, {y, -1, 1}]Table[RegionPlot[x ^ 2 + y ^ 2 < a, {x, -1, 1}, {y, -1, 1}], {a, {1 / 2, 3 / 2, 5 / 2}}]ArrayPlot[Boole[Table[PrimeQ[a ^ b + 3], {a, 50}, {b, 50}]]]属性和关系 (7)
Boole 的逆:
(# != 0)& /@ {1, 0, 1, 1, 1}Boole[%]用 PiecewiseExpand 将 Boole 转换为 Piecewise:
PiecewiseExpand[Boole[a]]条件逻辑运算与 Boole 算术运算之间的对应:
Simplify[Boole[a && b] - Min[Boole[a], Boole[b]]]Simplify[Boole[a || b] - Max[Boole[a], Boole[b]]]Simplify[Boole[a && b] - Boole[a]Boole[b]]Simplify[Boole[a || b] - (Boole[a] + Boole[b] - Boole[a]Boole[b])]Simplify[Boole[!a] - (1 - Boole[a])]使用 Refine、Simplify 和 FullSimplify 转换含有 Boole 的表达式:
Refine[Boole[x ^ 2 + y ^ 2 < 10 && x > y], (x - 2) ^ 2 + y ^ 2 < 1]Simplify[Boole[x > y], x == y + 2]简化含有 Boole 的方程以及优化含有 Boole 的函数:
Reduce[Exp[Sin[x]Boole[x ^ 2 + y ^ 2 < 1]] < 1, {x, y}]Minimize[Exp[Sin[x]Boole[x ^ 2 + y ^ 2 <= 1]], {x, y}]用 Boole 作为积分问题的特征函数:
Integrate[(x ^ 2 + x y + 3y ^ 4)Boole[x ^ 2 + y ^ 2 < 1 && y > x], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]NIntegrate[Exp[x ^ 2 + x y + 3y ^ 4]Boole[x ^ 2 + y ^ 2 < 1 && y > x], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]某些情况下,Boole 可被表示为 DifferenceRoot:
DifferenceRootReduce[Boole[Mod[k, 5] == 1], k]参见
If Piecewise DiscreteDelta UnitStep Unitize Ramp DiscreteIndicator Pick RegionPlot True
神经网络编码器: Boolean
编译类型: Boolean
Function Repository: InverseBoole
历史
2004年引入 (5.1) | 在以下年份被更新:2007 (6.0)
文本
Wolfram Research (2004),Boole,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Boole.html (更新于 2007 年).
CMS
Wolfram 语言. 2004. "Boole." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2007. https://reference.wolfram.com/language/ref/Boole.html.
APA
Wolfram 语言. (2004). Boole. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Boole.html 年
BibTeX
@misc{reference.wolfram_2026_boole, author="Wolfram Research", title="{Boole}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Boole.html}", note=[Accessed: 31-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_boole, organization={Wolfram Research}, title={Boole}, year={2007}, url={https://reference.wolfram.com/language/ref/Boole.html}, note=[Accessed: 31-July-2026]}