Questions on the functionality of Mathematica for Boolean computation.
1
vote
1answer
107 views
Conditionals slower than operators?
I want to make my application faster. I tried to replace an If condition with operators.
The If condition is
...
3
votes
2answers
114 views
How to rewrite this function to be faster: Find sub-matrixes of boolean board which imply a given boolean pattern
I have Boolean matrix A (called "board") and Boolean matrix B with smaller dimensions (called "pattern"). I am trying to find sub-matrixes C of A such that C has same dimensions as B, and ...
3
votes
1answer
61 views
Defining an Implies operation that works for Boolean matrices
I have two Boolean matrices, that both have dimensions m x n. I want to create a function TableImplies, which would return True ...
5
votes
1answer
88 views
“And” to continue evaluation after “False”
Below, is it possible to print No and have x be 2. That is, I'm looking for an And-like function that looks at all arguments ...
3
votes
2answers
91 views
Sequence and boolean And
I'm trying to figure out if a calculation result it's a valid result. As it return a matrix, I need to test that every element it's a number, so I thought this could work...
...
11
votes
2answers
180 views
Simplify assumes Boolean 1 and 0 in logical expressions
Per this chat discussion and this previous question where I encountered the strange behaviour:
...
0
votes
1answer
74 views
Bit Operations — Force Binary Bit Representation
How to force binary bit representation of a number, so BitNot does yield the 1s-complement?
BitNot[n] turns ones into zeros and vice versa in the binary bit representation of n.
I was unable so ...
6
votes
2answers
239 views
Bitwise operators - Hamlet for Mathematica
What is the best way to check this famous equation:
0x2b || ~0x2b == 0xff
Mathematica doesn't seem to have a handy bitwise negation operator.
The best thing I ...
2
votes
1answer
87 views
Convert boolean test function to pattern?
What is a "reverse" to MatchQ? MatchQ converts pattern into boolean function. So how to convert back?
Suppose I want to use ...
1
vote
3answers
114 views
Creating a Specific Boolean Function
How can I implement a Boolean function F(A,B) that has outputs that are not specific and, therefore, the truth table output of this two-input function will be (a, b, c, d) -- here the first term ...
1
vote
1answer
168 views
Plotting Fresnel function
I am trying to plot the partial sums and the cesaro means of the function $\sqrt{|x|}$ and for $a_{n}$, I obtained the following code which contains FresnelS.
...
0
votes
0answers
99 views
Regionplot with Boole - with more than dimension number of variables [closed]
I am interested in plotting the 3D region which is the intersection of functions of the form :
f1( x, y, z, u) = 0
f2( x, y, z, u) = 0
f3( x, y, z, u) = 0
gmin <= g(u) <= gmax
Note that ...
7
votes
1answer
253 views
How to solve the liar problem?
In an island live two kinds of people: liar and truth-teller, the former only tells lies and the latter only tells truth, now there're two men A and B from the island, A said: "B is a truth-teller." B ...
6
votes
2answers
559 views
Implementation of a new Game of Life Rule
I need to implement a new "game of life" in Mathematica: I have three states — black, red and white. Black means go forward, red go back and white take no action.
I would like to implement the ...
16
votes
8answers
422 views
Applying And to lists of Booleans
I'd like to take {True,True,False} and {True,False,False} and apply And to get ...