When I told my father that one day I wanted to be so rich that I had 10000 dollars. He laughed and gave me $10000 dollars and some envelopes, he said that if I could sort the money such that I could give him one or more of the envelopes and it would total the sum of money he asked for, I could have his $10000. Unfortunately for him, I was able to sort the money this way. What is the least amount of envelopes that my father could have given me?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
For every envelope there are two options, either I give it to my father or I do not, so it is best to think of this problem in binary. Therefore the amount in each envelope should be a power of 2. Let the highest power of 2 among the envelopes be n. Then the sum of giving all of the envelopes we have created so far will be 2 − 1 2 n + 1 − 1 . We need to find the highest power of 2 where 1 0 0 0 0 − ( 2 n + 1 − 1 ) can be written in binary with less than n + 1 digits. We create the inequality 2 n + 1 − 1 > 1 0 0 0 0 − 2 n + 1 Solving this:
2 n + 1 − 1 > 1 0 0 0 0 − 2 n + 1
2 n + 2 > 1 0 0 0 1
Considering that n is an integer it must be 12 and 2 1 4 = 1 6 3 8 4 . So now we have 13 envelopes for 2 0 to 2 1 2 and and additional envelope for the remaining amount makes 14