Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplify boolean expression i.t.o variable occurrence

How to simplify a given boolean expression with many variables (>10) so that the number of occurrences of each variable is minimized?

In my scenario, the value of a variable has to be considered ephemeral, that is, has to recomputed for each access (while still being static of course). I therefor need to minimize the number of times a variable has to be evaluated before trying to solve the function.

Consider the function

f(A,B,C,D,E,F) = (ABC)+(ABCD)+(ABEF)

Recursively using the distributive and absorption law one comes up with

f'(A,B,C,E,F) = AB(C+(EF))

I'm now wondering if there is an algorithm or method to solve this task in minimal runtime.

Using only Quine-McCluskey in the example above gives

f'(A,B,C,E,F) = (ABEF) + (ABC)

which is not optimal for my case. Is it save to assume that simplifying with QM first and then use algebra like above to reduce further is optimal?

like image 666
user2722968 Avatar asked Feb 23 '26 00:02

user2722968


1 Answers

I usually use Wolfram Alpha for this sort of thing.

like image 115
500 - Internal Server Error Avatar answered Feb 24 '26 19:02

500 - Internal Server Error