Week 14 Discussion — Smaller Copies: Recursion or a Loop, and When to Trust One? — Traditional alternative (no AI)
Instructors: publish this instead of the adaptive version if you prefer, and unpublish or delete the adaptive one.
Hook
A countdown that calls itself prints 3, 2, 1, Go!, and a loop can print the same four lines. This week you learned that every recursive function needs a base case that answers at once and a recursive case that moves toward it, that sum_to(5) prints 15 whether you write it with recursion or with a for loop, and that a missing base case ends in RecursionError. Two versions that print the same thing can still be judged very differently by the people who read and maintain them.
Your discussion question — choose Option A or Option B; they carry the same weight and the same rubric, and you say which you picked.
Option A: A problem that holds smaller copies of itself, such as folders inside folders, a budget whose categories split into smaller categories, or a task list whose tasks have their own steps, can be written as a recursive function or as a loop. Pick one such problem from your own life, major, or workplace and take a position on which version you would want a teammate to write and maintain, and why. Use this week's ideas (base case, recursive case, call stack, iteration) and say what someone who values the other version would argue.
Option B: A teammate hands you a recursive function that looks right and prints the right answer for the first input you try. Pick one place where such a function might run, such as a club's sign-up sheet, a class project, or an app people depend on at work, and take a position on how much checking it needs before you trust it, and which inputs you would run. Use this week's ideas (base case, recursive case, RecursionError, call stack) and say what someone who weighs speed of delivery and caution differently from you would argue.
There is no single right answer. People who agree on every fact about what a recursive function prints still disagree about which version reads more plainly and how much testing is enough, because those questions rest on judgment about people and situations as well as on the facts about Python. Pick the option you actually care about, and make your case.
Expectations
Activity format: one initial post followed by two substantive peer replies. Plan on about 45 minutes across the two deadlines; your instructor sets both due dates in Canvas.
Your initial post — by the first due date (early in the module week):
- Say which option you chose.
- For Option A, name the problem, describe in words its base case and how each step makes it smaller, and say which version, recursion or a loop, you would want a teammate to write and why; for Option B, name the place the function would run, list the inputs you would test, and say how much checking is enough.
- Use at least two of this week's terms (base case, recursive case, call stack, iteration, RecursionError) correctly.
- State the strongest case for a view you do not hold, in one or two sentences.
- Length: roughly 150–250 words if written. You may instead record your post as audio or video (about two minutes) and attach a transcript; both forms are scored by the same rubric.
Your replies — by the second due date (the end of the module week):
- Reply substantively to at least two classmates.
- A substantive reply does more than agree: name the base case of the function they describe, suggest one input that would test it, or make the strongest fair case for the side they did not take. "Nice point!" on its own does not count.
What a strong post looks like:
I chose Option A. My club keeps its shared files in folders that hold more folders, and I would want the file counter written recursively: count the files here, then do the same job on each folder inside, with an empty folder as the base case. Each call works on a smaller folder, so it always reaches the base case. Someone could argue that a loop is easier for a new teammate to read, and that is fair, so I would add a comment naming the base case and test the counter on an empty folder first.
Notice how it names the problem, names the base case and how each call gets smaller, takes a position with a reason, and states a fair case for the other side. That is the bar.
Participation rubric
This discussion is worth 10 points. The three criteria below look at your initial post and your peer replies.
| Criterion | Full credit | Partial credit | No credit |
|---|---|---|---|
| Quality of the initial post (4 pts) | A specific problem or place, a description of the function's base case and how each call shrinks the input, a clear position with a reason, and a fair statement of another view | A problem is present, but the function stays vague, or the position is asserted without a reason | Missing, off-topic, or no reasoning about recursion or about trusting a recursive function |
| Use of course concepts (3 pts) | Uses base case, recursive case, call stack, iteration, and RecursionError precisely, with every claim about what a function prints matching a run | Uses a term loosely, or treats a base case and a recursive case as the same thing | No course terms, or used incorrectly |
| Engagement with peers (3 pts) | Two or more substantive replies that extend or challenge a classmate's reasoning | One substantive reply, or replies that only agree | No replies, or "I agree" with nothing added |
Post early if you can — the best threads happen when people have time to reply before the second due date.
Built with The Course Maker · samples.thecoursemaker.com