Post Reply 
(42S) Probability of Same Birthday Day
12-05-2018, 08:36 PM
Post: #2
RE: (42S) Probability of Same Birthday Day
(12-05-2018 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 { 26-Byte Prgm }
01>LBL "BDAY"
02 365
03 X<>Y
04 PERM
05 365
06 LASTX
07 Y^X
08 ÷
09 1
10 X<>Y
11 -
12 END

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 12-digit result is 1 anyway. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (42S) Probability of Same Birthday Day - Dieter - 12-05-2018 08:36 PM



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