alteryx Community

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.

Challenge #270: Pony Permutations

Alteryx

A solution to last week's challenge can be found hereSource: https://en.wikipedia.org/wiki/Belmont_Stakes

This week's challenge was submitted by @mst3k  - Thank you for your submission!

Later this week, the Belmont Stakes will be held in New York. If you are unfamiliar, this is a famous horse race which serves as the third race in the Triple Crown (the Kentucky Derby and Preakness are the other two legs). While there will not be a triple crown winner this year (since different horses won the previous two legs), we can still have some fun analyzing some race possibilities!

A race is being held between 4 horses. Create an output of every possible combination of race finishes. No horse should be able to finish in more than 1 place, but be warned there are two *different* mustangs named Sally in this race!
Extra Credit: If there are 5 horses instead of 4, how many possible outcomes are there? Can that number be generalized if there are n number of horses?

17 - Castor

@estherb47 Does this bring back nightmares of Born to Solve Nashville?

Spoiler

17 - Castor

My solution.

Spoiler

Macro:

16 - Nebula

My solution attached,

Spoiler

For 5 horses there would be 5! = 120 ways of arranging them.

The cheat dynamic solution

Spoiler

17 - Castor

And to solve the advanced part/make it more dynamic without macros, we can simulate enough horse races to get all the possible outcomes

Spoiler

9 - Comet

Off to the races! 🐎

Spoiler

16 - Nebula

Append fields tool to the rescue for this week's challenge!

Spoiler

16 - Nebula

My solution

Spoiler
Alteryx

fun fact: race horse names cannot be reused until 5 years after the horse has stopped racing or breeding

Spoiler

I believe the number of solutions for this problem is just a simple factorial? So it should generalize to any number of starters.

12 - Quasar

My solution :

Spoiler