# Questions tagged [boolean-computation]

Questions on the functionality of Mathematica for Boolean computation.

168 questions
Filter by
Sorted by
Tagged with
402 views

### Why False && {False, False} does not preserve list structure?

I am on Mathematica 12.1.1.0 trying to perform a boolean operation over every element of a list, but preserving the list structure. When I run ...
160 views

### How can I subtract and calculate the complement of a pair of sets? [closed]

I cannot properly implement these operations. How can I do it? This is a reduced example: A={2,3,4} B={2,4,6} C={1,2,3,4} Find ...
1 vote
48 views

### Simplifying RegionUnion call after CylindricalDecomposition

I want to simplify unions of output from CylindricalDecomposition calls. Consider: ...
53 views

### Joining a table of statements with And [closed]

How could I algorithmically generate a statement such as Subscript[a, 1] ∈ Reals && Subscript[a, 2] ∈ Reals && Subscript[a, 3] ∈ Reals joining a ...
42 views

### RegionMeasure works very slow for BooleanRegion

Consider two regions: ...
122 views

### Can this previously solved three-dimensional constrained integration also be solved with certain added products in the integrand?

In Solved3DConstrainedIntegration the constrained three-dimensional (Hilbert-Schmidt-metric-based HSmetric) integration problem for the absolute separability probability of the two-qubit (quantum bit)...
1 vote
69 views

### Mathematica, from a⟺b∨c to (a≤b+c)⋀(a≥b)⋀(a≥c)

I want to enter a⟺b∨c to Mathematica and to have an answer (a≤b+c)⋀(a≥b)⋀(a≥c) I tried some BooleanConvert and such functions but cannot find the right one. How to do it? This example is taken from ...
1 vote
88 views

### "Total" function for a Boolean expression

I have a very long vector of the form ...
190 views

### Are there any alternatives for NIntegrate to calculate the area for which $f(x,y)<0$?

I have this two-variable function $$f(x,y)= (8 \cos (x+y)+7)\cos \left(\frac{x}{2}\right)+\cos \frac{x-2 y}{2}+2 \cos \left(\frac{3 x}{2}\right)$$ where $0<x,y<\pi$. I want to calculate ... 1 vote
79 views

### Symbolic add of 32Bit Registers

I would like to perform multiple 32bit word register additions (mod 32 add. with variables of Boolean type shuffled with symbolic type). For this task I implemented a ripple adder function: ...
70 views

### How to make the following table compiled?

This is the continuation of the two previous questions 1, 2. The task In short, I computed the Lorentz boost of some 3-vector $\mathbf p = \mathbf{p}(E,\theta,\phi) \to \mathbf{p}'$ having the 3-...
167 views

### Efficient uniform sampling of certain Boolean matrices

I want to uniformly sample $(0,1)$-matrices with certain constraints. In particular, I want sum of each row to be rowsum and the sums of columns to equal ...
538 views

### How to map a function with boolean operators over an array?

I am a beginner in Mathematica. I have this in Mathematica v12: A = {1, 1, 1, 1} B = {2, 2, 2, 2} A+B (* 3,3,3,3 *) I'd like to experiment with evaluating ...
1 vote
80 views

### TautologyQ like feature that also works for inequalities

If a=b and b=c, then a=c. So in mathematica, TautologyQ[(a == b) && (b == c) \[Implies] a == c, {a, b, c}] yields 'True'. If a<b and b<c, then a<c....
76 views

### Minimize Number of Boolean Formulas that Evaluate to True

I'm interested in a MinSat variant: given a list of boolean formulas like ...
1 vote
167 views

### How can I change the Mathematica programming for creating a Venn Diagram?

I am working on using Venn diagram to explain logic and logical connections between sets. After coming upon these answers: Create a Venn Diagram, How to plot Venn diagrams with Mathematica?, which I ...
992 views

### How can I use Mathematica to solve a complex truth-teller/liar logic problem?

I have a logic puzzle I want to convert to Mathematica to solve: Person A states, "Exactly two people are truth-tellers," Person B states, "I and Person C are truth-tellers." ...
67 views

### How to use MaxValue with booleans?

I tried to use MaxValue on Booleans domain: MaxValue[{x + y, Element[x|y, Booleans]},{x,y}] However, it fails with ...
111 views

### Verify a conjectured formula for a modification of a 3D constrained integration successfully solved using Mathematica

I've acquired somewhat indirect--and not fully conclusive--evidence that the solution of a certain three-dimensional constrained integration takes the form ...
258 views

### Usage of 'Less than' condition in Sum

I have following sum: $$\sum_{\substack{n,j\\j<n}}^{3} x_nx_j$$. How can I give this $j<n$ condition in Sum?
100 views

### Find the probability (relative volume) of a certain 4-ball with respect to Hilbert-Schmidt measure

Let us consider the set of points {x,y,z,1-x-y-z} and impose the strict ordering constraint ...
1 vote
183 views

### Confirm and possibly simplify a 2009 result for a 2D constrained integration

