Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Challenge: Monte Carlo simulation

Ned
Alteryx Alumni (Retired)

The last challenge was so popular I figured I should do another.  If you aren't a pretty solid Alteryx user, this one might be difficult.

 

There is a well known problem called the birthday problem.  It gives the slightly counter intuitive result that for any group of 23 people (about a soccer team) the chances are about 50/50 that 2 of them will have the same birthday.  Wikipedia has a good writeup of the problem: https://en.wikipedia.org/wiki/Birthday_problem  The way they arrive at the solution is correct, but it is slightly wrong because they are presuming there are 365 possible birthdays (there are 366.)  The attached module has the proper synthetic calculation.

 

Of course in the real world, not all birthdays have an even likelyhood of happenning.  (see http://www.nytimes.com/2006/12/19/business/20leonhardt-table.html) Attached is a Alteryx module that has the percent likelyhood of every birthday.  The challenge is to generate 1,000,000 or more random teams of 23 people and show what percentage of the teams have 2 people with the same birthday.  Hint - the simulated answer is slightly higher than the synthetic answer because some birthdays are more common.

 

This is an Alteryx challenge, not a programming challenge, so no fair using R.  I'll post my solution in a day or two.

 

 

11 REPLIES 11
jdunkerley79
ACE Emeritus
ACE Emeritus

Finally got some time to play with this.

 

First version was too slow (took 11 minutes to run 1mm case), bit of fiddling got a solution which can run 1mm rows in a reasonable time 2m50 on my laptop.

 

My simulation gave a probability 0.507517. Folowing Chris's example and playing with the Alteryx prototype charting tool

 

probChart.png

 

Posting my solution so I can nose at Adam's 30s one...

jdunkerley79
ACE Emeritus
ACE Emeritus

Nice solution Adam.

Labels