# Converting Sentence to Boolean Expression...

• Oct 16th 2008, 02:08 PM
inthedl
Converting 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 PM
Soroban
Hello, inthedl!

Quote:

If I have three variables: $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: . $(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 AM
inthedl
Thanks! I appreciate your help!