This is a direct descendant of two other recent questions, 3D and Equivalence, both of which have been answered in skillful, interesting manners. (See also the comment [actually answer] of JimB to ...
1 vote
207 views

### Evaluate 3D- and 5D-constrained integrals for absolute separability probabilities

In a recent posting, TwoQubits user JimB, employing a change-of-transformations put forth by N. Tessore, was able to confirm a formula for the "two-qubit absolute separability Hilbert-Schmidt ...
185 views

### Simplifying expressions containing binary variables

Consider an expression with two binary variables, $a,b\in\left\{ 0,1\right\}$, given by $F=(1-a-b)^{3}(1-b)$, with truth table: ...
395 views

### Evaluate a certain three-dimensional constrained integral

The result of the three-dimensional integration ...
1 vote
68 views

### How to evaluate a multidimensional NIntegral in a range where certain conditions must be satisfied by the variables

I have a function f which looks similar to this : f[a_, b_, c_] := NIntegrate[sigma[a, b, c], {a, -valueA, valueA}, {b, -valueB, valueB}, {c, -valueC, valueC}] and ...
27 views

### Boole does not limit boundaries of interpolation function, which rise in problems when using NIntegrate for multidimensional integral

I tried to use the Boole function to limit the boundaries of an interpolation function I created when integrating, and noticed that despite this condition, the function will always call extrapolated ...
88 views

### How do you simplify a boolean expression (!A B)+(B !C)+(BC)+(A !B !C)? [closed]

How would you simplify the following boolean expression (!A B)+(B !C)+(BC)+(A !B !C)? I factorised B and managed to get B(!A+!C+C)+(A !B !C) = B+(A !B !C), but I do not know where I should go next. ... 135 views

### Create a Venn and/or related diagrams given the eight atoms of a three-set (A,B,C) 256-dimensional Boolean algebra

In my recent answer to How can one expand an arbitrary boolean combination into the $2^n$ atoms of the associated boolean algebra of size $2^{2^n}$?, for the eight atoms {G,G,G,G,G,G[...
1 vote
159 views

### How can one expand an arbitrary boolean combination into the $2^n$ atoms of the associated boolean algebra of size $2^{2^n}$?

The answer of user250938 to Can one usefully apply the Boolean functions of Mathematica to measurable Boolean sets? and the second comment of Monroe Eskew to the answer to https://mathoverflow.net/...
102 views

### Can one usefully apply the Boolean functions of Mathematica to measurable Boolean sets?

This is something of an attempted succinct/pointed rephrasing of an earlier question Given measures on sets and on certain Boolean combinations of the sets, can one check their consistency and/or ...
1 vote
98 views

### removing brackets from the argument of a function like XOR [closed]

Xor[0,1,0] gives me the Xor of the elements 0,1 and 0 while Xor[{0,1,0}] gives me {0,1,0}. If I have a long list whose elements I want to Xor, how can I remove brackets from the argument? I tried Xor[...
125 views

### What is the meaning of this code section?

I like to know the meaning of this: Total[#4 Boole[Norm[({x, y} - #1).RotationMatrix[#3]/#2]^2 < 1] & @@@ Data] I need to make a slight modification to a ...
31 views

### BooleanComputation and superfunctions / meta-algorithms

Background : A friend intends to model biological systems using boolean equations. He needed to write a solver to find out all possible solutions for such equations. I suggested WL as a viable ...
102 views

### Plot Venn Diagram of Boolean Formula with Mathematica [duplicate]

https://www.wolframalpha.com/input/?i=%28a+and+b+and+c%29+or+%28not+a+and+not+b+and+not+c%29+or+%28not+a+and+b+and+not+c%29+or+%28a+and+not+b+and+not+c%29 How do you plot Venn Diagramm shown in the ...
67 views

### Boole Simplifcation

If you submit this to WA https://www.wolframalpha.com/input/?i=%28a+and+b+and+c%29+or+%28not+a+and+not+b+and+not+c%29+or+%28not+a+and+b+and+not+c%29+or+%28a+and+not+b+and+not+c%29 and expand the ...
128 views

### Store boolean expression into a variable

My purpose is to use a boolean expression as a requirement that a pattern must comply. The requirement is c1 == "a", and I am using it to select a string from a ...
165 views

### How to modify a string of symbols based on the positions of $1$'s in a list of Booleans?

Given a list of Booleans: exampleInput = {1, 1, 0, 1, 0, 0, 1, 0}; and given the string: ...
254 views

### What can we expect from boolean region operations?

In my recent efforts to design some 3D printable objects, I have been tempted to use relatively recent additions to the Wolfram Language such as RegionDifference ...
63 views

### Using Boolean operators in FindInstance

The section on Boolean operators suggests that FindInstance can be applied to them. However, when I try to use it I get a rather confusing error: ...
292 views

### How to insert a character between any several characters without knowing indexes?

There is a list of strings: {"x1x2", "x1", "x1x2x3", "x3", "x4", "x1x2x3x4"} The goal is to insert "&&" between every two elements in a list. I need to ...
1 vote
47 views

998 views

### Mathematica vs. state-of-the-art SAT solvers

I found some fascinating paper by Marijn Heule and Oliver Kullmann on advances in SAT solvers and automated reasoning. In particular, the authors where able to show (a year earlier) a breakthrough ...
1 vote
57 views

### Can I get mapping as output from SatisfiabilityInstances?

Consider the code: SatisfiabilityInstances[Implies[a, b], {a, b}, All] (* output *) {{True, True}, {False, True}, {False, False}} I would like to obtain the ...
275 views

### List of lists elementwise greater/smaller than

I have two lists a = {{3,1,2},{5,1,3},{4,1,1}} b = {{4,0,3},{4,2,2},{5,0,2}} And would like to compare each element within ...
1k views

### Create a list of all possible Boolean configurations of three constraints

I have three nonnegativity constraints \begin{equation} A_1>0, A_2>0, A_3>0. \end{equation} I want to create a single List consisting of all possible/inequivalent Boolean configurations of ...
Equation (7) in the 2012 paper, "Complementarity Reveals Bound Entanglement of Two Twisted Photons" of B. C. Hiesmayr and W. Löffler for a state $\rho_d$ in the "magic simplex" of Bell states \begin{...