Module 3: 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. The "modulo" operator, %
      In many programming applications there is a common need for finding the remainder on division.
    1. This is not available in al programming languages.
    2. One can create an expression (or a function) to do this, x-int(x/y).
    3. Most often used with just positive integers.
    4. When using negative integers there is no consistent understanding about the reult across different programming languages.
    5. Example: We can fit 72 boxes into a crate, we have 857 boxes, how many will be left over once we have packed them into crates?
  2. Prime factors: not a huge use in real programming (unless you are writing programs for a math class) but expected knowledge in computer courses (basically because it provided a great example of a "simple" concept that has many points where the program to find prime factors can be improved).
  3. The greatest common factor (greatest common divisor)
    1. Essential for reducing fractions
    2. Brute strength vs. consideration (prime factors) vs. elegance (Euclidean algorithm)
    3. Not built-in to some programming languages
  4. The least common multiple
    1. Not a huge need in programming, but again, expected knowledge.
    2. Another brute strength vs. consideration (prime factors) vs. elegance (product/gcf)
  5. Factorial and the ! operator
    1. Used in computing permutations and combinations
    2. Not directly available in most computer languages
    3. Expected knowledge because it is among the easiest examples of a "recursive" function
  6. Fibonacci sequence
    1. Probably will not come up in any real program you will write
    2. Expected knowledge since it provides a great example for programming courses
    3. Important as an instance where we assign few initial values and then produce additional values based on the previously determined values.

Return to Lecture Notes page.

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