Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

Challenge #140: Prove the Birthday Paradox!

Highlighted
8 - Asteroid

Highlighted
Alteryx Partner

Solution attached.

Highlighted
Alteryx

Hi @jezknee !

I looked at your solution out of interest and was wondering, as I saw a message that "Run does not fit in Size Byte", so I did some further checks and it looked to me that in the end, even though you had 100000 in your "Generate Rows" tool, it only output 255 of it in the end, which then of course also just leads to 255 trials. I think you just need to add a Select tool right after your Input tool and change the "Run" column from Byte to an Int64, and then it will run the full number from the Generate rows tool (might want to reduce then the 100k to 10k or even 1k, as 100k will be a heavy burden and long calculation time :) )

But cool solution other than this without a Macro actually :)

Highlighted
5 - Atom
Spoiler

So I went for the "brute force" option - no macros necessary. It was also a good opportunity to use the interactive chart tool.

Highlighted
5 - Atom

Highlighted
8 - Asteroid

used a batch macro in this challenge.  my question is - did anyone else deal with leap years?  I put a randomizer in that outputs 0 to 3 and if it is a 3, then there are 366 birth day options for that person (as approximately 1 in every 4 people would have been born in a leap year).

I ran 10,000 iterations (in under 20 seconds).

> 75% - 32 people

> 90% - 41 people

also - there is a 99.9%+ chance of 2 people having the same birthday as soon as you have over 70 people together.

Spoiler
Highlighted
8 - Asteroid

Was a tricky one for me, but eventually got there.

Highlighted
8 - Asteroid

Hello,

First challenge in a few weeks ive managed to have time to do. My group size for 50% was 23, 75% was 32 and 90% was 41.

I took the very simple approach on this one.

Spoiler
17 - Castor

Here's my solution!

As for the brute force vs macro debate, I went the brute force approach with a straight in-line flow. 1,000 trials of each of the 49 groups ran in 3 seconds on my first Gen i7(7 years old) with 32 GB of ram.  10,000 trials trials of the 49 group sizes generated 12,740,000 rows and ran in 14.9 seconds.  I'd be interested to see the run times for other approaches.  @OliverW , @JoeS  Comparisons?

Spoiler

Dan

Highlighted
Alteryx

Hi @danilang,

My approach was very similar to yours and I am getting very similar run times of 3 seconds for 1k and 13 seconds for 10k (recent i7 but "only" 16GB RAM)

I'll let Olli reply on his timings, but I think we were quicker ;-)