Boolean algebra and conditions .edu
Outline
1 Boolean Algebra logical expressions pseudocode and flowcharts
2 Conditional Constructs the type bool if, else, elif
MCS 260 Lecture 8 Introduction to Computer Science
Jan Verschelde, 21 June 2023
Intro to Computer Science (MCS 260)
Boolean algebra and conditions
L-8 21 June 2023 1 / 16
Boolean Algebra, Flowcharts Conditional Expressions
1 Boolean Algebra logical expressions pseudocode and flowcharts
2 Conditional Constructs the type bool if, else, elif
Intro to Computer Science (MCS 260)
Boolean algebra and conditions
L-8 21 June 2023 2 / 16
Boolean Algebra
computing with logical expressions
Boolean algebra is the calculation with True and False (often having values 1 and 0). The operators are and, or, and not. Truth tables define the outcome for all values:
x False False True True
y False True False True
x and y False False False True
x False False True True
y False True False True
x or y False True True True
Intro to Computer Science (MCS 260)
Boolean algebra and conditions
L-8 21 June 2023 3 / 16
Evaluation Laws
law and order in the Boolean algebra
When not, and, or occur in an expression, not is first evaluated, before and, and finally or.
De Morgan's laws for simplifying expressions: not (( not x ) or ( not y )) = x and y Negating not being alive or not being well means being alive and being well. not (( not x ) and ( not y )) = x or y Negating not going to school and not going to work means going to school or going to work.
We prove these laws by truth tables. Applications of truth tables:
Realization of electronic circuits. Simplification of conditional statements in programs.
Intro to Computer Science (MCS 260)
Boolean algebra and conditions
L-8 21 June 2023 4 / 16
Boolean Algebra, Flowcharts Conditional Expressions
1 Boolean Algebra logical expressions pseudocode and flowcharts
2 Conditional Constructs the type bool if, else, elif
Intro to Computer Science (MCS 260)
Boolean algebra and conditions
L-8 21 June 2023 5 / 16
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- booleans and conditionals
- boolean algebra and conditions edu
- chapter 3 boolean algebra and digital logic
- how to use basic boolean functions tutorial
- boolean functions of one variable
- graph based algorithms for boolean function manipulation
- basic scripting syntax and data types in python
- 5 conditionals — how to think like a computer scientist
Related searches
- general terms and conditions navy
- generic terms and conditions website
- website terms and conditions template
- website terms and conditions free
- sales terms and conditions template
- terms and conditions example
- website terms and conditions template free
- standard terms and conditions template
- terms and conditions for website
- website terms and conditions sample
- standard terms and conditions sample
- free terms and conditions generator