Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Mathematical Functions > Numerical Functions >

Boole

Boole[expr]
yields 1 if expr is True and 0 if it is False.
  • Boole[expr] is effectively equivalent to If[expr, 1, 0].
  • Integrate[f Boole[pred], ...] can be used to integrate f over the region in which pred is True.
Convert a list of truth values to integers:
Find the area of the disc defined by the inequality x^2+y^2<=1:
In[1]:=
Click for copyable input
Out[1]=
 
Convert a list of truth values to integers:
In[1]:=
Click for copyable input
Out[1]=
 
Find the area of the disc defined by the inequality x^2+y^2<=1:
In[1]:=
Click for copyable input
Out[1]=
Find the area of a region defined by an inequality:
Plot the region:
Find the volume of a solid defined by an inequality:
Plot the solid:
Find the area of the intersection of a circle with a parametric radius and a square:
Convert a table of True, False values to 1, 0 for plotting:
The inverse of Boole:
Use PiecewiseExpand to convert Boole to Piecewise:
Correspondence between logic operations on conditions and arithmetic operations on Boole:
Use Refine, Simplify and FullSimplify to transform expressions involving Boole:
Reduce equations and optimize functions involving Boole:
Use Boole as a characteristic function for integration problems:
New in 5.1 | Last modified in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team