Prateek Agrawal
Prateek Agrawal

Reputation: 163

Combining logical operators

I have an expression of the form

A or A and B

Can we represent it more concisely by representing the expression some other way?

Upvotes: 0

Views: 40

Answers (1)

CollinD
CollinD

Reputation: 7573

As stated the expression may be slightly ambiguous. It can be interpereted in two ways:

(A or A) and B

Obviously A or A is logically equivalent to A, so in this case the entire statement is simply equivalent to A and B

More likely, this is intended to be read as

A or (A and B)

Let's write a truth table for this

A B | A or (A and B) | result
-----------------------------
0 0 | 0 or (0 and 0) | 0
0 1 | 0 or (0 and 1) | 0
1 0 | 1 or (1 and 0) | 1
1 1 | 1 or (1 and 1) | 1

Now you can pretty clearly see, in this case the statement is equivalent to A alone.

Upvotes: 1

Related Questions