Skip to main content

CSC 151 2019S, Class 05: Basic types in Racket

Overview

  • Preliminaries
    • Notes and news
    • Upcoming work
    • Extra credit
    • Questions
  • Important issues
  • Lab

Preliminaries

News / Etc.

  • Happy Monday!
  • I’ve heard some concerning reports from students and mentors in this course. We’ll discuss those before continuing with preliminaries.
  • You should have received grades on HW2.
  • Ramadan begins during Week 14 this semester. I will do my best to make appropriate accommodations during week 14 and finals week. College policy suggests that you must notify me by the end of this week if you need such accomodations, but I will make them no matter when you notify me.
  • The lab writeup links should now be working.
  • I apologize for the limited time for Friday’s lab. We strive to write labs that you can finish (or come close to finishing) during class time. If you don’t finish in class time, skim the remaining problems and do those that you are not confident you can do.
    • Warning: Today may be another “too much lab” day.
  • Mentor sessions: Wednesday 8-9, Thursday 8-9, Sunday 5-6. CS Commons.
  • Our mentors have created a page of useful stuff, available at https://xinyayang0506.github.io/CSC-151/ and from the reference menu.

Upcoming work

  • Reading (available online), due before class Wednesday.
  • Assignment 3 due Tuesday night.
  • Flash cards due Wednesday at 8:00 p.m.
  • Lab writeup due before class Wednesday.
    • Exercise: 6c (the next-char procedure)
    • Subject: CSC 151.01 Writeup for Class 5 (YOUR NAMES)
    • To: csc151-01-grader@grinnell.edu
  • Quiz Friday
    • Basic types
    • Writing procedures

Extra Credit

Extra credit (Academic/Artistic)

Extra credit (Peer)

  • Home track meet, Saturday, all-day and beyond. (30 min suffices)

Extra credit (Wellness)

  • HIIT training, 4:30 pm, Tuesday, Dance Studio, Bear. (Cap of two EC units.)
  • Hatha Yoga, 7:00 pm, Tuesday, Dance Studo, Bear. (Cap of two EC units.)

Extra credit (Misc)

  • Leadership Institute info session, Tuesday, 7 p.m. JRC 2nd.

Other good things

Questions

Written or electronic flash cards?

Send me electronic. Choose whatever is better for your studying for yourself.

For problem 2A, should we generate our own sentence or use the one you gave us?

Use the one we gave you.

For problem 2B, should we generate our own templates or use the ones you gave us?

It’s up to you. The ones we gave you should be good starting points.

For problem 2C, should we generate our own template?

Definitely.

It appears you screwed up some of the Scheme in the assignment.

Yup. Let me know and I’ll fix it.

How do we get the libraries on our personal computers?

Start DrRacket

File > Install Package

Enter “https://github.com/grinnell-cs/loudhum.git” (without the quotation marks).

Click Install* or **Update (whichever appears).

When the Close button becomes available, click it.

Important things

Introduction

Background: I have heard from some of you and from some mentors that it does not seem that you are always treating your partners with respect.

You have different backgrounds in this material and, irrespective of background, some of you may “catch on” to an idea more quickly than your partners.

That does not give you permission to treat your partner as less able, less valuable, or less competent than you are.

Everyone in this classroom got into Grinnell. Everyone in this classroom is capable of doing the material and can contribute usefully to work. We already had a class code of conduct on the agenda for Friday, but we need to do some work on those issues today.

Note: Traditionally, the pair programming in CSC 151 is considered a strength of the course. (There are issues, but we resolve them quickly.)

Activity

I have handed many of you cards with statements on them. I will ask you to read those aloud.

Plans

If you would prefer a partner of the same gender expression on HW4 (or labs) email me and I’ll make sure that happens.

Lab

Why do we round x.5 toward even numbers?

It’s a tradition from statistics. Suppose we have a lot of numbers ending in .5 and we’ve made the decision to round all of them. If we round all of them up, the average of our data set is now going to be higher. If we round all of them down, the average of our data set is going to be lower. If we round them “toward the even”, the average of our data set should be similar. (This depends on our distribution.)

Why are the numerator and denominator of 1.2 so strange?

Racket represents inexact numbers (with a decimal point) as fractions whose denominator is a power of 2, more or less. 1.2 or 6/5, doesn’t have a denominator which is a power of 2, so it does the best it can.

If we used a denominator of 4, we’d probably write 5/4 (1.25, rather than 1.2).

If we used a denominator of 8, we’d probably use 10/8 (1.25 again), which is better than 9/8 (1.125).

If we used a denominator of 16, we’d probably use 19/16 (1.1875), which seems a bit closer.

Which numbers should we use?

Debrief

I forgot: Quizzes returned. You can check the second set of problems on your own. Let me know if you have questions on the grading.