0

I've been struggling with boolean simplification in class, and took it to practice some more at home. I found a list of questions, but they don't have any answers or workings. This one I'm stuck on, if you could answer clearly showing each step I'd much appreciate:

Q=A.B.(~B+C)+B.C+B

I tried looking for a calculator to give me the answer and then to work out how to get to that, but I'm lost

(I'm new to this)

Edit: ~B = NOT B

J. McGill
  • 9
  • 3

3 Answers3

0

Let's be lazy and use sympy, a Python library for symbolic computation.

>>> from sympy import *
>>> from sympy.logic import simplify_logic
>>> a, b, c = symbols('a, b, c')
>>> expr = a & b & (~b | c) | b & c | b # A.B.(~B+C)+B.C+B
>>> simplify_logic(expr)
b

There are two ways to go about such a formula:

  • Applying simplifications,
  • Brute force

Let's look at brute force first. The following is a dense truth table (for a better looking table, look at ), enumerating all possible value for a, b and c, alongside the values of the expression.

a b c -- a & b & (~b | c) | b & c | b = Q
0 0 0    0   0    10 1 0    0 0 0   0 = 0
0 0 1    0   0    10 1 1    0 0 1   0 = 0
0 1 0    0   1    01 0 0    1 0 0   1 = 1
0 1 1    0   1    01 1 1    1 1 1   1 = 1
1 0 0    1   0    10 1 0    0 0 0   0 = 0
1 0 1    1   0    10 1 1    0 0 1   0 = 0
1 1 0    1   1    01 1 0    1 0 0   1 = 1
1 1 1    1   1    01 1 1    1 1 1   1 = 1

You can also think of the expression as a tree, which will depend on the precedence rules (e.g. usually AND binds stronger than OR, see also this question on math.se).

So the expression:

a & b & (~b | c) | b & c | b 

is a disjunction of three terms:

a & b & (~b | c)
b & c
b

You can try to reason about the individual terms, knowing that only one has to be true (as this is a disjunction).

The last two will be true, if and only if b is true. For the first, this a bit harder to see, but if you look closely: you have now a conjunction (terms concatenated by AND): All of them must be true, for the whole expression to be true, so a and b must be true. Especially b must be true.

In summary: For the whole expression to be true, in all three top-level cases, b must be true (and it will be false, if b is false). So it simplifies to just b.

Explore more on Wolfram Alpha:

miku
  • 181,842
  • 47
  • 306
  • 310
  • 1
    It's good and all to have the answer, but I won't exactly be having a python program in my exam to use. Really I need to understand how to get the answer as well – J. McGill Mar 01 '18 at 11:35
  • @J.McGill, *if in doubt, use brute force*. I updated my answer. – miku Mar 01 '18 at 11:39
0

I've never done this, so I'm using this site to help me.

A.B.(B' + C) = A.(B.B' + B.C) = A.(0 + B.C) = A.(B.C)

So the expression is now A.(B.C) + B.C + B.

Not sure about this, but I'm guessing A.(B.C) + (B.C) = (A + 1).(B.C). This equals A.(B.C).

So the expression is now A.(B.C) + B.

As A.(B + C) = B.(A.C), the expression is now B.(A.C) + B, which equals (B + 1).(A.C) = B.(A.C).

NOTE: This isn't complete yet, so please avoid downvoting as I'm not finished yet (posted this to help the OP understand the first part).

Adi219
  • 4,712
  • 2
  • 20
  • 43
0
A.B.(~B+C) + B.C + B = A.B.~B + A.B.C + B.C + B    ; Distribution
                     = A.B.C + B.C + B             ; Because B.~B = 0
                     = B.C + B                     ; Because A.B.C <= B.C
                     = B                           ; Because B.C <= B
Leandro Caniglia
  • 14,495
  • 4
  • 29
  • 51