This is a quirky little experiment I was shown the other day.
The object is to find the equation that will define the process with X amount of iterations.
For ease of understanding lets start with 3 iterations.
A Person has X amount of money when he enters a store. The store charges 1 dollar for entry. The Person then spends half of his remaining money inside the store. Exiting a store also costs 1 dollar. He does this 3 times
If he ends up with no money how much did he start with?
What if he did it 5 times? or 7? How much does the person need to start with based on the amount of iterations.
Notes:
1. Yes these stores charge for exit.![[tongue] [tongue] [tongue]](/data/assets/smilies/tongue.gif)
2. He can never be left without money inside the store. That is the last iteration ends with him having 1 dollar and using it to exit the final store.
3. At no time can he have change. Only integral dollar amounts.
----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
Web & Tech
The object is to find the equation that will define the process with X amount of iterations.
For ease of understanding lets start with 3 iterations.
A Person has X amount of money when he enters a store. The store charges 1 dollar for entry. The Person then spends half of his remaining money inside the store. Exiting a store also costs 1 dollar. He does this 3 times
If he ends up with no money how much did he start with?
What if he did it 5 times? or 7? How much does the person need to start with based on the amount of iterations.
Notes:
1. Yes these stores charge for exit.
![[tongue] [tongue] [tongue]](/data/assets/smilies/tongue.gif)
2. He can never be left without money inside the store. That is the last iteration ends with him having 1 dollar and using it to exit the final store.
3. At no time can he have change. Only integral dollar amounts.
----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
Web & Tech