The following script should execute and generate the results in the Birthday page on the Wiki ********************* Note 'The Birthday problem' Feller included this problem in the 1950 edition of his book, which is earlier than any of the references either in Wikipedia or Math World. Roger does everything below, but it is interesting to go back to Feller and put it in functional terms.
In J Feller's solution is very simple. If there are r persons in the room then the probability that the next one has a different birthday is (365-r)%365 The product of the terms gives the probability all are different and that makes it easy to find the probability that one or more have the same birthday. Most of Feller's text was concerned with finding numerical approximations to the values. Computations were done very differently in 1950. So let the left argument be the number of days or categories and the right argument the number in the room ) NB. probability next person entering has a different birthday p =: - % [ NB. Find the probability that the birthdays are all different pcombine =: */\ NB. Produce the probabilities required psame =: pcombine @ p NB. in table form include both the Feller case and its negation NB. as used by Roger ptable =: (>:@]) ,. (],.-.)@ psame Note 'This gives a general solution' Under appropriate conditions what is the probability of recurrence of the same day of the week, or the recurrence of the same day for the set of birthdays in a 30 day month ) 7 ptable i.8 30 ptable i.31 ----- Original Message ----- From: "Roger Hui" <[email protected]> To: "Programming forum" <[email protected]> Sent: Friday, May 27, 2011 1:24 PM Subject: [Jprogramming] roll and deal > What is the least c such that the probability of ?c$n having > m distinct values is at least p? > > ref: http://www.jsoftware.com/jwiki/Essays/Birthday%20Problem > > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
