Questions tagged [boolean-computation]

Questions on the functionality of Mathematica for Boolean computation.

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

BooleanConvert: Boolean decision tree

The BooleanConvert function includes an available form called "Boolean decision tree": BDT. What is the formal logical definition of a Boolean decision tree as used here? What is the ...
ShyPerson's user avatar
  • 440
1 vote
1 answer
104 views

Is "and" the exact same as "&&" in Mathematica? [closed]

Does the word "and" compile the exact same way as "&&" or are there differences?
BigMistake's user avatar
0 votes
0 answers
35 views

Symbolic solutions to systems of Boolean constraints?

Is it possible to solve a system of Boolean constraints symbolically? I'm trying to solve systems like the following, where $X$ is the unknown Boolean expression I'm trying to find, $a, b, c$ are the ...
ShyPerson's user avatar
  • 440
1 vote
1 answer
45 views

Creating a boolean expression of assumptions between variables

I'm trying to create a boolean expression from a list of lists of variables such that the elements of one list are not equal to the elements of all other lists. I thought this might work: ...
David's user avatar
  • 87
1 vote
1 answer
51 views

How to use Mathematica for demonstration of Analysis of Boolean functions?

I am wondering how to use Mathematica to demonstrate some concepts in Analysis of Boolean functions, e.g.: Influence Noise stability Noise operator $L_q$-norm and $L_\infty$ norm of a boolean ...
138 Aspen's user avatar
  • 787
2 votes
5 answers
422 views

Calculating union of two sets of reals

Given the following two sets of reals: -(1/4) < x <= 0 || 0 < x <= 1/2 || x > 1/2 x <= -1 || -1 < x < 0 how can I calculate their union? ...
csn899's user avatar
  • 2,695
2 votes
1 answer
132 views

Square Root of a Boolean Matrix

I am trying to find the square roots of transitive Boolean matrices. Let $B$ be a transitive Boolean matrix, If $A^2= B$, then $A$ is the square root of $B$. Here is my try ...
Jonathan's user avatar
1 vote
3 answers
148 views

Validity of the number of transitive matrices

I am trying to generate all possible transitive boolean matrices of order nxn which satisfies the following definition of transitivity Let A=(a_ij)∈M_n(B) be a non-zero matrix. If for any i,j,k in ...
Jonathan's user avatar
2 votes
3 answers
315 views

Finding transitive Boolean matrices

I am fairly new here and with Mathematica too. I have a question regarding Boolean matrices but before this I did a random search and got this Defining an arbitrary binary relation But I am unable to ...
Jonathan's user avatar
2 votes
1 answer
105 views

Is there a function which tests whether a Boolean expression is an inequality?

For something I am doing in Mathematica, it would be very helpful to have a function f[] which, when applied to an atomic Boolean expression, returns True if the Boolean expression is an inequality, ...
user871418's user avatar
2 votes
3 answers
158 views

Check if a curve is contained in a region

Let's consider a curve described by a function $y = f(x)$ as well as a region $\mathcal{R}$ (consider that this region can be complicated) described by a set of points $\mathcal{X} = (x_{i,1},x_{i,2})$...
Jocelyn Minini's user avatar
5 votes
6 answers
745 views

Similarities between two vectors

Is there simpler and/or faster code for this? List1={1,2,4,6,7}; List2={1,3,5,6,7}; Rule: If values at respective positions match, output 1 else output 0. Result: ...
Reda.Kebbaj's user avatar
1 vote
0 answers
31 views

How to count the number of disjoint regions covered by a Boolean expression?

Consider the following Boolean expression as an example: ...
user13892's user avatar
  • 9,023
1 vote
1 answer
78 views

How to define functions using $Z_2$ coefficients and $Z_N$ variables, e.g, realizing $1+1=0$?

A minimal example is to realize the following: $x+x = (1+1)x = 0$, and $x^{N+1}y^{N+1}=xy$, where $N$ is a given positive integer.
SimMach's user avatar
  • 113
6 votes
2 answers
110 views

How to solve logic problem with a joker sometimes tell truth and sometimes lie?

If there are only truth teller and liar, I used to solve with BooleanConvert or SatisfiabilityInstances. However for this one, ...
timhu's user avatar
  • 101
2 votes
1 answer
92 views

Evaluation process of And, Or,

Small questions about evaluation process of And, Or. code 1) ...
imida k's user avatar
  • 4,037
5 votes
1 answer
414 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 ...
ShineOn's user avatar
  • 53
2 votes
2 answers
199 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 ...
wally's user avatar
  • 417
1 vote
0 answers
51 views

Simplifying RegionUnion call after CylindricalDecomposition

I want to simplify unions of output from CylindricalDecomposition calls. Consider: ...
Colin Rowat's user avatar
0 votes
1 answer
64 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 ...
Roy's user avatar
  • 79
0 votes
0 answers
62 views

RegionMeasure works very slow for BooleanRegion

Consider two regions: ...
John Taylor's user avatar
  • 4,984
1 vote
1 answer
147 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)...
Paul B. Slater's user avatar
1 vote
1 answer
73 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 ...
Mr. Retired's user avatar
1 vote
0 answers
99 views

"Total" function for a Boolean expression

I have a very long vector of the form ...
AlbaCL's user avatar
  • 327
5 votes
4 answers
239 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 ...
user avatar
1 vote
0 answers
83 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: ...
Bogdan Sofalca's user avatar
8 votes
2 answers
197 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 ...
kirma's user avatar
  • 18.6k
5 votes
4 answers
738 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 ...
Contango's user avatar
  • 463
1 vote
0 answers
85 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....
imida k's user avatar
  • 4,037
2 votes
1 answer
96 views

Minimize Number of Boolean Formulas that Evaluate to True

I'm interested in a MinSat variant: given a list of boolean formulas like ...
J Bausch's user avatar
  • 151
1 vote
1 answer
204 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 ...
Peter Burbery's user avatar
19 votes
2 answers
1k 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." ...
Peter Burbery's user avatar
0 votes
0 answers
88 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 ...
DurandA's user avatar
  • 161
2 votes
1 answer
117 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 ...
Paul B. Slater's user avatar
3 votes
4 answers
367 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?
Arghya Datta's user avatar
0 votes
1 answer
106 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 ...
Paul B. Slater's user avatar
1 vote
2 answers
196 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 ...
Paul B. Slater's user avatar
1 vote
1 answer
287 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 ...
Paul B. Slater's user avatar
2 votes
3 answers
223 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: ...
almagy's user avatar
  • 23
3 votes
3 answers
424 views

Evaluate a certain three-dimensional constrained integral

The result of the three-dimensional integration ...
Paul B. Slater's user avatar
1 vote
1 answer
81 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 ...
A. Chitzac's user avatar
0 votes
0 answers
37 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 ...
A. Chitzac's user avatar
0 votes
2 answers
119 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. ...
user avatar
0 votes
1 answer
147 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[...
Paul B. Slater's user avatar
1 vote
4 answers
178 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/...
Paul B. Slater's user avatar
0 votes
1 answer
121 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 ...
Paul B. Slater's user avatar
1 vote
0 answers
123 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[...
cleanplay's user avatar
  • 650
4 votes
1 answer
129 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 ...
Dean's user avatar
  • 645
0 votes
0 answers
37 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 ...
sunil joglekar's user avatar
0 votes
1 answer
155 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 ...
booli100's user avatar