(42S) Probability of Same Birthday Day

12052018, 06:09 PM
Post: #1




(42S) Probability of Same Birthday Day
Mini Program: Probability of Same Birthday Day
by Guillermo Castarés Dic2018 Given a group of n people, what is the probability that at least two of them share the birthday day? Takes n from register X and put result on the same register. Important program to have if you like to bet ;) Stack not preserved. No flags and data registers used. Examples of use: 10 [Psbd] 0.1169 23 [Psbd] 0.5073 25 [Psbd] 0.5687 50 [Psbd] 0.9704 70 [Psbd] 0.9992 Code:
10C 11C 12C 15C 16C 28C 28S 32S 32SII 33C 41C 41CV 41CX 42S 48SX 48G 97 100LX 

12052018, 08:36 PM
Post: #2




RE: (42S) Probability of Same Birthday Day
(12052018 06:09 PM)morex Wrote: Given a group of n people, what is the probability that at least two of them share the birthday day? What about a direct solution? Code: 00 { 26Byte Prgm } Yes, on a real hardware 42s this will overflow for n > 195. Unlike your program that shoud be able to handle such cases. But then... for n ≥ 135 the 12digit result is 1 anyway. ;) Dieter 

12052018, 09:02 PM
Post: #3




RE: (42S) Probability of Same Birthday Day
(12052018 08:36 PM)Dieter Wrote: What about a direct solution? Nice. Thanks! 10C 11C 12C 15C 16C 28C 28S 32S 32SII 33C 41C 41CV 41CX 42S 48SX 48G 97 100LX 

12052018, 11:46 PM
(This post was last modified: 12052018 11:46 PM by ijabbott.)
Post: #4




RE: (42S) Probability of Same Birthday Day
The generalised birthday problem (probability of at least n people in a group sharing a birthday) is a lot harder. Probably intractable on a HP42S. (Now there's a challenge!)
— Ian Abbott 

12062018, 04:32 AM
Post: #5




RE: (42S) Probability of Same Birthday Day
(12052018 11:46 PM)ijabbott Wrote: The generalised birthday problem (probability of at least n people in a group sharing a birthday) is a lot harder. Probably intractable on a HP42S. (Now there's a challenge!) Intractable on a 42S? Birthday problem generalizations V. 

12062018, 05:54 AM
Post: #6




RE: (42S) Probability of Same Birthday Day
(12062018 04:32 AM)Valentin Albillo Wrote: Birthday problem generalizations The probability of being born on February 29th is NOT zero. The above document seems to utterly ignore leap year babies. X<> c Joe 

12062018, 08:49 AM
Post: #7




RE: (42S) Probability of Same Birthday Day
(12062018 04:32 AM)Valentin Albillo Wrote:(12052018 11:46 PM)ijabbott Wrote: The generalised birthday problem (probability of at least n people in a group sharing a birthday) is a lot harder. Probably intractable on a HP42S. (Now there's a challenge!) Specifically, the Multiple Birthday Problem. You may be able to get approximate results (up to about 3 decimal places) using Levin's approach mentioned in that paper, but a combinatorial approach blows up too quickly as n increases, rendering it unsuitable for computation on a HP 42S. I did knock up a program in C++ (but really C style but using C++ for convenence) using the GNU Multiple Precision library (which is a PITA to use in C, hence the use of C++ for convenience) to generate exact probabilities a while ago, although I'm not proud of it as the calculations are far from optimal (too many repeated sub calculations). Anyway, here is is: ianabbott/birthdays.cpp (raw). (12062018 05:54 AM)Joe Horn Wrote: The probability of being born on February 29th is NOT zero. The above document seems to utterly ignore leap year babies. Assume a spherical cow. — Ian Abbott 

12062018, 03:59 PM
Post: #8




RE: (42S) Probability of Same Birthday Day
(12062018 05:54 AM)Joe Horn Wrote: The probability of being born on February 29th is NOT zero. Of course it's not zero (0.00068 > 0), no one would say it is so no need to highlight the "NOT", everybody knows that. Quote:The above document seems to utterly ignore leap year babies. Me too, I've never met anybody born on that date. V. 

12062018, 07:49 PM
Post: #9




RE: (42S) Probability of Same Birthday Day
Quote:Me too, I've never met anybody born on that date. Smile Superman! :) 10C 11C 12C 15C 16C 28C 28S 32S 32SII 33C 41C 41CV 41CX 42S 48SX 48G 97 100LX 

12102018, 05:10 PM
(This post was last modified: 12102018 05:46 PM by Joe Horn.)
Post: #10




RE: (42S) Probability of Same Birthday Day
(12062018 03:59 PM)Valentin Albillo Wrote:(12062018 05:54 AM)Joe Horn Wrote: The probability of being born on February 29th is NOT zero. I was NOT highlighting it; I was following HP Prime syntax, which insists on NOT being capitalized. EDIT: Come to think of it, here's a minichallenge for ya: Write a program for the Same Birthday Probability problem, taking leap years into account. EDIT 2: Never mind, the following delightful article fully explains the solution and its impact on the probabilities, which (as everybody said above) is minimal. http://www.efgh.com/math/birthday.htm X<> c Joe 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)