Discrete Structures & Algorithms

Class #17 (Mon April 4)

Topics

  • Finish Sec 2.3: Functions (“onto” functions)
  • Start Ch 3 – Algorithms
  • Python code
    • We discussed the function in Sec 2.3, #7(b): “the function that assigns to each positive integer the number of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 that do not appear as decimal digits of the integer.”
    • See here for an implementation of that function in python, using python’s “set” data type.

Announcements/To-do:

  • Hand in HW#3

1 Comment

  1. Suman Ganguli

    Here is the python code from class yesterday, which computes the image of a set S for given function (for one of the HW exercises from Sec 2.3):
    https://trinket.io/python/6509451351

Leave a Reply

Your email address will not be published. Required fields are marked *