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!

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #73: Plinko Probabilities

JosephSerpis
17 - Castor
17 - Castor

Challenge Completed

jamielaird
14 - Magnetar

Extremely pleased to have cracked this one!

 

Here's how I solved it:

 

Spoiler
1) I started by creating a replica of the board in Excel and identifying the rules dictating whether a certain 'move' is permissible.
img1.png


2) I then initialised my workflow with 5 starting positions and used generate rows to create a version of the entire first row for each starting position.  This includes paths that would not be valid, e.g. 1 --> 4 since we haven't yet applied any constraints.

img2.png

3) Next I used the filter tool to only keep the valid paths. When moving from a start to row 1 position we can keep any paths where row 1 is equal to or 1 bigger than the start position.

img3.png

4) To calculate the probability of each path we count the distinct start and row 1 positions for each start position, then divide these two numbers.

img4.png

5) These probabilities are appended to the start position. The probabilities for each given start position always add up to 1, as the "plink" has to go somewhere.
img5.png

6) The process then repeats for each row, with a slight variation in number of rows generated (5 or 6) and the filtering logic depending on whether we're moving from a wide to narrow or narrow to wide row.

img6.png
7) After repeating for all rows, we end up with a table of data where each row represents one of the unique paths the "plink" could have taken, and the probability of that exact route occurring given the starting position, calculated by multiplying all of the individual probabilities across the row.

img7.png

8) Finally, we summarise the data by start and end position and add together the probabilities for all paths with a common start and end position.  Then we can convert that summary into a matrix.

img8.png

9) Giving a final output of:

img9.png
KOBoyle
11 - Bolide

Solution attached. I was disappointed that the solution provided did not respond to the question from @alex and give a definitive answer regarding the correct probabilities. I know I’m way late to the party, but I’ll weigh in and agree that Alex has the correct probabilities. It looks like the solution from @patrick_digan did not exclude paths that go out of bounds.

 

Spoiler

Assuming that the question is which start slot has the highest probability of landing the Alteryx chip where it is in the diagram (i.e. Finish Slot 2), then the answer would be Start Slot 1 with a probability of 38.1%.

challenge_73_results_pic.png

challenge_73_workflow_pic.png

Kenda
16 - Nebula
16 - Nebula
Spoiler
My approach was very brute force and not dynamic to varying columns/rows, but I was able to get to the right answer nonetheless!

Basically, I used lots of Text Input, Append Fields, Filter, and Formula tools repeatedly.
73.PNG

In the Formula tools, I accounted for the fact that, on the even rows, the first slot can only go to the first slot and the sixth slot can only go to the fifth slot. Because of this, it is necessary to force both of slot 1's options to slot 1 in the next row and both of slot 6's options to slot 5 in the next row. By changing slot 1 and 6's values to be 1 and 5, respectively, it looks like those rows are double counted but this is required in order to get the full probability for that transition. Because of the way that the probabilities are calculated at the end, based on counts, both rows 1 and 2 & rows 19 and 20 in the below screenshot are required to account for the fact that 1 will either go to 1 or 1 and 6 will either go to 5 or 5, just as you would expect slot 2 to go to either slot 1 or slot 2.
73.2.PNG

Another way to think about it would be that 3/4 (or (0.5*1)+(0.5*0.5)) of the options need to be assigned to slot one in the third row, when starting from slot 1.
73.5.PNG

Along the workflow, I checked the counts to ensure nothing was dropping off. 
73.3.PNG

Lastly, just some normal Alteryx transformations to calculate the percentages and get the output in the right format.
73.4.PNG

Looks like my answer matches @patrick_digan! This was a tough one to think through, but we got it!

EDIT: @jamielaird it looks like we got the same solution, too! wtg
KOBoyle
11 - Bolide

@Kenda did you have a chance to look at the second hint provided with the original problem labeled "Reshaping approach"? It explains the issue with the approach you described.

 

Spoiler

In your example of Start Slot 1 and row 3, one of the 4 possible paths goes out of bounds, but in your picture you have pointed it back in bounds and counted the same path twice. When starting in Slot 1, there are only three possible paths to row 3, not 4, so the probability that you calculated should be 2/3, not 3/4. Here is an excerpt from the hint that explains it, using row 4 as an example. As it shows, on each row you need to subtract paths that go out of bounds and account for the adjustments in all subsequent calcs. Hope that is helpful.

challenge_73_hint_screenshot.png

kat
12 - Quasar

Great challenge :) 

Spoiler
Challenge #73 WF.PNGChallenge #73.PNG
dsmdavid
11 - Bolide

I've been keeping this challenge on hold, as when I first came to it I thought it would be a nice use case for the Python SDK tool. Now that I more or less have it, I should try with the new Python tool...

Spoiler
Config of the Plinko ToolConfig of the Plinko ToolWhat happens if the token starts more or less in the middleWhat happens if the token starts more or less in the middleBiased when the token starts in one of the end slotsBiased when the token starts in one of the end slotsMain Workflow using the Plinko ToolMain Workflow using the Plinko Tool

(the tool needs some polishing --and clarification of what the "position" actually means-- but that's for another day)

Laurap1228
11 - Bolide

This one was really difficult.

 

 

JoBen
11 - Bolide

Cheers!

 

Spoiler
Here is what I came up with. I basically determined how many viable paths could be taken from each starting point to an end point, and then based on all the viable paths, I determined the likelihood for each starting to ending point. 
Challenge_73_2.pngChallenge_73_1.png

justynam
8 - Asteroid

Here is my solution - short, simple and generic

All you need to change are 2 parameters in Text input tool: Number of slots and Number of rows

 

 

Spoiler

Main workflow to run batch macro with list of slots in initial row as control parameter

New Picture (6).jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Batch macro that runs iterative macro for every slot in initial row

New Picture (7).jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And finally iterative macro that takes possible slots with their probabilities in previous row and calculate possible slots and their probabilities in the next row

New Picture (8).jpg