Birthday Paradox Simulation

davery5872

New Member
Joined
Apr 28, 2011
Messages
1
I am trying to set up a simulation for the birthday paradox. I have random dates set up, but cannot figure out how to sort (so I can count duplicates). Every time I hit sort, it generates another batch of random numbers. Or is there a way I can set this up?

Thanks for the help.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Random functions are volatile. The only thing you can do is to set up the random dates, copy & paste (special.. values) them to fix them and then sort.
 
Upvote 0
You can also use the data analysis toolpak (addin) to generate random numbers that won't be formulas (I've done it a few times - short term it's probably easier to just hard copy the values as stated ... you might put a "live formula" in a row above your data so you can easily copy it down and "refresh" your random number list without having to retype the formula.
 
Upvote 0
Hi
Welcome to the board

You can use a dynamic solution that's very easy to implement. You can generate a new draw simply by hitting F9 and so by hitting repeatedly F9 you can experiment with the birthday paradox.

For ex., for draws of 30 numbers (from the set of numbers 1 to 365, representing the days of the year)

In A1: =1+INT(RAND()*365)
In C1: =SMALL($A$1:$A$30,ROW())
In D1: =IF(C1=C2,"True","")

Copy the formulas till row 30.

Hit F9 repeatedly. Whenever a number in the draw repeats you get a True in column D.

Have fun.
 
Upvote 0
hi, if the issue is just counting the duplicates, you dont need to sort the set

say your rand numbers sit in A1:A30. in B1, type

=SUM(COUNTIF(A1:A30,A1:A30))-30

where 30 is the number of entries. you can change it based on how many numbers you have. enter this formula as array, i.e. with ctrl+shift+enter. it will give you number of duplicates. you can also add >=1 piece to it so it just gives you TRUE or FALSE. smth like, again entered as array formula

=SUM(COUNTIF(A1:A30,A1:A30))-30>=1
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top