Boolean Algebra - PowerPoint PPT Presentation

About This Presentation
Title:

Boolean Algebra

Description:

Boolean Algebra – PowerPoint PPT presentation

Number of Views:323
Avg rating:3.0/5.0
Slides: 9
Provided by: angel101
Category:
Tags: algebra | boolean

less

Transcript and Presenter's Notes

Title: Boolean Algebra


1
Boolean Algebra
  • True, false

2
Logical tables
  • Or in Java
  • One condition must be true for AB to be true
  • And in Java
  • Both conditions must be true for AB to be true

3
Example
4
Continued
5
Other notation in some texts
  • And can be written so AB means AB
  • Or can be written v so AB means Av B
  • So some text books will use the notation
  • if AB then print name
  • but in reality, the code is more like this
  • if (A B)
  • System.out.println(name)

6
DeMorgans law
  • Not(AB) Not A v Not B
  • Not(A v B) Not A Not B
  • In other words,
  • !(AB) (!A!B)
  • !(AB) (!A!B)

7
Example
  • Note that the gets done first!!!

8
Assignment 8
  • Write a class that will act as an expert system
    for classifying animals
  • If an animal has lunges, has a skeleton with
    vertebrae, does not lay eggs, and does not fly,
    then the animal must be a mammal
Write a Comment
User Comments (0)
About PowerShow.com