Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

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 #270: Pony Permutations

AYXAcademy
Alteryx
Alteryx

A solution to last week's challenge can be found hereSource: https://en.wikipedia.org/wiki/Belmont_StakesSource: 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?

patrick_digan
17 - Castor
17 - Castor

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

Spoiler
patrick_digan_0-1622552982939.png

 

AkimasaKajitani
17 - Castor
17 - Castor

My solution.

 

Spoiler
AkimasaKajitani_0-1622553803146.png

Macro:

AkimasaKajitani_1-1622553823806.png

 

PhilipMannering
16 - Nebula
16 - Nebula

My solution attached,

 

Spoiler
PhilipMannering_0-1622553952784.png

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

 

The cheat dynamic solution

Spoiler
PhilipMannering_0-1622562501973.png

 

patrick_digan
17 - Castor
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
patrick_digan_0-1622554272201.png

 


 

DeanWest
9 - Comet

Off to the races! 🐎

 

Spoiler
challenge_270_solution_DeanWest-snippet.jpg

 

AngelosPachis
16 - Nebula

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

 

Spoiler
AngelosPachis_4-1622556368793.png

 


 

RolandSchubert
16 - Nebula
16 - Nebula

My solution

 

Spoiler
270.jpg
ellen-wiegand
Alteryx
Alteryx

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

 

Spoiler
ellen-wiegand_0-1622558229261.png

 

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

Toons
12 - Quasar

My solution :

 

Spoiler
Toons_0-1622558303955.png