20
Boolean Operators Defined by truth tables and applied in search expressions

Boolean Operators Defined by truth tables and applied in search expressions

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Boolean Operators Defined by truth tables and applied in search expressions

Boolean Operators

Defined by truth tables and applied in search expressions

Page 2: Boolean Operators Defined by truth tables and applied in search expressions

Building a Truth Tablep q ~p p • q p v q

T T F T T

T F F F T

F T T F T

F F T F F

Page 3: Boolean Operators Defined by truth tables and applied in search expressions

Building a Truth Tablep q ~p p • q p v q

T T F T T

T F F F T

F T T F T

F F T F F

The number of rows in a truth table is 2n, where n is the

number of terms in the table.

Page 4: Boolean Operators Defined by truth tables and applied in search expressions

Building a Truth TableNegation

p q ~p p • q p v q

T T F T T

T F F F T

F T T F T

F F T F F

The truth-value of ~p is always the opposite of p. This is essentially what contradiction looks like.

Page 5: Boolean Operators Defined by truth tables and applied in search expressions

Building a Truth Table Boolean AND

p q ~p p • q p v q

T T F T T

T F F F T

F T T F T

F F T F F

The expression p • q (p AND q) evaluates to TRUE only when both p and q are TRUE.

Page 6: Boolean Operators Defined by truth tables and applied in search expressions

Building a Truth TableBoolean OR

p q ~p p • q p v q

T T F T T

T F F F T

F T T F T

F F T F F

The expression p v q ( p OR q; inclusive OR) evaluates to TRUE when either p or q is TRUE.

Page 7: Boolean Operators Defined by truth tables and applied in search expressions

Building a Truth TableAll Relations

p q ~p p • q p v q

T T F T T

T F F F T

F T T F T

F F T F F

Page 8: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

Page 9: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 10: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 11: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 12: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 13: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 14: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 15: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 16: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 17: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 18: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 19: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3

Page 20: Boolean Operators Defined by truth tables and applied in search expressions

In the music store...

C - CD e - electronica 1 - single disk pkg.

D - DVD h - hip hop 2 - double disk pkg.

S - Super Audio CD m - metal 3 - triple disk pkg.

All CDs C

Everything that is not a Super Audio CD ~S

All electronica DVDs D • e

DVDs that are not metal D • (~m)

All CDs and DVDs C v D

Hip hop CDs except triple disk pkgs. (h • C) • ~3