Question: PYTHON Part a: Evaluating Booleans Write a program that reads in true/false values for the variables a, b, and c and evaluates the following Boolean

PYTHON

Part a: Evaluating Booleans

Write a program that reads in true/false values for the variables a, b, and c and evaluates the following Boolean expressions. Your program should thus read in 3 True/False values, and should output 8 values.

1) a and b and c

2) a or b or c

3) (not (a and not b) or (not c and b)) and (not b) or (not a and b and not c) or (a and not b)

4) (not ((b or not c) and (not a or not c))) or (not (c or not (b and c))) or (a and not c) and (not a or (a and b and c) or (a and ((b and not c) or (not b))))

Part b: Writing Boolean expressions

Extend the program above to write Boolean expressions that meet the following criteria:

5) Is true if just one of a or b is true, but not if both are true or both or false

(Note: this is also called an exculsive or between a and b.)

6) Is true if an odd number (i.e. exactly 1 or 3) of the variables a, b, and c is true, and is false otherwise.

Part c: Simplifying Booleans

Extend the program from above, but try to create simpler versions of complex Boolean expressions that still give the same results

7) For the expression #3, try to provide a simpler version

8) Likewise for the expression #4

Hint: There are 2 possible values for each of A, B, and C. Any expression that evaluates the same for all possible combinations of True/False of those values is an equivalent Boolean expression!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!