EBoard 24: Pairs and pair structures (Section 2)

Warning! You are being recorded and transcribed, provided the technology is working correctly.

Approximate optimistic overview

  • Administrative stuff
  • Q&A
  • Lab

Administrative stuff

Introductory notes

  • Next week is preregistration. Yay! I hope that many of you are considering pre-registering for CSC-161. Feel free to chat with me if you have questions about the course.
    • We should be able to fit all interested parties.
  • Sorry about the delay on MP6 on Gradescope.
  • Every person needs a piece of paper.

Upcoming activities

Scholarly

  • Thursday, 3 April 2025, 11am–noon, JRC 101. Scholars’ Convocation: LeAnne Howe “A Choctaw In King Abdullah’s Court”
    • Also important, but not directly relevant to this class.
  • Thursday, 3 April 2025, 4:00–5:30pm, the Kernel (HSSC Multipurpose Room). CS Poster Session
  • Thursday, 10 April 2025, 4:00–5:30pm, the Kernel (HSSC Multipurpose Room). CS Poster Session
  • Tuesday, 15 April 2025, noon–1pm, Some PDR. CS Table: ???

Artistic

  • Friday, 4 April 2025 5:00–7:00 p.m., Saturday, 5 April 2025, 1:00–4:00 p.m., and Sunday, 6 April 2025, 1:00–4:00 p.m. Educational Comics Workshop.
    • You must attend all three sessions.
    • But you’ll earn three tokens.
  • Sunday, 6 April 2025 2:00 p.m. Sebring-Lewis. Grinnell Singers

Multicultural

  • Friday, 4 April 2025, 4:00–5:00 p.m., HSSC N1170 (Global Living Room). Middle of Everywhere: Vietnam
  • Friday, 4 April 2025, 6:00–9:00 p.m.,. JRC 101. Eid Fest
    • You need tickets for food.

Peer

Musical, theatric, sporting, and academic events involving this section’s students are welcome.

  • Read S&B articles by your fellow CSC-151 students and comment on them online.
  • Saturday, 5 April 2025, Noon, Baseball field. Baseball vs. Monmouth.
  • Saturday, 5 April 2025, 2:30 p.m., Baseball field. Baseball vs. Monmouth.
  • Sunday, 6 April 2025, Noon, Baseball field. Baseball vs. Monmouth.

Wellness

  • Thursday, 3 April 2025. ???. ???. Forest Bathing. Maybe?
  • Friday, 4 April 2025, 6:00 p.m.–8:00 p.m., Aux Gym. Badminton Club (Smash that bird!)
  • Friday, 4 April 2025, 9:00 p.m., Noyce Elbow. Nerf at Noyce.
  • Saturday, 5 April 2025, 4:00 p.m.–6:00 p.m., Aux Gym. Badminton Club (Smash that bird!)
  • Tuesday, 8 April 2025, 12:15–12:50 p.m., GCMoA. Yoga in the Museum.
  • Tuesday, 8 April 2025, 4:30–6:30 p.m., BRAC P103 (Multipurpose Dance Studio). Wellness Yoga.
  • Tuesday, 15 April 2025, 5:00–6:00 p.m., HSSC Atrium. Therapy Dogs.
  • Tuesday, 15 April 2025, 7:15–8:15 p.m., HSSC Atrium. Therapy Dogs.

Misc

  • Wednesday, 2 April 2025, Noon–1:00 p.m., HSSC A2231 (Auditorium) Community Forum
    • “Weekly discussion on legal protections and recourse on issues that higher education and Grinnell College face.”
    • Also online.
  • Friday, 4 April 2025, 3:00–5:00 p.m., Burling Digital Studio. GCIEL / Digital Studio Workshop: Spatial Audio and Immersive Soundscapes
  • Sunday, 6 April 2025, 7:30–8:30 p.m., Science 3819. Mentor Session
  • Tuesday, 8 April 2025, 7:00–8:00 p.m., Science 3820. Mentor Session

