EBoard 24: Pairs and pair structures (Section 1)
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.
- Section 1 only: One of you told a friend that you felt that I wasn’t
very snarky in class and wished that I were more so. Hence, we have
a survey.
- Sam needs to be more snarky.
- Sam’s snarkiness is about right.
- Sam needs to be less snarky. Too bad, so sad.
- Students need to be less snarky. WINS!
- 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
Peer
Musical, theatric, sporting, and academic events involving this section’s
students are welcome.
- Read 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 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.
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.
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 lists, our test is usually either (null? lst)
or
(null? (cdr lst))
.
For numbers, our test is usually (zero? n)
or (<= n 1)
.
In both cases, the test is an affirmative. Is this thing __?
For pair structures, our base case test is usually “Is it NOT a pair.?
if (not (pair? thing)) (base-computation) ...)
It’s a negative test.
b. Why are there two calls to sum-of-number-tree
in its recursive
case?
Number trees have two parts, and we need to extract data from both
parts. Since the parts themselves may be complex, we need to recurse
in both directions.
In effect, you’re using two assistants, rather than one.
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 refrence.
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.
Other
Lab
The first problem requires paper. Die, trees, die! I suppose you could
use a whiteboard.