Value of $(a=1) \wedge (b=1) \wedge (c=2)$ given $a=1$, $b=2$ and $c=2$

205 Views Asked by At

How would I solve the following question.

Assume $a=1$, $b=2$ and $c=2$ what is the value of the following Boolean expression

$(a=1)$ AND $(b=1)$ AND $(c=2)$

I am kind of confused because I know the first and is false AND so is the second AND, so would two false make a true?

5

There are 5 best solutions below

2
On BEST ANSWER

Assume $a=1$, $b=2$, and $c=2.$

For the following expression to be true, every statement connected by AND must be true:

$(a=1) \;\; AND \;\; (b=1)\;\; AND\;\; (c=2)\tag{1}$

$(1)$ is true If and ONLY IF EACH of the following are true.

  1. $a = 1\quad \checkmark\;$ true
  2. $b = 1 \quad \color{red}{\bf X}\;\;$ (we are given that $b = 2$, so $b = 1$ is false)
  3. $c = 2 \quad \checkmark\;$ true

So we have $\qquad{\bf T}\;\;\; AND \;\;\;\color{red}{\bf F} \;\;\;AND \;\;\;{\bf T}\; = \;\; \color{red}{\bf FALSE}$

0
On

No, false and true is false, thus the expression evaluates to false. In the case of ANDs, you can short-circuit on a false since false and anything is always going to be false, just like a true in an OR with anything will evaluate to true.

Truth tables may be useful if you want a reference here.

1
On

No, the statement does not become true because it claims two false things.

1
On

$$(a = 1) \wedge (b = 1) \wedge (c = 2)$$ $$(1 = 1) \wedge (2 = 1) \wedge (2 = 2)$$ $$\text{True} \wedge \text{False} \wedge \text{True} $$ Which is false.

If I say I'm going to get pizza and coke, am I lying if I get neither pizza or coke (yes)? Am I lying if I get both (No)? Am I lying if I get one but not the other (Yes)?

0
On

$(a=1)$ is TRUE
$(b=1)$ is FALSE (since $b=2$),
therefore result is FALSE