Other good things

These do not earn tokens, but are worth your consideration.

Upcoming work

  • Wednesday, 2 April 2025
    • Quiz: List recursion
    • Makeup quiz: Local bindings (let and let*)
    • Makeup quiz: Program style
    • Makeup quiz: Tracing
    • Remember that you can bring a sheet of hand-written notes for each quiz.
    • Remember that you can start as early as 8:00 a.m. (section 1) or stay until noon (section 2) or 4:30 p.m. (section 3)
  • Thursday, 3 April 2025
  • Friday, 4 April 2025
  • Sunday, 6 April 2025
    • Submit unpenalized “late” MP6 on Gradescope
    • Submit pre-reflection for MP7 on Gradescope
    • Submit lab writeup for Class 25 on Gradescope
    • No readings
  • Wednesday, 2 April 2025
    • Quiz: Diagramming structures (paper only)
    • Makeup quiz: List recursion
    • Makeup quiz: Tracing

Questions

Administrative

Gradescope is confusing. How do I know what work is coming up?

I’d suggest the “upcoming work” section of the daily eboard.

If you have other suggestions of ways I can help you know what work is coming up, please let me know.

Can you send grade report emails more frequently?

I can try.

Did anyone attempt to fool Sam yesterday?

I don’t think so.

What does AFK mean?

Away from keyboard. If I tell you that I’m AFK, it means I’m probably answering a Teams Message or an email from my phone.

Can I earn tokens retrospectively?

Yes. We only look at your end-of-semester total.

Can I submit my MP6 post-reflection late without penalty?

Yes.

Does it matter whether I complete an LA as a quiz or on a SoLA?

No. The important issue is that you complete the LA. You can tell from your grade report which ones you’ve completed.

Two of the LAs can only be completed on paper (tracing and diagramming structures).

Reading on Pairs

I’m not exactly seeing the benefits of viewing pairs.

We study pairs so that we have a better understanding of how Scheme functions (and why we get some of the outputs we do). Understanding pairs also permits us to build more complex structures.

Just like there are some procedures that only work with lists, are there any procedures that work only with nested pairs?

Most of the procedures that work with nested pairs also work with lists. I suppose we could write some that only work with nested pairs.

When Racket displays pairs, it puts the dots in somewhat strange places, not just in between each element. How does it decide where to put them?

It puts it before the last element if the last element isn’t null.

Is this useful for MP6?

Probably not. Perhaps if you see periods in your output, it will explain why.

I would like you to go over the check 2 in class.

Okay.

a. How does the base case test for pair recursion differ from the base case test for other types of recursion you have seen?

For list recursion, we have one of two base cases: (null? lst). (null? (cdr lst)).

For numeric recursion, we usually have base cases like (zero? n), (= n 1), or (<= n 1).

All of these are what I’d call “positive tests”: Does the parameter look like this?

For pair recursion, our base case test is almost always “is it not a pair?” (not (pair? param)). I’d call this a “negative test”.

You see this sometimes in how we write pair recursion. Instead of (if (base-case-test? param) base-case recursive-case), we tend to write (if (pair? param) recursive-case base-case), we tend to write

b. Why are there two calls to sum-of-number-tree in its recursive case?

The output usually depends on the contents of both subtrees, so we must recurse on both.

Could you describe more what’s happening with cddr and stuff like that?

If we think in terms of pairs, each d means “follow the right reference from the pair” and each “a” means follow the left reference. We work right-to-left.

Tennis players understand this as advantage and deuce.

If we think in terms of lists, and only have an a at the front, think of each d as representing “drop one element”.

Mini-project 6

Should combine-pairs-above look remarkably like combine-pairs-beside?

Yes.

Can we repeat code in tests?

Yes.

Just for clarity, we get two tokens for turning it in tomorrow and don’t pay any tokens for turning it in on Sunday, right?

Yes.

Other

Lab

The first problem requires paper. Die, trees, die! I suppose you could use a whiteboard.