Saturday, May 14, 2011

The Valley of NAND and NOR: Part 3 of Ann's encounter with the Booleans

NAND and NOR are Boolean logic operations. They are negations of AND and OR respectively. NAND (Not AND) evaluates to true if and only if at least one of the inputs is false. NOR (Not OR) evaluates to true if and only if both inputs are false.

After leaving the wizard's resort and completing her trek through the Lagrange mountains, Ann came to the Valley of NAND and NOR. She had heard rumors that it was a most disagreeable place, filled with negative people. The valley itself certainly seemed to uphold this reputation. It could only generously be described as a desert oasis. A more accurate description would be two small villages on either side of a large muddy puddle.

Ann considered passing by the villages without stopping. Her experience at the wizard's resort had left her feeling bitter. But, her horse needed water and Ann herself was tired. She decided to try the village of NAND first.

"Hi." Ann began cheerfully as she walked up to the counter at the village's only inn. "I would like a room for the night and some dinner, please." Ann smiled broadly, hoping to set a cheerful tone.

"No." responded the inn keeper. "One or the other." She pointed behind her to a sign on the wall that read: 'NAND INN - Providing a room, or dinner, or neither.'

"But, that does not make any sense." objected Ann.

The inn keeper shrugged. "That is how we do things in NAND. If you do not like it, you can always try NOR. They are really nice over there." She laughed as she spoke.

"So, I can NOT have a dinner AND a room?" Ann confirmed.

"No!" The inn keeper was most rude.

Frustrated, Ann left the inn and started her journey to NOR on the other side of the mud puddle. She had heard that the villagers in this valley were descendants of the Booleans, but she had hoped that they did not adhere quite as strictly to the Boolean's beliefs. If anything though, the people of NAND seemed worse!

It took an hour before Ann arrive at NOR's inn.

"I would like a room for the night and some dinner, please." Ann asked the inn keeper. This time Ann was too tired to pretend to be overly cheerful.

"No." he responded. Without any additional explanation, he pointed to a sign on the wall that read: NOR INN - Providing no rooms or food.

"Wait." Ann objected. "You are telling me that this inn does NOT provide rooms OR dinner? What sort of an inn is that? What do you provide?"

The inn keeper shrugged. "If you don't like it, you can always try the village of NAND."

Ann stormed out with responding, and left town. NAND and NOR were just as negative as everyone had warned. As she looked back at the two villages disappearing into the distance, she hoped that the next place she went would not be filled with Booleans.