# Recursion > Tenth graders meet recursion — a function that solves a problem by calling itself on a smaller version, until it reaches a base case that stops it. Think… **Computer Science** | **Grade 10** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g10-cs-recursion.html* Tenth graders meet recursion — a function that solves a problem by calling itself on a smaller version, until it reaches a base case that stops it. Think Russian nesting dolls, or factorial. They test the idea, then trace and write a recursive function. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - Explain **recursion**. - Identify the **base case**. - Trace a **recursive call**. - Write a recursive function. How can a function solve a problem by calling itself? ## Understand Recursion Project each item and have students answer about recursion. ## 55 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — Dolls Within Dolls How do you open a stack of nesting dolls? #### 👩‍🏫 Teacher Moves - Show nesting dolls. - Ask about the smallest one. - Set the goal. #### 🎒 Student Actions - Look. - Guess. - Get ready. ### Use — Recursion Students use the idea. #### 👩‍🏫 Teacher Moves - Send students to Understand Recursion. - Note calls itself + base case. - Trace factorial(3). #### 🎒 Student Actions - Answer. - Note it. - Trace. ### Modify — Trace It Students modify. #### 👩‍🏫 Teacher Moves - Expand factorial(3) step by step. - Change the base case; see the effect. - Spot an infinite recursion risk. #### 🎒 Student Actions - Expand. - Change. - Spot. ### Create — Write It Students create. #### 👩‍🏫 Teacher Moves - Write a recursive function (countdown). - Give it a base case. - Test a few inputs. #### 🎒 Student Actions - Write. - Base. - Test. ### Reflect — Reflect Students close. #### 👩‍🏫 Teacher Moves - Say what recursion is. - Say why a base case matters. - Complete the exit ticket. #### 🎒 Student Actions - Say it. - Say. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Iteratively develop programs using control structures. Decompose problems into smaller same-shaped parts. Use procedures to reduce complexity. Decompose problems recursively. ## One lesson, every learner ### Multilingual Learners - Use nesting dolls. - Frame: “smaller, then smaller, then stop.” - Trace with a picture. ### Support & Access - Use a 3-step countdown. - Identify the stop case. - Use a trace table. ### Stretch & Extend - Write recursive factorial. - Compare recursion vs a loop. - Draw the call stack. ### What to gather - 📽️Screen / board - 🪆Nesting dolls - 💻Understand Recursion - 🐍Python / editor - 📓Notebooks - 🎫Exit-ticket slips ### Key terms - **recursion**: a function that calls itself - **base case**: the input that stops the recursion - **recursive case**: the step that calls itself on a smaller input - **call stack**: the record of active function calls - **factorial**: n * (n-1) * ... * 1 — a classic recursion - **infinite recursion**: no base case reached (a bug) - **decompose**: break into a smaller same-shaped problem - **return**: pass a result back up the calls ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Reflect: recursion. Have students describe a recursive function and its base case. A printable recursion worksheet is in the Computer Science library. ## Check your understanding **1. What does “recursion” mean?** - a function that calls itself *(correct)* - pass a result back up the calls - the input that stops the recursion - the record of active function calls “recursion” means: a function that calls itself **2. Which word means: “the input that stops the recursion”?** - call stack - infinite recursion - recursion - base case *(correct)* “base case” means: the input that stops the recursion **3. What does “recursive case” mean?** - break into a smaller same-shaped problem - n * (n-1) * ... * 1 — a classic recursion - the step that calls itself on a smaller input *(correct)* - no base case reached (a bug) “recursive case” means: the step that calls itself on a smaller input **4. Which word means: “the record of active function calls”?** - recursive case - call stack *(correct)* - decompose - base case “call stack” means: the record of active function calls **5. What does “factorial” mean?** - n * (n-1) * ... * 1 — a classic recursion *(correct)* - the record of active function calls - the input that stops the recursion - the step that calls itself on a smaller input “factorial” means: n * (n-1) * ... * 1 — a classic recursion **6. Which word means: “no base case reached (a bug)”?** - return - recursion - infinite recursion *(correct)* - recursive case “infinite recursion” means: no base case reached (a bug) ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g10-cs-recursion.html All lessons: https://lessonplans.k12academics.com/