Lazy Caterer Formula

I created an activity I’m really proud of!
In the activity, students are allowed to cut a “cake” (a square) with a given number of straight cuts (i.e., lines).
I wrote some complex code to calculate each and every piece of cake that the students get from their cuts (that’s the part I’m particularly proud of).

I also discovered that it’s possible to disable certain geometry tools if specific conditions are met (for example, when the students have made enough cuts).

Here’s where I need help:
On the final slide, I want to ask students to write the formula for the maximum number of pieces that can be obtained with n cuts. I know about patterns, but is there a way to parse the students’ answers to check if they’re correct?

https://teacher.desmos.com/activitybuilder/custom/674470700546576ad129ca02

The correct answer is:

n(n+1)/2 + 1

But of course, this formula can be written in many different ways.

Do you have any suggestions for how to evaluate their responses?

Love the geometry.

You can use simpleFunction defined in terms of n and evaluate their answers against your expression at a given arbitrary value. I like to use 999. Something like this:

func = simpleFunction("0.5n\left(n+1\right)+1", "n").evaluateAt(999)
input = simpleFunction(this.latex,"n").evaluateAt(999)
check = func=input

1 Like

Thank you!!! I was thinking about evaluating the two functions for the values 1,2,3,4,5 but that’s risky … while if the two functions coincide at 999 then it is very unlikely that they are different.

Yes, I’m very happy about the geometry calculations … I had this idea in mind for some days and started thinking that it could actually be possible to write a formula that finds all the polygons you get … I was very pleased to see that it works fine handling all possible scenarios and that it is not that slow. The only possible situation where there might be some glitches is when 3 lines intersect on the same point. I could add checks for this situation but in the end I don’t think they’re necessary.

Thank’s for your answer.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.