Explain a recursive function in plain English
Model scores over time
| Model | Trend | Latest score | Pass | Last tested |
|---|---|---|---|---|
| Claude Opus 4.7 | 8/9 | Pass | 2026-05-23 | |
| Claude Sonnet 4.6 | 9/9 | Pass | 2026-05-23 | |
| GPT-4o | 6/9 | Fail | 2026-05-23 | |
| Gemini 2.5 Pro | 9/9 | Pass | 2026-05-23 |
Rubric
Each criterion scored 0โ3. Pass threshold: 7/9.
- 1.Identifies the base case correctly
- 2.Explains the recursion without using the word recursion unnecessarily
- 3.Output is plain English with no code in the response
Latest outputs โ run 2026-05-23
Here is a recursive function:
```
{{code}}
```
Explain in plain English what it does and what its base case is.def fib(n): return n if n<2 else fib(n-1)+fib(n-2)This function computes Fibonacci numbers. Its base cases are n=0 and n=1 โ for those it returns n directly. For any larger number, it adds the results of two smaller versions of itself, working recursively down until both reach a base case.
Here is a recursive function:
```
{{code}}
```
Explain in plain English what it does and what its base case is.def fib(n): return n if n<2 else fib(n-1)+fib(n-2)This function calculates the nth Fibonacci number. The base case is n < 2 โ returning 0 or 1 directly. For any larger n, it adds the two preceding Fibonacci values by calling itself with n-1 and n-2, continuing until both chains hit a base case.
Here is a recursive function:
```
{{code}}
```
Explain in plain English what it does and what its base case is.def fib(n): return n if n<2 else fib(n-1)+fib(n-2)This function computes Fibonacci numbers using recursion. The base case (n < 2) returns n directly โ 0 for n=0 and 1 for n=1. For any n>=2, it calls itself with n-1 and n-2, adding the results. It works by breaking the problem down repeatedly until reaching the base case.
Here is a recursive function:
```
{{code}}
```
Explain in plain English what it does and what its base case is.def fib(n): return n if n<2 else fib(n-1)+fib(n-2)This function finds Fibonacci numbers. It stops when n is 0 or 1 โ those are the base cases โ and returns n directly. For anything larger, it adds together the results of two calls with smaller inputs, building the answer from the smallest possible cases upward.