Mary baked a number of cookies. She ate one, gave half of the remaining cookies to her sister, ate another one, then gave half of the remaining cookies to her brother. Given that she ended up with 55 cookies, how many did she start with?
1 Answer
Explanation:
Work backwards through the story:
-
Mary ends up with
55 cookies, after giving away half to her brother. So before she gave away half, she had1010 cookies. -
Before she had
1010 cookies she ate one, so prior to eating that cookie she had1111 cookies. -
Before she gave away half to her sister, she had
2222 cookies. -
Before eating the first cookie she started with
2323 cookies.
We can express the story algebraically.
If Mary starts with
((n-1)/2-1)/2 = 5n−12−12=5
Multiplying both sides by
(n-1)/2-1 = 10n−12−1=10
Add one to both sides to get:
(n-1)/2 = 11n−12=11
Multiply both sides by
n-1 = 22n−1=22
Add one to both sides to get:
n=23n=23
Alternative method
In terms of functions, we can define:
d(x) = x-1d(x)=x−1
h(x) = x/2h(x)=x2
Then the inverse functions are:
d^(-1)(x) = x+1d−1(x)=x+1
h^(-1)(x) = 2xh−1(x)=2x
If
h(d(h(d(n)))) = 5h(d(h(d(n))))=5
Hence:
n = d^(-1)(h^(-1)(d^(-1)(h^(-1)(5)))) = 2*(2*5+1)+1 = 23n=d−1(h−1(d−1(h−1(5))))=2⋅(2⋅5+1)+1=23