1. First of all, pick the number of times a week that you would like to have chocolate (try for more than once but less than 10) 2. Multiply this number by 2 3. Add 5 4. Multiply it by 50 5. If you have already had your birthday this year add 1761 ; If you haven't, add 1760 6. Now subtract the four digit year that you were born You should have a three digit number The first digit of this was your original number (i.e. how many times you want to have chocolate each week) The next two numbers equal YOUR AGE! (Oh YES IT IS!!!)

1. Write a simplified function for the procedures taken in Chocolate Math. Use a variable to represent the number of times a person would like to have chocolate each week.

2. Write a simplified function that represents the number and a person’s age.

3. Prove algebraically that these two functions are equivalent.
The grading rubric is on the following page.

1. pick a number -- x

2. multiply by 2 -- 2x
3. add 5 -- 2x+5
4. multiply by 50 -- 50(2x+5) = 100x + 250
5. add 1761 -- 100x + 250 + 1761 = 100x + 2011
6. I was born in 1940, so subtract that
100x + 2011 - 1940 = 100x + 71

So whatever you pick for x , would move into the hundreds position of your final answer.
Thus the first number is the choice , the last two numbers are the age.
The rules for step5 would change from year to year, in the next year (2012) we have to add 1762, etc.

1. Here's a simplified function for the procedures in Chocolate Math, using the variable "x" to represent the number of times a person would like to have chocolate each week:

function chocolateMath(x) {
let result = ((x * 2 + 5) * 50);
let year = 2021; // assuming the current year is 2021
let birthday = true; // assuming the user has already had their birthday this year

if (birthday) {
result += 1761;
} else {
result += 1760;
}

result -= year; // subtract the year of birth
return result;
}

2. Here's a simplified function that represents the number and a person's age:

function findAge(number) {
let originalNumber = Math.floor(number / 100); // extract the first digit to get the original number of times to have chocolate per week
let age = number % 100; // extract the last two digits to get the age

return [originalNumber, age];
}

3. To prove algebraically that these two functions are equivalent, let's substitute the second function into the first one:

chocolateMath(x) = ((x * 2 + 5) * 50) + 1761 - 2021 = (100x + 1711) - 2021 = 100x - 310
findAge(chocolateMath(x)) = [Math.floor((100x - 310) / 100), (100x - 310) % 100]

Simplifying further:
[Math.floor((100x - 310) / 100), (100x - 310) % 100] = [Math.floor(x - 3.1), (100x - 310) % 100] = [Math.floor(x), 100x % 100] = [Math.floor(x), 0]

Therefore, the expression [Math.floor((100x - 310) / 100), (100x - 310) % 100] simplifies to [Math.floor(x), 0], which confirms the equivalence of the two functions.