CeejeeB
CeejeeB

Reputation: 3114

Simplify boolean logic

Simple question, can the following logic

A && !(A && B)

be simplified into this?

A && !B

If not can it be simplified at all?

Upvotes: 1

Views: 970

Answers (2)

Paul R
Paul R

Reputation: 213190

Simple answer: yes. You can check this with a truth table:

A  B  X
-  -  -
0  0  0
0  1  0
1  0  1
1  1  0

i.e. X is true only when A is true and B is false.

You can also prove this algebraically if you really want to:

  A && !(A && B)

= A && (!A || !B)           ; de Morgan

= (A && !A) || (A && !B)

= 0 || (A && !B)            ; X && !X is always FALSE

= A && !B

Upvotes: 5

Gustav Barkefors
Gustav Barkefors

Reputation: 5086

Yes, it most definitely can: if A is false then the expression is false, and if A is true, then A is true and the expression is true iff B is false.

Upvotes: 1

Related Questions