Patrick walks by the cookie jar and takes half of the cookies. Then, Debbie walks by and takes 2/5 of what's left. Amy takes 2/3 of what is left after Debbie has been there. If there are now 4 cookies left in the jar, how many were in there to begin with?
We can work backwards in this problem:
4=1/3 of what is left after Amy has been there, so there were 12 after Debbie took cookies.
12=3/5 of what is left after Debbie took the cookies, so there were 20 cookies after Patrick took some.
20=1/2 of the original amount of cookies in the jar before Patrick took them, so there were $\boxed{40}$ cookies in the jar to begin with.
Start with 1 whole jar
remove 1/2 then 1/2 is left
removing 2/5 of the 1/2 leaves 3/5 of the 1/2
3/5 * 1/2 = 3/10 now are left
removing 2/3 leaves 1/3 of what is left
1/3 * 3/10 = 3/30 of the original and this is equal to 4
3/30 x = 4 x = 4 * 30 /3 = 40 cookies originally