Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Some Alteryx fun - the King's quest

ulrich_schumann
8 - Asteroid

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!

10 REPLIES 10
JohnJPS
15 - Aurora

Cool challenge!  Very tricky.  I came up with 31 unlocked cells. Pretty cool in Alteryx, to see the grid of actual lock toggles in partial results along the way.

Spoiler

 

 

Capture.PNG

 

 

 

ulrich_schumann
8 - Asteroid

@JohnJPS: very good - very impressive solution!

DataBlender
11 - Bolide

This was fun! I also got the answer of 31.

 

 

Spoiler
I tried two methods. One was an iterative macro to simulate the guard going round 1000 times.

The other was to calculate the number of divisors for each number. Those with an even number of divisors would remain locked whilst those with an odd number would become unlocked.

Kingsquest.jpg



ulrich_schumann
8 - Asteroid

@DataBlender: 2 additional great solutions - thanks for sharing!

MarqueeCrew
20 - Arcturus
20 - Arcturus

Hi @ulrich_schumann,

 

https://community.alteryx.com/t5/Data-Preparation-Blending/Challenge-5th-grade-math/m-p/3920#M596

 

A fun challenge for perfect squares like us 🤓

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ulrich_schumann
8 - Asteroid

@MarqueeCrew: thanks for the hint: soo many more solutions that fit to the challenge :-)

I am really amazed of the possibilities of Alteryx to come to a solution!

DataBlender
11 - Bolide

Wow, you can do it in one tool!

JohnJPS
15 - Aurora

That's awesome - should've spotted the pattern in my other solution.  Yeah, knowing which numbers contribute makes for a trivial one-tool approach.

 

 

Spoiler

 

Capture.PNG

 

 

 




 

ulrich_schumann
8 - Asteroid

The one tool approach was NOT in my expectation as I was looking for a way to come to a solution without the mathematical background. So very happy with the provided solutions. The various solutions are giving me very good inside for other (business related) questions.

So thanks a lot for all your contribution.

Labels