community
cancel
Showing results for 
Search instead for 
Did you mean: 
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.

Challenge #140: Prove the Birthday Paradox!

Asteroid
 
Meteor

Solution attached.

Alteryx
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 :)

Atom
Spoiler
2018-11-08 Spoiler - challenge_140_jp.png

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

Atom

01.png

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
140-1.JPG140-2.JPG
Asteroid

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

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
140.PNG
Quasar

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? 

 

Results.png

 

 

Spoiler
Solution.png

 

 

Dan 

Alteryx
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 ;-)