Why is every way to score 87 points just a way to score 86, 85, or 84 plus one more basket — and what does that make the three base cases?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
The video walks the counts upward from the base cases: score_count(4) is 6, score_count(5) is 11, and score_count(6) is 20.
Using nothing but the recursive step and those three numbers, work out the count for a score of 8 and assign it to score8. No function and no recursion — arithmetic is enough. Careful: 8 sits two rungs above 6, so one of the numbers the final sum needs is not in the list yet.
Three base cases for scores of 1, 2 and 3
Write score_count(1) = 1, score_count(2) = 2 and score_count(3) = 3, listing the actual basket combinations that sit behind each of those three values.
The three-branch recursive step
State that the ways to reach 87 are the ways to reach 86, 85 and 84 with a one-, two- or three-point basket added, then write the three-term return.
Trace of score_count(6)
Follow the descent into scores of five, four and three down to the base cases, recording the order in which each call's three branches are resolved.
Compact recursion against nested brute-force loops
Write the finished score_count beside a sketch of the nested loops an iterative version would need, and record the outputs 6, 20 and 1431 for inputs 4, 6 and 13.