My son came from school today with a math challenge. I saw (and think understood) the mathematical solution. So I thought, this could be also possibly solved within Alteryx.
So here is the challenge:
It is the birthday of the king and therefore he will release some prisoners. The king has 1000 prisoners, everyone in a single cell.
He advised his guard to:
- go 1000 times along the cells
- in the first round the guard has to go to every cell, in the second round to every second cell, in the third round to every third cell and so on
- every time the guard comes to a cell, he has to turn the key (so lock or unlock the door)
- at the start all cells were locked
How many prisoners will be released after 1000 rounds?
Any ideas? - Have fun!
Solucionado! Ir para Solução.
I was writing this up a little since it led me to a really nice discussion of problem solving and thinking outside the box. In all (for me) I looked at four solutions:
Performance-wise... for n = 10,000, my computer was already choking on the first solution; for n=10,000,000, it was bogging down on the second... for n=1,000,000,000,000,000, the third generative solution was up to about 7 seconds... still quick, but the final solution was still just a half second. If you have big data or need to iteratively make complex calculations numerous times, then these kinds of exercises - looking for these kinds of insights - can yield incredible dividends. Discerning insight into our solution took a rather difficult problem (unassailable for large [n]) into something that can be delivered almost instantly.
I'm sure the fast solution was obvious to some right away... for me it was a valuable lesson. thanks for the challenge!