Hey guys,

If I have three variables: X, Y, and Z, and I want to convert "exactly two of the three variables" into a boolean expression, would I express that as...

(X^Y^!Z) \/ (X^!Y^Z) \/ (!X^Y^Z)

...with ^ being AND, \/ being OR, and ! being NOT?

Printable View

- Oct 16th 2008, 02:08 PMinthedlConverting Sentence to Boolean Expression...
Hey guys,

If I have three variables: X, Y, and Z, and I want to convert "exactly two of the three variables" into a boolean expression, would I express that as...

(X^Y^!Z) \/ (X^!Y^Z) \/ (!X^Y^Z)

...with ^ being AND, \/ being OR, and ! being NOT? - Oct 16th 2008, 09:06 PMSoroban
Hello, inthedl!

Quote:

If I have three variables: $\displaystyle X, Y,\text{ and }Z$, and I want to convert

"exactly two of the three variables" into a boolean expression,

would I express that as: .$\displaystyle (X \wedge Y \wedge \sim\!Z) \vee (X \wedge \sim\!Y \wedge Z) \vee (\sim\!X \wedge Y \wedge Z)$

Yes, that's correct.

The three cases are mutually exclusive, so an ordinary OR will suffice.

- Oct 17th 2008, 05:14 AMinthedl
Thanks! I appreciate your help!