Chances / Probability

Started by Charles Pegge, February 16, 2025, 09:56:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Charles Pegge


macro Chances as float(r, n,p)
==============================
'n nomber of opportunities or trials
'p probability of a single coincidence
float np=1.0-p
r=pow(np,n)
r=1.0-r
end macro
'
'TEST
'going to a party with 50 guests.
'what is the chances that someone at the
'party has the same birthday as you?
print str(chances(50, 1/365)*100,0) "%"  '13%
'also
print str(chances(300, 1/365)*100,0) "%" '56%