Module 5: Lecture Notes for Math 170

Return to Lecture Notes page.
Some images on this page have been generated via AsciiMathML.js.
For more information see: www.chapman.edu/~jipsen/asciimath.html.

  1. Boolean logic is used throughout programming. It is an essential part of conditional statements (i.e., if then, if then else statements) and iterative statements (i.e., for, while do, repeat until statements).
    1. Example: if ( ($part_start[$y] > $desired_week) || ($desired_week>$part_end[$y]))
    2. Example: if ($fields[8] eq " " || $fields[9] eq " ")
    3. Example: if (($early_time[$m] > 0) && ($n < $low_slot))
    4. Example: while ( (x3==0) || (x3==x1) || (( p1*(y3-y2))==(-1*q1*(x3-x2)) ) )
  2. Complex problems are generally segmented via Boolean values that break the problem into distinct smaller problems or conditions.
  3. One of the most common causes of programming errors is the misstatement and/or misinterpretation of Boolean expressions.
  4. The "proof" of a program as a solution to a problem involves testing each combination of Boolean values possible in the problem; this is a essentially tracing through a giant truth table to be sure that we have properly handled every possible situation.

Return to Lecture Notes page.

©Roger M. Palay
Saline, MI 48176
November, 2013