Questions tagged [boolean-computation]
Questions on the functionality of Mathematica for Boolean computation.
168
questions
5
votes
1
answer
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
...
2
votes
2
answers
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
0
answers
48
views
Simplifying RegionUnion call after CylindricalDecomposition
I want to simplify unions of output from CylindricalDecomposition calls.
Consider:
...
0
votes
1
answer
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 ...
0
votes
0
answers
42
views
RegionMeasure works very slow for BooleanRegion
Consider two regions:
...
0
votes
1
answer
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
1
answer
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
0
answers
88
views
"Total" function for a Boolean expression
I have a very long vector of the form
...
5
votes
4
answers
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
0
answers
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:
...
0
votes
0
answers
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-...
8
votes
2
answers
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 ...
5
votes
4
answers
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
0
answers
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....
2
votes
1
answer
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
1
answer
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 ...
17
votes
1
answer
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."
...
0
votes
0
answers
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 ...
2
votes
1
answer
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
...
3
votes
4
answers
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?
0
votes
1
answer
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
2
answers
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
1
answer
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 ...
2
votes
3
answers
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:
...
2
votes
3
answers
395
views
Evaluate a certain three-dimensional constrained integral
The result of the three-dimensional integration
...
1
vote
1
answer
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 ...
0
votes
0
answers
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 ...
0
votes
2
answers
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.
...
0
votes
1
answer
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[0],G[1],G[2],G[3],G[4],G[...
1
vote
4
answers
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/...
0
votes
1
answer
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
0
answers
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[...
4
votes
1
answer
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 ...
0
votes
0
answers
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 ...
0
votes
1
answer
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 ...
2
votes
0
answers
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 ...
2
votes
1
answer
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 ...
8
votes
4
answers
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:
...
3
votes
2
answers
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 ...
2
votes
1
answer
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:
...
5
votes
2
answers
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
1
answer
47
views
Translate formula boolean to variables expression
I need prepare simple parser for Boolean formula in format CNF:
So we have some formula like:
$$
F = (x_1 \lor x_2) \land (x_1 \lor \overline x_3) \land (x_2 \lor x_4) \land (\overline x_3 \lor \...
2
votes
1
answer
48
views
FindInstance confused by CoprimeQ
For some reason when I type
FindInstance[a + b == c && CoprimeQ[a, b, c] == True, {a, b, c}, Integers]
Mathematica just immediately returns my input as ...
2
votes
0
answers
136
views
Combinatorics with booleans equations
I have variables $X_i \in \{1,0,-1\}$. Now I add up $m=3$ variables
$$S=X_1 + X_2 + X_3
$$
and want to find all combinations that give me, $S=1$. I can do this with (see this solution):
...
23
votes
0
answers
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
1
answer
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 ...
5
votes
2
answers
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
...
3
votes
2
answers
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 ...
0
votes
1
answer
92
views
Solve a constrained four-dimensional integration problem for a "magic simplex" probability
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{...
0
votes
0
answers
63
views
Result of BooleanCountingFunction?
Folks,
when i use BooleanCountingFunction[{1}, {v1,v2,v3}, "CNF" ] i get a neat output like:
...