EBoard 25: Numeric recursion (Section 2)
Please follow the standard start-of-class routine.
Warning! You are being recorded (and transcribed) (provided the technology
is working correctly).
Approximate overview
- Administrivia
- Q&A (potentially)
- Pop quiz
- Lab
Administrative stuff
Announcement about Computing Peers United (CPU) Buddies Program
- A mentorship program that pairs less experienced students (“mentees”)
with more experienced students (“mentors”).
- As 151 students, you are considered less experienced.
- Lots of advice: Conferences, hack-a-thons, courses, internships,
CS in general.
- Get connected with the broader CS community.
- Posters are up soon with QR codes and URLs.
- November 10 at 8pm kickoff event. More dead trees!
- Spam coming soon, too.
Introductory Notes
- I had a non-productive weekend, so I’m a bit behind on grading. Stay
tuned! I’ll also be spending the first few minutes of lab getting some
important things updated.
- Thank you to all the folks who asked and answered questions on MP4.
- We had a problem in class on Friday: A student was observed taking
pictures of a quiz on their phone. Hence, I am imposing stricter guidelines
on phone usage during quizzes.
- Your phone must be in your bag during quizzes.
- Your phone must be turned off (or at least silenced) during quizzes.
- If we see your phone out during a quiz,
- I will void all of your LA grades. (You can still make them up
in subsequent weeks.)
- Your final grade in the class will be reduced by one letter grade.
- I will report you for an academic honesty violation.
Upcoming work
- Due Tuesday, 2026-11-03
- Due Thursday, 2026-11-05
- On Friday, 2026-11-06
- NEW Quiz/LA on numeric recursion (today and Wednesday)
- NEW Quiz/LA on tail recursion
- Makeup Quiz/LA on list recursion
- Makeup Quiz/LA on testing
- Makeup Quiz/LA on local bindings
- Makeup Quiz/LA on collaboration
- Makeup Quiz/LA on lists and list operations
- Makeup Quiz/LA on conditionals
- Makeup Quiz/LA on compose, cut, and section
- Makeup Quiz/LA on tracing
- Makeup Quiz/LA on decomposition
- Makeup Quiz/LA on procedures
Upcoming activities
Scholarly
- Tuesday, 3 October 2026, Noon–1:00 p.m., CS Commons (I think).
CS Table
- Thursday, 5 October 2026, 11:00 a.m.–Noon, JRC 101.
Scholars’ Convocation: More Humanities
Artistic/Cultural
- Any day. Visit the GCMOA for at least 30 minutes.
Multicultural
- Friday, 6 November 2026, 4:10–5:00 p.m., HSSC N1170.
Middle of Everywhere ()
Peer
Musical, theatric, sporting, academic, and similar events involving this
section’s students are welcome.
Wellness
- Monday, 2 November 2026, 8:00–9:00 p.m., Prayer Garage in the CRSSJ.
Meditation Group
- Tuesday, 3 November 2026, 12:15–12:45 p.m., GCMoA.
Yoga in the Museum
- Tuesday, 3 November 2026, 4:30–6:00 p.m., Bear P103.
Wellness Yoga
- Tuesday, 10 November 2026, 5:00–8:00 p.m., HSSC North Auditorium.
Therapy Dogs
Misc
- Wednesday, 4 November 2026, 8:00–9:00 p.m., Science 3820.
Mentor Session
- Thursday, 5 November 2026, 8:00–9:00 p.m., Science 3820.
Mentor Session
Other good things
These do not earn tokens, but are worth your consideration.
Check in on the “Sam talks less” experiment
- Do you want me to go over the upcoming work?
- Do you want me to go over the token events?
- Do you want Q&A time?
- Would you prefer that I send out notes about problems from the previous
lab that people struggled on or talk about them in class or both?
- Email: 3
- In-class: 6
- Both: 7
- I don’t care: 3
- Do you want me to record class?
- Do you want to discuss any of the issues above?
Q&A
MP4
Could you explain more about similar colors (problem 2e)?
Go through the list. For each color, remove any remaining elements that
are similar to it.
Administrative
Pop quiz
- What is your favorite kind of (soda) pop?
- Lists: What is
(cdr (cons 1 (list 4 5 6)))?
- Characters: How do we determine the collating sequence of a character?
- Strings: What’s the difference between a character and a string?
- Tracing: What are the three basic steps in tracing?
Lab
- There are two labs today. You’ll start the second one after you finish
the first (assuming you finish the first).
- You will continue partners on Wednesday.
- First lab:
tail-recursion.scm.
- Exercise 1 on today’s first lab should be “Tallying strings”
- Refresh if it’s not
- Rename the previous
tail-recursion.scm lab to recursion-patterns.scm
- Second lab:
numeric-recursion.scm
Exercise 1: Tallying strings
;; tally-so-far remaining
;; ------------ ---------
;; 0 (list 5 "a" "b" 1 "c" 2 3 "b" 4)
;; 0 (list "a" "b" 1 "c" 2 3 "b" 4)
;; 1 (list "b" 1 "c" 2 3 "b" 4)
;; 2 (list 1 "c" 2 3 "b" 4)
;; 2 (list "c" 2 3 "b" 4)
;; 3 (list 2 3 "b" 4)
;; 3 (list 3 "b" 4)
;; 3 (list "b" 4)
;; 4 (list 4)
;; 4 (list)
- When should we stop? When
remaining is null.
- What should we return when we are done?
tally-so-far.
- How do we “simplify”
remaining? Remove the first element using cdr.
- What should the recursive call look like?
- We already know that we take
(cdr remaining)
(tally-strings/helper ??? (cdr remaining))
- What should we do to
tally-so-far? If (car remaining) is a string,
add 1 to tally-so-far. Otherwise, keep it as is.
(define tally-strings/helper
(lambda (tally-so-far remaining)
(if (null? remaining)
tally-so-far
(tally-strings/helper
(if (string? (car remaining))
(+ 1 tally-so-far)
tally-so-far)
(cdr remaining)))))
(define tally-strings
(lambda (lst)
(tally-strings/helper ??? ???)))
Notes during lab