Search Header Logo
Comparing Boolean Expressions

Comparing Boolean Expressions

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

Katherine Valenti

Used 1+ times

FREE Resource

54 Slides • 8 Questions

1

Comparing Boolean Expressions

2

Students will be able to...

  • Apply De Morgan’s Laws to transform boolean expressions

  • Identify and write logically equivalent boolean expressions

  • Use truth tables to evaluate logical equivalence

  • Compare object references and values using == and .equals()

  • Determine when objects are the same or merely equivalent in attributes

3

Warm Up

4

Open Ended

Can two different expressions produce the same true/false result for all input values?

5

Warm Up

  • Yes

  • They can be logically equivalent, even if they may look different

6

Open Ended

Why might you want to simplify a boolean expression?

7

Warm Up

  • Make code shorter

  • Make code easier to read

8

Open Ended

What does it mean for two objects to be “equal”?

9

Warm Up

  • Have the same values

  • Are the exact same object

10

media

11

media

12

media

13

media

14

media

15

media

16

media

17

media

18

media

19

media

20

media

21

media

22

media

23

media

24

media

25

media

26

media

27

media

28

media

29

media

30

Open Ended

Question image

Using De Morgan’s Laws, what would be the equivalent of the expression below?

31

media

32

media

33

Open Ended

Question image

Using De Morgan’s Laws, what would be the equivalent of the expression below?

34

media

35

media

36

media

37

media

38

media

39

media

40

media

41

media

42

media

43

media

44

media

45

media

46

media

47

media

48

media

49

media

50

media

51

media

52

media

53

media

54

media

55

media

56

Now It's Your Turn!

  • Head to CodeHS and access the Comparing Boolean Expressions (Part 2) modules. You will be completing:

    • Comparing Rectangles

    • Exploration: Comparing Strings

    • Determine Classmates

57

Wrap Up

58

Match

Match the following concepts

Defines how we can negate AND and OR statements

Used in logic for comparing Boolean Expressions

Equality operator (==) compares the addresses in memory of two objects

Checks if two objects have the same content or state (.equals)

Two expressions that produce the same truth value for all inputs

DeMorgan's Laws

Truth Tables

Reference Equality

Value Equality

Logical Equivalence

59

Open Ended

What do De Morgan’s Laws help you do when working with boolean expressions?

60

Wrap Up

  • Help you rewrite expressions in different, equivalent ways

61

Open Ended

What is the difference between == and .equals() when comparing objects?

62

Wrap Up

  • == checks if 2 variables point to the same object

  • .equals() checks if they have the same content

Comparing Boolean Expressions

Show answer

Auto Play

Slide 1 / 62

SLIDE