Assessment Tool

Lecture 11:  Complex Conditions

Content Tested:  Application of De Morgan's laws

Lecture Content:

Goals:

Assessment Technique:  Simplifying Conditionals

Purpose:

Instructors can find out if students can apply De Morgan's laws correctly to conditionals.

Activity:

Please simplify the following conditionals so that the ! operator is only used as !=.  As you complete these problems, keep in mind De Morgan's laws.  Here A and B represent variables.

1.  !(A != B)

2.  !((A == 1) || (A == 4))

3.  !((A >= 4) && (B < 2))

4.  !((A != 5) || (B == 6))

5.  !((A != 5) || (A == 5))
(Note:  Can this conditional evaluate to true?)

6.  !((A != 5) && (A == 5))
(Note:  Can this conditional evaluate to false?)

Conditionals that never evaluate to true are called contradictions.  Conditionals that always evaluate to true are called tautologies.
 

Possible Solutions


1.  !(A != B)
A == B

2.  !((A == 1) || (A == 4))
A != 1 && A != 4

3.  !((A >= 4) && (B < 2))
A < 4 || B >= 2

4.  !((A != 5) || (B == 6))
A == 5 && B != 6

5.  !((A != 5) || (A == 5))
(Note:  Can this conditional evaluate to true?)
A == 5 && A != 5
This conditional is always false.

6.  !((A != 5) && (A == 5))
(Note:  Can this conditional evaluate to false?)
A == 5 || A != 5
This conditional is always true.
 

Possible Uses of Activity: