Tag Info

New answers tagged

4

Could use GroebnerBasis as below. rels = {a^2 - a, b^2 - b, c^2 - c}; gb = GroebnerBasis[Join[{a + b - (1 + 2 c)}, rels], {a, b, c}]; Thread[Complement[gb, rels] == 0] (* Out[337]= {-1 + a + b == 0, c == 0} *) Here it is packaged into a function: binarySimplify[eq_, vars_] := Module[{rels, gb}, rels = (#^2 - # &) /@ vars; gb = ...


1

The following should do what you want eqnToBool={Times->And,Plus->Xor,i_Integer:>OddQ[i]}; boolToEqn={And->Times,Xor->Plus,True->1,False->0}; eqToRules={Equal->Rule}; reduceBool[eq_]:=Resolve[Exists[{},eq/.eqnToBool],Booleans] simplifyBool[eq_]:=Module[{newEqns={}}, ...


6

This sort of thing can be recast as a quantifier elimination problem, as below. Quantify the variables you want to remove, set conditions on them as needed, and use Resolve to do the elimination step. A postprocessing step of BooleanMinimize might be needed (not in the examples below though). Resolve[Exists[p, p == True, p \[Xor] q]] (* Out[324]= ! q *) ...


2

WRT your first example: Simplify[Xor[p, q] == True, Assumptions -> p == True] (* True == ! q *) Not /@ Simplify[Xor[p, q] == True, Assumptions -> p == True] (* False == q *) Edit Daniel's answer is probably the way. However just for reference (and because I already did it :) ), here is another more laborious possibility that works OK with ...


1

Have you tried these substitution? ReplaceAll[ ReplaceAll[ a + b == 1 + 2*c, {Times -> And, Plus -> Xor, i_Integer :> OddQ[i]} ], {And -> Times, Xor -> Plus, True -> 1, False -> 0} ] Or something along these lines? I also think your second example is wrong, because when you're performing a computation mod ...


1

Reduce[Join[{a + b == 1 + 2 c, {a, b, c} \[Element] Integers}, 0 <= # <= 1 & /@ {a, b, c}]] (*(a == 0 && b == 1 && c == 0) || (a == 1 && b == 0 && c == 0)*) Reduce[Join[{a + 2 b a + 2 c == 2 d, {a, b, c, d} \[Element] Integers}, 0 <= # <= 1 & /@ {a, b, c, d}]] (*(a == 0 && b == 0 ...



Top 50 recent answers are included