EBoard 24: Randomness

This class will be recorded! Its use is limited to members of the class. Please do not share with others.

Approximate overview

  • Administrative stuff [~10 min]
  • Q&A [~10 min]
  • Lab [~70 min]

Administrative stuff

Notes and News

  • Please use the evening tutors. Please consider visiting them in person (if you are on campus).
  • Let me know if you’d like to be on the csstudents mailing list.
  • I think I’ve fixed the links to eboards. Let me know if you find links missing on the site!

Upcoming activities and other token-earning things

Events

  • Visit Grinnell Art Museum, maybe get an art pack https://www.grinnell.edu/campus-life/arts-culture/museum.
  • TODAY CS Extras, Thursday, 4 March 2021, at 5pm
  • TODAY W@G, Thursday, 4 March 2021, at 7pm
  • TODAY Journalism Ethics Workshop, 7:00-8:30 pm, Thursday, March 4 and Tuesday, March 9
  • Monday, CS Table at noon

Upcoming work

I’m not sure if all of these links are correct. Let me know if any are not.

Q&A

What are good edge cases?

It depends on the situation.

For lists, here are things I normally make sure to check.

    * Empty lists (input, results)
    * Something special about the first element
    * Something special about the last element
    * Repeated elements

For integers, here are things I normally make sure to check.

    * Zero
    * Negative numbers (as appropriate)
    * Large positive numbers

For real or rational numbers, I generally add

    * Non-integers
    * Really small numbers (e.g., 1/1000000000)
    * Both exact and inexact

For numbers, I generally add

    * Complex numbers (negative and positive real part, negative and
      positive imaginary part)

In the roll-a-die procedure from the reading, why is the lambda empty?

  1. So that it’s a procedure.
  1. You’ll understand better in lab why we want a procedure and not just a value.

With pattern matching, do we have to document the variables from the matching in our documentation?

No. The assumption is that the reader can see the variables in the patterns.

    (match lst
      [(cons x xs) ; the reader should say "This matches a
                   ; nonempty list, and we'll be using 'x'
                   ; to refer to the car and 'xs' to refer
                   ; to the cdr Lab ---